fix(runner): pull snapshot layers for the host arch, not hardcoded amd64#671
Conversation
The snapshot puller hardcoded linux/amd64. On a non-amd64 runner host (e.g. Apple Silicon dev runners) that pulls x86 layers, so /bin/sh and other binaries land as x86 ELF and fail with `ENOEXEC: Exec format error` when libkrun execs them inside the microVM. Use runtime.GOARCH so the pulled image matches the host that will run it; rename the now-misleading linuxAmd64Platform to linuxHostPlatform. Adds a regression test asserting the platform tracks runtime.GOARCH (fails if re-hardcoded to a fixed arch on a mismatched host). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR updates the boxlite registry package to select image manifests compatible with the runner's host architecture at startup. Instead of requesting a hardcoded ChangesDynamic host-architecture registry platform
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
lile seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
1 similar comment
|
lile seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates registry image pulls to target the runner host’s CPU architecture instead of hardcoding linux/amd64, preventing pulling incompatible image layers on non-amd64 hosts (e.g., Apple Silicon).
Changes:
- Replace the fixed
linux/amd64pull platform with alinux/<host-arch>platform derived fromruntime.GOARCH. - Update remote registry options to use the new platform.
- Add a regression test to ensure the selected platform architecture matches the process architecture.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/runner/pkg/boxlite/registry.go | Switch default remote pull platform from hardcoded amd64 to runtime.GOARCH. |
| apps/runner/pkg/boxlite/registry_test.go | Add a test to assert default pull platform matches runtime.GOARCH and OS is linux. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Default registry-pull platform. Daytona's original hardcode of | ||
| // `linux/amd64` is correct for prod EC2 runners but breaks on Apple Silicon | ||
| // (`/bin/sh` lands as x86 ELF → `ENOEXEC: Exec format error` when libkrun | ||
| // tries to exec inside the microVM). Detect at startup based on host arch. | ||
| var linuxHostPlatform = v1.Platform{ | ||
| OS: "linux", | ||
| Architecture: runtime.GOARCH, // "amd64", "arm64", etc. | ||
| } |
| var linuxHostPlatform = v1.Platform{ | ||
| OS: "linux", | ||
| Architecture: runtime.GOARCH, // "amd64", "arm64", etc. | ||
| } |
…r infra-local Re-add the OIDC user-create default-region fix that was split to PR boxlite-ai#668. Removing it from this branch broke infra-local: a fresh Dex login creates a Personal org with defaultRegionId=NULL, and dashboard create-sandbox then fails with HTTP 428 "organization does not have a default region" (caught by E2E). Like the runner arm64 (boxlite-ai#671) and cron orderby (boxlite-ai#672) fixes, this is a general fix the local stack depends on, so it stays in-branch until boxlite-ai#668 lands on main; it drops from this PR's diff on the next rebase. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
PullSnapshothardcodedlinux/amd64when pulling snapshot image layers. On a non-amd64 runner host (e.g. an Apple Silicon dev runner) that pulls x86 layers, so/bin/shand other binaries land as x86 ELF and fail withENOEXEC: Exec format errorthe moment libkrun execs them inside the microVM.Fix: use
runtime.GOARCHso the pulled image matches the architecture of the host that will actually run it. Also renames the now-misleadinglinuxAmd64Platform→linuxHostPlatform.Why a separate PR
Extracted from the infra-local stack PR (#595) per review — it's a general runner correctness fix unrelated to the local-dev stack, so it should land and be reviewed on its own.
Test
Adds
TestLinuxHostPlatformMatchesHostArchasserting the pull platform tracksruntime.GOARCH(fails if re-hardcoded to a fixed arch on a mismatched host). Verified on arm64:🤖 Generated with Claude Code
Summary by CodeRabbit