fix: pin Docker builds to workspace lockfile#166
Merged
scale-ballen merged 2 commits intomainfrom Mar 17, 2026
Merged
Conversation
…tive deps The Dockerfile was not copying the workspace root pyproject.toml or uv.lock into the build context. Without the lockfile, `uv sync` resolved dependencies fresh from PyPI on every build, causing agentex-sdk to resolve to 0.9.4 (latest) instead of the pinned 0.4.18. Version 0.9.4 introduced a transitive dependency on claude-agent-sdk>=0.1.0, and the latest release (0.1.49) only published a macOS ARM64 wheel — breaking all Linux Docker builds. Changes: - Copy workspace root pyproject.toml and uv.lock into Docker build context - Add --frozen flag to all uv sync commands (base, dev, docs stages) - Add --package agentex-backend to target member dependencies, not root Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
smoreinis
approved these changes
Mar 17, 2026
The default ARG SOURCE_DIR=public/agentex placed the member pyproject.toml at /app/public/agentex/ which doesn't match the workspace root's members = ["agentex"] declaration. This would cause uv to fail resolving agentex-backend as a workspace member. The public/agentex path also doesn't exist in the repo — docker-compose already overrides to SOURCE_DIR=agentex. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.
Summary
Fixes two Docker build failures in the release workflow:
401 Unauthorized pulling golden base image — The golden image migration (PR sec: migrate standard Dockerfiles to Chainguard golden base images #159) switched the base image from public Docker Hub to private ECR, but the release workflow was never updated to authenticate to ECR.
Broken transitive dependency resolution — The Dockerfile didn't use the workspace lockfile, so
uv syncresolved dependencies fresh from PyPI every build. This causedagentex-sdkto resolve to 0.9.4 (latest) which transitively pulls inclaude-agent-sdk==0.1.49— a broken release with only a macOS ARM64 wheel.Root Cause #1: ECR Auth (build-agentex.yml)
The release workflow only authenticated to GHCR, not ECR. The Dockerfile's
FROM 022465994601.dkr.ecr...requires ECR credentials.Fix: Add OIDC auth + ECR login steps, matching the existing pattern in
integration-tests.yml.Root Cause #2: Unpinned Dependencies (Dockerfile)
The workspace root
pyproject.tomlpinsagentex-sdk==0.4.18anduv.locklocks all transitive deps, but the Dockerfile only copied the memberpyproject.toml— no lockfile, fresh resolution every build.Fix: Copy workspace root files + use
--frozen --package agentex-backend.Changes
.github/workflows/build-agentex.ymlid-token: writepermission for OIDC.github/workflows/build-agentex.ymlagentex/Dockerfilepyproject.toml+uv.lockinto build contextagentex/Dockerfile--frozento alluv synccommands (base, dev, docs stages)agentex/Dockerfile--package agentex-backendto target member deps, not rootagentex/DockerfileSOURCE_DIRfrompublic/agentex→agentexto match workspacemembers = ["agentex"]Test Evidence
All tests run locally against Docker images built without
--build-argoverrides (using the corrected defaultSOURCE_DIR=agentex).Build tests (all 3 Dockerfile stages)
basestage builds (--no-cache)devstage builds (--no-cache)productionstage builds (--no-cache, includes docs)Production runtime tests
fastapi,ddtrace,uvicorn,redis,sqlalchemy,temporalio,litellm,aiohttp,pymongo,httpx,docker,alembic,asyncpg,aiodocker,kubernetes_asyncio,websockets,json_log_formatter,datadog,opentelemetry,dotenv,multipart)/usr/bin/uvicorn,/usr/bin/ddtrace-run,/usr/bin/python3src.api.app)/app/docs/site/index.htmlagentex-sdkNOT installed (dev-only, correctly excluded by--no-dev)claude-agent-sdkNOT installedDev runtime tests
agentex-sdk==0.4.18(lockfile pin, NOT 0.9.4 from PyPI)claude-agent-sdkNOT installed (0.4.18 doesn't depend on it)Negative test (reproducing the original failure)
uv sync --group devresolvesagentex-sdk==0.9.4→claude-agent-sdk==0.1.49→ fails on Linux with "no matching distribution"ECR auth pattern verification
github-action-scale-agentex-ecr-read) matchesintegration-tests.yml022465994601) matches golden image accountid-token: writepermission added for OIDC federation🤖 Generated with Claude Code