Skip to content

Commit 5949b2f

Browse files
authored
feat(installer): support macOS dev installs (#1183)
1 parent 689835c commit 5949b2f

7 files changed

Lines changed: 463 additions & 43 deletions

File tree

.github/workflows/release-dev.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,9 @@ jobs:
768768
openshell-x86_64-unknown-linux-musl.tar.gz \
769769
openshell-aarch64-unknown-linux-musl.tar.gz \
770770
openshell-aarch64-apple-darwin.tar.gz \
771+
openshell-driver-vm-x86_64-unknown-linux-gnu.tar.gz \
772+
openshell-driver-vm-aarch64-unknown-linux-gnu.tar.gz \
773+
openshell-driver-vm-aarch64-apple-darwin.tar.gz \
771774
*.deb \
772775
openshell-*.rpm \
773776
*.whl > openshell-checksums-sha256.txt
@@ -782,6 +785,15 @@ jobs:
782785
openshell-sandbox-aarch64-unknown-linux-gnu.tar.gz > openshell-sandbox-checksums-sha256.txt
783786
cat openshell-sandbox-checksums-sha256.txt
784787
788+
- name: Generate Homebrew formula
789+
run: |
790+
set -euo pipefail
791+
python3 tasks/scripts/release.py generate-homebrew-formula \
792+
--release-tag dev \
793+
--release-dir release \
794+
--output release/openshell.rb
795+
cat release/openshell.rb
796+
785797
- name: Attest VM driver artifacts
786798
uses: actions/attest@v4
787799
with:
@@ -879,6 +891,7 @@ jobs:
879891
release/openshell-driver-vm-aarch64-unknown-linux-gnu.tar.gz
880892
release/openshell-driver-vm-aarch64-apple-darwin.tar.gz
881893
release/*.whl
894+
release/openshell.rb
882895
release/openshell-checksums-sha256.txt
883896
release/openshell-gateway-checksums-sha256.txt
884897
release/openshell-sandbox-checksums-sha256.txt

.github/workflows/release-tag.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,9 @@ jobs:
772772
openshell-x86_64-unknown-linux-musl.tar.gz \
773773
openshell-aarch64-unknown-linux-musl.tar.gz \
774774
openshell-aarch64-apple-darwin.tar.gz \
775+
openshell-driver-vm-x86_64-unknown-linux-gnu.tar.gz \
776+
openshell-driver-vm-aarch64-unknown-linux-gnu.tar.gz \
777+
openshell-driver-vm-aarch64-apple-darwin.tar.gz \
775778
openshell_*.deb \
776779
openshell-*.rpm \
777780
*.whl > openshell-checksums-sha256.txt
@@ -786,6 +789,15 @@ jobs:
786789
openshell-sandbox-aarch64-unknown-linux-gnu.tar.gz > openshell-sandbox-checksums-sha256.txt
787790
cat openshell-sandbox-checksums-sha256.txt
788791
792+
- name: Generate Homebrew formula
793+
run: |
794+
set -euo pipefail
795+
python3 tasks/scripts/release.py generate-homebrew-formula \
796+
--release-tag "${RELEASE_TAG}" \
797+
--release-dir release \
798+
--output release/openshell.rb
799+
cat release/openshell.rb
800+
789801
- name: Attest VM driver artifacts
790802
uses: actions/attest@v4
791803
with:
@@ -847,6 +859,7 @@ jobs:
847859
release/openshell-driver-vm-aarch64-unknown-linux-gnu.tar.gz
848860
release/openshell-driver-vm-aarch64-apple-darwin.tar.gz
849861
release/*.whl
862+
release/openshell.rb
850863
release/openshell-checksums-sha256.txt
851864
release/openshell-gateway-checksums-sha256.txt
852865
release/openshell-sandbox-checksums-sha256.txt

architecture/custom-vm-runtime.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,11 @@ run `cargo build --release -p openshell-driver-vm`. The macOS driver is
323323
cross-compiled via osxcross (no macOS runner needed for the binary build —
324324
only for the kernel build).
325325

326-
macOS driver binaries produced via osxcross are not codesigned. Local
327-
development builds are signed automatically by `tasks/scripts/gateway-vm.sh`
328-
(registered as `mise run gateway:vm`). Release tarball users on macOS must
329-
ad-hoc sign `openshell-driver-vm` before running VM sandboxes.
326+
macOS driver binaries produced via osxcross are not codesigned. Development
327+
builds are signed automatically by `tasks/scripts/gateway-vm.sh`
328+
(registered as `mise run gateway:vm`) and by the generated Homebrew formula
329+
when `install-dev.sh` installs the selected release on Apple Silicon macOS. A
330+
packaged release needs signing in CI.
330331

331332
## Rollout Strategy
332333

crates/openshell-driver-vm/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,17 @@ On Linux amd64 and arm64, `install-dev.sh` installs the Debian package from the
182182
selected `OPENSHELL_VERSION` release tag. That package includes
183183
`openshell-gateway` and `openshell-driver-vm`.
184184
185+
On Apple Silicon macOS, `install-dev.sh` installs the generated `openshell.rb`
186+
formula from the selected release. Homebrew installs `openshell`,
187+
`openshell-gateway`, and `openshell-driver-vm`, ad-hoc signs the driver with
188+
the Hypervisor entitlement in `post_install`, and owns the `brew services`
189+
gateway lifecycle.
190+
185191
## Relationship to `openshell-vm`
186192
187193
`openshell-vm` is a separate, legacy crate that runs the **whole OpenShell gateway inside a single VM**. It remains in the repository for later deprecation or removal, but is excluded from normal workspace builds and release paths. `openshell-driver-vm` is the active compute driver called by a host-resident gateway to spawn **per-sandbox VMs**. The driver vendors its own rootfs handling and runtime loader so `openshell-server` never has to link libkrun.
188194
189195
## TODOs
190196
191197
- The gateway still configures the driver via CLI args; this will move to a gRPC bootstrap call so the driver interface is uniform across backends. See the `TODO(driver-abstraction)` notes in `crates/openshell-server/src/lib.rs` and `crates/openshell-server/src/compute/vm.rs`.
192-
- macOS local builds are codesigned by `tasks/scripts/gateway-vm.sh`; release tarball users must ad-hoc sign `openshell-driver-vm` before running VM sandboxes.
198+
- macOS local builds are codesigned by `tasks/scripts/gateway-vm.sh`; the generated Homebrew formula signs the release tarball driver for local installs.

0 commit comments

Comments
 (0)