Skip to content

Commit f1fbdc6

Browse files
committed
build(packaging): ship the Podman driver binary
The gateway now launches openshell-driver-podman instead of linking it, so build the binary for Linux and install it next to the VM driver in /usr/libexec/openshell in the Debian and RPM packages and the test machine artifacts. Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 39f02d4 commit f1fbdc6

9 files changed

Lines changed: 67 additions & 5 deletions

File tree

‎.github/workflows/build-binaries-linux.yml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,22 @@ jobs:
9292
timeout-minutes: 60
9393
steps: *build_steps
9494

95+
podman-driver:
96+
name: openshell-driver-podman (${{ matrix.triple }})
97+
env:
98+
PACKAGE: openshell-driver-podman
99+
BINARY: openshell-driver-podman
100+
strategy:
101+
matrix:
102+
include:
103+
- triple: x86_64-unknown-linux-gnu
104+
runner: linux-amd64-cpu8
105+
- triple: aarch64-unknown-linux-gnu
106+
runner: linux-arm64-cpu8
107+
runs-on: ${{ matrix.runner }}
108+
timeout-minutes: 60
109+
steps: *build_steps
110+
95111
runtimes:
96112
name: ${{ matrix.binary }} (${{ matrix.triple }})
97113
env:

‎.github/workflows/build-rpm.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,16 @@ jobs:
9090
name: openshell-prover-${{ inputs.prover-target }}
9191
path: package-binaries/
9292

93+
- name: Download Podman driver artifact
94+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
95+
with:
96+
name: openshell-driver-podman-${{ inputs.gateway-target }}
97+
path: package-binaries/
98+
9399
- name: Configure package inputs
94100
run: |
95101
set -euo pipefail
96-
chmod +x package-binaries/openshell{,-gateway,-prover}
102+
chmod +x package-binaries/openshell{,-gateway,-prover,-driver-podman}
97103
ls -lah package-binaries
98104
99105
- name: Mark workspace safe for git

‎.github/workflows/deb-package.yml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,16 @@ jobs:
6363
name: openshell-driver-vm-${{ matrix.gnu_target }}
6464
path: package-binaries/
6565

66+
- name: Download Podman driver artifact
67+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
68+
with:
69+
name: openshell-driver-podman-${{ matrix.gnu_target }}
70+
path: package-binaries/
71+
6672
- name: Configure package inputs
6773
run: |
6874
set -euo pipefail
69-
chmod +x package-binaries/openshell{,-gateway,-prover,-driver-vm}
75+
chmod +x package-binaries/openshell{,-gateway,-prover,-driver-vm,-driver-podman}
7076
ls -lah package-binaries
7177
7278
- name: Build Debian package
@@ -76,6 +82,7 @@ jobs:
7682
OPENSHELL_GATEWAY_BINARY="${PWD}/package-binaries/openshell-gateway" \
7783
OPENSHELL_PROVER_BINARY="${PWD}/package-binaries/openshell-prover" \
7884
OPENSHELL_DRIVER_VM_BINARY="${PWD}/package-binaries/openshell-driver-vm" \
85+
OPENSHELL_DRIVER_PODMAN_BINARY="${PWD}/package-binaries/openshell-driver-podman" \
7986
OPENSHELL_DEB_VERSION="${INPUTS_DEB_VERSION}" \
8087
OPENSHELL_DEB_ARCH="${{ matrix.deb_arch }}" \
8188
OPENSHELL_OUTPUT_DIR=artifacts \

‎nix/test-guest/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ Package existing ARM64 Linux binaries with the repository's `package:deb:arm64`
263263
OPENSHELL_CLI_BINARY="$PWD/target/aarch64-unknown-linux-musl/release/openshell" \
264264
OPENSHELL_GATEWAY_BINARY="$PWD/target/aarch64-unknown-linux-gnu/release/openshell-gateway" \
265265
OPENSHELL_DRIVER_VM_BINARY="$PWD/target/aarch64-unknown-linux-gnu/release/openshell-driver-vm" \
266+
OPENSHELL_DRIVER_PODMAN_BINARY="$PWD/target/aarch64-unknown-linux-gnu/release/openshell-driver-podman" \
266267
OPENSHELL_DEB_VERSION=0.0.0-local \
267268
OPENSHELL_OUTPUT_DIR="$PWD/artifacts" \
268269
nix develop --command mise run package:deb:arm64

