Repository navigation
feat: PANDA_WORKER_IMAGE env var to override the queue-default worker image - #63
Merged
Merged
Conversation
… image Concrete queues inherit the submitter block from the shared template queue via templateQueueName, so render-panda-queues.py can patch the template's containerImage at render time. Without PANDA_WORKER_IMAGE the committed template default (alpine:latest) is kept; consumers with their own worker image (e.g. a snakemake CI that builds one) no longer need to edit the template to use it. Adds test coverage for the queue-template containerImage path, which the smoke test never exercised: it only ever submitted jobs with --container (per-job image), so a broken template -> render -> submitter chain kept CI green. - scripts/render-panda-queues.py: apply PANDA_WORKER_IMAGE to the template queue before rendering concrete queues - docker-compose.yml: pass PANDA_WORKER_IMAGE to the harvester - .env.example, README: document the knob - tests/test_render_panda_queues.py: unit tests for the render script (template invariant, concrete-queue creation, default preserved, override applied), run in a new unit-tests CI job - smoke test: assert the rendered panda_queues.cfg in the live harvester (after the health wait — the file only appears once the entrypoint finishes setup), and run a second E2E job WITHOUT --container, asserting via the docker_submitter log that the queue default (overridden to python:3.13-alpine via env-overrides, distinct from the per-job python:3.12-alpine) was actually used
grep ... | tail -1 always exits 0 (a pipeline's status is the last command's), so the queue-default check could never fail the step — it only passed because the image happened to be correct. Drop the pipe for the assertion: grep -q exits 1 when the line is missing, failing the step. The informational grep | tail -1 above it is unchanged.
…x stale comment The rendered-config check only asserted containerImage is non-empty, so a broken compose -> env -> render chain for PANDA_WORKER_IMAGE would only surface when the queue-default job lands in the wrong container ~4 minutes later. Assert the exact value CI sets (python:3.13-alpine) right after the health wait, catching the whole chain in seconds. Also update the first integration test's comment: the queue default in CI is no longer alpine:latest but the PANDA_WORKER_IMAGE override; the reasoning (deliberately distinct images prove each path) is unchanged.
- render-panda-queues.py: a missing submitter block now fails loudly (sys.exit) instead of setdefault silently creating a nameless, module-less block that no harvester could use - tests: cover that failure mode; fix the env comment (four vars, not three); keep a minimal PATH in the test env in case the script ever shells out - smoke test: assert BOTH jobs' output LFNs are registered in Rucio, not just that some file DID exists (the first job's output alone would satisfy the old check); pattern matches the search's bare JSON list response Co-authored-by: Hermes Agent <hermes@localhost>
wdconinc
approved these changes
Nov 22, 2026
veprbl
added a commit
that referenced
this pull request
Nov 23, 2026
Review-driven cleanups on top of the rebase: - drop the queue-template containerImage hunk: PANDA_WORKER_IMAGE (merged in #63) is the supported way to point the queue at a custom worker image, so the template stays generic (alpine:latest) - rucio client config fallback: resolve the host path from the compose-provided /config/rucio directory bind via mountinfo instead of hardcoding a dev checkout path (/home/agent/...); fail the worker loudly if neither bind is found, rather than mounting a nonexistent file - remove the /agent/ -> /home/agent/ prefix translation: mountinfo's bind root is the actual host path (verified: /agent/... is a real directory here; CI runners have no /agent), and the docker daemon resolves sources in the host namespace either way - worker network: queue-config workerNetwork key (default panda-compose_default) instead of a hardcoded name, so a custom compose project name (-p) still gets hostname resolution Co-authored-by: Hermes Agent <hermes@localhost>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The queue-level worker image currently comes from
config/harvester/panda_queues.template.json(containerImage: alpine:latest), with no way to change it without editing the template. Consumers that bring their own worker image — e.g. the snakemake-executor-plugin-panda CI, which builds a snakemake worker image — would have to fork or patch the template.This adds a
PANDA_WORKER_IMAGEenvironment variable (same pattern asPANDA_QUEUES):render-panda-queues.pyapplies it to the template queue'scontainerImagebefore rendering the concrete queues. Unset keeps the committed default. A template lacking asubmitterblock fails the render loudly instead of silently producing a useless one.It also adds test coverage for the queue-template
containerImagepath, which was never exercised before: the smoke test only ever submitted jobs with--container(per-job image), so a broken template → render → submitter chain kept CI green.Changes
scripts/render-panda-queues.py— applyPANDA_WORKER_IMAGEto the template queue before rendering concrete queues (concrete queues inherit the submitter block viatemplateQueueName, so patching the template is enough);sys.exitif the template has nosubmitterblockdocker-compose.yml— passPANDA_WORKER_IMAGEto the harvester service.env.example,README.md— document the knobtests/test_render_panda_queues.py— unit tests for the render script (template invariant, concrete-queue creation, default preserved without override, override applied, missing-submitter failure); stdlib-only, run in a newunit-testsCI jobci.ymlsmoke test —panda_queues.cfginside the live harvester equals the override (python:3.13-alpine) right after the health wait, catching a broken compose → env → render chain in seconds (plus DockerSubmitter template block andtemplateQueueNameinheritance)--container, asserting via thedocker_submitterlog (grep -q, no pipe — a pipeline's status istail's and can't fail) that the queue default was actually used. The stack runs withPANDA_WORKER_IMAGE=python:3.13-alpine(via the composite action'senv-overrides), deliberately distinct from the per-jobpython:3.12-alpineused by the first integration test, so each test proves its own path.user.alice.ci.out.txt,user.alice.ci.default-image.out.txt) are registered in Rucio, so the second job's stage-out is verified too, not just that some file DID existsTesting
python3 -m unittest discover -s tests— 5 tests pass locally (including the missing-submitter failure mode)unit-testsandsmoke-testboth pass, with all new assertions firing in the logs (rendered-config exact-value check, queue-defaultgrep -qassertion, both-LFN Rucio check)PANDA_WORKER_IMAGE=panda-compose/snakemake-worker:$SNAKEMAKE_VERSIONin its.env) and its snakemake → PanDA → docker worker → Rucio E2E is green with it