From b1cdfa7da3e40fc6fe3f25d185ccbdb0b5210603 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Thu, 9 Jan 2025 14:09:09 +0000 Subject: [PATCH] Install lxd using k8s-snap composite action This simplifies the gh workflows and also applies the Docker iptables workaround. --- .github/workflows/k8s-snap-integration.yaml | 6 +----- .github/workflows/performance.yaml | 12 +----------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/workflows/k8s-snap-integration.yaml b/.github/workflows/k8s-snap-integration.yaml index dc21a6ab..7be400bd 100644 --- a/.github/workflows/k8s-snap-integration.yaml +++ b/.github/workflows/k8s-snap-integration.yaml @@ -34,11 +34,7 @@ jobs: run: | sudo snap download k8s --channel=latest/edge --basename k8s - name: Install lxd - run: | - sudo snap refresh lxd --channel 5.21/stable - sudo lxd init --auto - sudo usermod --append --groups lxd $USER - sg lxd -c 'lxc version' + uses: canonical/k8s-snap/.github/actions/install-lxd@main - name: Build k8s-dqlite run: | make static diff --git a/.github/workflows/performance.yaml b/.github/workflows/performance.yaml index 5fc5f600..89af6ed6 100644 --- a/.github/workflows/performance.yaml +++ b/.github/workflows/performance.yaml @@ -45,17 +45,7 @@ jobs: sudo apt install r-base sudo Rscript -e 'install.packages(c("ggplot2", "dplyr", "optparse"), repos="https://cloud.r-project.org")' - name: Install lxd - run: | - sudo snap refresh lxd --channel 5.21/stable - sudo lxd init --auto - sudo usermod --append --groups lxd $USER - sg lxd -c 'lxc version' - - name: Ensure lxd network traffic flows by removing docker if installed - run: | - if command -v docker >/dev/null 2>&1; then - echo "Docker is installed, purging it" - sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli containerd runc - fi + uses: canonical/k8s-snap/.github/actions/install-lxd@main - name: Download latest k8s-snap run: | sudo snap download k8s --channel=latest/edge --basename k8s