From 0eee1e3d27db67ce187d6cf317b7087dfafbcee8 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 12:55:23 +0200 Subject: [PATCH 01/21] artifacts v3->v4 --- .github/workflows/cicd.yml | 36 +++++++++++++++---------------- .github/workflows/vxlan-tests.yml | 6 +++--- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 90a1ec7e0..e4dfaa2ac 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -82,7 +82,7 @@ jobs: - name: Build containerlab run: make build-with-podman-debug BINARY=containerlab # store clab binary as artifact - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: containerlab path: containerlab @@ -129,7 +129,7 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: coverage @@ -152,7 +152,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: containerlab - name: Move containerlab to usr/bin @@ -178,7 +178,7 @@ jobs: run: | bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/01-smoke # upload test reports as a zip file - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: 01-smoke-log @@ -186,7 +186,7 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: coverage @@ -208,7 +208,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: containerlab - name: Move containerlab to usr/bin @@ -231,7 +231,7 @@ jobs: run: | bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/06-ext-container # upload test reports as a zip file - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: 06-ext-container-log @@ -239,7 +239,7 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: coverage @@ -261,7 +261,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: containerlab - name: Move containerlab to usr/bin @@ -286,7 +286,7 @@ jobs: run: | bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/03-basic-ceos # upload test reports as a zip file - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: 03-basic-ceos-log @@ -294,7 +294,7 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: coverage @@ -317,7 +317,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: containerlab - name: Move containerlab to usr/bin @@ -347,7 +347,7 @@ jobs: run: | bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/02-basic-srl # upload test reports as a zip file - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: 02-basic-srl-log @@ -355,7 +355,7 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: coverage @@ -377,7 +377,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: containerlab - name: Move containerlab to usr/bin @@ -394,7 +394,7 @@ jobs: run: | bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/04-basic-ixiacone # upload test reports as a zip file - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: 04-basic-ixiacone-log @@ -402,7 +402,7 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: coverage @@ -435,7 +435,7 @@ jobs: - uses: WillAbides/setup-go-faster@v1.13.0 with: go-version: ${{ env.GOVER }} - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: coverage path: /tmp/clab-tests/coverage diff --git a/.github/workflows/vxlan-tests.yml b/.github/workflows/vxlan-tests.yml index 43c991f19..bc03e40e9 100644 --- a/.github/workflows/vxlan-tests.yml +++ b/.github/workflows/vxlan-tests.yml @@ -20,7 +20,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: containerlab @@ -49,7 +49,7 @@ jobs: bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/08-vxlan/${{ matrix.test-suite }} # upload test reports as a zip file - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: 08-${{ matrix.runtime }}-vxlan-log @@ -57,7 +57,7 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: coverage From 908fb7f4c01c841651d67ce6ed9afc82ad837ebf Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 13:19:36 +0200 Subject: [PATCH 02/21] refactor upload/download artifacts for v4 --- .github/workflows/cicd.yml | 42 +++++++++++++++++++------------ .github/workflows/vxlan-tests.yml | 5 ++-- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index e4dfaa2ac..b85518c2e 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -82,10 +82,12 @@ jobs: - name: Build containerlab run: make build-with-podman-debug BINARY=containerlab # store clab binary as artifact - - uses: actions/upload-artifact@v4 + - name: Upload containerlab binary + uses: actions/upload-artifact@v4 with: name: containerlab path: containerlab + compression-level: 0 staticcheck: runs-on: ubuntu-22.04 @@ -129,10 +131,11 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v4 + - name: Upload coverage + uses: actions/upload-artifact@v4 if: always() with: - name: coverage + name: coverage-unit-test path: /tmp/clab-tests/coverage/* retention-days: 7 @@ -178,7 +181,8 @@ jobs: run: | bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/01-smoke # upload test reports as a zip file - - uses: actions/upload-artifact@v4 + - name: Upload test report + uses: actions/upload-artifact@v4 if: always() with: name: 01-smoke-log @@ -186,10 +190,11 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v4 + - name: Upload coverage + uses: actions/upload-artifact@v4 if: always() with: - name: coverage + name: coverage-smoke-tests path: /tmp/clab-tests/coverage/* retention-days: 7 @@ -231,7 +236,8 @@ jobs: run: | bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/06-ext-container # upload test reports as a zip file - - uses: actions/upload-artifact@v4 + - name: Upload test reports + uses: actions/upload-artifact@v4 if: always() with: name: 06-ext-container-log @@ -239,10 +245,11 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v4 + - name: upload coverage reports + uses: actions/upload-artifact@v4 if: always() with: - name: coverage + name: coverage-ext-container-test path: /tmp/clab-tests/coverage/* retention-days: 7 @@ -294,10 +301,11 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v4 + - name: Upload coverage + uses: actions/upload-artifact@v4 if: always() with: - name: coverage + name: coverage-ceos-tests path: /tmp/clab-tests/coverage/* retention-days: 7 @@ -355,10 +363,11 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v4 + - name: Upload coverage + uses: actions/upload-artifact@v4 if: always() with: - name: coverage + name: coverage-srlinux-tests path: /tmp/clab-tests/coverage/* retention-days: 7 @@ -402,10 +411,11 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v4 + - name: Upload coverage + uses: actions/upload-artifact@v4 if: always() with: - name: coverage + name: coverage-ixiac-one-tests path: /tmp/clab-tests/coverage/* retention-days: 7 @@ -437,7 +447,7 @@ jobs: go-version: ${{ env.GOVER }} - uses: actions/download-artifact@v4 with: - name: coverage + name: coverage* path: /tmp/clab-tests/coverage - name: convert Go's binary coverage to text coverage run: make convert-coverage diff --git a/.github/workflows/vxlan-tests.yml b/.github/workflows/vxlan-tests.yml index bc03e40e9..97883e717 100644 --- a/.github/workflows/vxlan-tests.yml +++ b/.github/workflows/vxlan-tests.yml @@ -57,9 +57,10 @@ jobs: # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - - uses: actions/upload-artifact@v4 + - name: Upload coverage report + uses: actions/upload-artifact@v4 if: always() with: - name: coverage + name: coverage-vxlan-tests path: /tmp/clab-tests/coverage/* retention-days: 7 From f9492cd154e3c494cc3c04f78fe2b31a1c3624a0 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 13:36:37 +0200 Subject: [PATCH 03/21] added matrix vars --- .github/workflows/vxlan-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vxlan-tests.yml b/.github/workflows/vxlan-tests.yml index 97883e717..1e6bce645 100644 --- a/.github/workflows/vxlan-tests.yml +++ b/.github/workflows/vxlan-tests.yml @@ -61,6 +61,6 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: coverage-vxlan-tests + name: coverage-vxlan-tests-${{ matrix.runtime }}-${{ replace(matrix.test-suite, '*', '') }} path: /tmp/clab-tests/coverage/* retention-days: 7 From f2126ecea519acb4a1264306117841ff25521094 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 13:36:51 +0200 Subject: [PATCH 04/21] downgrade podman to match kubic release? --- go.mod | 3 +-- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 507ca3162..fc8108b43 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible github.com/containernetworking/plugins v1.4.0 github.com/containers/common v0.57.1 - github.com/containers/podman/v4 v4.8.1 + github.com/containers/podman/v4 v4.6.2 github.com/digitalocean/go-openvswitch v0.0.0-20201214180534-ce0f183468d8 github.com/distribution/reference v0.5.0 github.com/docker/docker v24.0.7+incompatible @@ -90,7 +90,6 @@ require ( github.com/mdlayher/socket v0.4.1 // indirect github.com/mistifyio/go-zfs/v3 v3.0.1 // indirect github.com/moby/sys/sequential v0.5.0 // indirect - github.com/morikuni/aec v1.0.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/sftp v1.13.6 // indirect diff --git a/go.sum b/go.sum index d18142929..3d96269c5 100644 --- a/go.sum +++ b/go.sum @@ -1133,8 +1133,8 @@ github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= github.com/containers/ocicrypt v1.1.9 h1:2Csfba4jse85Raxk5HIyEk8OwZNjRvfkhEGijOjIdEM= github.com/containers/ocicrypt v1.1.9/go.mod h1:dTKx1918d8TDkxXvarscpNVY+lyPakPNFN4jwA9GBys= -github.com/containers/podman/v4 v4.8.1 h1:wUc3TlpHCzolc7+ADdyH/dfzIi1agKUhniBt6esRaMc= -github.com/containers/podman/v4 v4.8.1/go.mod h1:xtbor/KJs+xeWFS6KZmW7TGsKFNxBtnawYBS9AdFvHM= +github.com/containers/podman/v4 v4.6.2 h1:tUHH6RfavqH0QZJHA9JoiMtMatjUSe4LjkvQYD8AhMs= +github.com/containers/podman/v4 v4.6.2/go.mod h1:RszjaonNv/hLayX58T06xci2ixrcCoR5hfdfN6PQWmc= github.com/containers/psgo v1.8.0 h1:2loGekmGAxM9ir5OsXWEfGwFxorMPYnc6gEDsGFQvhY= github.com/containers/psgo v1.8.0/go.mod h1:T8ZxnX3Ur4RvnhxFJ7t8xJ1F48RhiZB4rSrOaR/qGHc= github.com/containers/storage v1.43.0/go.mod h1:uZ147thiIFGdVTjMmIw19knttQnUCl3y9zjreHrg11s= From 504722b7b8da20104aab78899146bce0f5039ace Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 13:38:43 +0200 Subject: [PATCH 05/21] replace doesn't exist --- .github/workflows/vxlan-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vxlan-tests.yml b/.github/workflows/vxlan-tests.yml index 1e6bce645..a023f2c98 100644 --- a/.github/workflows/vxlan-tests.yml +++ b/.github/workflows/vxlan-tests.yml @@ -61,6 +61,6 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: coverage-vxlan-tests-${{ matrix.runtime }}-${{ replace(matrix.test-suite, '*', '') }} + name: coverage-vxlan-tests-${{ matrix.runtime }}-${{ matrix.test-suite }} path: /tmp/clab-tests/coverage/* retention-days: 7 From 376ed14e9c624db0aec9371478f64bff5d0e144b Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 13:53:27 +0200 Subject: [PATCH 06/21] bring back recent podman --- go.mod | 3 ++- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index fc8108b43..f3733cab7 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible github.com/containernetworking/plugins v1.4.0 github.com/containers/common v0.57.1 - github.com/containers/podman/v4 v4.6.2 + github.com/containers/podman/v4 v4.8.2 github.com/digitalocean/go-openvswitch v0.0.0-20201214180534-ce0f183468d8 github.com/distribution/reference v0.5.0 github.com/docker/docker v24.0.7+incompatible @@ -90,6 +90,7 @@ require ( github.com/mdlayher/socket v0.4.1 // indirect github.com/mistifyio/go-zfs/v3 v3.0.1 // indirect github.com/moby/sys/sequential v0.5.0 // indirect + github.com/morikuni/aec v1.0.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/sftp v1.13.6 // indirect diff --git a/go.sum b/go.sum index 3d96269c5..e104ff5fe 100644 --- a/go.sum +++ b/go.sum @@ -1133,8 +1133,8 @@ github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= github.com/containers/ocicrypt v1.1.9 h1:2Csfba4jse85Raxk5HIyEk8OwZNjRvfkhEGijOjIdEM= github.com/containers/ocicrypt v1.1.9/go.mod h1:dTKx1918d8TDkxXvarscpNVY+lyPakPNFN4jwA9GBys= -github.com/containers/podman/v4 v4.6.2 h1:tUHH6RfavqH0QZJHA9JoiMtMatjUSe4LjkvQYD8AhMs= -github.com/containers/podman/v4 v4.6.2/go.mod h1:RszjaonNv/hLayX58T06xci2ixrcCoR5hfdfN6PQWmc= +github.com/containers/podman/v4 v4.8.2 h1:g8lLSQQwDa4nhh/sRUu+7AONp7kUJSOPJWq0dmG9DZQ= +github.com/containers/podman/v4 v4.8.2/go.mod h1:D6x9VeKVr0eqgqISBbrJ0c/g5eKcnJGrRdXxYShrOnE= github.com/containers/psgo v1.8.0 h1:2loGekmGAxM9ir5OsXWEfGwFxorMPYnc6gEDsGFQvhY= github.com/containers/psgo v1.8.0/go.mod h1:T8ZxnX3Ur4RvnhxFJ7t8xJ1F48RhiZB4rSrOaR/qGHc= github.com/containers/storage v1.43.0/go.mod h1:uZ147thiIFGdVTjMmIw19knttQnUCl3y9zjreHrg11s= From 8d76f0ed872c53d4918d5423dc869aa988da217a Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 13:55:10 +0200 Subject: [PATCH 07/21] added runtime to artifacts names --- .github/workflows/cicd.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index b85518c2e..5e08ccc75 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -194,7 +194,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: coverage-smoke-tests + name: coverage-smoke-tests-${{ matrix.runtime }} path: /tmp/clab-tests/coverage/* retention-days: 7 @@ -240,7 +240,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: 06-ext-container-log + name: 06-ext-container-log-${{ matrix.runtime }} path: ./tests/out/*.html # upload coverage report from unit tests, as they are then @@ -249,7 +249,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: coverage-ext-container-test + name: coverage-ext-container-test-${{ matrix.runtime }} path: /tmp/clab-tests/coverage/* retention-days: 7 @@ -296,7 +296,7 @@ jobs: - uses: actions/upload-artifact@v4 if: always() with: - name: 03-basic-ceos-log + name: 03-basic-ceos-log-${{ matrix.runtime }} path: ./tests/out/*.html # upload coverage report from unit tests, as they are then @@ -305,7 +305,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: coverage-ceos-tests + name: coverage-ceos-tests-${{ matrix.runtime }} path: /tmp/clab-tests/coverage/* retention-days: 7 @@ -358,7 +358,7 @@ jobs: - uses: actions/upload-artifact@v4 if: always() with: - name: 02-basic-srl-log + name: 02-basic-srl-log-${{ matrix.runtime }} path: ./tests/out/*.html # upload coverage report from unit tests, as they are then @@ -367,7 +367,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: coverage-srlinux-tests + name: coverage-srlinux-tests-${{ matrix.runtime }} path: /tmp/clab-tests/coverage/* retention-days: 7 @@ -406,7 +406,7 @@ jobs: - uses: actions/upload-artifact@v4 if: always() with: - name: 04-basic-ixiacone-log + name: 04-basic-ixiacone-log-${{ matrix.runtime }} path: ./tests/out/*.html # upload coverage report from unit tests, as they are then @@ -415,7 +415,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: coverage-ixiac-one-tests + name: coverage-ixiac-one-tests-${{ matrix.runtime }} path: /tmp/clab-tests/coverage/* retention-days: 7 From 50bad5570ef721638d4ff8e2283ce7fccff620e7 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 14:10:02 +0200 Subject: [PATCH 08/21] trying kubic from podman install docs --- .github/workflows/cicd.yml | 15 ++++++++++----- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 5e08ccc75..d92c51fc1 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -15,7 +15,6 @@ env: CGO_ENABLED: 0 MKDOCS_INS_VER: 9.1.4-insiders-4.32.4-hellt GORELEASER_VER: v1.11.4 - PODMAN_VER: v4.4.2 jobs: file-changes: @@ -164,10 +163,16 @@ jobs: if: matrix.runtime == 'podman' run: | sudo apt purge -y podman - echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/ /' | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list - curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_22.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_unstable.gpg > /dev/null - sudo apt update - sudo apt install -y podman + sudo mkdir -p /etc/apt/keyrings + curl -fsSL "https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key" \ + | gpg --dearmor \ + | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\ + https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \ + | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null + sudo apt-get update -qq + sudo apt-get -qq -y install podman sudo systemctl start podman - uses: actions/setup-python@v5 with: diff --git a/go.mod b/go.mod index f3733cab7..507ca3162 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible github.com/containernetworking/plugins v1.4.0 github.com/containers/common v0.57.1 - github.com/containers/podman/v4 v4.8.2 + github.com/containers/podman/v4 v4.8.1 github.com/digitalocean/go-openvswitch v0.0.0-20201214180534-ce0f183468d8 github.com/distribution/reference v0.5.0 github.com/docker/docker v24.0.7+incompatible diff --git a/go.sum b/go.sum index e104ff5fe..d18142929 100644 --- a/go.sum +++ b/go.sum @@ -1133,8 +1133,8 @@ github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= github.com/containers/ocicrypt v1.1.9 h1:2Csfba4jse85Raxk5HIyEk8OwZNjRvfkhEGijOjIdEM= github.com/containers/ocicrypt v1.1.9/go.mod h1:dTKx1918d8TDkxXvarscpNVY+lyPakPNFN4jwA9GBys= -github.com/containers/podman/v4 v4.8.2 h1:g8lLSQQwDa4nhh/sRUu+7AONp7kUJSOPJWq0dmG9DZQ= -github.com/containers/podman/v4 v4.8.2/go.mod h1:D6x9VeKVr0eqgqISBbrJ0c/g5eKcnJGrRdXxYShrOnE= +github.com/containers/podman/v4 v4.8.1 h1:wUc3TlpHCzolc7+ADdyH/dfzIi1agKUhniBt6esRaMc= +github.com/containers/podman/v4 v4.8.1/go.mod h1:xtbor/KJs+xeWFS6KZmW7TGsKFNxBtnawYBS9AdFvHM= github.com/containers/psgo v1.8.0 h1:2loGekmGAxM9ir5OsXWEfGwFxorMPYnc6gEDsGFQvhY= github.com/containers/psgo v1.8.0/go.mod h1:T8ZxnX3Ur4RvnhxFJ7t8xJ1F48RhiZB4rSrOaR/qGHc= github.com/containers/storage v1.43.0/go.mod h1:uZ147thiIFGdVTjMmIw19knttQnUCl3y9zjreHrg11s= From 5282c0c0fa909a48fa6c2d91f777c9e48dcf2c80 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 14:23:15 +0200 Subject: [PATCH 09/21] endless trying --- .github/workflows/cicd.yml | 25 ++++++++++++++++--------- .github/workflows/vxlan-tests.yml | 7 +++++-- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index d92c51fc1..1b4ff4880 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -15,6 +15,7 @@ env: CGO_ENABLED: 0 MKDOCS_INS_VER: 9.1.4-insiders-4.32.4-hellt GORELEASER_VER: v1.11.4 + PY_VER: 3.10 jobs: file-changes: @@ -176,7 +177,7 @@ jobs: sudo systemctl start podman - uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.10" cache: pip cache-dependency-path: "tests/requirements.txt" - name: Install robotframework @@ -225,7 +226,7 @@ jobs: run: sudo mv ./containerlab /usr/bin/containerlab && sudo chmod a+x /usr/bin/containerlab - uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: ${{ env.PY_VER }} cache: pip cache-dependency-path: "tests/requirements.txt" - name: Install robotframework @@ -280,7 +281,7 @@ jobs: run: sudo mv ./containerlab /usr/bin/containerlab && sudo chmod a+x /usr/bin/containerlab - uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: ${{ env.PY_VER }} cache: pip cache-dependency-path: "tests/requirements.txt" - name: Install robotframework @@ -342,15 +343,21 @@ jobs: # for available podman releases run: | sudo apt purge -y podman - echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/ /' | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list - curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_22.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_unstable.gpg > /dev/null - sudo apt update - sudo apt install -y podman + sudo mkdir -p /etc/apt/keyrings + curl -fsSL "https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key" \ + | gpg --dearmor \ + | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\ + https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \ + | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null + sudo apt-get update -qq + sudo apt-get -qq -y install podman sudo systemctl start podman - uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: ${{ env.PY_VER }} cache: pip cache-dependency-path: "tests/requirements.txt" - name: Install robotframework @@ -398,7 +405,7 @@ jobs: run: sudo mv ./containerlab /usr/bin/containerlab && sudo chmod a+x /usr/bin/containerlab - uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: ${{ env.PY_VER }} cache: pip cache-dependency-path: "tests/requirements.txt" - name: Install robotframework diff --git a/.github/workflows/vxlan-tests.yml b/.github/workflows/vxlan-tests.yml index a023f2c98..8fcc8c9b8 100644 --- a/.github/workflows/vxlan-tests.yml +++ b/.github/workflows/vxlan-tests.yml @@ -29,7 +29,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: ${{ env.PY_VER }} cache: pip cache-dependency-path: "tests/requirements.txt" @@ -55,12 +55,15 @@ jobs: name: 08-${{ matrix.runtime }}-vxlan-log path: ./tests/out/*.html + - name: Sanitize test-suite name + run: echo "TEST_SUITE=$(echo ${{ matrix.test-suite }} | tr -d '*')" >> $GITHUB_ENV + # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - name: Upload coverage report uses: actions/upload-artifact@v4 if: always() with: - name: coverage-vxlan-tests-${{ matrix.runtime }}-${{ matrix.test-suite }} + name: coverage-vxlan-tests-${{ matrix.runtime }}-${{ env.TEST_SUITE }} path: /tmp/clab-tests/coverage/* retention-days: 7 From 92dbc46aa02c6cc18a1b34d08c9870de1b76daae Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 14:32:56 +0200 Subject: [PATCH 10/21] dear yaml --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 1b4ff4880..ad4baa8c4 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -15,7 +15,7 @@ env: CGO_ENABLED: 0 MKDOCS_INS_VER: 9.1.4-insiders-4.32.4-hellt GORELEASER_VER: v1.11.4 - PY_VER: 3.10 + PY_VER: "3.10" jobs: file-changes: From 9e6f0cd67551ef7d4c881a1e3f1be2b682759b6a Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 14:55:32 +0200 Subject: [PATCH 11/21] distinct names for vxlan logs --- .github/workflows/vxlan-tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vxlan-tests.yml b/.github/workflows/vxlan-tests.yml index 8fcc8c9b8..c78cb68cc 100644 --- a/.github/workflows/vxlan-tests.yml +++ b/.github/workflows/vxlan-tests.yml @@ -48,22 +48,22 @@ jobs: run: | bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/08-vxlan/${{ matrix.test-suite }} + - name: Sanitize test-suite name + run: echo "TEST_SUITE=$(echo ${{ matrix.test-suite }} | tr -d '*')" >> $GITHUB_ENV + # upload test reports as a zip file - uses: actions/upload-artifact@v4 if: always() with: - name: 08-${{ matrix.runtime }}-vxlan-log + name: 08-vxlan-log-${{ env.TEST_SUITE }}-${{ matrix.runtime }} path: ./tests/out/*.html - - name: Sanitize test-suite name - run: echo "TEST_SUITE=$(echo ${{ matrix.test-suite }} | tr -d '*')" >> $GITHUB_ENV - # upload coverage report from unit tests, as they are then # merged with e2e tests coverage - name: Upload coverage report uses: actions/upload-artifact@v4 if: always() with: - name: coverage-vxlan-tests-${{ matrix.runtime }}-${{ env.TEST_SUITE }} + name: coverage-vxlan-tests-${{ env.TEST_SUITE }}-${{ matrix.runtime }} path: /tmp/clab-tests/coverage/* retention-days: 7 From 24c5ea9dfd8f72ea86a60b81b482bb43af5c869f Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 15:09:38 +0200 Subject: [PATCH 12/21] add timeout --- .github/workflows/cicd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index ad4baa8c4..852160405 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -141,6 +141,7 @@ jobs: smoke-tests: runs-on: ubuntu-22.04 + timeout-minutes: 10 strategy: matrix: runtime: From f6d0555e2adc706f3139deaa2f8762de780e2847 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 17:43:31 +0200 Subject: [PATCH 13/21] use outputs for cross-wf arg pass --- .github/workflows/cicd.yml | 4 ++++ .github/workflows/vxlan-tests.yml | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 852160405..7785a1882 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -23,6 +23,8 @@ jobs: outputs: code: ${{ steps.filter.outputs.code }} docs: ${{ steps.filter.outputs.docs }} + # exporting env vars to be used in invoked workflows + py_ver: ${{ env.PY_VER }} steps: - uses: actions/checkout@v4 - uses: dorny/paths-filter@v2 @@ -434,6 +436,8 @@ jobs: vxlan-tests: uses: ./.github/workflows/vxlan-tests.yml + with: + py_ver: ${{ jobs.file-changes.outputs.py_ver }} needs: - unit-test - staticcheck diff --git a/.github/workflows/vxlan-tests.yml b/.github/workflows/vxlan-tests.yml index c78cb68cc..a592caa9d 100644 --- a/.github/workflows/vxlan-tests.yml +++ b/.github/workflows/vxlan-tests.yml @@ -2,6 +2,10 @@ name: vxlan-test "on": workflow_call: + inputs: + py_ver: + required: true + type: string jobs: vxlan-tests: @@ -29,7 +33,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: ${{ env.PY_VER }} + python-version: ${{ inputs.py_ver }} cache: pip cache-dependency-path: "tests/requirements.txt" From 381ae0d453765081b7f0b0ea751aafffbfad040c Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Mon, 18 Dec 2023 17:52:14 +0200 Subject: [PATCH 14/21] use needs --- .github/workflows/cicd.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 7785a1882..fa5b0ff44 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -436,12 +436,13 @@ jobs: vxlan-tests: uses: ./.github/workflows/vxlan-tests.yml - with: - py_ver: ${{ jobs.file-changes.outputs.py_ver }} needs: + - file-changes - unit-test - staticcheck - build-containerlab + with: + py_ver: ${{ needs.file-changes.outputs.py_ver }} # a job that downloads coverage artifact and uses codecov to upload it coverage: From 6ce0f6d4888b6084d1c77729c94d3f5b372ec825 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Tue, 19 Dec 2023 22:04:15 +0200 Subject: [PATCH 15/21] carve out clab build step --- .github/workflows/build-containerlab.yml | 40 ++++++++++++++++++++++++ .github/workflows/cicd.yml | 33 +++---------------- 2 files changed, 44 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/build-containerlab.yml diff --git a/.github/workflows/build-containerlab.yml b/.github/workflows/build-containerlab.yml new file mode 100644 index 000000000..98aa20e6d --- /dev/null +++ b/.github/workflows/build-containerlab.yml @@ -0,0 +1,40 @@ +name: build-clab + +"on": + workflow_call: + inputs: + go_ver: + required: true + type: string + +jobs: + build-clab: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: WillAbides/setup-go-faster@v1.13.0 + with: + go-version: ${{ inputs.go_ver }} + + - name: Cache go modules + uses: actions/cache@v3 + with: + # In order: + # * Module download cache + # * Build cache (Linux) + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Build containerlab + run: make build-with-podman-debug BINARY=containerlab + # store clab binary as artifact + - name: Upload containerlab binary + uses: actions/upload-artifact@v4 + with: + name: containerlab + path: containerlab + compression-level: 0 diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index fa5b0ff44..d980e73ea 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -25,6 +25,7 @@ jobs: docs: ${{ steps.filter.outputs.docs }} # exporting env vars to be used in invoked workflows py_ver: ${{ env.PY_VER }} + go_ver: ${{ env.GO_VER }} steps: - uses: actions/checkout@v4 - uses: dorny/paths-filter@v2 @@ -59,37 +60,11 @@ jobs: - '.github/workflows/cicd.yml' build-containerlab: - runs-on: ubuntu-22.04 needs: file-changes if: needs.file-changes.outputs.code == 'true' || startsWith(github.ref, 'refs/tags/v') - steps: - - uses: actions/checkout@v4 - - uses: WillAbides/setup-go-faster@v1.13.0 - with: - go-version: ${{ env.GOVER }} - - - name: Cache go modules - uses: actions/cache@v3 - with: - # In order: - # * Module download cache - # * Build cache (Linux) - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Build containerlab - run: make build-with-podman-debug BINARY=containerlab - # store clab binary as artifact - - name: Upload containerlab binary - uses: actions/upload-artifact@v4 - with: - name: containerlab - path: containerlab - compression-level: 0 + uses: ./.github/workflows/build-containerlab.yml + with: + go_ver: ${{ needs.file-changes.outputs.go_ver }} staticcheck: runs-on: ubuntu-22.04 From 633847b4aa16dedecb4afe1a9a1ce7414092f7ab Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Tue, 19 Dec 2023 22:06:24 +0200 Subject: [PATCH 16/21] go ver env var fix --- .github/workflows/cicd.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index d980e73ea..9ad27fd9d 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -11,7 +11,7 @@ on: workflow_dispatch: env: - GOVER: 1.20.2 + GO_VER: "1.20.2" CGO_ENABLED: 0 MKDOCS_INS_VER: 9.1.4-insiders-4.32.4-hellt GORELEASER_VER: v1.11.4 @@ -74,7 +74,7 @@ jobs: - uses: actions/checkout@v4 - uses: WillAbides/setup-go-faster@v1.13.0 with: - go-version: ${{ env.GOVER }} + go-version: ${{ env.GO_VER }} - name: Staticcheck run: | @@ -89,7 +89,7 @@ jobs: - uses: actions/checkout@v4 - uses: WillAbides/setup-go-faster@v1.13.0 with: - go-version: ${{ env.GOVER }} + go-version: ${{ env.GO_VER }} - name: Cache go modules uses: actions/cache@v3 @@ -437,7 +437,7 @@ jobs: fetch-depth: 0 - uses: WillAbides/setup-go-faster@v1.13.0 with: - go-version: ${{ env.GOVER }} + go-version: ${{ env.GO_VER }} - uses: actions/download-artifact@v4 with: name: coverage* @@ -501,7 +501,7 @@ jobs: - name: Set up Go uses: WillAbides/setup-go-faster@v1.13.0 with: - go-version: ${{ env.GOVER }} + go-version: ${{ env.GO_VER }} - name: Cache go modules uses: actions/cache@v3 From ab902b081223d3e44e1e9582f3bb1b19474b11b2 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Tue, 19 Dec 2023 23:02:36 +0200 Subject: [PATCH 17/21] carve out smoke tests --- .github/workflows/cicd.yml | 63 ++---------------------- .github/workflows/smoke-tests.yml | 80 +++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/smoke-tests.yml diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 9ad27fd9d..27e507cce 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -117,70 +117,13 @@ jobs: retention-days: 7 smoke-tests: - runs-on: ubuntu-22.04 - timeout-minutes: 10 - strategy: - matrix: - runtime: - - "docker" - - "podman" + uses: ./.github/workflows/smoke-tests.yml + with: + py_ver: ${{ needs.file-changes.outputs.py_ver }} needs: - unit-test - staticcheck - build-containerlab - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/download-artifact@v4 - with: - name: containerlab - - name: Move containerlab to usr/bin - run: sudo mv ./containerlab /usr/bin/containerlab && sudo chmod a+x /usr/bin/containerlab - - name: Setup Podman - if: matrix.runtime == 'podman' - run: | - sudo apt purge -y podman - sudo mkdir -p /etc/apt/keyrings - curl -fsSL "https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key" \ - | gpg --dearmor \ - | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\ - https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \ - | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null - sudo apt-get update -qq - sudo apt-get -qq -y install podman - sudo systemctl start podman - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - cache: pip - cache-dependency-path: "tests/requirements.txt" - - name: Install robotframework - run: | - pip install -r tests/requirements.txt - - name: Run smoke tests - run: | - bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/01-smoke - # upload test reports as a zip file - - name: Upload test report - uses: actions/upload-artifact@v4 - if: always() - with: - name: 01-smoke-log - path: ./tests/out/*.html - - # upload coverage report from unit tests, as they are then - # merged with e2e tests coverage - - name: Upload coverage - uses: actions/upload-artifact@v4 - if: always() - with: - name: coverage-smoke-tests-${{ matrix.runtime }} - path: /tmp/clab-tests/coverage/* - retention-days: 7 ext-container-tests: runs-on: ubuntu-22.04 diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml new file mode 100644 index 000000000..94cd1d81a --- /dev/null +++ b/.github/workflows/smoke-tests.yml @@ -0,0 +1,80 @@ +name: smoke-tests + +"on": + workflow_call: + inputs: + py_ver: + required: true + type: string + +jobs: + smoke-tests: + runs-on: ubuntu-22.04 + timeout-minutes: 5 + strategy: + matrix: + runtime: + - "docker" + - "podman" + # allow podman job to fail, since it started to fail on github actions + continue-on-error: ${{ matrix.runtime == 'podman' }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/download-artifact@v4 + with: + name: containerlab + + - name: Move containerlab to usr/bin + run: sudo mv ./containerlab /usr/bin/containerlab && sudo chmod a+x /usr/bin/containerlab + + - name: Setup Podman + if: matrix.runtime == 'podman' + run: | + sudo apt purge -y podman + sudo mkdir -p /etc/apt/keyrings + curl -fsSL "https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key" \ + | gpg --dearmor \ + | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\ + https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \ + | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null + sudo apt-get update -qq + sudo apt-get -qq -y install podman + sudo systemctl start podman + + - uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.py_ver }} + cache: pip + cache-dependency-path: "tests/requirements.txt" + + - name: Install robotframework + run: | + pip install -r tests/requirements.txt + + - name: Run smoke tests + run: | + bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/01-smoke + + # upload test reports as a zip file + - name: Upload test report + uses: actions/upload-artifact@v4 + if: always() + with: + name: 01-smoke-log-${{ matrix.runtime }} + path: ./tests/out/*.html + + # upload coverage report from unit tests, as they are then + # merged with e2e tests coverage + - name: Upload coverage + uses: actions/upload-artifact@v4 + if: always() + with: + name: coverage-smoke-tests-${{ matrix.runtime }} + path: /tmp/clab-tests/coverage/* + retention-days: 7 From 7dc9bbe92ff6fe4f849456f60a0f5a1cdf36ed3b Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Wed, 20 Dec 2023 00:09:38 +0200 Subject: [PATCH 18/21] carve out srl tests --- .github/workflows/cicd.yml | 65 ++------------------------- .github/workflows/install-podman.sh | 14 ++++++ .github/workflows/smoke-tests.yml | 14 +----- .github/workflows/srlinux-tests.yml | 69 +++++++++++++++++++++++++++++ 4 files changed, 87 insertions(+), 75 deletions(-) create mode 100755 .github/workflows/install-podman.sh create mode 100644 .github/workflows/srlinux-tests.yml diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 27e507cce..496977ffd 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -237,72 +237,13 @@ jobs: retention-days: 7 srlinux-basic-tests: - runs-on: ubuntu-22.04 - strategy: - matrix: - runtime: - - "docker" - - "podman" + uses: ./.github/workflows/srlinux-tests.yml + with: + py_ver: ${{ needs.file-changes.outputs.py_ver }} needs: - unit-test - staticcheck - build-containerlab - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/download-artifact@v4 - with: - name: containerlab - - name: Move containerlab to usr/bin - run: sudo mv ./containerlab /usr/bin/containerlab && sudo chmod a+x /usr/bin/containerlab - - - name: Setup Podman - if: matrix.runtime == 'podman' - # check http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/amd64/ - # for available podman releases - run: | - sudo apt purge -y podman - sudo mkdir -p /etc/apt/keyrings - curl -fsSL "https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key" \ - | gpg --dearmor \ - | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\ - https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \ - | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null - sudo apt-get update -qq - sudo apt-get -qq -y install podman - sudo systemctl start podman - - - uses: actions/setup-python@v5 - with: - python-version: ${{ env.PY_VER }} - cache: pip - cache-dependency-path: "tests/requirements.txt" - - name: Install robotframework - run: | - pip install -r tests/requirements.txt - - name: Run srlinux tests - run: | - bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/02-basic-srl - # upload test reports as a zip file - - uses: actions/upload-artifact@v4 - if: always() - with: - name: 02-basic-srl-log-${{ matrix.runtime }} - path: ./tests/out/*.html - - # upload coverage report from unit tests, as they are then - # merged with e2e tests coverage - - name: Upload coverage - uses: actions/upload-artifact@v4 - if: always() - with: - name: coverage-srlinux-tests-${{ matrix.runtime }} - path: /tmp/clab-tests/coverage/* - retention-days: 7 ixiac-one-basic-tests: runs-on: ubuntu-22.04 diff --git a/.github/workflows/install-podman.sh b/.github/workflows/install-podman.sh new file mode 100755 index 000000000..d96e23062 --- /dev/null +++ b/.github/workflows/install-podman.sh @@ -0,0 +1,14 @@ +sudo apt purge -y podman +sudo mkdir -p /etc/apt/keyrings +curl -fsSL "https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key" \ + | gpg --dearmor \ + | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null + +echo \ +"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\ + https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \ + | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null + +sudo apt-get update -qq +sudo apt-get -qq -y install podman +sudo systemctl start podman \ No newline at end of file diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 94cd1d81a..2c3408cc6 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -33,19 +33,7 @@ jobs: - name: Setup Podman if: matrix.runtime == 'podman' - run: | - sudo apt purge -y podman - sudo mkdir -p /etc/apt/keyrings - curl -fsSL "https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key" \ - | gpg --dearmor \ - | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\ - https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \ - | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null - sudo apt-get update -qq - sudo apt-get -qq -y install podman - sudo systemctl start podman + run: sudo bash ./.github/workflows/install-podman.sh - uses: actions/setup-python@v5 with: diff --git a/.github/workflows/srlinux-tests.yml b/.github/workflows/srlinux-tests.yml new file mode 100644 index 000000000..d77fb7995 --- /dev/null +++ b/.github/workflows/srlinux-tests.yml @@ -0,0 +1,69 @@ +name: srlinux-tests + +"on": + workflow_call: + inputs: + py_ver: + required: true + type: string + +jobs: + srlinux-tests: + runs-on: ubuntu-22.04 + strategy: + matrix: + runtime: + - "docker" + - "podman" + # allow podman job to fail, since it started to fail on github actions + continue-on-error: ${{ matrix.runtime == 'podman' }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/download-artifact@v4 + with: + name: containerlab + + - name: Move containerlab to usr/bin + run: sudo mv ./containerlab /usr/bin/containerlab && sudo chmod a+x /usr/bin/containerlab + + - name: Setup Podman + if: matrix.runtime == 'podman' + # check http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/amd64/ + # for available podman releases + run: sudo bash ./.github/workflows/install-podman.sh + + - uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.py_ver }} + cache: pip + cache-dependency-path: "tests/requirements.txt" + + - name: Install robotframework + run: | + pip install -r tests/requirements.txt + + - name: Run srlinux tests + run: | + bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/02-basic-srl + + # upload test reports as a zip file + - name: Upload test logs + uses: actions/upload-artifact@v4 + if: always() + with: + name: 02-basic-srl-log-${{ matrix.runtime }} + path: ./tests/out/*.html + + # upload coverage report from unit tests, as they are then + # merged with e2e tests coverage + - name: Upload coverage + uses: actions/upload-artifact@v4 + if: always() + with: + name: coverage-srlinux-tests-${{ matrix.runtime }} + path: /tmp/clab-tests/coverage/* + retention-days: 7 From 9640a20a89e21449b24c5186b13bff673fbc5d42 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Wed, 20 Dec 2023 00:17:25 +0200 Subject: [PATCH 19/21] added file changes dep --- .github/workflows/cicd.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 496977ffd..f15694471 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -121,6 +121,7 @@ jobs: with: py_ver: ${{ needs.file-changes.outputs.py_ver }} needs: + - file-changes - unit-test - staticcheck - build-containerlab @@ -241,6 +242,7 @@ jobs: with: py_ver: ${{ needs.file-changes.outputs.py_ver }} needs: + - file-changes - unit-test - staticcheck - build-containerlab From 0748c902c9fa89af0705cdd131d94c5426ee368c Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Wed, 20 Dec 2023 00:24:49 +0200 Subject: [PATCH 20/21] download all coverage artifacts --- .github/workflows/cicd.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index f15694471..e6bcb387f 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -321,15 +321,21 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - uses: WillAbides/setup-go-faster@v1.13.0 with: go-version: ${{ env.GO_VER }} + - uses: actions/download-artifact@v4 with: - name: coverage* + pattern: coverage* path: /tmp/clab-tests/coverage - - name: convert Go's binary coverage to text coverage + merge-multiple: true + - run: ls -R /tmp/clab-tests/coverage + + - name: Convert Go's binary coverage to text coverage run: make convert-coverage + - name: Upload coverage to codecov uses: codecov/codecov-action@v3 From 89a37df5ecfd27b4fff167b03f869d0d6ec31659 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Wed, 20 Dec 2023 00:26:54 +0200 Subject: [PATCH 21/21] added go mod cache for static check step --- .github/workflows/cicd.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index e6bcb387f..6d840fdd1 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -76,6 +76,19 @@ jobs: with: go-version: ${{ env.GO_VER }} + - name: Cache go modules + uses: actions/cache@v3 + with: + # In order: + # * Module download cache + # * Build cache (Linux) + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Staticcheck run: | go install honnef.co/go/tools/cmd/staticcheck@latest