feat(miner-deployment): add docker-compose.miner.yml for AMS fleet mode - #5266
feat(miner-deployment): add docker-compose.miner.yml for AMS fleet mode#5266davion-knight wants to merge 1 commit into
Conversation
Add a compose file so operators run the miner as a long-lived worker instead of a hand-assembled docker run (JSONbored#5177): a `miner` service built from the package Dockerfile, `restart: unless-stopped`, SQLite state on a named `miner-data` volume, and credentials via an env file (.gittensory-miner.env) rather than inlined — so tokens stay out of the compose file and out of `docker inspect`. Documents `--scale miner=N` plus the honest caveat that a shared volume corrupts the SQLite ledgers, with the per-worker isolation patterns (separate compose projects or distinct config dirs; k8s StatefulSet for built-in isolation), in the compose comments and DEPLOYMENT.md. Ships a scanner-safe .env.example (empty values) and a validation test asserting the service contract + that no credential is hardcoded. Closes JSONbored#5177
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5266 +/- ##
=======================================
Coverage 94.36% 94.36%
=======================================
Files 474 474
Lines 40096 40096
Branches 14620 14620
=======================================
Hits 37836 37836
Misses 1585 1585
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-12 12:51:34 UTC
✅ Suggested Action - Approve/Merge
Review summary Blockers
Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
JSONbored
left a comment
There was a problem hiding this comment.
Closing:
packages/gittensory-miner/docker-compose.miner.yml:36 hardcodes GITTENSORY_MINER_CONFIG_DIR in the compose environment, so an operator following packages/gittensory-miner/.gittensory-miner.env.example:11 to override that variable through the env file will be silently ignored by Compose's precedence rules; remove the hardcoded environment entry or change it to an interpolated default such as `GITTENSORY_MINER_CONFIG_DIR: ${GITTENSORY_MINER_CONFIG_DIR:-/data/miner}`.
Adds
packages/gittensory-miner/docker-compose.miner.ymlso operators run the miner as a long-lived worker instead of a hand-assembleddocker run(#5177). Built on the existing package Dockerfile.Contents
docker-compose.miner.yml— aminerservice built from the Dockerfile (monorepo-root context),command: ["run"](continuous worker),restart: unless-stopped, SQLite state on a namedminer-datavolume, and credentials viaenv_file(not inlined)..gittensory-miner.env.example— env template with empty values (real values go in an uncommitted.gittensory-miner.env; nothing credential-like is committed).DEPLOYMENT.md— a Docker Compose section:upusage + scaling. It documents--scale miner=Nand the honest caveat that a sharedminer-datavolume corrupts the miner’s SQLite ledgers (not safe for concurrent access), with the per-worker isolation patterns: separate compose projects (-p miner-1 …) or distinctGITTENSORY_MINER_CONFIG_DIRmounts — and points at thek8s/StatefulSet for built-in isolated scaling.Validation
test/unit/miner-docker-compose.test.ts(4 tests): the service is built from the package Dockerfile with the named volume +unless-stoppedrestart, credentials come from an env file (no secret-named key assigned a value in the compose), and the env example ships only empty placeholders. The existingminer-deployment-doc.test.tsstill passes (required DEPLOYMENT.md sections preserved).tsctypecheck clean; prettier-clean; no hardcoded credentials. Static packaging only — nosrc/**logic, no runtime control-flow touched.Closes #5177