CI: switch from LXD to Incus #499
Workflow file for this run
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
--- | |
name: Main | |
on: [push, pull_request] | |
env: | |
DOCKER_BUILDKIT: 1 | |
KUBECONFIG: ./kubeconfig | |
jobs: | |
single-node: | |
name: "Single node" | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 40 | |
strategy: | |
fail-fast: false | |
matrix: | |
engine: [docker, podman] | |
env: | |
CONTAINER_ENGINE: "${{ matrix.engine }}" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up cgroup v2 delegation | |
run: | | |
sudo mkdir -p /etc/systemd/system/[email protected] | |
cat <<EOF | sudo tee /etc/systemd/system/[email protected]/delegate.conf | |
[Service] | |
Delegate=cpu cpuset io memory pids | |
EOF | |
sudo systemctl daemon-reload | |
- name: Remove preinstalled Moby | |
# Preinstalled Moby does not contain dockerd-rootless-setuptool.sh | |
run: sudo apt-get remove moby-engine-* | |
- name: Set up Rootless Docker | |
if: ${{ matrix.engine == 'docker' }} | |
run: | | |
set -eux -o pipefail | |
curl https://get.docker.com | sudo sh | |
sudo systemctl disable --now docker.socket docker.service | |
sudo rm -rf /var/run/docker* | |
dockerd-rootless-setuptool.sh install | |
docker info | |
- name: Set up Rootless Podman | |
if: ${{ matrix.engine == 'podman' }} | |
run: | | |
set -eux -o pipefail | |
# Preinstalled Podman is too old (v3.4.4) | |
sudo apt-get remove podman* | |
sudo ./init-host/init-host.root.d/install-podman.sh | |
podman info | |
- run: make up | |
- run: sleep 5 | |
- run: make kubeadm-init | |
- run: make install-flannel | |
- run: make kubeconfig | |
- run: kubectl taint nodes --all node-role.kubernetes.io/control-plane- | |
- run: ./hack/test-smoke.sh | |
- name: "Test data persistency after restarting the node" | |
run: | | |
make down | |
make up | |
sleep 30 | |
./hack/test-smoke.sh | |
multi-node: | |
name: "Multi node (emulated using Incus)" | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- incus-image: ubuntu:22.04 | |
engine: docker | |
- incus-image: images:fedora/39/cloud | |
engine: podman | |
env: | |
INCUS_IMAGE: "${{ matrix.incus-image }}" | |
CONTAINER_ENGINE: "${{ matrix.engine }}" | |
steps: | |
- run: sudo modprobe vxlan | |
- uses: actions/checkout@v3 | |
- run: | | |
sudo mkdir -p /etc/apt/keyrings/ | |
sudo curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc | |
sudo sh -c 'cat <<EOF > /etc/apt/sources.list.d/zabbly-incus-stable.sources | |
Enabled: yes | |
Types: deb | |
URIs: https://pkgs.zabbly.com/incus/stable | |
Suites: $(. /etc/os-release && echo ${VERSION_CODENAME}) | |
Components: main | |
Architectures: $(dpkg --print-architecture) | |
Signed-By: /etc/apt/keyrings/zabbly.asc | |
EOF' | |
sudo apt-get update | |
sudo apt-get install -y incus | |
sudo systemctl start enable --now incus | |
- run: ./hack/create-cluster-incus.sh | |
- run: kubectl taint nodes --all node-role.kubernetes.io/control-plane- || true | |
- run: ./hack/test-smoke.sh | |
- name: "Test data persistency after restarting the node" | |
run: | | |
sudo incus restart host0 host1 | |
sleep 30 | |
./hack/test-smoke.sh |