forked from firecracker-microvm/firecracker
-
Notifications
You must be signed in to change notification settings - Fork 0
[v1.12] Expose memory mapping; Make memfile dump optional #2
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
Draft
ValentaTomas
wants to merge
21
commits into
firecracker-v1.12
Choose a base branch
from
firecracker-v1.12-direct-mem
base: firecracker-v1.12
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
03e5061
Expose memory mapping; Add optional memfile dump
ValentaTomas eff49ed
Fix compile errors
ValentaTomas 5cfd4e3
Remove required field from spec
ValentaTomas 523dc12
Fix parameter
ValentaTomas 8769de7
Fix type
ValentaTomas 55b6479
Add upload script
ValentaTomas 1133bd6
Parse without python
ValentaTomas 0bb99c5
Refactor
ValentaTomas 01f3491
Add tests
ValentaTomas 178223a
Fix version
ValentaTomas dbc5552
fix(test_reboot): do not assert thread count
Manciukic f1510d5
Limit test suite
ValentaTomas 4129956
Merge branch 'firecracker-v1.12' into firecracker-v1.12-direct-mem
ValentaTomas 8a5491a
Tweak GHA
ValentaTomas 63ed770
Merge branch 'firecracker-v1.12-direct-mem' of https://github.com/e2b…
ValentaTomas 0111337
Change runner
ValentaTomas 6726338
Remove flaky test invocation
ValentaTomas 671febe
Fix build script
ValentaTomas 6ffeddf
Switch to 7 hash chars everywhere
ValentaTomas 1dfe77c
Remove g
ValentaTomas 717921c
Cleanup
ValentaTomas 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
Some comments aren't visible on the classic Files Changed page.
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 |
|---|---|---|
|
|
@@ -15,3 +15,4 @@ test_results/* | |
| /resources/linux | ||
| /resources/x86_64 | ||
| /resources/aarch64 | ||
| .env | ||
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,2 @@ | ||
| gcloud 534.0.0 | ||
| rust 1.85.0 |
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,12 @@ | ||
| -include .env | ||
|
|
||
| .PHONY: build | ||
| build: | ||
| ./scripts/build.sh | ||
|
|
||
| .PHONY: upload | ||
| upload: | ||
| ./scripts/upload.sh $(GCP_PROJECT_ID) | ||
|
|
||
| .PHONY: build-and-upload | ||
| build-and-upload: build upload |
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,17 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| # The format will be: v<major>.<minor>.<patch>_<commit_hash> — e.g. v1.7.2_8bb88311 | ||
| # Extract full version from src/firecracker/swagger/firecracker.yaml | ||
| FC_VERSION=$(awk '/^info:/{flag=1} flag && /^ version:/{print $2; exit}' src/firecracker/swagger/firecracker.yaml) | ||
| commit_hash=$(git rev-parse --short=7 HEAD) | ||
| version_name="v${FC_VERSION}_${commit_hash}" | ||
| echo "Version name: $version_name" | ||
|
|
||
| echo "Starting to build Firecracker version: $version_name" | ||
| tools/devtool -y build --release | ||
|
|
||
| mkdir -p "./build/fc/${version_name}" | ||
| cp ./build/cargo_target/x86_64-unknown-linux-musl/release/firecracker "./build/fc/${version_name}/firecracker" | ||
| echo "Finished building Firecracker version: $version_name and copied to ./build/fc/${version_name}/firecracker" |
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,13 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| GCP_PROJECT_ID=$1 | ||
|
|
||
| gsutil -h "Cache-Control:no-cache, max-age=0" cp -r "build/fc/*" "gs://${GCP_PROJECT_ID}-fc-versions" | ||
| if [ "$GCP_PROJECT_ID" == "e2b-prod" ]; then | ||
| # Upload kernel to GCP public builds bucket | ||
| gsutil -h "Cache-Control:no-cache, max-age=0" cp -r "build/fc/*" "gs://${GCP_PROJECT_ID}-public-builds/firecrackers/" | ||
| fi | ||
|
|
||
| rm -rf build/fc/* |
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,39 @@ | ||
| // Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| use vmm::logger::{IncMetric, METRICS}; | ||
| use vmm::rpc_interface::VmmAction; | ||
|
|
||
| use super::super::parsed_request::{ParsedRequest, RequestError}; | ||
|
|
||
| pub(crate) fn parse_get_memory_mappings() -> Result<ParsedRequest, RequestError> { | ||
| METRICS.get_api_requests.instance_info_count.inc(); | ||
| Ok(ParsedRequest::new_sync(VmmAction::GetMemoryMappings)) | ||
| } | ||
|
|
||
| pub(crate) fn parse_get_memory() -> Result<ParsedRequest, RequestError> { | ||
| METRICS.get_api_requests.instance_info_count.inc(); | ||
| Ok(ParsedRequest::new_sync(VmmAction::GetMemory)) | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
| use super::*; | ||
| use crate::api_server::parsed_request::RequestAction; | ||
|
|
||
| #[test] | ||
| fn test_parse_get_memory_mappings_request() { | ||
| match parse_get_memory_mappings().unwrap().into_parts() { | ||
| (RequestAction::Sync(action), _) if *action == VmmAction::GetMemoryMappings => {} | ||
| _ => panic!("Test failed."), | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_parse_get_memory_request() { | ||
| match parse_get_memory().unwrap().into_parts() { | ||
| (RequestAction::Sync(action), _) if *action == VmmAction::GetMemory => {} | ||
| _ => panic!("Test failed."), | ||
| } | ||
| } | ||
| } | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.