diff options
author | Franck Cuny <franck@fcuny.net> | 2021-05-15 20:00:31 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-06-11 13:57:43 -0700 |
commit | ca5bc817bbaccc5909367cf6176e73105c4ddf39 (patch) | |
tree | 9b3a70bc9ccad30766b2e08ace082819116f537d /users/fcuny | |
parent | rename the variable for the linux kernel (diff) | |
download | world-ca5bc817bbaccc5909367cf6176e73105c4ddf39.tar.gz |
Makefile: install binaries and configs
To help working on this project in the future, let's try to install dependencies and configurations with `make`. For now we know that we need the firecracker binary, the CNI configuration and the CNI plugin for TAP.
Diffstat (limited to '')
-rw-r--r-- | users/fcuny/exp/containerd-to-vm/Makefile | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/users/fcuny/exp/containerd-to-vm/Makefile b/users/fcuny/exp/containerd-to-vm/Makefile index a7997d8..11b7f9a 100644 --- a/users/fcuny/exp/containerd-to-vm/Makefile +++ b/users/fcuny/exp/containerd-to-vm/Makefile @@ -1,9 +1,26 @@ +FC_VERSION?=0.24.3-x86_64 +FC_BINARY?=hack/firecracker/firecracker-v$(FC_VERSION) + +FCNET_CONFIG?=/etc/cni/conf.d/50-c2vm.conflist +CNI_BIN_ROOT?=/opt/cni/bin +CNI_TAP_PLUGIN?=$(CNI_BIN_ROOT)/tc-redirect-tap + .PHONY: build build: - go build -o c2vm cmd/c2vm/main.go + @go build -o c2vm cmd/c2vm/main.go + +$(FC_BINARY): + @mkdir -p hack/firecracker + @curl -L -o hack/firecracker/firecracker.tgz -s https://github.com/firecracker-microvm/firecracker/releases/download/v0.24.3/firecracker-v$(FC_VERSION).tgz + @tar xvzf hack/firecracker/firecracker.tgz -C hack/firecracker + +$(FCNET_CONFIG): + @sudo mkdir -p $(dir $(FCNET_CONFIG)) + @sudo cp hack/cni/50-c2vm.conflist $(FCNET_CONFIG) + +$(CNI_TAP_PLUGIN): + @go install github.com/awslabs/tc-redirect-tap/cmd/tc-redirect-tap@latest + @sudo cp ${GOPATH}/bin/tc-redirect-tap $(CNI_BIN_ROOT) -.PHONY: firecracker-binary -firecracker-binary: - mkdir -p hack/firecracker - curl -L -o hack/firecracker/firecracker.tgz https://github.com/firecracker-microvm/firecracker/releases/download/v0.24.3/firecracker-v0.24.3-x86_64.tgz - tar xvzf hack/firecracker/firecracker.tgz -C hack/firecracker +.PHONY: all +all: build $(FC_BINARY) $(FCNET_CONFIG) $(CNI_TAP_PLUGIN) |