Skip to content

Commit 490e9b7

Browse files
authored
Merge pull request #45 from stacklok/rename/propolis-to-go-microvm
Rename project from propolis to go-microvm
2 parents 0f8c850 + 02d2702 commit 490e9b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+429
-429
lines changed

.claude/rules/adding-options.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
paths:
33
- "options.go"
4-
- "propolis.go"
4+
- "microvm.go"
55
- "runner/config.go"
6-
- "runner/cmd/propolis-runner/main.go"
6+
- "runner/cmd/go-microvm-runner/main.go"
77
---
88

99
# Adding a New Option
1010

1111
1. Add the field to the `config` struct in `options.go`
1212
2. Set the default in `defaultConfig()` if needed
1313
3. Create a `With*` constructor following the existing pattern in `options.go`
14-
4. Use the field in `propolis.go` (in `Run()`) where appropriate
15-
5. If the option affects the runner, add the field to BOTH `runner.Config` in `runner/config.go` AND the runner's duplicate `Config` struct in `runner/cmd/propolis-runner/main.go` with the same JSON tag
14+
4. Use the field in `microvm.go` (in `Run()`) where appropriate
15+
5. If the option affects the runner, add the field to BOTH `runner.Config` in `runner/config.go` AND the runner's duplicate `Config` struct in `runner/cmd/go-microvm-runner/main.go` with the same JSON tag

.claude/rules/preflight-and-hooks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ paths:
1010
- Create a function returning `preflight.Check` with Name, Description, Run, and Required fields
1111
- See existing checks in `preflight/kvm_linux.go` and `preflight/ports.go` for patterns
1212
- Platform-specific checks go in build-tagged files (`//go:build linux` or `//go:build darwin`)
13-
- Register via `propolis.WithPreflightChecks()` or add to `registerPlatformChecks()` for defaults
13+
- Register via `microvm.WithPreflightChecks()` or add to `registerPlatformChecks()` for defaults
1414

1515
## Adding a Network Provider
1616
- Implement the `net.Provider` interface (Start, SocketPath, Stop)
@@ -22,4 +22,4 @@ paths:
2222
- Type: `func(rootfsPath string, cfg *image.OCIConfig) error`
2323
- Run before `.krun_config.json` is written and before VM boot
2424
- Multiple hooks run in registration order; any error aborts the pipeline
25-
- Register via `propolis.WithRootFSHook()`
25+
- Register via `microvm.WithRootFSHook()`

.github/workflows/builder.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions:
2020

2121
env:
2222
REGISTRY: ghcr.io
23-
IMAGE_NAME: stacklok/propolis-builder
23+
IMAGE_NAME: stacklok/go-microvm-builder
2424

2525
jobs:
2626
build:

.github/workflows/release.yaml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ jobs:
5252
- name: Upload runtime artifact
5353
uses: actions/upload-artifact@v7
5454
with:
55-
name: propolis-runtime-linux-${{ matrix.arch }}
56-
path: dist/propolis-runtime-linux-${{ matrix.arch }}.tar.gz
55+
name: go-microvm-runtime-linux-${{ matrix.arch }}
56+
path: dist/go-microvm-runtime-linux-${{ matrix.arch }}.tar.gz
5757

5858
- name: Upload firmware artifact
5959
uses: actions/upload-artifact@v7
6060
with:
61-
name: propolis-firmware-linux-${{ matrix.arch }}
62-
path: dist/propolis-firmware-linux-${{ matrix.arch }}.tar.gz
61+
name: go-microvm-firmware-linux-${{ matrix.arch }}
62+
path: dist/go-microvm-firmware-linux-${{ matrix.arch }}.tar.gz
6363

6464
build-artifacts-darwin:
6565
name: Build macOS (${{ matrix.arch }})
@@ -101,14 +101,14 @@ jobs:
101101
- name: Upload runtime artifact
102102
uses: actions/upload-artifact@v7
103103
with:
104-
name: propolis-runtime-darwin-${{ matrix.arch }}
105-
path: dist/propolis-runtime-darwin-${{ matrix.arch }}.tar.gz
104+
name: go-microvm-runtime-darwin-${{ matrix.arch }}
105+
path: dist/go-microvm-runtime-darwin-${{ matrix.arch }}.tar.gz
106106

