fix(deploy): install tracebility-tenant in service Docker images#5
Merged
Conversation
The three Python service Dockerfiles install the service via ``pip install --no-cache-dir .`` against PyPI. PR #3 added a ``tracebility-tenant`` dependency that lives in services/_shared/tenant as a uv-workspace member — it isn't on PyPI, so pip fails the build: ERROR: Could not find a version that satisfies the requirement tracebility-tenant (from tracebility-ingest-api) Fix: copy services/_shared/tenant into the image and ``pip install`` it locally before installing the service. Pip's resolver finds the already- installed copy and the service install succeeds. Verified: ``docker build`` succeeds for ingest-api, api, and ingest-worker locally; running the image confirms ``from tracebility_tenant import ...`` works inside the container. Signed-off-by: Gaurav Dubey <gauravdubey0107@gmail.com> Signed-off-by: gaurav0107 <gauravdubey0107@gmail.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.
Why
deployran for the first time after PR #4 fixed CI, and the three Python service image builds (ingest-api, api, ingest-worker) all failed with:PR #3 added
tracebility-tenantas a dependency on those services, but it's a uv workspace member that lives inservices/_shared/tenant/— not published to PyPI.pip install --no-cache-dir .inside the Dockerfile has no way to find it.(Web + migrator builds were fine: web is a Node app, migrator is just bash + psql + curl.)
What this changes
Each of the three Python Dockerfiles now does:
…before the existing service install. Pip's resolver finds the already-installed
tracebility-tenant, the service install succeeds, and the temp directory is cleaned up so it doesn't bloat the layer.The build context is the repo root (per
.github/workflows/deploy.yml), so the COPY path resolves correctly.Verified locally
docker build -f services/ingest-api/Dockerfile .— successdocker build -f services/api/Dockerfile .— successdocker build -f services/ingest-worker/Dockerfile .— successdocker run --rm -e TRACEBILITY_REDIS_URL=… -e TRACEBILITY_PG_DSN=… -e TRACEBILITY_CLICKHOUSE_URL=… test-ingest-api:fix python -c "from tracebility_ingest.app import create_app; from tracebility_tenant import ShardRouter; print(ShardRouter().shard_count)"— prints16Test plan
cisucceeds (already going green per PR Unblock deploy: green ci (ruff + next lint) #4).deployworkflow_run fires; all 5 image builds succeed;helm-deployjob runs end-to-end and the rollout reaches GKE.🤖 Generated with Claude Code