Repository navigation
fix: run apko_image on remote executors - #411
Merged
Merged
Conversation
apko_image carried a no-remote-exec requirement, added as a stopgap for apko failing to build offline from a read-only cache (#331). apko has handled that since v1.4.3 and this module pins v1.4.6. Checked on darwin with the cache from this module's lock repository, made read-only: v1.4.2 fails with permission denied, v1.4.6 builds and leaves the cache unchanged, with HOME set or unset. Add a CI step that fails if any action in e2e/smoke carries no-remote-exec, so the requirement cannot come back unnoticed.
codysoyland
approved these changes
Oct 27, 2026
codysoyland
left a comment
There was a problem hiding this comment.
Automated review by unblok using Codex · gpt-6-astra · medium reasoning effort
LGTM. Removing the execution restriction is supported by the current apko pin.
What I verified
apko/private/apko_image.bzl:104-112no longer forces local execution; declared inputs, tools, outputs and--offlineremain intact.MODULE.bazel:20pins apko v1.4.6. Itspkg/apk/expandapk/verify.go:165-176falls back toos.TempDir()when a private data file cannot be created in the cache directory..github/workflows/ci.yaml:112-115checks the smoke action graph forno-remote-exec; the smoke CI jobs passed on Bazel 7.6.1, 8.3.0, 8.6.0 and 9.1.0 at49322ae.e2e/smoke/BUILD:6-18includes an actualapko_imagebuild target. Real remote execution remains unverified; staging still needs mkdir/cp on the executor, as disclosed in the PR.
Security
- ci: cleared. Workflow triggers and
contents: readpermissions are unchanged; the new step uses a literal command in the existing smoke workspace. A fresh reviewer confirmed the clearance.
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.
apko_imagestill pins its build action to local execution (no-remote-exec), so it never runs on a remote executor. Remote execution worked before #332, which added the pin as a stopgap for #331: apko failed to build--offlinefrom the read-only cache that Bazel provides as an input.apko no longer has that problem. Since v1.4.3 it verifies cached packages without writing to the cache directory, and this module pins v1.4.6. This deletes the pin.
Evidence
On darwin/arm64 I built the cache with this module's own repository rules (
bazel build //:lockin e2e/smoke), made the copy read-only withchmod -R a-w, and ran the invocationapko_imageuses:apko build apko.yaml lock:latest out --vcs=false --lockfile=apko.lock.json --cache-dir=cache --offline.mkdir .../expand-apk...: permission deniedfailed installation from lockfile ... expanding {busybox ...}v1.4.6 also exits 0 with
HOMEunset (env -i), so the action needs no writable home either.bazel test //...in e2e/smoke on Bazel 9.1.0: 4/4 pass.The new CI step runs
bazel aquery //... --output=jsonprotoin e2e/smoke and fails if any action has ano-remote-execexecution requirement. Against this tree it passes; against main (pin present) the same query reports the requirement.Not verified
I have not run this on a real remote executor. The darwin runs show apko handles a read-only cache; they do not show the whole action working on a remote worker. The
copy_to_workdiractions still callmkdirandcpfrom the executor's PATH, so an executor with no userspace would still fail there (#380 and #409 address that with a coreutils toolchain). A conventional RBE image has both.