107107
- name: Upload firmware artifact
108108
uses: actions/upload-artifact@v7
109109
with:
110-
name: propolis-firmware-darwin-${{ matrix.arch }}
111-
path: dist/propolis-firmware-darwin-${{ matrix.arch }}.tar.gz
110+
name: go-microvm-firmware-darwin-${{ matrix.arch }}
111+
path: dist/go-microvm-firmware-darwin-${{ matrix.arch }}.tar.gz
112112

113113
create-release:
114114
name: Create Release
@@ -126,18 +126,18 @@ jobs:
126126

127127
- name: Generate checksums
128128
run: |
129-
sha256sum propolis-*.tar.gz > sha256sums.txt
129+
sha256sum go-microvm-*.tar.gz > sha256sums.txt
130130
131131
- name: Create or update GitHub Release
132132
env:
133133
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134134
run: |
135135
if gh release view "${{ github.ref_name }}" >/dev/null 2>&1; then
136136
gh release upload "${{ github.ref_name }}" --clobber \
137-
propolis-*.tar.gz sha256sums.txt
137+
go-microvm-*.tar.gz sha256sums.txt
138138
else
139139
gh release create "${{ github.ref_name }}" --generate-notes \
140-
propolis-*.tar.gz sha256sums.txt
140+
go-microvm-*.tar.gz sha256sums.txt
141141
fi
142142
143143
push-oci:
@@ -153,12 +153,12 @@ jobs:
153153
- name: Download runtime artifact
154154
uses: actions/download-artifact@v8
155155
with:
156-
name: propolis-runtime-linux-${{ matrix.arch }}
156+
name: go-microvm-runtime-linux-${{ matrix.arch }}
157157

158158
- name: Download firmware artifact
159159
uses: actions/download-artifact@v8
160160
with:
161-
name: propolis-firmware-linux-${{ matrix.arch }}
161+
name: go-microvm-firmware-linux-${{ matrix.arch }}
162162

163163
- name: Install oras
164164
uses: oras-project/setup-oras@v1
@@ -169,15 +169,15 @@ jobs:
169169
170170
- name: Push runtime OCI artifact
171171
run: |
172-
oras push ghcr.io/stacklok/propolis/runtime:${{ github.ref_name }}-linux-${{ matrix.arch }} \
173-
--artifact-type application/vnd.stacklok.propolis.runtime \
174-
propolis-runtime-linux-${{ matrix.arch }}.tar.gz:application/gzip
172+
oras push ghcr.io/stacklok/go-microvm/runtime:${{ github.ref_name }}-linux-${{ matrix.arch }} \
173+
--artifact-type application/vnd.stacklok.go-microvm.runtime \
174+
go-microvm-runtime-linux-${{ matrix.arch }}.tar.gz:application/gzip
175175
176176
- name: Push firmware OCI artifact
177177
run: |
178-
oras push ghcr.io/stacklok/propolis/firmware:${{ github.ref_name }}-linux-${{ matrix.arch }} \
179-
--artifact-type application/vnd.stacklok.propolis.firmware \
180-
propolis-firmware-linux-${{ matrix.arch }}.tar.gz:application/gzip
178+
oras push ghcr.io/stacklok/go-microvm/firmware:${{ github.ref_name }}-linux-${{ matrix.arch }} \
179+
--artifact-type application/vnd.stacklok.go-microvm.firmware \
180+
go-microvm-firmware-linux-${{ matrix.arch }}.tar.gz:application/gzip
181181
182182
push-oci-darwin:
183183
name: Push OCI macOS (${{ matrix.arch }})
@@ -191,12 +191,12 @@ jobs:
191191
- name: Download runtime artifact
192192
uses: actions/download-artifact@v8
193193
with:
194-
name: propolis-runtime-darwin-${{ matrix.arch }}
194+
name: go-microvm-runtime-darwin-${{ matrix.arch }}
195195

196196
- name: Download firmware artifact
197197
uses: actions/download-artifact@v8
198198
with:
199-
name: propolis-firmware-darwin-${{ matrix.arch }}
199+
name: go-microvm-firmware-darwin-${{ matrix.arch }}
200200

201201
- name: Install oras
202202
uses: oras-project/setup-oras@v1
@@ -207,12 +207,12 @@ jobs:
207207
208208
- name: Push runtime OCI artifact
209209
run: |
210-
oras push ghcr.io/stacklok/propolis/runtime:${{ github.ref_name }}-darwin-${{ matrix.arch }} \
211-
--artifact-type application/vnd.stacklok.propolis.runtime \
212-
propolis-runtime-darwin-${{ matrix.arch }}.tar.gz:application/gzip
210+
oras push ghcr.io/stacklok/go-microvm/runtime:${{ github.ref_name }}-darwin-${{ matrix.arch }} \
211+
--artifact-type application/vnd.stacklok.go-microvm.runtime \
212+
go-microvm-runtime-darwin-${{ matrix.arch }}.tar.gz:application/gzip
213213
214214
- name: Push firmware OCI artifact
215215
run: |
216-
oras push ghcr.io/stacklok/propolis/firmware:${{ github.ref_name }}-darwin-${{ matrix.arch }} \
217-
--artifact-type application/vnd.stacklok.propolis.firmware \
218-
propolis-firmware-darwin-${{ matrix.arch }}.tar.gz:application/gzip
216+
oras push ghcr.io/stacklok/go-microvm/firmware:${{ github.ref_name }}-darwin-${{ matrix.arch }} \
217+
--artifact-type application/vnd.stacklok.go-microvm.firmware \
218+
go-microvm-firmware-darwin-${{ matrix.arch }}.tar.gz:application/gzip

CLAUDE.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# propolis
1+
# go-microvm
22

33
Go library + runner binary for running OCI container images as microVMs via libkrun.
4-
Two-process model: pure-Go library spawns a CGO runner subprocess. Module: `github.com/stacklok/propolis`.
4+
Two-process model: pure-Go library spawns a CGO runner subprocess. Module: `github.com/stacklok/go-microvm`.
55

66
## Commands
77

@@ -31,23 +31,23 @@ macOS dev setup: `brew tap slp/krun && brew install libkrun libkrunfw` (see `doc
3131

3232
## Architecture
3333

34-
Entry point: `propolis.go:Run()` orchestrates the full pipeline (preflight, pull, hooks, config, net, spawn, post-boot). Config via functional options in `options.go`. Returns a `*VM` handle (`vm.go`).
34+
Entry point: `microvm.go:Run()` orchestrates the full pipeline (preflight, pull, hooks, config, net, spawn, post-boot). Config via functional options in `options.go`. Returns a `*VM` handle (`vm.go`).
3535

36-
**CGO boundary**: Only `krun/` and `runner/cmd/propolis-runner/` use CGO. Everything else is pure Go. The runner binary is sacrificial -- `krun_start_enter()` never returns, so it runs in a detached subprocess.
36+
**CGO boundary**: Only `krun/` and `runner/cmd/go-microvm-runner/` use CGO. Everything else is pure Go. The runner binary is sacrificial -- `krun_start_enter()` never returns, so it runs in a detached subprocess.
3737

3838
**Key subsystems**: `hypervisor/` (Backend abstraction + libkrun impl), `image/` (OCI pull + cache), `runner/` (subprocess spawning), `net/` (Provider interface + firewall + hosted mode + egress policy + topology constants), `guest/` (guest-side boot orchestration, hardening, SSH server), `hooks/` (RootFS hook factories for key injection, file injection), `extract/` (binary bundle caching), `preflight/` (platform checks via build tags), `ssh/` (keygen + client), `state/` (flock-based JSON persistence), `internal/` (pathutil, procutil).
3939

4040
## Things That Will Bite You
4141

42-
- **CGO boundary is strict**: Only `krun/` and `runner/cmd/propolis-runner/` use CGO. Every other package MUST stay `CGO_ENABLED=0`. Never import `krun` from a non-CGO package.
43-
- **Runner config is duplicated**: `runner.Config` in `runner/config.go` and a duplicate `Config` struct in `runner/cmd/propolis-runner/main.go`. When adding a field, update BOTH structs with the same JSON tag, then handle it in `runVM()`.
42+
- **CGO boundary is strict**: Only `krun/` and `runner/cmd/go-microvm-runner/` use CGO. Every other package MUST stay `CGO_ENABLED=0`. Never import `krun` from a non-CGO package.
43+
- **Runner config is duplicated**: `runner.Config` in `runner/config.go` and a duplicate `Config` struct in `runner/cmd/go-microvm-runner/main.go`. When adding a field, update BOTH structs with the same JSON tag, then handle it in `runVM()`.
4444
- **`krun_start_enter()` never returns**: It calls `exit()` when the guest shuts down. That's why we need the two-process model -- the runner process is sacrificial.
4545
- **Platform build tags**: Preflight checks, resource checks, and some net code use `//go:build linux` or `//go:build darwin`. Each platform goes in a separate file. macOS preflight checks verify `kern.hv_support` sysctl and use `hw.memsize`/`syscall.Statfs` for resources.
4646
- **Entitlements required on macOS**: `assets/entitlements.plist` has three entitlements: `com.apple.security.hypervisor`, `com.apple.security.cs.disable-library-validation`, and `com.apple.security.cs.allow-dyld-environment-variables` (needed because the hypervisor entitlement activates hardened runtime, which strips DYLD_* vars). The `task build-dev-darwin` command signs automatically.
4747
- **CGO Homebrew paths**: `krun/context.go` CGO directives include `-L/opt/homebrew/lib` and `-L/usr/local/lib` for macOS. The linker ignores nonexistent paths.
48-
- **Tests excluding CGO packages**: When CGO isn't available, exclude krun: `CGO_ENABLED=0 go test $(go list ./... | grep -v krun | grep -v propolis-runner)`
48+
- **Tests excluding CGO packages**: When CGO isn't available, exclude krun: `CGO_ENABLED=0 go test $(go list ./... | grep -v krun | grep -v go-microvm-runner)`
4949
- **Functional options pattern**: All public config uses `With*` constructors applying to unexported `config` struct via `optionFunc`. Follow the existing pattern in `options.go` exactly.
50-
- **Backend abstraction**: `WithRunnerPath`, `WithLibDir`, and `WithSpawner` are NOT on the top-level `propolis` package. They live in `hypervisor/libkrun` as backend-specific options. Use `propolis.WithBackend(libkrun.NewBackend(libkrun.WithRunnerPath(...)))`. Similarly, `VM.PID()` is gone; use `VM.ID()` (returns string).
50+
- **Backend abstraction**: `WithRunnerPath`, `WithLibDir`, and `WithSpawner` are NOT on the top-level `microvm` package. They live in `hypervisor/libkrun` as backend-specific options. Use `microvm.WithBackend(libkrun.NewBackend(libkrun.WithRunnerPath(...)))`. Similarly, `VM.PID()` is gone; use `VM.ID()` (returns string).
5151

5252
## Conventions
5353

@@ -72,7 +72,7 @@ task test # Full test suite with race detector
7272

7373
After modifying CGO-free packages only:
7474
```bash
75-
CGO_ENABLED=0 go vet $(go list ./... | grep -v krun | grep -v propolis-runner)
75+
CGO_ENABLED=0 go vet $(go list ./... | grep -v krun | grep -v go-microvm-runner)
7676
```
7777

7878
When tests fail, fix the implementation, not the tests.

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to propolis
1+
# Contributing to go-microvm
22

33
## Prerequisites
44

@@ -60,7 +60,7 @@ Run `task --list` for the full list. Key tasks for development:
6060
- **Error wrapping**: `fmt.Errorf("context: %w", err)`
6161
- **Table-driven tests** with testify
6262
- **Functional options**: follow the `With*` pattern in `options.go`
63-
- **CGO boundary**: only `krun/` and `runner/cmd/propolis-runner/` use CGO.
63+
- **CGO boundary**: only `krun/` and `runner/cmd/go-microvm-runner/` use CGO.
6464
Never import `krun` from other packages.
6565

6666
## Commit Guidelines

0 commit comments

Comments
 (0)