Files
secs-gem/docker-compose.yml
T
raphael a1dc7937d4 test: live persistent-spool restart end-to-end
Adds a docker-compose service `server-spool` that runs secs_server
with --spool-dir pointed at a named volume.  Two-phase Python
harness (interop/spool_persistence_test.py):

  1. Enqueue phase: force-spool one S6F11(CEID=300) via the
     SPOOL_ON / START / SPOOL_OFF RCMD trio, then disconnect.
  2. Driver runs `docker compose restart server-spool` between
     the phases — the named volume preserves the journal files.
  3. Drain phase: reconnect, send S6F23(Transmit), verify the
     replayed S6F11 carries CEID 300.

Surfaces a real interop bug along the way: secsgem-py 0.3.0 encodes
RSDC (and other "single-byte status" fields) as <U1>, while SEMI E5
spells them as <B>.  Our `as_binary_first` was strict on Binary; now
accepts either (the byte semantics are identical, and the leniency is
symmetric with the U-type widening from the first interop commit).

Result: enqueue → docker restart → drain returns CEID 300 cleanly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-09 01:04:49 +02:00

106 lines
2.9 KiB
YAML

# All build artifacts live in the named `build` volume (inside Docker), the
# host only provides the source tree mounted read-write at /app.
#
# docker compose build # build the toolchain image
# docker compose run --rm builder # configure + compile
# docker compose run --rm tests # run unit tests
# docker compose up server client # live HSMS demo
x-base: &base
build: .
volumes:
- .:/app
- build:/app/build
services:
builder:
<<: *base
# Put builder on the same network as server/client/equipment_py so
# one-off `docker compose run --rm builder /app/build/secs_interop_probe ...`
# commands can DNS-resolve peer services by their compose name.
networks: [secs]
command:
- bash
- -lc
- >
cmake -S /app -B /app/build -G Ninja -DCMAKE_BUILD_TYPE=Release &&
cmake --build /app/build
tests:
<<: *base
depends_on:
builder:
condition: service_completed_successfully
command: ["ctest", "--test-dir", "/app/build", "--output-on-failure"]
server:
<<: *base
depends_on:
builder:
condition: service_completed_successfully
command: ["/app/build/secs_server", "--port", "5000", "--device", "0"]
networks: [secs]
# No host port publish: the client reaches the server over the `secs`
# Docker network by service name. Uncomment to expose to the host.
# ports:
# - "5000:5000"
client:
<<: *base
depends_on:
builder:
condition: service_completed_successfully
server:
condition: service_started
command: ["/app/build/secs_client", "--host", "server", "--port", "5000", "--device", "0"]
networks: [secs]
# Python container preloaded with secsgem-py 0.3.0 for cross-validation
# of our C++ HSMS/SECS-II/GEM implementation against the reference library.
interop:
build: ./interop
volumes:
- .:/app
working_dir: /app/interop
networks: [secs]
# secsgem-py running as passive equipment so the C++ active host can
# connect to it. Used by tools/run_interop.sh which then launches
# `secs_interop_probe --host equipment_py`.
equipment_py:
build: ./interop
volumes:
- .:/app
working_dir: /app/interop
command: ["python3", "/app/interop/passive_equipment.py", "--port", "5000"]
networks: [secs]
# Server variant for the persistent-spool restart test. Identical to
# `server` but with --spool-dir pointed at a named volume so spooled
# messages survive `docker compose restart server-spool`.
server-spool:
<<: *base
depends_on:
builder:
condition: service_completed_successfully
command:
- /app/build/secs_server
- --port
- "5000"
- --device
- "0"
- --spool-dir
- /spool
volumes:
- .:/app
- build:/app/build
- spool:/spool
networks: [secs]
networks:
secs: {}
volumes:
build: {}
spool: {}