-
Notifications
You must be signed in to change notification settings - Fork 139
Implemented snapshot loading capabilities #414
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
find . -user root -print0 | xargs -0 sudo rm -rf '{}' | ||
sudo chown -hR "${USER}:${USER}" . |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ root-drive.img | |
TestPID.img | ||
build/ | ||
testdata/fc.stamp | ||
testdata/bin/ | ||
testdata/logs/ | ||
testdata/ltag | ||
testdata/release-* |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ FIRECRACKER_DIR=build/firecracker | |
FIRECRACKER_TARGET?=x86_64-unknown-linux-musl | ||
|
||
FC_TEST_DATA_PATH?=testdata | ||
FC_TEST_BIN_PATH:=$(FC_TEST_DATA_PATH)/bin | ||
FIRECRACKER_BIN=$(FC_TEST_DATA_PATH)/firecracker-main | ||
JAILER_BIN=$(FC_TEST_DATA_PATH)/jailer-main | ||
|
||
|
@@ -37,7 +38,17 @@ $(FC_TEST_DATA_PATH)/vmlinux \ | |
$(FC_TEST_DATA_PATH)/root-drive.img \ | ||
$(FC_TEST_DATA_PATH)/jailer \ | ||
$(FC_TEST_DATA_PATH)/firecracker \ | ||
$(FC_TEST_DATA_PATH)/ltag | ||
$(FC_TEST_DATA_PATH)/ltag \ | ||
$(FC_TEST_BIN_PATH)/ptp \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We switched from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I looked into this and it didn't work out-of-the-box. Mainly I didn't see the bridge plugin creating the IP route on the host like the ptp plugin does. So packets were not being routed to the bridge. More than likely I am miss configuring though. @sondavidb would you like to give it a shot? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I understand, the bridge plugin doesn't actually create any network interfaces, it only bridges two pre-existing connections. So, to refactor this would probably take moderate effort — entirely doable, but I would also like to finish this PR first to get the feature out, and then create a separate PR to refactor this. Given that it's only used in a test, I think it's not crucial to ship this change with the existing PR. What do you think @Kern--? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both the bridge plugin and ptp create veth pairs, so it should be just a slightly different config to switch, but I don't feel strongly enough about which we use to block on that. It's fine to ship this as is. |
||
$(FC_TEST_BIN_PATH)/host-local \ | ||
$(FC_TEST_BIN_PATH)/static \ | ||
$(FC_TEST_BIN_PATH)/tc-redirect-tap | ||
|
||
# Enable pulling of artifacts from S3 instead of building | ||
# TODO: https://github.com/firecracker-microvm/firecracker-go-sdk/issues/418 | ||
ifeq ($(GID), 0) | ||
testdata_objects += $(FC_TEST_DATA_PATH)/root-drive-with-ssh.img $(FC_TEST_DATA_PATH)/root-drive-ssh-key | ||
endif | ||
|
||
testdata_dir = testdata/firecracker.tgz testdata/firecracker_spec-$(firecracker_version).yaml testdata/LICENSE testdata/NOTICE testdata/THIRD-PARTY | ||
|
||
|
@@ -82,6 +93,34 @@ $(FC_TEST_DATA_PATH)/fc.stamp: | |
$(FC_TEST_DATA_PATH)/root-drive.img: | ||
$(curl) -o $@ https://s3.amazonaws.com/spec.ccfc.min/img/hello/fsfiles/hello-rootfs.ext4 | ||
|
||
$(FC_TEST_DATA_PATH)/root-drive-ssh-key $(FC_TEST_DATA_PATH)/root-drive-with-ssh.img: | ||
# Need root to move ssh key to testdata location | ||
sondavidb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ifeq ($(GID), 0) | ||
$(MAKE) $(FIRECRACKER_DIR) | ||
$(FIRECRACKER_DIR)/tools/devtool build_rootfs | ||
cp $(FIRECRACKER_DIR)/build/rootfs/bionic.rootfs.ext4 $(FC_TEST_DATA_PATH)/root-drive-with-ssh.img | ||
cp $(FIRECRACKER_DIR)/build/rootfs/ssh/id_rsa $(FC_TEST_DATA_PATH)/root-drive-ssh-key | ||
austinvazquez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
rm -rf $(FIRECRACKER_DIR) | ||
else | ||
$(error unable to place ssh key without root permissions) | ||
endif | ||
|
||
$(FC_TEST_BIN_PATH)/ptp: | ||
GO111MODULE=off GOBIN=$(abspath $(FC_TEST_BIN_PATH)) \ | ||
go get github.com/containernetworking/plugins/plugins/main/ptp | ||
|
||
$(FC_TEST_BIN_PATH)/host-local: | ||
GO111MODULE=off GOBIN=$(abspath $(FC_TEST_BIN_PATH)) \ | ||
go get github.com/containernetworking/plugins/plugins/ipam/host-local | ||
|
||
$(FC_TEST_BIN_PATH)/static: | ||
GO111MODULE=off GOBIN=$(abspath $(FC_TEST_BIN_PATH)) \ | ||
go get github.com/containernetworking/plugins/plugins/ipam/static | ||
|
||
$(FC_TEST_BIN_PATH)/tc-redirect-tap: | ||
GO111MODULE=off GOBIN=$(abspath $(FC_TEST_BIN_PATH)) \ | ||
go get github.com/awslabs/tc-redirect-tap/cmd/tc-redirect-tap | ||
|
||
$(FC_TEST_DATA_PATH)/ltag: | ||
GO111MODULE=off GOBIN=$(abspath $(FC_TEST_DATA_PATH)) \ | ||
go get github.com/kunalkushwaha/ltag | ||
|
Uh oh!
There was an error while loading. Please reload this page.