Repository navigation
fix: don't rm root-owned COPY temp files as non-root build user - #62
Merged
Merged
Conversation
The builder/single-stage paths run as $MAMBA_USER, but COPY creates /tmp/requirements.txt owned by root. In sticky /tmp a non-owner can't delete it, so `rm -f /tmp/requirements.txt` failed with "Operation not permitted" and broke the build (CI #61). Drop the cleanup in these two paths: the builder stage is discarded (multi-stage), and single-stage already leaves /tmp/env.yaml behind, so this is consistent and the leftover is a harmless few-KB text file. The conda_on_base path runs as root and keeps its cleanup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
The Deploy-to-NCI run for #61 (merged) failed building absconda's own image:
The conda+pip two-phase install itself worked. The failure was the cleanup step I added to the packed paths: the build runs as the non-root
$MAMBA_USER, butCOPY <<'ABSCONDA_PIP' /tmp/requirements.txtcreates the file owned by root. In sticky/tmp, a non-owner can't delete it, sorm -f /tmp/requirements.txtfailed and broke the&&chain.(The
conda_on_basepath runs as root, so itsrmis fine — and that path isn't what CI builds.)Fix
Drop the
rm -f /tmp/requirements.txt /tmp/conda.constraints.txtline inbuilder_stage.j2andsingle_stage.j2:/tmpleftovers never reach the runtime image./tmp/env.yamlbehind pre-feat: install pip deps constrained to conda's resolved versions #61, so this is consistent; the leftover is a harmless few-KB text file.conda_on_base.j2keeps its cleanup (runs as root, permitted).Testing
pytest tests/test_templates.py: 9 passed; full suite green.ruffclean.&&chain is intact (… pip check && conda-pack && …) with normof the COPY'd file.Follow-up to #61. Merging this re-triggers Deploy-to-NCI, which should now build cleanly.
🤖 Generated with Claude Code