forked from firecracker-microvm/firecracker
-
Notifications
You must be signed in to change notification settings - Fork 0
[v1.10] Expose memory mapping; Make memfile dump optional #3
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
15
commits into
firecracker-v1.10
Choose a base branch
from
firecracker-v1.10-direct-mem
base: firecracker-v1.10
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
15 commits
Select commit
Hold shift + click to select a range
fc294d6
Expose memory mapping; Add optional memfile dump
ValentaTomas a3d19a1
Merge
ValentaTomas b63d1b8
Fix compile errors
ValentaTomas 8bf13f2
Remove required field from spec
ValentaTomas 70c0afa
Fix parameter
ValentaTomas 8155dcd
Fix type
ValentaTomas d3dca80
Add upload script
ValentaTomas 99e280c
Parse without python
ValentaTomas aac8541
Split endpoints
ValentaTomas 5124422
Fix build
ValentaTomas 85abaa2
Rollback deps
ValentaTomas 2d550e6
Fix build script
ValentaTomas 2757ca0
Switch to 7 hash chars everywhere
ValentaTomas 6c05dd5
Remove g
ValentaTomas fb257a1
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
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.79.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
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
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.