Skip to content

docker: start simulator with compose, bind published ports to localhost - #51

Open
clement-igonet wants to merge 1 commit into
yamcs:masterfrom
clement-igonet:fix/compose-start-simulator
Open

docker: start simulator with compose, bind published ports to localhost#51
clement-igonet wants to merge 1 commit into
yamcs:masterfrom
clement-igonet:fix/compose-start-simulator

Conversation

@clement-igonet

Copy link
Copy Markdown

Closes #50.

docker compose up started Yamcs but never the simulator, so the udp-in link stayed at dataInCount 0 and no parameter ever received a value.

Changes

  • Add a simulator service (python:3.12-alpine, mounting the repo like the yamcs service) that runs simulator.py once Yamcs passes its healthcheck (depends_on: condition: service_healthy).
  • It shares the yamcs network namespace (network_mode: "service:yamcs"), so no flags and no Yamcs config changes are needed: the simulator's default 127.0.0.1 TM target reaches the udp-in link, and the udp-out link (host: localhost) reaches the simulator's TC port — commanding works out of the box too, which a simulator on a separate bridge address would not get.
  • Bind published ports to 127.0.0.1 (8090, 10015/udp): the quickstart runs without authentication, so it should not be reachable from the host's network by default. The 10015/udp publish is kept so running simulator.py on the host (make yamcs-simulator) still works as before.

Verified (rootless podman + podman-compose on Debian 13)

  • up -d --build: simulator starts automatically after the healthcheck; udp-in shows status: OK with dataInCount climbing at 1 Hz.
  • TC: POSTing Reboot via /api/processors/myproject/realtime/commands/myproject/Reboot shows udp-out dataOutCount incrementing, and netns UDP counters confirm delivery to the simulator's TC socket over IPv4 (no NoPorts drops).

One note: the simulator's in-place (\r-rewritten) status line doesn't show up in compose logs under podman's journald log driver — cosmetic only; #48's readiness/status work touches that area of simulator.py anyway.

The compose started Yamcs but never the simulator, so the udp-in link
stayed at dataInCount 0 and no parameter received a value (yamcs#50).

Run simulator.py in a companion container sharing the yamcs network
namespace: the simulator's default 127.0.0.1 targets reach the udp-in
link, and the udp-out link (host: localhost) reaches the simulator's
TC port, so both telemetry and commanding work out of the box.

Also bind the published ports (8090, 10015/udp) to 127.0.0.1: the
quickstart runs without authentication and should not be exposed to
the host network by default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

docker compose starts YAMCS but no telemetry (simulator not started)

1 participant