Skip to content

fix(deploy): install tracebility-tenant in service Docker images#5

Merged
gaurav0107 merged 1 commit into
mainfrom
fix/docker-tenant-dep
Jun 7, 2026
Merged

fix(deploy): install tracebility-tenant in service Docker images#5
gaurav0107 merged 1 commit into
mainfrom
fix/docker-tenant-dep

Conversation

@gaurav0107

Copy link
Copy Markdown
Collaborator

Why

deploy ran for the first time after PR #4 fixed CI, and the three Python service image builds (ingest-api, api, ingest-worker) all failed with:

ERROR: Could not find a version that satisfies the requirement
tracebility-tenant (from tracebility-ingest-api)

PR #3 added tracebility-tenant as a dependency on those services, but it's a uv workspace member that lives in services/_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:

COPY services/_shared/tenant /tmp/tracebility-tenant
RUN pip install --no-cache-dir /tmp/tracebility-tenant && rm -rf /tmp/tracebility-tenant

…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 . — success
  • docker build -f services/api/Dockerfile . — success
  • docker build -f services/ingest-worker/Dockerfile . — success
  • docker 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)" — prints 16

Test plan

  • CI on this PR goes green.
  • Merge.
  • Post-merge ci succeeds (already going green per PR Unblock deploy: green ci (ruff + next lint) #4).
  • deploy workflow_run fires; all 5 image builds succeed; helm-deploy job runs end-to-end and the rollout reaches GKE.

🤖 Generated with Claude Code

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>
@gaurav0107 gaurav0107 merged commit b1220b0 into main Jun 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant