Repository navigation
✨ Sandbox kicks get hive's relays (hive-review) on PATH from the hive image - #18519
Conversation
Job runtime: an init container from the running hive image (by digest, read from hive's own pod) copies hive-review into an emptyDir that the kick container mounts read-only at /opt/hive/relays. The init container is restricted-SCC safe: runAsNonRoot, read-only root filesystem, no privilege escalation, all capabilities dropped; the uid is left to the SCC on OpenShift and is 65534 elsewhere. job.relay_image and job.relay_run_as_user override, relay_image: none opts out. Podman: hive stages its own hive-review in a private temp dir and bind-mounts it read-only. Both wrap the kick command in a /bin/sh preflight that fails the kick (exit 78) with a clear message when bash or python3 is missing, and prepends the relay dir to PATH. Fixes #18512 Signed-off-by: Andy Anderson <andy@clubanderson.com>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. |
Mutation testing❌ gremlins did not produce a report for 2 package(s), so no verdict can be derived from this run (see the job log):
gremlins found 5 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.
Verdict: |
Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
cc @joerunde: this is part of the hive changes for the spyre-inference deps agent and sandboxed reviewer setup. |
Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Fixes #18512
What
Hive now supplies its sandbox-safe relays itself on every sandboxed agent kick, so a project image no longer needs to include
hive-review. Todayhive-reviewis the only relay that works from a sandbox, through the review spool from #14986.crux/kubejob). An init container namedhive-relaysuses the running hive image by digest. Hive reads its own pod through the existingpodsget grant and takes thehivecontainer'simageID. If that is not pullable it falls back to the image ref. Hive'simagePullSecretsare copied onto the Job./usr/local/bin/hive-reviewinto a 16MiemptyDir. The kick container mounts it read-only at/opt/hive/relays.runAsNonRoot,readOnlyRootFilesystem,allowPrivilegeEscalation: false, all capabilities dropped,RuntimeDefaultseccomp.openshift.io/sccannotation on hive's own pod. Elsewhere it is 65534, because the hive image defaults to root.job.relay_image(noneopts out) andjob.relay_run_as_userfields.crux/sandbox). Hive copies its ownhive-review(from itsPATHor$HIVE_SANDBOX_RELAY_DIR) into a private temp dir, bind-mounts itro,Zand removes it after the run./bin/shpreflight. It fails the kick with exit 78 and a clear message whenbashorpython3is missing, then prepends/opt/hive/relaystoPATHand execs the command.sandbox-isolation.md.LaunchSpec.Relays). Verify runs, contained runs and the terminal viewer are unchanged.src/Dockerfilealready installsbin/hive-review.shas/usr/local/bin/hive-review, so no image change was needed.Follow-up
OpenShell and Substrate are not wired yet. Their pods are built by the gateway or the actor API, and need an init container plus Landlock read access. The doc says so, and those runtimes still need
hive-reviewin the image.Tests
crux/kubejob/relays_test.go: the Job spec on a vanilla cluster and on OpenShift (init container, digest, volume, read-only mount, wrapped command, security context, pull secrets), configured overrides, opt-out, failure messages, image selection and pod-name fallbacks.crux/sandbox/relays_test.go: the Podman args mount, staging and cleanup, a missing relay, and the preflight run under a real/bin/shwith and without python3.🤖 Generated with Claude Code