From 02e9adcfabd1a2101d18cb485c86b27f86fe5637 Mon Sep 17 00:00:00 2001 From: Anastassios Nanos Date: Thu, 19 Nov 2026 10:21:08 +0200 Subject: [PATCH 1/3] feat(bundle): Make hull the runtime when the bundle carries it The launcher defaulted BRIG_RUNTIME to nerdctl and left hull an opt-in, because brig refused on hull on Linux what the agent profiles ask for: an isolated network, an egress policy, routes and published ports. brig v0.6.0 serves all of them on hull on Linux, on a network gateway of the sandbox's own, and also defaults to hull when a hull is on PATH. The launcher now defaults to hull when the bundle carries one, and to nerdctl when it does not. BRIG_RUNTIME still names either, and nerdctl stays in the bundle for what hull on Linux refuses, such as an image whose USER is a name. This needs the brig in the bundle to be v0.6.0 or later: an older brig refuses those profiles on hull. It lands with the BRIG_VERSION bump. Signed-off-by: Anastassios Nanos --- README.md | 27 +++++++++++++-------------- scripts/build-bundle.sh | 11 ++++++++--- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 6bf54b3..b92412f 100644 --- a/README.md +++ b/README.md @@ -186,24 +186,23 @@ $ curl -fsSL https://raw.githubusercontent.com/NOFireAI/brig-standalone-linux/ma [docs/rootless.md](docs/rootless.md) has the detail, including the two things that still need root once per host, and what a home install gives up. -### hull beside nerdctl +### hull and nerdctl -nerdctl is brig's runtime here. The bundle also carries hull, the runtime brig -drives on macOS, built for Linux: a containerd client that boots the same urunc, -monitors and guest assets. `BRIG_RUNTIME=hull` selects it, and the launcher then -points brig at the bundle's hull rather than its nerdctl: +hull is brig's runtime here. It is the runtime brig drives on macOS, built for +Linux: a containerd client that boots the same urunc, monitors and guest assets, +and puts each networked sandbox on a network gateway of its own, which enforces +the egress policy and serves routes and published ports. nerdctl stays in the +bundle, and `BRIG_RUNTIME=nerdctl` selects it, for instance for an image whose +`USER` is a name, which hull on Linux refuses: ```console -$ BRIG_RUNTIME=hull brig doctor +$ BRIG_RUNTIME=nerdctl brig doctor ``` -It needs a brig that drives hull on Linux, which the `v0.5.0` in this bundle -does not. Even then, hull on Linux boots a sandbox on the shared bridge or with -no network, and brig refuses what it cannot enforce there yet: an egress policy, -a route, `network: isolated` and a published port. The shipped agent profiles -ask for an isolated network, so they stay on nerdctl for now. Every value the -launcher sets still defers to the environment, so `BRIG_RUNTIME_BIN` points brig -at another hull. +A sandbox stays on the runtime that booted it, so one booted on nerdctl before +this release needs `BRIG_RUNTIME=nerdctl` until `brig rm` removes it. Every value +the launcher sets still defers to the environment, so `BRIG_RUNTIME_BIN` points +brig at another hull. The launcher works out the binary each time it is sourced. A shell that has run `eval "$(brig-ctl env)"` has the bundle's `bin/` first on its `PATH`, so `brig` @@ -211,7 +210,7 @@ there is the binary itself and nothing sources the launcher again: set `BRIG_RUNTIME` before the eval, or run the eval again after changing it. ```console -# export BRIG_RUNTIME=hull +# export BRIG_RUNTIME=nerdctl # eval "$(/var/lib/brig/data/bin/brig-ctl env)" ``` diff --git a/scripts/build-bundle.sh b/scripts/build-bundle.sh index a28b710..dd4c41c 100755 --- a/scripts/build-bundle.sh +++ b/scripts/build-bundle.sh @@ -1098,6 +1098,10 @@ fi # a cross compile in a container of the build host's arch, not a --platform # build. No TELEMETRY_ENDPOINT is passed, so this hull never sends telemetry. HULL_INSTALLED=false +# The runtime brig drives when BRIG_RUNTIME names none: hull once the bundle +# carries it, since hull on Linux serves the policies, routes and published +# ports nerdctl does and publishes on a running sandbox too. +DEFAULT_RUNTIME=nerdctl HULL_PINNED="" if [ "$VARIANT" != "stock" ]; then command -v docker >/dev/null 2>&1 || fatal "docker is required to build hull from $HULL_REPO" @@ -1140,6 +1144,7 @@ if [ "$VARIANT" != "stock" ]; then cp "$hsrc/dist/hull_linux_$ARCH" "$DL/hull" || fatal "the hull build left no dist/hull_linux_$ARCH" chmod 0755 "$DL/hull" HULL_INSTALLED=true + DEFAULT_RUNTIME=hull info " built hull $HULL_REF" fi @@ -1531,15 +1536,15 @@ export CNI_PATH="\${CNI_PATH:-$CNI_DIR}" # install prefixes, but reads the variable in preference, so the export keeps # hull and nerdctl on one directory, an install at another prefix included. # -# nerdctl is brig's runtime here, and BRIG_RUNTIME=hull opts in to the hull -# beside it. The binary follows the runtime: a BRIG_RUNTIME=hull handed the +# hull is brig's runtime here when the bundle carries it, and nerdctl +# otherwise; BRIG_RUNTIME names either one. The binary follows the runtime: a BRIG_RUNTIME=hull handed the # nerdctl path would drive nerdctl with hull's command line. A runtime the # bundle does not carry gets no binary, so brig looks for it on PATH or says # it is missing. A BRIG_RUNTIME_BIN that names one of this bundle's runtimes # came from this file, sourced before for whatever runtime was set then (an # earlier eval of brig-ctl env), so it is worked out again. Any other value # is the caller's and stands. -export BRIG_RUNTIME="\${BRIG_RUNTIME:-nerdctl}" +export BRIG_RUNTIME="\${BRIG_RUNTIME:-$DEFAULT_RUNTIME}" case "\${BRIG_RUNTIME_BIN:-}" in "$BIN_DIR/nerdctl"|"$BIN_DIR/hull") unset BRIG_RUNTIME_BIN ;; esac From e2480bd19a3af026d5993aa1135ce062c785fbbf Mon Sep 17 00:00:00 2001 From: Anastassios Nanos Date: Thu, 19 Nov 2026 10:36:18 +0200 Subject: [PATCH 2/3] ci: Expect hull as the launcher's default The bundle check asserted that the launcher defaults to nerdctl and that BRIG_RUNTIME=hull switches to hull. With hull the default when the bundle carries it, the check now asserts the reverse: hull by default, nerdctl one setting away, and a re-sourced launcher that follows a switch to nerdctl. Signed-off-by: Anastassios Nanos --- .github/workflows/ci.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f45392..b551331 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,12 +232,14 @@ jobs: rootless) net="$HOME/.config/brig/cni/net.d" ;; *) net="$prefix/etc/cni/net.d" ;; esac + # The bundle carries hull, so hull is the default; nerdctl is + # still one setting away. got="$(launcher)" - [ "$got" = "nerdctl $prefix/bin/nerdctl $net" ] \ - || { echo "default launcher: got '$got'"; exit 1; } - got="$(launcher BRIG_RUNTIME=hull)" [ "$got" = "hull $prefix/bin/hull $net" ] \ - || { echo "BRIG_RUNTIME=hull launcher: got '$got'"; exit 1; } + || { echo "default launcher: got '$got'"; exit 1; } + got="$(launcher BRIG_RUNTIME=nerdctl)" + [ "$got" = "nerdctl $prefix/bin/nerdctl $net" ] \ + || { echo "BRIG_RUNTIME=nerdctl launcher: got '$got'"; exit 1; } got="$(launcher BRIG_RUNTIME=hull BRIG_RUNTIME_BIN=/opt/hull NETCONFPATH=/opt/net)" [ "$got" = "hull /opt/hull /opt/net" ] \ || { echo "the launcher overrode the caller's values: got '$got'"; exit 1; } @@ -245,9 +247,9 @@ jobs: # brig-ctl env does, the launcher drops the binary it set the first # time and names the new runtime's. got="$(env -i HOME="$HOME" PATH=/usr/bin:/bin \ - sh -c ". '$t/etc/brig-env.sh'; BRIG_RUNTIME=hull; . '$t/etc/brig-env.sh'; echo \"\$BRIG_RUNTIME \$BRIG_RUNTIME_BIN\"")" - [ "$got" = "hull $prefix/bin/hull" ] \ - || { echo "the launcher re-sourced for hull kept nerdctl: got '$got'"; exit 1; } + sh -c ". '$t/etc/brig-env.sh'; BRIG_RUNTIME=nerdctl; . '$t/etc/brig-env.sh'; echo \"\$BRIG_RUNTIME \$BRIG_RUNTIME_BIN\"")" + [ "$got" = "nerdctl $prefix/bin/nerdctl" ] \ + || { echo "the launcher re-sourced for nerdctl kept hull: got '$got'"; exit 1; } - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: From f56ad86a7d9eacf5160863c1cc239d2afcce63ff Mon Sep 17 00:00:00 2001 From: Anastassios Nanos Date: Thu, 19 Nov 2026 12:35:39 +0200 Subject: [PATCH 3/3] docs: Say that hull as the runtime needs brig v0.6.0, and test both switches The README and the launcher's comment now say that hull as the default takes a brig of v0.6.0 or later, as the merge note of this change does. The CI check that sources the launcher twice tests a switch from nerdctl to hull again, the case the binary reset was written for, beside the switch from hull to nerdctl. Signed-off-by: Anastassios Nanos --- .github/workflows/ci.yml | 6 +++++- README.md | 5 +++-- scripts/build-bundle.sh | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b551331..a4c946c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -245,11 +245,15 @@ jobs: || { echo "the launcher overrode the caller's values: got '$got'"; exit 1; } # Sourced again after a switch of runtime, as a second eval of # brig-ctl env does, the launcher drops the binary it set the first - # time and names the new runtime's. + # time and names the new runtime's, in both directions. got="$(env -i HOME="$HOME" PATH=/usr/bin:/bin \ sh -c ". '$t/etc/brig-env.sh'; BRIG_RUNTIME=nerdctl; . '$t/etc/brig-env.sh'; echo \"\$BRIG_RUNTIME \$BRIG_RUNTIME_BIN\"")" [ "$got" = "nerdctl $prefix/bin/nerdctl" ] \ || { echo "the launcher re-sourced for nerdctl kept hull: got '$got'"; exit 1; } + got="$(env -i HOME="$HOME" PATH=/usr/bin:/bin BRIG_RUNTIME=nerdctl \ + sh -c ". '$t/etc/brig-env.sh'; BRIG_RUNTIME=hull; . '$t/etc/brig-env.sh'; echo \"\$BRIG_RUNTIME \$BRIG_RUNTIME_BIN\"")" + [ "$got" = "hull $prefix/bin/hull" ] \ + || { echo "the launcher re-sourced for hull kept nerdctl: got '$got'"; exit 1; } - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: diff --git a/README.md b/README.md index b92412f..74ebec2 100644 --- a/README.md +++ b/README.md @@ -188,8 +188,9 @@ that still need root once per host, and what a home install gives up. ### hull and nerdctl -hull is brig's runtime here. It is the runtime brig drives on macOS, built for -Linux: a containerd client that boots the same urunc, monitors and guest assets, +hull is brig's runtime here, and needs the brig in the bundle to be v0.6.0 or +later: an older brig refuses the shipped profiles on hull. It is the runtime +brig drives on macOS, built for Linux: a containerd client that boots the same urunc, monitors and guest assets, and puts each networked sandbox on a network gateway of its own, which enforces the egress policy and serves routes and published ports. nerdctl stays in the bundle, and `BRIG_RUNTIME=nerdctl` selects it, for instance for an image whose diff --git a/scripts/build-bundle.sh b/scripts/build-bundle.sh index dd4c41c..9a1ee52 100755 --- a/scripts/build-bundle.sh +++ b/scripts/build-bundle.sh @@ -1100,7 +1100,8 @@ fi HULL_INSTALLED=false # The runtime brig drives when BRIG_RUNTIME names none: hull once the bundle # carries it, since hull on Linux serves the policies, routes and published -# ports nerdctl does and publishes on a running sandbox too. +# ports nerdctl does and publishes on a running sandbox too. That takes a brig +# of v0.6.0 or later; an older one refuses the shipped profiles on hull. DEFAULT_RUNTIME=nerdctl HULL_PINNED="" if [ "$VARIANT" != "stock" ]; then