‎openshell.spec‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ grep -q 'version = "%{openshell_cargo_version}"' Cargo.toml || (echo "ERROR: Car
107107
test -x "${OPENSHELL_PREBUILT_BINARIES_DIR}/openshell"
108108
test -x "${OPENSHELL_PREBUILT_BINARIES_DIR}/openshell-gateway"
109109
test -x "${OPENSHELL_PREBUILT_BINARIES_DIR}/openshell-prover"
110+
test -x "${OPENSHELL_PREBUILT_BINARIES_DIR}/openshell-driver-podman"
110111

111112
# Generate vendored crate manifest and license metadata.
112113
# cargo-vendor.txt is consumed by an RPM generator (from cargo-rpm-macros)
@@ -129,6 +130,11 @@ install -Dpm 0755 "${OPENSHELL_PREBUILT_BINARIES_DIR}/%{name}-prover" %{buildroo
129130
# --- Gateway binary ---
130131
install -Dpm 0755 "${OPENSHELL_PREBUILT_BINARIES_DIR}/%{name}-gateway" %{buildroot}%{_bindir}/%{name}-gateway
131132

133+
# --- Podman compute driver ---
134+
# The gateway launches this binary from %{_libexecdir}/%{name} to run Podman
135+
# sandboxes and to detect whether Podman is available.
136+
install -Dpm 0755 "${OPENSHELL_PREBUILT_BINARIES_DIR}/%{name}-driver-podman" %{buildroot}%{_libexecdir}/%{name}/%{name}-driver-podman
137+
132138
# --- Default gateway TOML config template ---
133139
# Shipped as a read-only reference in %{_datadir}. The systemd unit seeds a
134140
# user-level copy at ~/.config/openshell/gateway.toml on first start.
@@ -244,6 +250,9 @@ touch %{buildroot}%{python3_sitelib}/%{name}-%{openshell_python_version}.dist-in
244250
# Smoke-test the gateway binary
245251
%{buildroot}%{_bindir}/%{name}-gateway --version
246252

253+
# The Podman driver must run and report availability as JSON.
254+
%{buildroot}%{_libexecdir}/%{name}/%{name}-driver-podman probe | grep -q '"available"'
255+
247256
# Smoke-test the Python SDK version metadata via importlib.metadata.
248257
# We query the dist-info directly rather than importing the package because
249258
# the full import pulls in grpcio and other runtime deps not present in the
@@ -308,6 +317,7 @@ grep -q 'gateway.toml.default.v1' %{buildroot}%{_userunitdir}/%{name}-gateway.se
308317
%doc %{_docdir}/%{name}-gateway/CONFIGURATION.md
309318
%doc %{_docdir}/%{name}-gateway/TROUBLESHOOTING.md
310319
%{_bindir}/%{name}-gateway
320+
%{_libexecdir}/%{name}/%{name}-driver-podman
311321
%{_userunitdir}/%{name}-gateway.service
312322
%{_libexecdir}/%{name}-gateway-migrate-config
313323
%{_datadir}/%{name}-gateway/gateway.toml.default

‎tasks/scripts/package-deb-install.sh‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# or on the gateway-as-a-service flow.
88
#
99
# Steps:
10-
# 1. cargo build --release the four binaries that go into the deb.
10+
# 1. cargo build --release the five binaries that go into the deb.
1111
# 2. Run tasks/scripts/package-deb.sh against those binaries.
1212
# 3. sudo dpkg -i the resulting artifact.
1313
# 4. Start the packaged user gateway service and register it locally.
@@ -58,13 +58,15 @@ cargo build --release \
5858
-p openshell-cli \
5959
-p openshell-gateway \
6060
-p openshell-prover-cli \
61-
-p openshell-driver-vm
61+
-p openshell-driver-vm \
62+
-p openshell-driver-podman
6263

6364
echo "==> Building Debian package"
6465
OPENSHELL_CLI_BINARY="${repo_root}/target/release/openshell" \
6566
OPENSHELL_GATEWAY_BINARY="${repo_root}/target/release/openshell-gateway" \
6667
OPENSHELL_PROVER_BINARY="${repo_root}/target/release/openshell-prover" \
6768
OPENSHELL_DRIVER_VM_BINARY="${repo_root}/target/release/openshell-driver-vm" \
69+
OPENSHELL_DRIVER_PODMAN_BINARY="${repo_root}/target/release/openshell-driver-podman" \
6870
OPENSHELL_DEB_VERSION="$VERSION" \
6971
OPENSHELL_DEB_ARCH="$ARCH" \
7072
OPENSHELL_OUTPUT_DIR="$OUTPUT_DIR" \

‎tasks/scripts/package-deb.sh‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Required environment:
2323
OPENSHELL_GATEWAY_BINARY Path to openshell-gateway
2424
OPENSHELL_PROVER_BINARY Path to openshell-prover
2525
OPENSHELL_DRIVER_VM_BINARY Path to openshell-driver-vm
26+
OPENSHELL_DRIVER_PODMAN_BINARY Path to openshell-driver-podman
2627
OPENSHELL_DEB_VERSION Debian package version
2728
2829
Optional environment:
@@ -72,6 +73,7 @@ require_env OPENSHELL_CLI_BINARY
7273
require_env OPENSHELL_GATEWAY_BINARY
7374
require_env OPENSHELL_PROVER_BINARY
7475
require_env OPENSHELL_DRIVER_VM_BINARY
76+
require_env OPENSHELL_DRIVER_PODMAN_BINARY
7577
require_env OPENSHELL_DEB_VERSION
7678

7779
OPENSHELL_DEB_ARCH="${OPENSHELL_DEB_ARCH:-$(infer_deb_arch)}"
@@ -114,6 +116,7 @@ stage_binary "$OPENSHELL_CLI_BINARY" "$pkgroot/usr/bin/openshell"
114116
stage_binary "$OPENSHELL_GATEWAY_BINARY" "$pkgroot/usr/bin/openshell-gateway"
115117
stage_binary "$OPENSHELL_PROVER_BINARY" "$pkgroot/usr/bin/openshell-prover"
116118
stage_binary "$OPENSHELL_DRIVER_VM_BINARY" "$pkgroot/usr/libexec/openshell/openshell-driver-vm"
119+
stage_binary "$OPENSHELL_DRIVER_PODMAN_BINARY" "$pkgroot/usr/libexec/openshell/openshell-driver-podman"
117120

118121
# Per-user systemd unit. Each user enables it via `systemctl --user`.
119122
install -D -m 0644 "$src_dir/openshell-gateway.service" \

‎tasks/scripts/test-packaging-assets.sh‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,15 @@ if command -v dpkg-deb >/dev/null 2>&1; then
298298
package_work=$(mktemp -d "${TMPDIR:-/tmp}/openshell-package-assets.XXXXXX")
299299
trap 'rm -rf "$package_work"' EXIT
300300
mkdir -p "$package_work/bin" "$package_work/output"
301-
for binary in openshell openshell-gateway openshell-prover openshell-driver-vm; do
301+
for binary in openshell openshell-gateway openshell-prover openshell-driver-vm openshell-driver-podman; do
302302
printf '#!/bin/sh\nexit 0\n' >"$package_work/bin/$binary"
303303
chmod +x "$package_work/bin/$binary"
304304
done
305305
OPENSHELL_CLI_BINARY="$package_work/bin/openshell" \
306306
OPENSHELL_GATEWAY_BINARY="$package_work/bin/openshell-gateway" \
307307
OPENSHELL_PROVER_BINARY="$package_work/bin/openshell-prover" \
308308
OPENSHELL_DRIVER_VM_BINARY="$package_work/bin/openshell-driver-vm" \
309+
OPENSHELL_DRIVER_PODMAN_BINARY="$package_work/bin/openshell-driver-podman" \
309310
OPENSHELL_DEB_VERSION=0.0.0 \
310311
OPENSHELL_DEB_ARCH=amd64 \
311312
OPENSHELL_OUTPUT_DIR="$package_work/output" \
@@ -322,6 +323,14 @@ if command -v dpkg-deb >/dev/null 2>&1; then
322323
echo "FAIL: package-deb did not stage openshell-prover" >&2
323324
exit 1
324325
fi
326+
# The gateway launches the VM and Podman drivers from this directory.
327+
for driver in openshell-driver-vm openshell-driver-podman; do
328+
if ! dpkg-deb --fsys-tarfile "$package_work/output/openshell_0.0.0_amd64.deb" \
329+
| tar -tf - | grep -x "./usr/libexec/openshell/$driver" >/dev/null; then
330+
echo "FAIL: package-deb did not stage $driver" >&2
331+
exit 1
332+
fi
333+
done
325334
else
326335
echo "SKIP: dpkg-deb unavailable; Debian artifact staging requires its assigned lane"
327336
fi

‎tests/tmachine/artifacts.nix‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ rec {
205205
206206
cargo build --target ${gnuToolchain.target} \
207207
-p openshell-gateway \
208+
-p openshell-driver-podman \
208209
-p openshell-supervisor
209210
210211
install -D -m 0755 \
@@ -219,6 +220,10 @@ rec {
219220
target/${gnuToolchain.target}/debug/openshell-gateway \
220221
artifacts/binaries/${gnuToolchain.target}/openshell-gateway
221222
223+
install -D -m 0755 \
224+
target/${gnuToolchain.target}/debug/openshell-driver-podman \
225+
artifacts/binaries/${gnuToolchain.target}/openshell-driver-podman
226+
222227
install -D -m 0755 \
223228
target/${gnuToolchain.target}/debug/openshell-supervisor \
224229
artifacts/binaries/${gnuToolchain.target}/openshell-supervisor
@@ -389,6 +394,7 @@ rec {
389394
OPENSHELL_GATEWAY_BINARY="$root/artifacts/binaries/${gnuToolchain.target}/openshell-gateway" \
390395
OPENSHELL_PROVER_BINARY="$root/artifacts/binaries/${muslToolchain.target}/openshell-prover" \
391396
OPENSHELL_DRIVER_VM_BINARY="$root/artifacts/binaries/${gnuToolchain.target}/openshell-driver-vm" \
397+
OPENSHELL_DRIVER_PODMAN_BINARY="$root/artifacts/binaries/${gnuToolchain.target}/openshell-driver-podman" \
392398
OPENSHELL_DEB_VERSION="$package_version" \
393399
OPENSHELL_DEB_ARCH=${dockerArch} \
394400
OPENSHELL_OUTPUT_DIR="$root/artifacts/packages" \
@@ -424,6 +430,7 @@ rec {
424430
for binary in \
425431
artifacts/binaries/${muslToolchain.target}/openshell \
426432
artifacts/binaries/${gnuToolchain.target}/openshell-gateway \
433+
artifacts/binaries/${gnuToolchain.target}/openshell-driver-podman \
427434
artifacts/binaries/${muslToolchain.target}/openshell-prover; do
428435
if [[ ! -x "$binary" ]]; then
429436
echo "missing $binary; run build-artifacts-binaries first" >&2
@@ -442,6 +449,7 @@ rec {
442449
--volume "$root:/repo:ro" \
443450
--volume "$root/artifacts/binaries/${muslToolchain.target}/openshell:/binaries/openshell:ro" \
444451
--volume "$root/artifacts/binaries/${gnuToolchain.target}/openshell-gateway:/binaries/openshell-gateway:ro" \
452+
--volume "$root/artifacts/binaries/${gnuToolchain.target}/openshell-driver-podman:/binaries/openshell-driver-podman:ro" \
445453
--volume "$root/artifacts/binaries/${muslToolchain.target}/openshell-prover:/binaries/openshell-prover:ro" \
446454
--volume "$output_dir:/out" \
447455
--volume openshell-rpm-cargo:/root/.cargo/registry \

0 commit comments

Comments
 (0)