Skip to content

feat: improve docker-compose generation with restart, depends_on, network, and ZMQ mode #551

Open
Sahil-u07 wants to merge 2 commits into
ControlCore-Project:devfrom
Sahil-u07:improve-docker-compose
Open

feat: improve docker-compose generation with restart, depends_on, network, and ZMQ mode #551
Sahil-u07 wants to merge 2 commits into
ControlCore-Project:devfrom
Sahil-u07:improve-docker-compose

Conversation

@Sahil-u07
Copy link
Copy Markdown
Contributor

What's this

The --compose flag existed but generated a bare docker-compose.yml - just image: and volumes: per service. This makes the output actually usable.

What changed

  • restart: on-failure on every service so nodes that lose a startup
    race don't die permanently
  • Sequential depends_on between services for startup ordering
    (ordering hint only - concore studies use feedback loops so this
    isn't a correctness guarantee)
  • Shared concore_net bridge network so containers can reach each
    other by name without manual port wiring
  • New --zmq flag that injects CONCORE_TRANSPORT=zmq into each
    service environment for ZMQ transport studies
  • Console warning when --compose is used but no docker run script
    exists yet, replacing the previous silent None return

Files touched

  • concore_cli/commands/build.py - compose generation logic
  • concore_cli/cli.py - --zmq flag and validation
  • tests/test_compose_generation.py - 8 new tests
image

Verify locally

python -m pytest tests/test_compose_generation.py -v
ruff check concore_cli/commands/build.py concore_cli/cli.py tests/test_compose_generation.py

Copilot AI review requested due to automatic review settings May 19, 2026 18:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves the --compose flag output in the concore build command so the generated docker-compose.yml is actually runnable: services get a restart policy, a shared bridge network, and sequential depends_on links. Adds a new --zmq flag that injects CONCORE_TRANSPORT=zmq into every service for ZMQ-mode studies, and replaces the previous silent None return with a user-visible warning when no run script exists.

Changes:

  • Extend _write_docker_compose to emit restart, depends_on, networks, and optional ZMQ environment per service, plus a top-level concore_net bridge network and console warning when the docker run file is missing.
  • Add --zmq CLI flag with validation that it requires --compose, and thread zmq_mode through to build_workflow / _write_docker_compose.
  • Add 8 unit tests covering restart policy, network section, depends_on ordering, ZMQ env presence/absence, missing-script behavior, and CLI validation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
concore_cli/commands/build.py Reworks compose generation: adds restart/depends_on/networks/env blocks per service, moves networks declaration to bottom, warns when run script is missing, accepts console and zmq_mode parameters.
concore_cli/cli.py Adds --zmq build option, validates it requires --compose, passes zmq_mode to build_workflow.
tests/test_compose_generation.py New tests for compose generation features and --zmq CLI validation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants