-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add Firecracker hypervisor support #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ scripts/utm/images/ | |
|
|
||
| # IDE and editor | ||
| .cursor/ | ||
| .refs/ | ||
|
|
||
| # Build artifacts | ||
| api | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Firecracker Hypervisor | ||
|
|
||
| This package implements Firecracker support behind the common `lib/hypervisor` interfaces: | ||
|
|
||
| - `Starter` (`process.go`): starts/restores a Firecracker process and waits for the API socket. | ||
| - `Firecracker` client (`firecracker.go`): configures boot, controls lifecycle, and manages snapshots. | ||
| - `VsockDialer` (`vsock.go`): host-initiated vsock connections via Firecracker's UDS handshake. | ||
| - Config translation (`config.go`): maps `hypervisor.VMConfig` to Firecracker API models. | ||
|
|
||
| ## Binaries | ||
|
|
||
| Like Cloud Hypervisor, Firecracker binaries are embedded and extracted into `data_dir` at runtime. | ||
|
|
||
| - Embedded source path: `lib/hypervisor/firecracker/binaries/firecracker/<version>/<arch>/firecracker` | ||
| - Download helper: `make download-firecracker-binaries` | ||
| - Runtime override: `hypervisor.firecracker_binary_path` (uses external binary instead of embedded) | ||
|
|
||
| ## VM State Mapping | ||
|
|
||
| `mapVMState()` maps Firecracker `GET /` state strings to internal states: | ||
|
|
||
| - `Not started` -> `created` | ||
| - `Running` -> `running` | ||
| - `Paused` -> `paused` | ||
|
|
||
| These strings are validated against Firecracker's source/spec: | ||
|
|
||
| - `src/vmm/src/vmm_config/instance_info.rs` | ||
| - `src/firecracker/swagger/firecracker.yaml` | ||
|
|
||
| ## Rate Limits | ||
|
|
||
| Instance bandwidth limits are still instance-level API inputs, but are propagated into | ||
| per-interface `hypervisor.NetworkConfig` so Firecracker can program device rate limiters. | ||
| Host-level traffic shaping remains handled by Hypeman's network manager. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-existent Firecracker version v1.14.2 referenced
High Severity
FIRECRACKER_VERSIONis set tov1.14.2, but this release does not exist on the Firecracker GitHub releases page (the latest is v1.14.1). Thedownload-firecracker-binariestarget will fail with a 404 whencurltries to fetch the tarball, breakingbuild-linux,dev-linux,test-linux, andrelease-prep.Additional Locations (1)
lib/hypervisor/firecracker/binaries.go#L19-L21