Worker hosts keep the same keys in setup.env, env and every env.N
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- bash, python
- Domain
- devops, infrastructure
Research direction
Start with setup-scripts/debian13-worker/lib.sh and run-fleet.sh to trace how environment files are stamped, worker names are chosen, and slots are pruned; then inspect Makefile and ops/release/install-release.sh for env-file use and the pre-swap gate. Read the existing bats tests before choosing a layout, and add migration coverage for old hosts, per-slot keys, names, and rollback behavior. Done means all acceptance criteria pass, including the README, example config, and Unreleased changelog updates.
Written by the indexing model from the issue text.
Description
Problem
A fleet worker host has three kinds of environment file in the config directory (setup-scripts/debian13-worker/README.md:35-42):
setup.env: provisioning config that the operator edits. It is sourced by bash and uses shell quoting, including multi-line values such asEXTRA_ENV.env: the base worker env, written bysetup-scripts/debian13-worker/03-worker-env.sh:26.env.N: one per worker, written bysetup-scripts/debian13-worker/run-fleet.sh:174. The Makefile pointsWORKER_ENV_HOSTat it (Makefile:210) and passes it topodman run --env-file(Makefile:979).
stamp_worker_env copies the same keys from setup.env into env and into every env.N: ORCH_BASE_URL, ORCH_ENROLLMENT_TOKEN, the disk gate, the isolation flags and the full EXTRA_ENV block (setup-scripts/debian13-worker/lib.sh:651, :681-721). With two workers, a secret in EXTRA_ENV sits at rest in four files.
Other points:
- The base
envis not used in the fleet flow. The script says so itself (setup-scripts/debian13-worker/03-worker-env.sh:15-20). ORCH_API_KEYis stamped and preserved (setup-scripts/debian13-worker/lib.sh:658,:686), but the worker never reads it. Credentials come fromstate.json(client/src/orcaster_worker/config.py:4-5).run-fleet.shstill uses it as a credentials signal (setup-scripts/debian13-worker/run-fleet.sh:202).- A hand edit to an
env.Nis lost on the nextrun-fleet.shrun, exceptORCH_WORKER_NAME, the token and a previousORCH_ENFORCE_ISOLATIONvalue (setup-scripts/debian13-worker/lib.sh:656-677). The only value that really differs per worker isORCH_WORKER_NAME(setup-scripts/debian13-worker/run-fleet.sh:150-160). - Changing one value (for example rotating a secret in
EXTRA_ENV) means editingsetup.envand re-stamping every worker.
setup.env cannot be passed to --env-file as is: podman does not understand its shell quoting, and the file also holds provisioning-only keys (WORKER_COUNT, WORKER_MEMORY, and others).
Proposed change
Keep each key in one file at rest. Two layouts are possible (see Open questions).
Option A: setup.env is the only file. make up client N=<n> reads setup.env, builds the container env (the ORCH_* keys, the EXTRA_ENV lines and ORCH_WORKER_NAME for slot N) and passes it to podman with -e or through a 0600 temporary file that is removed even when podman run fails. env and env.N are no longer written.
Option B: two files with no overlap. setup.env keeps only provisioning keys. One shared env (in --env-file format) holds the container keys. The Makefile passes ORCH_WORKER_NAME with -e. env.N is no longer written.
In both options:
- Stop stamping
ORCH_API_KEY, and stop using it as a credentials signal inrun-fleet.sh. Keep thestate.jsoncheck. - Keep each worker's current name. Today a non-empty
ORCH_WORKER_NAMEinenv.Nwins overPREFIX-N. The new layout needs a place for per-slot name overrides, and the migration must copy existing names there. - Move slot ownership away from the
env.Nglob. The prune of surplus workers (setup-scripts/debian13-worker/run-fleet.sh:284-307) and the pre-swap gate ofops/release/install-release.sh(:892-910) use the existence ofenv.Nas proof that a slot exists. They need another source, for exampleWORKER_COUNTplus the existing containers and volumes. - Update
setup-scripts/debian13-worker/README.md,ops/release/README.mdandsetup.env.example.
Compatibility
Existing hosts have setup.env, env and env.N files, enrolled workers with state.json in their volumes, and possibly hand-set worker names in env.N.
Guard:
- The first
run-fleet.shorinstall-release.shrun on an old layout migrates in place. It reads names fromenv.N, never re-enrolls a worker, and never touches worker volumes orstate.json. - The migration keeps every key of an
env.Nthatsetup.envdoes not produce (for example a hand-addedORCH_FLUSH_MARKERSline, or a previousORCH_ENFORCE_ISOLATIONvalue). It moves those keys to the new layout, or it refuses to migrate and names the keys (never the values). It never drops a key silently. - A carried key can have different values in different
env.Nfiles.ORCH_ENFORCE_ISOLATIONdoes today: slots whoseenv.Nexisted at upgrade getfalse, slots created later gettrue(setup-scripts/debian13-worker/lib.sh:671-676). A shared layout cannot hold both. Such a key is kept per slot, or the migration refuses and names the key (never the values). - During one release, the Makefile and the pre-swap gate still accept an
env.Nwhen the new layout is absent, so a rollback to the previous release keeps working. - Rollback also needs
setup.env. The previous release'sload_envrequiresORCH_BASE_URLinsetup.env(setup-scripts/debian13-worker/lib.sh:270). During the compatibility window,setup.envkeeps every key that the previous release requires, or the release note says that a rollback needs the oldsetup.envrestored. - Leftover
envandenv.Nfiles are not deleted silently. The scripts print which files are no longer used, and the operator removes them.
Acceptance criteria
- After a fresh deploy, each key is stored in exactly one file in the config directory (plus
server-ed25519.pub). - Each worker N starts with its expected
ORCH_WORKER_NAMEwithout a per-worker env file. -
ORCH_API_KEYis no longer stamped, andrun-fleet.shno longer treats it as a credentials signal. - The prune of surplus workers and the pre-swap gate work without
env.N. Their bats tests pass. - Bats test: a host with the old layout (
setup.env,env,env.N, a customORCH_WORKER_NAME, existing volumes) runs the new scripts. No worker is re-enrolled, names are kept, volumes andstate.jsonare untouched, and the leftover files are reported on stderr. - Bats test: an
env.Nwith a hand-added key thatsetup.envdoes not produce. The migration keeps the key in the new layout, or refuses and names the key without its value. The key is never dropped silently. - Bats test:
env.1hasORCH_ENFORCE_ISOLATION=falseandenv.2hasORCH_ENFORCE_ISOLATION=true. After the migration each worker keeps its value, or the migration refuses and names the key. - Existing deployments keep working without manual config changes on upgrade, and a rollback to the previous release still starts the workers.
- The READMEs and
setup.env.exampledescribe the new layout. - CHANGELOG entry under Unreleased, with the upgrade note.
Open questions
- Option A or Option B? Option A gives one file but changes the most code (Makefile, prune, pre-swap gate) and needs a temporary file or many
-eflags. Option B keeps--env-file, which the current Makefile already uses, so it changes less code. But Option B removesORCH_BASE_URLandEXTRA_ENVfromsetup.env, and the previous release's scripts needORCH_BASE_URLthere, so a rollback with Option B also needs the window rule above. Either option keeps existing deployments working only with the migration and compatibility window above. - Should
ORCH_ENROLLMENT_TOKENstay at rest after enrollment, or only be injected while a worker has nostate.json?
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AInvirion/orcaster
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
enhancement good first issue P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug P2 server
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
bug P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
All issues in AInvirion/orcaster
Similar issues
-
[Resource]: SpaicelyOpenresource-submission validation-passed
Difficulty 1/5 Under an hour Newbie friendliness 68/100
hesreallyhim/awesome-claude-code#3875 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
bvis/aegis-hass#725 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xPossibly taken @NimaVaziri claimed this today. OpenPytorch
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/TensorRT-LLM#23406 ·
Maintainers usually reply within 1 day