From af131d725873472f2dca1adfe81192f1c30d479a Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Thu, 21 May 2020 14:35:17 +0900 Subject: [PATCH] cgroup2 CI Signed-off-by: Akihiro Suda --- .github/workflows/ci.yml | 17 ++++ .gitignore | 1 + Vagrantfile | 69 ++++++++++++++++ container_linux_test.go | 158 +++++++++++++++++++++++++++--------- daemon_config_linux_test.go | 4 + script/setup/install-runc | 4 +- 6 files changed, 214 insertions(+), 39 deletions(-) create mode 100644 Vagrantfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b962fe1ef..1f2a85b08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -361,3 +361,20 @@ jobs: sudo pkill containerd sudo rm -rf /etc/containerd test $TEST_RC -eq 0 || /bin/false + + cgroup2: + name: cgroup2 + # nested virtualization is only available on macOS hosts + runs-on: macos-10.15 + timeout-minutes: 40 + needs: [project, linters, protos, man] + + steps: + - name: Checkout containerd + uses: actions/checkout@v2 + + - name: Start vagrant + run: vagrant up + + - name: Integration + run: vagrant ssh default -- sudo -i /integration.sh diff --git a/.gitignore b/.gitignore index d41d474aa..0f7a0998c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ coverage.txt profile.out containerd.test _site/ +.vagrant/ diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 000000000..cb252a195 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,69 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Copyright The containerd Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Vagrantfile for cgroup2 +Vagrant.configure("2") do |config| + config.vm.box = "fedora/32-cloud-base" + config.vm.provider :virtualbox do |v| + v.memory = 2048 + v.cpus = 2 + end + config.vm.provider :libvirt do |v| + v.memory = 2048 + v.cpus = 2 + end + config.vm.provision "shell", inline: <<-SHELL + set -eux -o pipefail + # configuration + GO_VERSION="1.13.11" + RUNC_FLAVOR="crun" + + # install dnf deps + dnf install -y gcc git libseccomp-devel lsof make + + # install Go + curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local + + # setup env vars + cat >> /etc/profile.d/sh.local < /integration.sh <&2 "unknown runc flavor: ${RUNC_FLAVOR}" exit 1 ;; -esac \ No newline at end of file +esac