Skip to content

Commit 52ae834

Browse files
committed
build(release): ship the Podman driver for macOS through Homebrew
The gateway launches the Podman driver as a separate binary. Build it for macOS, package and checksum its tarball in the dev and stable release workflows, attest it, and install it into libexec from the Homebrew formula and the prerelease install path. Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent aee70da commit 52ae834

8 files changed

Lines changed: 56 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
- package: openshell-supervisor
4444
binary: openshell-supervisor
4545
triple: aarch64-apple-darwin
46+
- package: openshell-driver-podman
47+
binary: openshell-driver-podman
48+
triple: aarch64-apple-darwin
4649
runs-on: macos-15-xlarge
4750
timeout-minutes: 60
4851
steps:

‎.github/workflows/package-release-binaries.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ jobs:
6363
- artifact: openshell-driver-vm-aarch64-apple-darwin
6464
binary: openshell-driver-vm
6565
package: driver-vm-macos
66+
- artifact: openshell-driver-podman-aarch64-apple-darwin
67+
binary: openshell-driver-podman
68+
package: driver-podman-macos
6669
- artifact: openshell-prover-x86_64-unknown-linux-musl
6770
binary: openshell-prover
6871
package: prover-binary-linux-amd64

‎.github/workflows/release-dev.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,13 @@ jobs:
330330
path: release/
331331
merge-multiple: true
332332

333+
- name: Download Podman driver artifacts
334+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
335+
with:
336+
pattern: driver-podman-*
337+
path: release/
338+
merge-multiple: true
339+
333340
- name: Download prover binary artifacts
334341
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
335342
with:
@@ -400,6 +407,7 @@ jobs:
400407
openshell-driver-vm-x86_64-unknown-linux-gnu.tar.gz \
401408
openshell-driver-vm-aarch64-unknown-linux-gnu.tar.gz \
402409
openshell-driver-vm-aarch64-apple-darwin.tar.gz \
410+
openshell-driver-podman-aarch64-apple-darwin.tar.gz \
403411
*.deb \
404412
openshell-*.rpm > openshell-checksums-sha256.txt
405413
cat openshell-checksums-sha256.txt
@@ -433,6 +441,7 @@ jobs:
433441
release/openshell-driver-vm-x86_64-unknown-linux-gnu.tar.gz
434442
release/openshell-driver-vm-aarch64-unknown-linux-gnu.tar.gz
435443
release/openshell-driver-vm-aarch64-apple-darwin.tar.gz
444+
release/openshell-driver-podman-aarch64-apple-darwin.tar.gz
436445
437446
- name: Prune managed assets from dev release
438447
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
@@ -526,6 +535,7 @@ jobs:
526535
release/openshell-driver-vm-x86_64-unknown-linux-gnu.tar.gz
527536
release/openshell-driver-vm-aarch64-unknown-linux-gnu.tar.gz
528537
release/openshell-driver-vm-aarch64-apple-darwin.tar.gz
538+
release/openshell-driver-podman-aarch64-apple-darwin.tar.gz
529539
release/openshell-prover-x86_64-unknown-linux-musl.tar.gz
530540
release/openshell-prover-aarch64-unknown-linux-musl.tar.gz
531541
release/openshell-prover-aarch64-apple-darwin.tar.gz

‎.github/workflows/release-publish.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ jobs:
9595
path: release/
9696
merge-multiple: true
9797

98+
- name: Download Podman driver artifacts
99+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
100+
with:
101+
pattern: driver-podman-*
102+
path: release/
103+
merge-multiple: true
104+
98105
- name: Download prover binary artifacts
99106
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
100107
with:
@@ -140,6 +147,7 @@ jobs:
140147
openshell-driver-vm-x86_64-unknown-linux-gnu.tar.gz \
141148
openshell-driver-vm-aarch64-unknown-linux-gnu.tar.gz \
142149
openshell-driver-vm-aarch64-apple-darwin.tar.gz \
150+
openshell-driver-podman-aarch64-apple-darwin.tar.gz \
143151
openshell_*.deb \
144152
openshell-*.rpm > openshell-checksums-sha256.txt
145153
cat openshell-checksums-sha256.txt
@@ -399,6 +407,7 @@ jobs:
399407
release/openshell-driver-vm-x86_64-unknown-linux-gnu.tar.gz
400408
release/openshell-driver-vm-aarch64-unknown-linux-gnu.tar.gz
401409
release/openshell-driver-vm-aarch64-apple-darwin.tar.gz
410+
release/openshell-driver-podman-aarch64-apple-darwin.tar.gz
402411
release/openshell-prover-x86_64-unknown-linux-musl.tar.gz
403412
release/openshell-prover-aarch64-unknown-linux-musl.tar.gz
404413
release/openshell-prover-aarch64-apple-darwin.tar.gz
@@ -462,6 +471,7 @@ jobs:
462471
release/openshell-aarch64-apple-darwin.tar.gz
463472
release/openshell-gateway-aarch64-apple-darwin.tar.gz
464473
release/openshell-driver-vm-aarch64-apple-darwin.tar.gz
474+
release/openshell-driver-podman-aarch64-apple-darwin.tar.gz
465475
release/openshell-prover-aarch64-apple-darwin.tar.gz
466476
release/openshell.rb
467477
release/openshell-checksums-sha256.txt

