Skip to content

Docker image: compile the SDK once, and let the workflow push to ghcr.io - #281

Merged
igalshilman merged 1 commit into
mainfrom
claude/docker-image-build-timeout-usbxfa
Nov 5, 2026
Merged

igalshilman merged 1 commit into
mainfrom
claude/docker-image-build-timeout-usbxfa

Conversation

@igalshilman

Copy link
Copy Markdown
Contributor

The "Build docker image" workflow has failed on every push to main since Oct 30, and since #262 it takes about 100 minutes.

Why it's slow

The linux/arm64 half of the image is built under QEMU, and test-services/Dockerfile compiled the Rust extension twice per platform:

Step (run #272) amd64 arm64 (QEMU)
uv sync --all-extras --all-packages 3.5 min 55 min
uv build --all-packages (sdist, then a wheel from it) 4.7 min 45 min

uv sync also installed 158 packages of extras (google-adk, google-cloud-*, langchain…) that the image never uses: only the wheel in dist/ is copied to the final stage. The build stage now runs uv build --wheel, once, from the source tree.

Why it fails

Every run since #248 ends with:

failed to push ghcr.io/restatedev/test-services-python:main: denied: installation not allowed to Write organization package

docker.yml had no permissions: block (cla.yml needed explicit permissions the same day, so the token's default seems to have become read-only). It now asks for contents: read and packages: write. If the push is still denied after merging, the package's settings on ghcr.io need restatedev/sdk-python with write access under "Manage Actions access".

Testing

  • Built the image locally (amd64): one compile (3m 18s), the wheel installs, and the container answers /discover with the test services.
  • The push permission can only be checked once the workflow runs on main.

Expected effect

About 100 → 50 minutes (the arm64 compile under QEMU stays). Building arm64 on a native arm64 runner instead of QEMU would bring it to about 10; that's left for a follow-up.

integration.yaml builds the same Dockerfile, so its image build gets faster too.


Generated by Claude Code

The test-services image compiled the Rust extension twice per platform:
`uv sync --all-extras --all-packages` for an editable install (with 158
packages of extras the image never uses), then `uv build --all-packages`
again from the sdist. Under QEMU, for linux/arm64, that was 55 + 45
minutes. Only the wheel is copied to the final stage, so the build stage
now runs `uv build --wheel`, once.

The workflow had no permissions block, and every run since Oct 30 failed
at the push: "installation not allowed to Write organization package".
It now asks for packages: write.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RePHkQqibBdq1QeiSmBDhE

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

I reviewed the Dockerfile build-stage simplification and the new workflow token permissions.

  • One compile per platform: test-services/Dockerfile now runs only uv build --wheel. Before, it also ran uv sync --all-extras --all-packages and then built the wheel a second time from an sdist. The final stage only ever ran pip install deps/*whl with no extras, and restate-sdk is the only package in the repo (no uv workspace members), so dropping uv sync and --all-packages doesn't change what the image contains.
  • ghcr.io push permission: docker.yml now sets contents: read (enough for actions/checkout) and packages: write (needed for docker/build-push-action to push with GITHUB_TOKEN). No actions were added or changed, so actions.lock doesn't need updating.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Test Results

  8 files  ±0    8 suites  ±0   3m 55s ⏱️ -1s
 71 tests ±0   71 ✅ ±0  0 💤 ±0  0 ❌ ±0 
322 runs  ±0  322 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 5e48cd5. ± Comparison against base commit 312c765.

@igalshilman
igalshilman merged commit 6ddaa3f into main Nov 5, 2026
13 checks passed
@igalshilman
igalshilman deleted the claude/docker-image-build-timeout-usbxfa branch November 5, 2026 06:27
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants