Repository navigation
✨ feat(contributor): opt-in krun OCI runtime for the contributor container - #12262
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <scanner@hive.kubestellar.io> Co-authored-by: Danathar <6772335+Danathar@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
|
hive/awaiting-ci: merged origin/v6 into the branch and resolved the Justfile conflict (krun no-attach branch now precedes v6's new 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Signed-off-by: scanner <scanner@hive.kubestellar.io>
cf00cc1 to
0b7fe7b
Compare
0b7fe7b
ℹ️ Sentinel notice — informational; author is trusted (hive agent), merge is not blockedHive flagged this PR (author @hivecommons-hive[bot], head
Hive did not add the |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Opt-in krun microVM mode for the contributor container.
HIVE_CONTAINER_OCI_RUNTIME=krun(environment orcontributor.env) runsjust contribute-hive/just contribute-standbyunder rootless podman with--runtime krun, headless only. It fails closed and never falls back to a plain container. When the variable is unset or empty, the launch is byte-for-byte unchanged (checked against goldens).Closes #12199.
Refs #12197 (parent tracker; remaining children #12200, #12202 stay open).
Requirement mapping
contributor.envis sourced, so a value set only in that file still counts. Unset or empty skips every krun branch.krunis accepted. The refusal names the accepted value and says Kata is not supported because it does not run under podman.HIVE_CONTAINER_RUNTIME=docker, a missing podman, and rootful podman (.Host.Security.Rootless).localmode and any non-headless mode (pointing to 🌱 contributor krun mode: interactive sessions (omp) through the VM console #12202). In krun mode the recipe prints noexec -itattach command.pi(needs host networking) and any backend missing from the relay'sHEADLESS_BACKENDS, which is read frombin/contributor-relay.js.uname -s).podman --runtime=krun info, an open of/dev/kvmread-write (path overridable for tests viaHIVE_KRUN_KVM_DEVICE), and a fresh smoke run (--memory 1g --memory-swap 1g --cpus 1,krun.cpus=1,krun.ram_mib=768,--entrypoint sh). The smoke run must report a guest kernel different from the host's and the/.krun_config.jsonmarker. Each failure names the check and exits before the contributor starts.--runtime krunand the krun annotations. A test compares the two argvs after stripping those.krun.ram_mibis 75% ofHIVE_CONTAINER_MEMORY, rounded down (4g gives 3072).krun.cpusisceil(HIVE_CONTAINER_CPUS)clamped to 1..16.none/0sets nothing. A non-numeric CPU value is refused.Isolation: microVM (krun)line with guest kernel, memory and vCPUs, noting when krun's defaults apply. It warns about nested hosts based onsystemd-detect-virt --vm.contribute-stopremoves the contributor containers podman reports ran under.OCIRuntime == krunand deletescontributor-relay.pid.hivectlrelay controls refuse krun containers.contributor-relay.md, an env-var row, asandbox-isolation.mdsummary, a krun sentence added to every "no microVM" statement, and the correctedpodman-rootless-ci.mdsentence. Changelog fragment:changelog.d/added-contributor-krun-mode.md.Tests (run by CI only; nothing was run locally)
src/deploy/test_contributor_container_resources.shis extended with:src/deploy/testdata/contributor_run_*.golden) for unset and empty;contributor.env-only opt-in;contribute-stop.relay_control_test.gocovers krun refusal through a stubbed runtime command.The golden files were written by hand from the recipe. If CI shows a diff against them, that is the first thing to check.
The end-to-end run on bare-metal KVM hardware happens after merge, per the issue.
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@Danathar