Files
PacketStation/deploy/compose.ci.yaml
T
spencermandClaude Fable 5.1 591fe90076
ci / frontend (push) Successful in 30s
ci / server (push) Successful in 4m12s
ci / image (push) Successful in 46s
ci / e2e (push) Successful in 1m24s
Phase 3: VISUAL feed and M-Files drawings in the worker
Migration 0004 (VISUAL and drawing caches, go-live ignored list, resource
map, job tables, order-derived columns with provenance; work order key
includes the operation sequence). The real worker on APScheduler with
settings re-read each fire, pause, run now, advisory locks, job_runs and a
heartbeat. The visual-feed job (five VisualKit reads, COPY and MERGE cache,
suspect-batch guard, the apply in one transaction: drafts, change orders,
retire-moved, work order gone, closed and cancelled observed, projects and
units from order links, auto-release) and the fingerprint. The drawing-lookup
job (queue, budget, download on version change, sha256 into assets, decision
table, staging for rev approval, drawing-origin change orders). Clerical From
VISUAL panel, flags, rev approval, hand uploads, change-order review; Admin
Feed settings and resource map. Synthetic fixture generator and a
fixture-driven worker in CI with a Playwright scenario. Docs updated.

Verified: 3249 server tests and 13 Playwright scenarios on the docker-1 CI
stack, 76 frontend tests, doctor at 0004; one feed and one drawing run
against VISUAL DEV and the vault from the developer machine (counts in the
changelog).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-16 14:45:38 -06:00

134 lines
4.4 KiB
YAML

# Overlay for CI and local end-to-end runs. Builds the image from this checkout
# instead of pulling it, and reads throwaway secrets made by ci/make-secrets.sh.
# Adds the throwaway Samba AD DC (deploy/samba/) and the Playwright runner (profile e2e).
#
# deploy/ci/make-secrets.sh
# docker compose -p packetstation-ci --env-file deploy/ci/ci.env \
# -f deploy/compose.yaml -f deploy/compose.ci.yaml up -d --build --wait --wait-timeout 300
# docker compose -p packetstation-ci --env-file deploy/ci/ci.env \
# -f deploy/compose.yaml -f deploy/compose.ci.yaml --profile e2e run --rm playwright
# docker compose -p packetstation-ci --env-file deploy/ci/ci.env \
# -f deploy/compose.yaml -f deploy/compose.ci.yaml down -v
#
# The worker reads the synthetic feed and drawings fixtures (FEED_SOURCE=fixture, DRAWING_SOURCE=fixture in
# ci.env) from ../tests/fixtures/generated, mounted at /fixtures. Generate them first:
# python -m tests.fixtures.generator --out tests/fixtures/generated
#
# Never combine this overlay with compose.proxy.yaml.
x-logging: &logging
driver: json-file
options:
max-size: "10m"
max-file: "5"
x-build: &build
context: ..
dockerfile: Dockerfile
args:
PS_BUILD: ci
services:
migrate:
build: *build
image: ${IMAGE:-packetstation:ci}
pull_policy: build
volumes:
- ci-dc-export:/etc/ssl/pstest:ro # the DC's CA, LDAP_CA_BUNDLE=/etc/ssl/pstest/ca.pem
app:
build: *build
image: ${IMAGE:-packetstation:ci}
pull_policy: build
volumes:
- ci-dc-export:/etc/ssl/pstest:ro
# Playwright reaches the app as ps-app, never as "app": "app" is a top-level domain on
# Chromium's HSTS preload list, so http://app:8000 is forced to TLS and fails.
networks:
backend:
aliases:
- ps-app
egress: {}
depends_on:
samba-dc:
condition: service_healthy
worker:
build: *build
image: ${IMAGE:-packetstation:ci}
pull_policy: build
volumes:
- ci-dc-export:/etc/ssl/pstest:ro
- ../tests/fixtures/generated:/fixtures:ro # synthetic feed and drawings; the scenario switches state
# Throwaway Samba AD DC (PSTEST.LOCAL) so LDAP sign-in runs over real TLS in CI.
# Built from deploy/samba/. Runs as root, as Samba needs. No published port.
# The app reaches it as ldaps://dc1.pstest.local:636 on the internal backend network.
# It writes ca.pem, users.json and seeded to ci-dc-export.
samba-dc:
build:
context: ./samba
image: packetstation-samba-dc:ci
pull_policy: build
hostname: dc1
networks:
backend:
aliases:
- dc1.pstest.local
secrets:
- samba_admin_password
- ldap_bind_password
volumes:
- ci-dc-data:/var/lib/samba
- ci-dc-export:/export
# Provisioning sets NT ACLs on sysvol, which needs security.* xattrs and therefore
# CAP_SYS_ADMIN (verified on docker-1, Samba 4.17: without it the provision step fails).
cap_add:
- SYS_ADMIN
security_opt:
- no-new-privileges:true
healthcheck:
test: ["CMD", "/usr/local/bin/healthcheck.sh"]
interval: 10s
timeout: 10s
retries: 30
start_period: 120s
restart: "no"
logging: *logging
# Playwright runner. Drives the app at http://ps-app:8000 over backend.
# Also on egress, because npm ci fetches @playwright/test from the public registry
# and backend is internal. The image tag must match @playwright/test in tests/e2e/package.json.
playwright:
image: mcr.microsoft.com/playwright:v1.64.1-noble
profiles: ["e2e"]
working_dir: /work/tests/e2e
environment:
E2E_BASE_URL: http://ps-app:8000
E2E_DC_USERS_FILE: /export/users.json
E2E_FIXTURE_DIR: /fixtures
CI: "true"
volumes:
- ../tests/e2e:/work/tests/e2e
- ../tests/fixtures/generated:/fixtures # read-write: the scenario writes /fixtures/state
- /work/tests/e2e/node_modules # anonymous volume: node_modules stays out of the checkout
- ci-dc-export:/export:ro
networks:
backend: {}
egress: {}
depends_on:
app:
condition: service_healthy
init: true
shm_size: 1g
command: ["sh", "-c", "npm ci --no-audit --no-fund && npx playwright test"]
logging: *logging
volumes:
ci-dc-data: {}
ci-dc-export: {}
secrets:
samba_admin_password:
file: ${SECRETS_DIR:?set SECRETS_DIR in the stack env file}/samba_admin_password