Skip to content
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

Firecracker v1.4.1 vhive integration #43

Open
wants to merge 5 commits into
base: firecracker-v1.4.1-vhive-integration
Choose a base branch
from

Conversation

char-1ee
Copy link

@char-1ee char-1ee commented Oct 9, 2023

Issue #, if available:
Refer to vhive-serverless/vHive#807

Description of changes:
To support UPF of vanilla firecracker snapshot and keep consistent with firecracker Golang SDK design, add MemBackend as new parameter in CreateVM request. MemBackend contains BackendType and BackendPath, when BackendType is "Uffd", MemFilePath is ignored. For details of memory backend, refer to firecracker-microvm/firecracker-go-sdk@2e09014

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

return errors.New("failed to load snapshot: snapshot path or container snapshot path was not provided")
}
if request.MemFilePath == "" && request.MemBackend.BackendType != "Uffd" {
return errors.New("failed to load snapshot: memroy file path was not provided")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Suggested change
return errors.New("failed to load snapshot: memroy file path was not provided")
return errors.New("failed to load snapshot: memory file path was not provided")

Copy link
Member

@ustiugov ustiugov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, you can proceed to the vHive modifications and test there.

the code seems ok, no need to lint

@ustiugov
Copy link
Member

you need to squash the commits and sign them as described here: https://github.com/vhive-serverless/vHive/blob/main/docs/contributing_to_vhive.md

Copy link
Member

@CuriousGeorgiy CuriousGeorgiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be a good idea to just drop the request.MemFilePath field in favor of the request.MemBackend field (our hands are not tied with backward compatibility support).

Please make sure the diff does not contain unnecessary changes (like blank lines).

Please make sure this patchset works by testing it manually with a simple setup.

I would prefer squashing the commits into one and supplying it with a small commit message describing the changes (basically, what you wrote in the PR description).

If there is no urgency in merging this PR, it would be great to see a PoC of how this patchset will be integrated with vHive (you can temporarily point to your fork's branch).

message MemoryBackend {
string BackendType = 1; // Either File or Uffd
string BackendPath = 2; // Either path to the file that contains the guest memory to be loaded or path to the UDS where a process is listening for a UFFD initialization
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: please restore the blank line at the end of the file.

// Path to the disk device backing the container snapshot.
string ContainerSnapshotPath = 19;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: please drop the blank lines here and above from the diff.

runtime/service.go Outdated Show resolved Hide resolved

message MemoryBackend {
string BackendType = 1; // Either File or Uffd
string BackendPath = 2; // Either path to the file that contains the guest memory to be loaded or path to the UDS where a process is listening for a UFFD initialization
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
string BackendPath = 2; // Either path to the file that contains the guest memory to be loaded or path to the UDS where a process is listening for a UFFD initialization
string BackendPath = 2; // Either path to the file that contains the guest memory to be loaded or path to the UDS where a process is listening for a UFFD initialization control payload and open file descriptor that it can use to serve this process's guest memory page faults

@CuriousGeorgiy CuriousGeorgiy added the do not merge Not ready to be merged label Oct 10, 2023
@ustiugov
Copy link
Member

lgtm, please squash the commits into one and sign it as described in our developer guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Not ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants