Repository navigation
feat: render env file variables: as image ENV (silence gcloud NumPy warning) - #64
Merged
Merged
Conversation
… warning absconda deploys itself by building a conda image from examples/absconda-env.yaml (not the root Dockerfile), so the NumPy fix added to the Dockerfile in #53 never reached the deployed image. NumPy is already in the conda env, but gcloud runs its Python with `-S` and so can't import it, emitting "consider installing NumPy" on every IAP tunnel. The missing piece is CLOUDSDK_PYTHON_SITEPACKAGES=1, which must be a runtime env var in the image. absconda images run binaries directly (no `conda activate`), so conda's own `variables:` handling never fires. Render a conda-style `variables:` section in the environment file into Dockerfile `ENV` lines (in the export block, so it lands in the final image for every build mode), and strip it from the conda env file the solver reads. Then set CLOUDSDK_PYTHON_SITEPACKAGES=1 in the self-env. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The deployed absconda image is built by dogfooding (`absconda publish --file examples/absconda-env.yaml` in deploy.yml), not from this Dockerfile. It was the artifact #53 added the NumPy/CLOUDSDK fix to, which never reached the deployed conda image — now handled via the env file's `variables:` section. Nothing (CI, MANIFEST.in, docs, tests) references it, so drop it to leave a single source of truth for the image. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
johnyaku
force-pushed
the
feat/env-variables-to-dockerfile-env
branch
from
June 18, 2026 06:29
6cf3d1b to
fe864cd
Compare
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.
Why the NumPy warning persists
This was supposedly fixed in #53 ("NumPy in tool image") — but that change went into the root
Dockerfile, which isn't what gets deployed.deploy.ymlbuilds the image by dogfooding:absconda publish --file examples/absconda-env.yaml --repository ghcr.io/swarbricklab/absconda ...i.e. a conda image built from
examples/absconda-env.yaml. That env already containsnumpyandgoogle-cloud-sdk— so NumPy is installed. The real problem: gcloud runs its Python with-S(no site-packages) unlessCLOUDSDK_PYTHON_SITEPACKAGES=1, so it never imports the NumPy that's sitting right there.That env var must be present at runtime in the image. But absconda images run binaries directly via the singularity wrapper — they never
conda activate— so conda's ownvariables:mechanism (which only applies on activate) doesn't fire, and there was no other way to bake an env var in.Changes
Render a conda-style
variables:section into imageENVlines (general, reusable — any env can now set image env vars; aligns with conda's existingenvironment.yamlschema):ENV FOO="a b") so spaces survive.variables:section is stripped from the conda env file the solver reads (it's an image directive, not a solve input).Set it in the self-env to silence the warning:
Delete the unused root
Dockerfile. It's where feat: opt-in build context, NumPy in tool image, config-based GHCR auth #53's ineffective NumPy/CLOUDSDK_*lines lived, but nothing builds from it (not CI,MANIFEST.in,pyproject.toml, docs, or tests — only temp test files and the generated-Dockerfile concept reference the name). Removing it leaves a single source of truth for the absconda image.Testing
pytest: 117 passed, 2 skipped.ruff+ format clean.ENV CLOUDSDK_PYTHON_SITEPACKAGES="1"appears in the runtime stage andvariables:is absent from the condaenv.yamlblock.🤖 Generated with Claude Code