From 3c8a8b0bfd079418d73989cca9ae97d279ce6232 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 22:42:52 -0500 Subject: [PATCH 01/14] ci: add weekly tests on a variety of distros --- .github/workflows/tests-weekly.yaml | 42 +++++++++++++++++++++++++++++ Makefile | 4 +++ 2 files changed, 46 insertions(+) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index 0cb1a1631..b361c8edd 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -4,6 +4,10 @@ on: # Every Monday at 00:00 UTC - cron: "0 0 * * 1" + push: + paths: + - .github/workflows/tests-weekly.yaml + # Allows triggering the workflow manually from the Actions tab workflow_dispatch: inputs: @@ -77,3 +81,41 @@ jobs: run: | make setup-tests make test-slow + + integration-linux-lxd-distros: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, ubuntu-24.04-arm] + lxd-image: + - almalinux/9 + - amazonlinux/2023 + - centos/9-Stream + - debian/12 + - debian/13 + - fedora/42 + - mint/virginia + - mint/xia + - opensuse/tumbleweed + - oracle/9 + - rockylinux/9 + runs-on: ${{ matrix.os }} + steps: + - uses: canonical/setup-lxd@v1 + - name: Launch ${{ matrix.lxd-image }} container + run: | + lxc launch images:${{ matrix.lxd-image }}/default test-runner -c security.nesting=true + - name: Install requirements in container + run: | + lxc exec test-runner -- bash -c 'apt-get --yes install git make snapd build-essential libffi-dev || dnf install -y git make snapd libffi-devel @c-development cargo python3-devel' + lxc exec test-runner -- ln -s /var/lib/snapd/snap /snap + lxc exec test-runner -- snap wait system seed.loaded + - name: Clone repository + run: | + lxc exec test-runner -- git clone https://github.com/canonical/craft-providers + - name: Set up tests + run: | + lxc exec test-runner --cwd /root/craft-providers -- make setup-tests + - name: Run tests + run: | + lxc exec test-runner --cwd /root/craft-providers -- make test PYTEST_ADDOPTS='-vv -m lxd_instance' diff --git a/Makefile b/Makefile index 30223e8c9..fb4eceefb 100644 --- a/Makefile +++ b/Makefile @@ -56,6 +56,10 @@ else ifeq ($(shell which apt-get),) else sudo $(APT) install $(APT_PACKAGES) endif +ifeq ($(OS)_$(shell which lxd),Linux_) + sudo snap install lxd + lxd init --auto +endif ifeq ($(CI)_$(OS),true_Linux) # Only do this in CI on Linux # In CI, delete the android SDK if it's installed. It's kinda huge! sudo rm -rf /usr/local/lib/android/ From b0752f6487dac85bfa1424f10117019d51903166 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 22:50:06 -0500 Subject: [PATCH 02/14] fix: install squashfuse --- .github/workflows/tests-weekly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index b361c8edd..bbd41f4b0 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -107,8 +107,8 @@ jobs: lxc launch images:${{ matrix.lxd-image }}/default test-runner -c security.nesting=true - name: Install requirements in container run: | - lxc exec test-runner -- bash -c 'apt-get --yes install git make snapd build-essential libffi-dev || dnf install -y git make snapd libffi-devel @c-development cargo python3-devel' lxc exec test-runner -- ln -s /var/lib/snapd/snap /snap + lxc exec test-runner -- bash -c 'apt-get --yes install git make snapd fuse squashfuse build-essential libffi-dev || dnf install -y git make snapd libffi-devel @c-development cargo python3-devel' lxc exec test-runner -- snap wait system seed.loaded - name: Clone repository run: | From c7781ef5bd60d96554dc16df0c63664a0e5581e4 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 22:53:56 -0500 Subject: [PATCH 03/14] fix: CI env var --- .github/workflows/tests-weekly.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index bbd41f4b0..2d26eae95 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -115,7 +115,7 @@ jobs: lxc exec test-runner -- git clone https://github.com/canonical/craft-providers - name: Set up tests run: | - lxc exec test-runner --cwd /root/craft-providers -- make setup-tests + lxc exec test-runner --cwd /root/craft-providers --env CI=1 -- make setup-tests - name: Run tests run: | - lxc exec test-runner --cwd /root/craft-providers -- make test PYTEST_ADDOPTS='-vv -m lxd_instance' + lxc exec test-runner --cwd /root/craft-providers --env CI=1 -- make test PYTEST_ADDOPTS='-vv -m lxd_instance' From 2a3c2c45af915444cc320a1c90ef23133959e64b Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 22:55:30 -0500 Subject: [PATCH 04/14] fix: only on x86 runners --- .github/workflows/tests-weekly.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index 2d26eae95..9bc7a90b4 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -86,7 +86,6 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, ubuntu-24.04-arm] lxd-image: - almalinux/9 - amazonlinux/2023 @@ -99,7 +98,7 @@ jobs: - opensuse/tumbleweed - oracle/9 - rockylinux/9 - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - uses: canonical/setup-lxd@v1 - name: Launch ${{ matrix.lxd-image }} container From 168790c9cc3ce8fd16bfd4310042c5d4609bf755 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 22:58:21 -0500 Subject: [PATCH 05/14] fix: sleep longer for non-debian distros --- .github/workflows/tests-weekly.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index 9bc7a90b4..fd2a904a8 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -22,8 +22,8 @@ jobs: strategy: fail-fast: false matrix: - python: ["3.11"] - os: [macos-13] + python: ["3.12"] + os: [macos-14-large] runs-on: ${{ matrix.os }} timeout-minutes: 120 steps: @@ -55,7 +55,7 @@ jobs: fail-fast: false matrix: python: ["3.11"] - os: [macos-13] + os: [macos-14-large] runs-on: ${{ matrix.os }} steps: - name: Install Multipass @@ -107,6 +107,8 @@ jobs: - name: Install requirements in container run: | lxc exec test-runner -- ln -s /var/lib/snapd/snap /snap + # Non Debian like distros need longer to get network for some reason + sleep 10 lxc exec test-runner -- bash -c 'apt-get --yes install git make snapd fuse squashfuse build-essential libffi-dev || dnf install -y git make snapd libffi-devel @c-development cargo python3-devel' lxc exec test-runner -- snap wait system seed.loaded - name: Clone repository From 8dda3e8efc4c97d3ffd5ab244d5dc00ce726ac8e Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 23:00:46 -0500 Subject: [PATCH 06/14] fix: more generic dnf command --- .github/workflows/tests-weekly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index fd2a904a8..92bc33f99 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -109,7 +109,7 @@ jobs: lxc exec test-runner -- ln -s /var/lib/snapd/snap /snap # Non Debian like distros need longer to get network for some reason sleep 10 - lxc exec test-runner -- bash -c 'apt-get --yes install git make snapd fuse squashfuse build-essential libffi-dev || dnf install -y git make snapd libffi-devel @c-development cargo python3-devel' + lxc exec test-runner -- bash -c 'apt-get --yes install git make snapd fuse squashfuse build-essential libffi-dev || dnf install -y git make snapd libffi-devel gcc cargo python3-devel' lxc exec test-runner -- snap wait system seed.loaded - name: Clone repository run: | From a021991afe1aa832ea80c0cb9412c6a43ddc998a Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 23:08:52 -0500 Subject: [PATCH 07/14] fix: epel --- .github/workflows/tests-weekly.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index 92bc33f99..0ad2fb4b5 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -103,12 +103,19 @@ jobs: - uses: canonical/setup-lxd@v1 - name: Launch ${{ matrix.lxd-image }} container run: | - lxc launch images:${{ matrix.lxd-image }}/default test-runner -c security.nesting=true + lxc launch images:${{ matrix.lxd-image }} test-runner -c security.nesting=true - name: Install requirements in container run: | lxc exec test-runner -- ln -s /var/lib/snapd/snap /snap # Non Debian like distros need longer to get network for some reason sleep 10 + + # centos-based distros need EPEL for snapd. + if [[ ${{ matrix.lxd-image }} =~ almalinux* ]] || [[ ${{ matrix.lxd-image }} =~ amazonlinux* ]] || [[ ${{ matrix.lxd-image }} =~ centos* ]] || [[ ${{ matrix.lxd-image }} =~ rockylinux* ]]; then + lxc exec test-runner -- dnf install epel-release + lxc exec test-runner -- dnf upgrade + fi + lxc exec test-runner -- bash -c 'apt-get --yes install git make snapd fuse squashfuse build-essential libffi-dev || dnf install -y git make snapd libffi-devel gcc cargo python3-devel' lxc exec test-runner -- snap wait system seed.loaded - name: Clone repository From fcd6aaf04886bb356561a4b3884207e7c1577334 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 23:15:34 -0500 Subject: [PATCH 08/14] fix: more opensuse --- .github/workflows/tests-weekly.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index 0ad2fb4b5..63f2e94c3 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -116,7 +116,13 @@ jobs: lxc exec test-runner -- dnf upgrade fi - lxc exec test-runner -- bash -c 'apt-get --yes install git make snapd fuse squashfuse build-essential libffi-dev || dnf install -y git make snapd libffi-devel gcc cargo python3-devel' + # OpenSUSE tumbleweed + if [[ ${{ matrix.lxd-image }} == 'opensuse/tumbleweed' ]]; then + lxc exec test-runner -- zypper addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/openSUSE_Tumbleweed snappy + lxc exec test-runner -- zypper --gpg-auto-import-keys refresh + fi + + lxc exec test-runner -- bash -c 'apt-get --yes install git make snapd fuse squashfuse build-essential libffi-dev || dnf install -y git make snapd libffi-devel gcc cargo python3-devel || zypper install -y snapd squashfuse fuse git make gcc libffi-devel python3-devel' lxc exec test-runner -- snap wait system seed.loaded - name: Clone repository run: | From 2390c6db1f6c3010906fbd1127cdbd47605e87d9 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 23:17:20 -0500 Subject: [PATCH 09/14] ci: free up space --- .github/workflows/tests-weekly.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index 767cfde95..4e9885328 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -106,6 +106,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: canonical/setup-lxd@v1 + - uses: lengau/pristine-ubuntu-action@v0 - name: Launch ${{ matrix.lxd-image }} container run: | lxc launch images:${{ matrix.lxd-image }} test-runner -c security.nesting=true From 77d543986e545257fa8ed31e6386c2016579782a Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 23:18:10 -0500 Subject: [PATCH 10/14] fix: more auto-yes --- .github/workflows/tests-weekly.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index 4e9885328..789973bb8 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -118,8 +118,8 @@ jobs: # centos-based distros need EPEL for snapd. if [[ ${{ matrix.lxd-image }} =~ almalinux* ]] || [[ ${{ matrix.lxd-image }} =~ amazonlinux* ]] || [[ ${{ matrix.lxd-image }} =~ centos* ]] || [[ ${{ matrix.lxd-image }} =~ rockylinux* ]]; then - lxc exec test-runner -- dnf install epel-release - lxc exec test-runner -- dnf upgrade + lxc exec test-runner -- dnf install -y epel-release + lxc exec test-runner -- dnf upgrade -y fi # OpenSUSE tumbleweed From b93ba0d3951533b9d02c316548b710db8cfb6408 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 23:24:50 -0500 Subject: [PATCH 11/14] fix: amazon --- .github/workflows/tests-weekly.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index 789973bb8..ff43b7a41 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -117,11 +117,15 @@ jobs: sleep 10 # centos-based distros need EPEL for snapd. - if [[ ${{ matrix.lxd-image }} =~ almalinux* ]] || [[ ${{ matrix.lxd-image }} =~ amazonlinux* ]] || [[ ${{ matrix.lxd-image }} =~ centos* ]] || [[ ${{ matrix.lxd-image }} =~ rockylinux* ]]; then + if [[ ${{ matrix.lxd-image }} =~ almalinux* ]] || [[ ${{ matrix.lxd-image }} =~ centos* ]] || [[ ${{ matrix.lxd-image }} =~ rockylinux* ]]; then lxc exec test-runner -- dnf install -y epel-release lxc exec test-runner -- dnf upgrade -y fi + if [[ ${{ matrix.lxd-image }} =~ amazonlinux* ]]; then + wget -O /etc/yum.repos.d/snapd.repo https://bboozzoo.github.io/snapd-amazon-linux/al2023/snapd.repo + fi + # OpenSUSE tumbleweed if [[ ${{ matrix.lxd-image }} == 'opensuse/tumbleweed' ]]; then lxc exec test-runner -- zypper addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/openSUSE_Tumbleweed snappy From bb9cee784466a1de18077da441a820b0bf8016b4 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 23:26:34 -0500 Subject: [PATCH 12/14] fix: install snapd earlier --- .github/workflows/tests-weekly.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index ff43b7a41..59e536dee 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -132,7 +132,10 @@ jobs: lxc exec test-runner -- zypper --gpg-auto-import-keys refresh fi - lxc exec test-runner -- bash -c 'apt-get --yes install git make snapd fuse squashfuse build-essential libffi-dev || dnf install -y git make snapd libffi-devel gcc cargo python3-devel || zypper install -y snapd squashfuse fuse git make gcc libffi-devel python3-devel' + # Install snapd first so it has time to warm up while we're installing other stuff + lxc exec test-runner -- bash -c 'apt-get --yes install snapd fuse squashfuse || dnf install -y snapd fuse squashfuse || zypper install -y snapd squashfuse fuse' + + lxc exec test-runner -- bash -c 'apt-get --yes install git make build-essential libffi-dev || dnf install -y git make libffi-devel gcc cargo python3-devel || zypper install -y git make gcc libffi-devel python3-devel' lxc exec test-runner -- snap wait system seed.loaded - name: Clone repository run: | From 105fff5a8248bf885b3b2a5bf6f86eea7ed7e5d1 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 23:33:34 -0500 Subject: [PATCH 13/14] fix: remove amazonlinux as I can't currently install snapd --- .github/workflows/tests-weekly.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index 59e536dee..d7593e00b 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -93,7 +93,7 @@ jobs: matrix: lxd-image: - almalinux/9 - - amazonlinux/2023 + # - amazonlinux/2023 - centos/9-Stream - debian/12 - debian/13 @@ -123,7 +123,8 @@ jobs: fi if [[ ${{ matrix.lxd-image }} =~ amazonlinux* ]]; then - wget -O /etc/yum.repos.d/snapd.repo https://bboozzoo.github.io/snapd-amazon-linux/al2023/snapd.repo + dnf install wget + wget -O /etc/yum.repos.d/snapd.repo https://bboozzoo.github.io/snapd-amazon-linux/al2023/snapd.repo fi # OpenSUSE tumbleweed From 9b70fc81a2176626b6408d4f40400c3729740256 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Fri, 12 Dec 2025 23:40:13 -0500 Subject: [PATCH 14/14] fix: no snapd for oracle --- .github/workflows/tests-weekly.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-weekly.yaml b/.github/workflows/tests-weekly.yaml index d7593e00b..3a0c96a19 100644 --- a/.github/workflows/tests-weekly.yaml +++ b/.github/workflows/tests-weekly.yaml @@ -101,7 +101,6 @@ jobs: - mint/virginia - mint/xia - opensuse/tumbleweed - - oracle/9 - rockylinux/9 runs-on: ubuntu-latest steps: @@ -131,12 +130,15 @@ jobs: if [[ ${{ matrix.lxd-image }} == 'opensuse/tumbleweed' ]]; then lxc exec test-runner -- zypper addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/openSUSE_Tumbleweed snappy lxc exec test-runner -- zypper --gpg-auto-import-keys refresh + lxc exec test-runner -- zypper install snapd squashfuse fuse + lxc exec test-runner -- systemctl enable --now snapd.apparmor fi # Install snapd first so it has time to warm up while we're installing other stuff - lxc exec test-runner -- bash -c 'apt-get --yes install snapd fuse squashfuse || dnf install -y snapd fuse squashfuse || zypper install -y snapd squashfuse fuse' + lxc exec test-runner -- bash -c 'apt-get --yes install snapd fuse squashfuse || dnf install -y snapd fuse squashfuse || true' lxc exec test-runner -- bash -c 'apt-get --yes install git make build-essential libffi-dev || dnf install -y git make libffi-devel gcc cargo python3-devel || zypper install -y git make gcc libffi-devel python3-devel' + lxc exec test-runner -- snap wait system seed.loaded - name: Clone repository run: |