From 04ecdb482348fd9f0e437f91d203c53120a01668 Mon Sep 17 00:00:00 2001 From: utam0k Date: Mon, 24 Oct 2022 20:14:14 +0900 Subject: [PATCH 1/3] Improve the flow of the containerd test with youki Signed-off-by: utam0k --- Makefile | 6 +++ Vagrantfile.containerd2youki | 77 +++++++++++++++++++----------------- 2 files changed, 47 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index 490cb1a7b..dfd6ba2e5 100644 --- a/Makefile +++ b/Makefile @@ -22,3 +22,9 @@ validate-rust-tests: clean: ./scripts/clean.sh $(ROOT) + +containerd-test: + VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant up --provision-with bootstrap | true + VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant provision --provision-with test + + diff --git a/Vagrantfile.containerd2youki b/Vagrantfile.containerd2youki index 7423601af..1a25805cb 100644 --- a/Vagrantfile.containerd2youki +++ b/Vagrantfile.containerd2youki @@ -3,49 +3,54 @@ Vagrant.configure("2") do |config| config.vm.box = "generic/ubuntu2204" - config.vm.synced_folder '.', '/vagrant/youki', disabled: true + config.vm.synced_folder '.', '/vagrant/youki', disabled: false config.vm.provider "virtualbox" do |v| v.memory = 4096 v.cpus = 2 end - config.vm.provision "shell", inline: <<-SHELL - set -e -u -o pipefail - apt-get update && apt-get install -y \ - make \ - pkg-config \ - libsystemd-dev \ - libdbus-glib-1-dev \ - build-essential \ - libelf-dev \ - libseccomp-dev \ - libbtrfs-dev \ - btrfs-progs - wget --quiet https://go.dev/dl/go1.18.1.linux-amd64.tar.gz -O /tmp/go1.18.1.linux-amd64.tar.gz - rm -rf /usr/local/go && tar -C /usr/local -xzf /tmp/go1.18.1.linux-amd64.tar.gz - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - echo "export PATH=$PATH:$HOME/.cargo/bin:/usr/local/go/bin" >> ~/.bashrc - echo "export GOPATH=$HOME/go" >> ~/.bashrc - export PATH=$PATH:$HOME/.cargo/bin:/usr/local/go/bin - export GOPATH=$HOME/go + config.vm.provision "bootstrap", type: "shell" do |s| + s.inline = <<-SHELL + set -e -u -o pipefail + apt-get update && apt-get install -y \ + make \ + pkg-config \ + libsystemd-dev \ + libdbus-glib-1-dev \ + build-essential \ + libelf-dev \ + libseccomp-dev \ + libbtrfs-dev \ + btrfs-progs + wget --quiet https://go.dev/dl/go1.18.1.linux-amd64.tar.gz -O /tmp/go1.18.1.linux-amd64.tar.gz + rm -rf /usr/local/go && tar -C /usr/local -xzf /tmp/go1.18.1.linux-amd64.tar.gz + echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc + echo "export GOPATH=$HOME/go" >> ~/.bashrc + export PATH=$PATH:$HOME/.cargo/bin:/usr/local/go/bin + export GOPATH=$HOME/go - rm -rf /root/containerd2youki - git clone https://github.com/containerd/containerd \ - /root/go/src/github.com/containerd/containerd -b v1.5.11 - git clone https://github.com/containers/youki \ - /root/containerd2youki/youki + git clone https://github.com/containerd/containerd \ + /root/go/src/github.com/containerd/containerd -b v1.5.11 - cd /root/go/src/github.com/containerd/containerd - make - make binaries - make install - ./script/setup/install-cni - ./script/setup/install-critools - rm -rf /bin/runc /sbin/runc /usr/sbin/runc /usr/bin/runc + cd /root/go/src/github.com/containerd/containerd + make + make binaries + make install + ./script/setup/install-cni + ./script/setup/install-critools + rm -rf /bin/runc /sbin/runc /usr/sbin/runc /usr/bin/runc - cd /root/containerd2youki/youki - make release-build - cp youki /usr/bin/runc - SHELL + cp /vagrant/youki/youki /usr/bin/runc + SHELL + end + + config.vm.provision "test", type: "shell" do |s| + s.inline = <<-SHELL + cd /root/go/src/github.com/containerd/containerd/ + export PATH=$PATH:$HOME/.cargo/bin:/usr/local/go/bin + make TEST_RUNTIME=io.containerd.runc.v2 TESTFLAGS="-timeout 120m" integration | tee result.txt + grep "FAIL: " result.txt + SHELL + end end From 737c09afe2bea69562dba8f1fb72a8cedc12b073 Mon Sep 17 00:00:00 2001 From: utam0k Date: Mon, 24 Oct 2022 20:16:18 +0900 Subject: [PATCH 2/3] Update docs for containerd tests Signed-off-by: utam0k --- .../developer/containerd_integration_test_using_youki.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/src/developer/containerd_integration_test_using_youki.md b/docs/src/developer/containerd_integration_test_using_youki.md index 0bf3b045b..af7b6f8f2 100644 --- a/docs/src/developer/containerd_integration_test_using_youki.md +++ b/docs/src/developer/containerd_integration_test_using_youki.md @@ -8,11 +8,5 @@ Find the cause of not supporting Kubernetes by integration test of CRI Runtime. ## local ```console -VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant up -vagrant ssh - -# in VM -sudo -i -cd /root/go/src/github.com/containerd/containerd/ -make TEST_RUNTIME=io.containerd.runc.v2 TESTFLAGS="-timeout 120m" integration +make containerd-test ``` From e3bf6988d4a2f13d642c2c06f36a1189b4a07011 Mon Sep 17 00:00:00 2001 From: Yashodhan Joshi Date: Tue, 22 Nov 2022 15:14:26 +0530 Subject: [PATCH 3/3] fix initial provisions always running --- Makefile | 2 +- Vagrantfile.containerd2youki | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index dfd6ba2e5..ec904fa80 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ clean: ./scripts/clean.sh $(ROOT) containerd-test: - VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant up --provision-with bootstrap | true + VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant up VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant provision --provision-with test diff --git a/Vagrantfile.containerd2youki b/Vagrantfile.containerd2youki index 1a25805cb..e8240e6a1 100644 --- a/Vagrantfile.containerd2youki +++ b/Vagrantfile.containerd2youki @@ -7,7 +7,7 @@ Vagrant.configure("2") do |config| config.vm.provider "virtualbox" do |v| v.memory = 4096 - v.cpus = 2 + v.cpus = 4 end config.vm.provision "bootstrap", type: "shell" do |s| @@ -50,7 +50,7 @@ Vagrant.configure("2") do |config| cd /root/go/src/github.com/containerd/containerd/ export PATH=$PATH:$HOME/.cargo/bin:/usr/local/go/bin make TEST_RUNTIME=io.containerd.runc.v2 TESTFLAGS="-timeout 120m" integration | tee result.txt - grep "FAIL: " result.txt + grep "FAIL: " result.txt || true SHELL end end