wifi-densepose/rust-port/wifi-densepose-rs/crates/wifi-densepose-sensing-server/src
voidborne-d e38c0f4dcc fix: Docker entrypoint arg handling + configurable model directory
Fixes #384: docker run with --source/--tick-ms flags now works correctly.
Fixes #399: model files in mounted volumes are now discoverable via MODELS_DIR env var.

Root cause (issue #384):
The Dockerfile used ENTRYPOINT ["/bin/sh", "-c"] with a shell-form CMD.
When users passed flags like `--source wifi --tick-ms 500` as docker run
arguments, Docker replaced CMD entirely, resulting in
`/bin/sh -c "--source wifi --tick-ms 500"` which executes `--source` as
a shell command → `--source: not found`.

Root cause (issue #399):
Model directory was hardcoded to the relative path `data/models`. When Docker
users mounted models to `/app/models/`, the scan looked in the wrong place.

Changes:

1. docker/docker-entrypoint.sh (new):
   - Proper entrypoint script that handles both env-var-based defaults and
     user-passed CLI flags
   - No arguments → starts server with CSI_SOURCE env var as --source
   - Flag arguments (start with -) → prepends /app/sensing-server + defaults,
     appends user flags (clap last-wins allows overrides)
   - Non-flag first arg → exec passthrough (e.g., /bin/sh for debugging)
   - Sets --bind-addr 0.0.0.0 (was 127.0.0.1 which blocks container access)

2. docker/Dockerfile.rust:
   - Switch from ENTRYPOINT ["/bin/sh", "-c"] to exec-form entrypoint
   - Add MODELS_DIR env var (default: data/models)
   - COPY the entrypoint script into the image

3. docker/docker-compose.yml:
   - Remove shell-form command (entrypoint handles defaults)
   - Add MODELS_DIR env var

4. model_manager.rs + main.rs:
   - Replace hardcoded `data/models` path with `effective_models_dir()`
     / `models_dir()` that reads MODELS_DIR env var at runtime
   - Docker users can now: docker run -v /host/models:/app/models -e MODELS_DIR=/app/models

5. tests/test_docker_entrypoint.sh (new, 17 tests):
   - Default CSI_SOURCE substitution (6 assertions)
   - Custom CSI_SOURCE propagation
   - User-passed flag arguments (--source, --tick-ms, --model)
   - Unset CSI_SOURCE defaults to auto
   - Explicit command passthrough
   - MODELS_DIR env var propagation
2026-04-18 21:55:01 +00:00
..
adaptive_classifier.rs feat: dynamic classifier classes, per-node UI, XSS fix, RSSI fix 2026-03-27 21:21:15 -07:00
cli.rs feat: ADR-080 P1+P2 remediation — refactor, perf, tests, safety 2026-04-06 17:00:27 -04:00
csi.rs feat: ADR-080 P1+P2 remediation — refactor, perf, tests, safety 2026-04-06 17:00:27 -04:00
dataset.rs feat: ADR-023 full DensePose training pipeline (Phases 1-8) 2026-02-28 23:22:15 -05:00
embedding.rs feat: ADR-024 Contrastive CSI Embedding Model — all 7 phases (#52) 2026-03-01 01:44:38 -05:00
field_bridge.rs fix(server): resolve adversarial review findings C1-C5, H1-H3, H5, M1-M2 2026-03-31 18:50:00 +00:00
graph_transformer.rs feat: ADR-024 Contrastive CSI Embedding Model — all 7 phases (#52) 2026-03-01 01:44:38 -05:00
lib.rs feat: ADR-024 Contrastive CSI Embedding Model — all 7 phases (#52) 2026-03-01 01:44:38 -05:00
main.rs fix: Docker entrypoint arg handling + configurable model directory 2026-04-18 21:55:01 +00:00
model_manager.rs fix: Docker entrypoint arg handling + configurable model directory 2026-04-18 21:55:01 +00:00
multistatic_bridge.rs fix(server): resolve adversarial review findings C1-C5, H1-H3, H5, M1-M2 2026-03-31 18:50:00 +00:00
pose.rs feat: ADR-080 P1+P2 remediation — refactor, perf, tests, safety 2026-04-06 17:00:27 -04:00
recording.rs fix: WebSocket race condition, data source indicators, auto-start pose detection (#96) 2026-03-02 13:47:49 -05:00
rvf_container.rs feat: ADR-024 Contrastive CSI Embedding Model — all 7 phases (#52) 2026-03-01 01:44:38 -05:00
rvf_pipeline.rs feat: ADR-023 full DensePose training pipeline (Phases 1-8) 2026-02-28 23:22:15 -05:00
sona.rs feat: ADR-023 full DensePose training pipeline (Phases 1-8) 2026-02-28 23:22:15 -05:00
sparse_inference.rs feat: Training mode, ADR docs, vitals and wifiscan crates 2026-02-28 23:50:20 -05:00
tracker_bridge.rs fix(server): resolve adversarial review findings C1-C5, H1-H3, H5, M1-M2 2026-03-31 18:50:00 +00:00
trainer.rs feat: ADR-024 Contrastive CSI Embedding Model — all 7 phases (#52) 2026-03-01 01:44:38 -05:00
training_api.rs fix: WebSocket race condition, data source indicators, auto-start pose detection (#96) 2026-03-02 13:47:49 -05:00
types.rs feat: ADR-080 P1+P2 remediation — refactor, perf, tests, safety 2026-04-06 17:00:27 -04:00
vital_signs.rs feat: ADR-021 vital sign detection + RVF container format (closes #45) 2026-02-28 22:52:19 -05:00