Disable Python user site in Apptainer jobs#787
Open
fomo-bot wants to merge 2 commits into
Open
Conversation
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.
Summary
PYTHONNOUSERSITE=1is present before Python starts in the container.PYTHONNOUSERSITE=1inside the container shell as a belt-and-suspenders guard.Why
Apptainer mounts
$HOMEby default. Because the container Python is 3.12, Python was discovering host packages under~/.local/lib/python3.12/site-packagesinside the container. In ORCD H200 debug runs this caused CuPy to import from the host user site and warn about mixedcupy-cuda12x/cupy-cuda13xinstalls.The container already includes the needed CuPy package, so the harness should keep host user-site packages out of
sys.path.Validation
bash -n scripts/slurm_apptainer_train.sbatchbash -n scripts/slurm_apptainer_eval.sbatchPYTHONNOUSERSITE=1:site.ENABLE_USER_SITEisFalse/home/jrusak/.local/...is not onsys.pathcupyimports from/usr/local/lib/python3.12/dist-packages/cupycupy-cuda13x==13.6.0is installed in the visible environmentdask.arrayimports and computes successfullyxarrayopens/orcd/data/abodner/002/jrusak/om4_onedeg_v3/OM4.zarr