-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Fedora 33 as the cgroup2 host. Fedora is launched as a Vagrant VM. Related: - https://github.com/containerd/containerd/blob/c4bff3d17cd0d92e516e755252e98f92d224cf2f/.github/workflows/ci.yml#L352-L378 - https://github.com/opencontainers/runc/blob/2adbc66b710f89bea89b6804137c934279a4abff/.github/workflows/test.yml#L91-L122 Signed-off-by: Akihiro Suda <[email protected]>
- Loading branch information
1 parent
f8e85d7
commit 1c76d71
Showing
4 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Cgroup v2 | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
docker: | ||
name: Cgroup v2 | ||
# nested virtualization is only available on macOS hosts | ||
runs-on: macos-10.15 | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
provider: [docker, podman] | ||
env: | ||
KIND_EXPERIMENTAL_PROVIDER: "${{ matrix.provider }}" | ||
HELPER: "./hack/ci/vagrant-helper.sh" | ||
JOB_NAME: "cgroup2-${{ matrix.provider }}" | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Boot Fedora | ||
run: | | ||
ln -sf ./hack/ci/Vagrantfile ./Vagrantfile | ||
vagrant up | ||
- name: Show provider info | ||
run: | | ||
"$HELPER" "$KIND_EXPERIMENTAL_PROVIDER" info | ||
"$HELPER" "$KIND_EXPERIMENTAL_PROVIDER" version | ||
- name: Create a cluster | ||
run: | | ||
"$HELPER" kind create cluster -v7 --wait 1m --retain | ||
- name: Get Cluster status | ||
run: | | ||
"$HELPER" kubectl wait --for=condition=ready pods --namespace=kube-system -l k8s-app=kube-dns | ||
"$HELPER" kubectl get nodes -o wide | ||
"$HELPER" kubectl get pods -A | ||
- name: Export logs | ||
if: always() | ||
run: | | ||
"$HELPER" kind export logs /tmp/kind/logs | ||
mkdir -p /tmp/kind/logs | ||
"$HELPER" tar cC /tmp/kind/logs . | tar xC /tmp/kind/logs | ||
- name: Upload logs | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }} | ||
path: /tmp/kind/logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ | |
# macOS | ||
.DS_Store | ||
|
||
# Vagrant | ||
.vagrant | ||
|
||
# files generated by editors | ||
.idea/ | ||
*.iml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# Vagrant box for testing kind with cgroup v2 | ||
Vagrant.configure("2") do |config| | ||
config.vm.box = "fedora/33-cloud-base" | ||
memory = 2048 | ||
cpus = 2 | ||
config.vm.provider :virtualbox do |v| | ||
v.memory = memory | ||
v.cpus = cpus | ||
end | ||
config.vm.provider :libvirt do |v| | ||
v.memory = memory | ||
v.cpus = cpus | ||
end | ||
config.vm.provision "install-packages", type: "shell", run: "once" do |sh| | ||
sh.inline = <<~SHELL | ||
set -eux -o pipefail | ||
dnf install -y golang-go make kubernetes-client podman | ||
# The moby-engine package (v19.03) included in Fedora 33 does not support cgroup v2. | ||
# So we need to install Docker 20.10 (or later) from the upstream. | ||
curl -fsSL https://get.docker.com | sh | ||
systemctl enable --now docker | ||
SHELL | ||
end | ||
config.vm.provision "install-kind", type: "shell", run: "once" do |sh| | ||
sh.inline = <<~SHELL | ||
set -eux -o pipefail | ||
make -C /vagrant install INSTALL_DIR=/usr/local/bin | ||
SHELL | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2021 The Kubernetes 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. | ||
|
||
set -o errexit -o nounset -o pipefail | ||
|
||
|
||
: "${KIND_EXPERIMENTAL_PROVIDER:=docker}" | ||
SSH_CONFIG=".vagrant/ssh-config" | ||
if [ ! -f "$SSH_CONFIG" ]; then | ||
vagrant ssh-config > "$SSH_CONFIG" | ||
fi | ||
|
||
exec ssh -F "$SSH_CONFIG" default sudo KIND_EXPERIMENTAL_PROVIDER="$KIND_EXPERIMENTAL_PROVIDER" "$@" |