chore(ci): keep .git out of the Dagster+ build context - #839
Merged
Conversation
Every deploy was transferring 316 MB before the first layer could build. The tracked tree is 13 MB; the rest was almost entirely .git, which CI clones with full history and which nothing in the image reads. The context is now 6.7 MB. Also excluded: Python caches, which are worse than useless in an image built on a pinned base; test fixtures and BDD features, since the image runs the code location and CI runs the suite outside it; and transfers/data, logs, and metrics, which are untracked, machine-specific, and roughly 900 MB on a developer checkout -- a local `docker build` was shipping all of it. Verified by building the real image with the new context: db, domain, services, core, schemas, automated_ingestion, and alembic are all present, db and domain import, and the code location resolves all four assets. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Coverage✅ 79.27% total — gate is 75%. |
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.
Every Dagster+ deploy transferred 316 MB of context before the first layer
could build. The tracked tree is 13 MB. The rest was almost entirely
.git—CI clones full history, and nothing in the image reads git metadata.
316.65 MB → 6.65 MB.
.dockerignorepreviously contained one line:.venv.What else is excluded, and why
.git,.github__pycache__,*.pyc,*.egg-infotests/,features/transfers/data,logs,metricsdocker buildwas shipping all of it.terraform/,*.tfstateVerification
Built the real image with the new context and checked inside it rather than
assuming:
db,domain,services,core,schemas,automated_ingestion, andalembicare all presentfrom db.transducer import TransducerObservationsucceedsdomain.units.convert_cm_to_ft(471.518)returns15.469751Not a fix for the open import bug
This is unrelated to
ModuleNotFoundError: No module named 'db'indatabase_connectivity— that reproduces identically with the old context, anddb/was always present in the image. #838 carries the diagnostic for it.🤖 Generated with Claude Code