Skip to content

Add docker-compose.miner.yml for AMS fleet mode with named services and restart policy #5177

Description

@JSONbored

Context

packages/gittensory-miner already ships a Dockerfile, but DEPLOYMENT.md currently asks operators to hand-assemble their own docker run invocation to run fleet mode (multiple parallel miner workers). No docker-compose file exists for AMS today: the repo-root docker-compose.yml is ORB's own review-stack compose, and the separate miner-ui daemon/launcher issue in Wave 5 covers the webapp, not this CLI.

Dependencies

None — independently shippable; only requires the existing Dockerfile in packages/gittensory-miner, which is already shipped.

Requirements

  1. Add packages/gittensory-miner/docker-compose.miner.yml.
  2. Define a miner service built from the existing packages/gittensory-miner/Dockerfile.
  3. Declare a named volume mapped to the package's documented state-dir path (e.g. /data/miner) for persistence across container restarts.
  4. Set restart: unless-stopped on the service.
  5. Document — in a comment block within the compose file, and in DEPLOYMENT.md — how to use docker compose -f docker-compose.miner.yml up --scale miner=N to run N parallel workers, including how to partition each worker's config/state dir so parallel workers don't collide on the same SQLite files.
  6. Reference environment variables via an env file rather than hardcoding credentials or provider config directly into the compose file (pointing at the .gittensory-miner.env.example starter file from this same batch, if it has already merged, or at the existing env documentation otherwise).
  7. Update DEPLOYMENT.md's fleet-mode section to point operators at this compose file instead of (or in addition to) the current hand-rolled docker run instructions.

Deliverables / Acceptance Criteria

  • New file packages/gittensory-miner/docker-compose.miner.yml
  • miner service built from the existing Dockerfile
  • Named volume for the state-dir path with restart: unless-stopped
  • --scale usage documented, including per-worker config/state partitioning
  • DEPLOYMENT.md updated to reference the new compose file
  • No credentials or secrets hardcoded in the compose file

Test Coverage Requirements

This PR must ship with full test coverage for every changed line and branch — the repo's Codecov patch gate requires 99%+ coverage and the house standard is to aim for 100%, including both sides of every conditional/nullish-coalescing branch introduced. Because the primary artifact is a docker-compose YAML file rather than application logic, add: (1) a validation test (e.g. invoking docker compose -f docker-compose.miner.yml config or an equivalent YAML-schema check) covering both a default single-instance invocation and a --scale-style multi-instance invocation, to confirm the file parses and the volume/service definitions are well-formed, (2) an invariant test for "the compose file never contains a literal credential value" (a grep-style check for common secret/token patterns run against the committed file), and (3) a regression test is not applicable since this is net-new tooling, not a bug fix — state that explicitly in the PR.

Codecov visibility note: packages/gittensory-miner/**, apps/gittensory-miner-ui/**, and apps/gittensory-miner-extension/** currently sit entirely outside vitest's coverage.include glob, so codecov/patch cannot measure changes there yet — closing that gap is exactly what #4864 and #4865 (in this same milestone) do. Any part of this change under packages/gittensory-engine/src/** or the repo's own src/** remains fully Codecov-instrumented as usual. Either way, this does not lower the bar: treat the 100%-including-invariants-and-regression target above as the enforced house standard regardless of what Codecov can currently see, and it becomes gate-enforced for real once #4864/#4865 ship.

Expected Outcome

An operator running AMS in fleet mode can bring up N parallel miner workers with one docker compose command and a documented --scale pattern, instead of hand-assembling repeated docker run invocations.

Links & Resources

  • packages/gittensory-miner/Dockerfile
  • packages/gittensory-miner/DEPLOYMENT.md
  • See the .gittensory-miner.env.example issue in this same batch
  • Theme: Self-host packaging & docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    Status
    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions