Skip to content

#632 - Run multiple dev compose stacks concurrently#644

Merged
bracyw merged 7 commits into
developfrom
632-concurrent-dev-compose-stacks
May 20, 2026
Merged

#632 - Run multiple dev compose stacks concurrently#644
bracyw merged 7 commits into
developfrom
632-concurrent-dev-compose-stacks

Conversation

@bracyw
Copy link
Copy Markdown
Collaborator

@bracyw bracyw commented May 20, 2026

Changes

Dev compose profiles (client-dev, scylla-dev, fake-data) can now run side-by-side via STACK_OFFSET=N. Defaults match today exactly, so single-stack and production behavior are unchanged.

This is mainly for making parallel development easier, specifically when using AI agents that share a computer.

Notes

  • container_name dropped from every dev-path service and host ports moved to ${VAR:-default}, so docker compose's project-name suffix handles uniqueness.
  • argos.sh just appends _$STACK_OFFSET to the project name when set; port math is the caller's job, recipe in compose/README.md.
  • integration_test.sh runs under its own compose project and reads ${ODYSSEY_DB_PORT:-5432}.
  • Operator impact: docker logs scylla-server / docker logs odyssey-db no longer work; use project-aware names (e.g. odyssey_router-scylla-server-1).

Test Cases

  • Single stack boots like before.
  • Two stacks run at the same time.
  • Router image still builds.
  • Integration tests still pass.

Checklist

  • All commits are tagged with the ticket number
  • No linting errors / newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • No package-lock.json changes
  • Request reviewers & ping on Slack
  • PR is linked to the ticket

Closes #632

bracyw added 7 commits May 16, 2026 12:56
Drop fixed container_name from db, scylla, siren, grafana, client, calypso
so docker compose's project-name suffix handles uniqueness. Parameterize
host ports via ${VAR:-default} for db (5432), scylla (8000), siren (1883
and 9002), grafana (3002), client (80). Defaults match today's values so
single-stack and production behavior are byte-identical.

Pass SCYLLA_PORT into the scylla container so its listener tracks the
host binding. Update compose.scylla-dev.yml BACKEND_URL to follow
SCYLLA_HOST_PORT so its dockerized client points at its own scylla.
When STACK_OFFSET=N is set, export per-service host-port env vars
shifted by N and suffix the compose project name with _oN so 'down',
'logs', and 'exec' target the right stack. Unset or 0 = byte-identical
to today's single-stack behavior.
Replace 'docker rm -f odyssey-db' with 'docker compose -p
odyssey_integration_test down', and run up/down under the same project
so the script no longer depends on a fixed container_name.
Add a 'Running multiple dev stacks side-by-side' section to
compose/README.md showing how STACK_OFFSET=N shifts ports and project
names, with a concurrent client-dev + fake-data example. Note that
production profiles and existing ng-serve / cargo-run workflows are
unaffected.

Also updates .claude/skills/run-local/SKILL.md (not tracked in this
repo, lives in the shared worktrees-root .claude/) to scan ports
8000/8010/.../8090 for backend liveness and identify which stack owns
the listening port via the docker project's _oN suffix.
argos.sh now only appends '_oN' to the compose project name when
STACK_OFFSET=N is set, leaving port env vars to the caller (shell,
.envrc, or an alias). The base compose files still default every port
to today's value via \${VAR:-default}, so unset = byte-identical.

README's two-stack recipe shows the inline 'env STACK_OFFSET=N
ODYSSEY_DB_PORT=... ./argos.sh ...' pattern, and notes that
'compose down' only needs STACK_OFFSET since it targets by project
name not port.
README:
- Correct the volume name (it is per-project, e.g.
  odyssey_client-dev_db-data, not the stale 'argos_db-data').
- Make the teardown line in the two-stack recipe use the same $N as
  the up command for copy-paste consistency.
- Add a one-line caveat that STACK_OFFSET is purely a project-name
  suffix (any non-empty value, including 0, creates a separate
  project), so it should not be set when running production profiles.

integration_test.sh:
- Read DATABASE_URL's port from ${ODYSSEY_DB_PORT:-5432} in both the
  diesel migration and cargo test invocations. Default behavior is
  unchanged; if the user has ODYSSEY_DB_PORT set (e.g. from running a
  parallel stack), the DB binds and the tests connect on the same
  port instead of fighting.
@bracyw bracyw self-assigned this May 20, 2026
@bracyw bracyw marked this pull request as ready for review May 20, 2026 17:59
@bracyw bracyw merged commit 860b04c into develop May 20, 2026
4 checks passed
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.

Run multiple dev compose stacks concurrently

1 participant