‎install.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ HOMEBREW_FORMULA_NAME="openshell"
2222
HOMEBREW_CLI_ASSET="openshell-aarch64-apple-darwin.tar.gz"
2323
HOMEBREW_GATEWAY_ASSET="openshell-gateway-aarch64-apple-darwin.tar.gz"
2424
HOMEBREW_DRIVER_VM_ASSET="openshell-driver-vm-aarch64-apple-darwin.tar.gz"
25+
HOMEBREW_DRIVER_PODMAN_ASSET="openshell-driver-podman-aarch64-apple-darwin.tar.gz"
2526
HOMEBREW_PROVER_ASSET="openshell-prover-aarch64-apple-darwin.tar.gz"
2627
BREAKING_RELEASE_VERSION="0.0.37"
2728
LINUX_PACKAGE_GLIBC_MIN_VERSION="2.28"
@@ -912,7 +913,7 @@ patch_prerelease_homebrew_formula_urls() {
912913
_formula_file="$1"
913914
[ -n "$RELEASE_ASSET_DIR" ] || return 0
914915

915-
for _asset in "$HOMEBREW_CLI_ASSET" "$HOMEBREW_GATEWAY_ASSET" "$HOMEBREW_DRIVER_VM_ASSET" "$HOMEBREW_PROVER_ASSET"; do
916+
for _asset in "$HOMEBREW_CLI_ASSET" "$HOMEBREW_GATEWAY_ASSET" "$HOMEBREW_DRIVER_VM_ASSET" "$HOMEBREW_DRIVER_PODMAN_ASSET" "$HOMEBREW_PROVER_ASSET"; do
916917
if [ ! -f "${RELEASE_ASSET_DIR}/${_asset}" ]; then
917918
error "prerelease artifact is missing the required macOS asset: ${_asset}"
918919
fi
@@ -925,6 +926,7 @@ patch_prerelease_homebrew_formula_urls() {
925926
-e "s#${_release_asset_url}/${HOMEBREW_CLI_ASSET}#${_local_asset_url}/${HOMEBREW_CLI_ASSET}#g" \
926927
-e "s#${_release_asset_url}/${HOMEBREW_GATEWAY_ASSET}#${_local_asset_url}/${HOMEBREW_GATEWAY_ASSET}#g" \
927928
-e "s#${_release_asset_url}/${HOMEBREW_DRIVER_VM_ASSET}#${_local_asset_url}/${HOMEBREW_DRIVER_VM_ASSET}#g" \
929+
-e "s#${_release_asset_url}/${HOMEBREW_DRIVER_PODMAN_ASSET}#${_local_asset_url}/${HOMEBREW_DRIVER_PODMAN_ASSET}#g" \
928930
-e "s#${_release_asset_url}/${HOMEBREW_PROVER_ASSET}#${_local_asset_url}/${HOMEBREW_PROVER_ASSET}#g" \
929931
"$_formula_file" >"$_patched_file"
930932
mv "$_patched_file" "$_formula_file"

‎tasks/scripts/release.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class Versions:
3737
HOMEBREW_CLI_ASSET = f"openshell-{HOMEBREW_TARGET}.tar.gz"
3838
HOMEBREW_GATEWAY_ASSET = f"openshell-gateway-{HOMEBREW_TARGET}.tar.gz"
3939
HOMEBREW_DRIVER_VM_ASSET = f"openshell-driver-vm-{HOMEBREW_TARGET}.tar.gz"
40+
HOMEBREW_DRIVER_PODMAN_ASSET = f"openshell-driver-podman-{HOMEBREW_TARGET}.tar.gz"
4041
HOMEBREW_PROVER_ASSET = f"openshell-prover-{HOMEBREW_TARGET}.tar.gz"
4142
GITHUB_RELEASE_DOWNLOADS = "https://github.com/ai-openshell/openshell/releases/download"
4243
LOCAL_GATEWAY_PORT = 17670
@@ -311,6 +312,7 @@ def render_homebrew_formula(
311312
cli_sha256: str,
312313
gateway_sha256: str,
313314
driver_vm_sha256: str,
315+
driver_podman_sha256: str,
314316
prover_sha256: str,
315317
) -> str:
316318
if not _RELEASE_TAG_RE.fullmatch(release_tag):
@@ -343,6 +345,11 @@ class Openshell < Formula
343345
sha256 "{driver_vm_sha256}"
344346
end
345347
348+
resource "openshell-driver-podman" do
349+
url "{_asset_url(release_tag, HOMEBREW_DRIVER_PODMAN_ASSET)}"
350+
sha256 "{driver_podman_sha256}"
351+
end
352+
346353
resource "openshell-prover" do
347354
url "{_asset_url(release_tag, HOMEBREW_PROVER_ASSET)}"
348355
sha256 "{prover_sha256}"
@@ -361,6 +368,10 @@ def install
361368
libexec.install "openshell-driver-vm"
362369
end
363370
371+
resource("openshell-driver-podman").stage do
372+
libexec.install "openshell-driver-podman"
373+
end
374+
364375
resource("openshell-prover").stage do
365376
bin.install "openshell-prover"
366377
end
@@ -518,6 +529,11 @@ def generate_homebrew_formula(
518529
HOMEBREW_DRIVER_VM_ASSET,
519530
checksums_path,
520531
),
532+
driver_podman_sha256=_required_checksum(
533+
checksums,
534+
HOMEBREW_DRIVER_PODMAN_ASSET,
535+
checksums_path,
536+
),
521537
prover_sha256=_required_checksum(
522538
prover_checksums,
523539
HOMEBREW_PROVER_ASSET,

‎tasks/scripts/release_formula_test.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def test_generate_homebrew_formula_uses_channel_urls_and_exact_version(
1919
[
2020
"a" * 64 + " openshell-aarch64-apple-darwin.tar.gz",
2121
"b" * 64 + " openshell-driver-vm-aarch64-apple-darwin.tar.gz",
22+
"c" * 64 + " openshell-driver-podman-aarch64-apple-darwin.tar.gz",
2223
]
2324
)
2425
+ "\n",
@@ -55,6 +56,13 @@ def test_generate_homebrew_formula_uses_channel_urls_and_exact_version(
5556
"https://github.com/ai-openshell/openshell/releases/download/"
5657
"v0.1.0-pre.3/openshell-driver-vm-aarch64-apple-darwin.tar.gz"
5758
) in formula
59+
assert (
60+
"https://github.com/NVIDIA/OpenShell/releases/download/"
61+
"v0.1.0-pre.3/openshell-driver-podman-aarch64-apple-darwin.tar.gz"
62+
) in formula
63+
assert 'sha256 "' + "c" * 64 + '"' in formula
64+
assert 'resource("openshell-driver-podman").stage' in formula
65+
assert 'libexec.install "openshell-driver-podman"' in formula
5866
assert 'version "0.1.0-pre.3"' in formula
5967
assert 'sha256 "' + "b" * 64 + '"' in formula
6068
assert (

‎tasks/scripts/test-install-sh.sh‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,18 +1040,19 @@ if [ "$(cat "$downloaded_checksum")" != "checksums" ]; then
10401040
exit 1
10411041
fi
10421042

1043-
for asset in "$HOMEBREW_CLI_ASSET" "$HOMEBREW_GATEWAY_ASSET" "$HOMEBREW_DRIVER_VM_ASSET" "$HOMEBREW_PROVER_ASSET"; do
1043+
for asset in "$HOMEBREW_CLI_ASSET" "$HOMEBREW_GATEWAY_ASSET" "$HOMEBREW_DRIVER_VM_ASSET" "$HOMEBREW_DRIVER_PODMAN_ASSET" "$HOMEBREW_PROVER_ASSET"; do
10441044
: >"${RELEASE_ASSET_DIR}/${asset}"
10451045
done
10461046
prerelease_formula="${tmpdir}/openshell.rb"
10471047
printf '%s\n' \
10481048
" url \"${GITHUB_URL}/releases/download/${RELEASE_TAG}/${HOMEBREW_CLI_ASSET}\"" \
10491049
" url \"${GITHUB_URL}/releases/download/${RELEASE_TAG}/${HOMEBREW_GATEWAY_ASSET}\"" \
10501050
" url \"${GITHUB_URL}/releases/download/${RELEASE_TAG}/${HOMEBREW_DRIVER_VM_ASSET}\"" \
1051+
" url \"${GITHUB_URL}/releases/download/${RELEASE_TAG}/${HOMEBREW_DRIVER_PODMAN_ASSET}\"" \
10511052
" url \"${GITHUB_URL}/releases/download/${RELEASE_TAG}/${HOMEBREW_PROVER_ASSET}\"" \
10521053
>"$prerelease_formula"
10531054
patch_prerelease_homebrew_formula_urls "$prerelease_formula"
1054-
for asset in "$HOMEBREW_CLI_ASSET" "$HOMEBREW_GATEWAY_ASSET" "$HOMEBREW_DRIVER_VM_ASSET" "$HOMEBREW_PROVER_ASSET"; do
1055+
for asset in "$HOMEBREW_CLI_ASSET" "$HOMEBREW_GATEWAY_ASSET" "$HOMEBREW_DRIVER_VM_ASSET" "$HOMEBREW_DRIVER_PODMAN_ASSET" "$HOMEBREW_PROVER_ASSET"; do
10551056
if ! grep -Fq "file://${RELEASE_ASSET_DIR}/${asset}" "$prerelease_formula"; then
10561057
echo "FAIL: prerelease formula did not use local asset ${asset}" >&2
10571058
exit 1

0 commit comments

Comments
 (0)