From 4e91e50813fb96316485db65471fed0da3b4edb6 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 3 Oct 2022 20:33:34 +0000 Subject: [PATCH 1/9] :robot: Run datasource tests on CircleCI --- .circleci/config.yml | 38 ++++++++++++++++++++++++++++++++++++++ Earthfile | 31 +++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index acaa52e91..eb7ff9686 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,6 +56,29 @@ jobs: ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${TAG} ./build/ fi + run-datasource-test: + parameters: + flavor: + type: string + cloud_config: + type: string + test_suite: + type: string + machine: + image: ubuntu-2004:current + resource_class: large + steps: + - checkout + - run: + name: Build + command: | + ./earthly.sh +pull-build-artifacts --BUNDLE_IMAGE=ttl.sh/<< parameters.flavor >>-$CIRCLE_SHA1:8h + ls -liah + export ISO=$(ls build/*.iso) + sudo mv $ISO build/kairos.iso + ./earthly.sh +datasource-iso --CLOUD_CONFIG=tests/assets/<< parameters.cloud_config >>.yaml + ./earthly.sh +run-qemu-datasource-tests --TEST_SUITE=<< parameters.test_suite >> --FLAVOR=<< parameters.flavor >> + build-iso: parameters: flavor: @@ -80,6 +103,7 @@ jobs: export TAG=latest fi ./earthly.sh +all --IMAGE=<< parameters.image >>-<< parameters.flavor >>:${TAG} --FLAVOR=<< parameters.flavor >> --ISO_NAME=kairos-<< parameters.flavor >>-${TAG} + ./earthly.sh +push-build-artifacts --BUNDLE_IMAGE=ttl.sh/<< parameters.flavor >>-$CIRCLE_SHA1:8h if [ "<< parameters.release >>" == "yes" ]; then docker push << parameters.image >>-<< parameters.flavor >>:${TAG} ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${TAG} ./build/ @@ -162,6 +186,20 @@ workflows: image: ["quay.io/kairos/framework"] flavor: ["opensuse"] release: ["no"] + - run-datasource-test: + matrix: + parameters: + cloud_config: ["tests/assets/autoinstall.yaml"] + flavor: ["alpine","opensuse","ubuntu"] + test_suite: ["reset-test", "autoinstall-test"] + requires: + - build-iso + - build-iso: + matrix: + parameters: + image: [quay.io/kairos/core] + flavor: ["alpine","opensuse","ubuntu"] + release: ["no"] lint: jobs: - lint diff --git a/Earthfile b/Earthfile index bad5d0ee1..e3b297abf 100644 --- a/Earthfile +++ b/Earthfile @@ -453,6 +453,37 @@ run-qemu-test: RUN PATH=$PATH:$GOPATH/bin ginkgo --label-filter "$TEST_SUITE" --fail-fast -r ./tests/ +pull-build-artifacts: + ARG OSBUILDER_IMAGE + FROM $OSBUILDER_IMAGE + RUN zypper in -y jq docker + COPY +uuidgen/UUIDGEN ./ + COPY +version/VERSION ./ + ARG UUIDGEN=$(cat UUIDGEN) + ARG BUNDLE_IMAGE=ttl.sh/$UUIDGEN:8h + + COPY +luet/luet /usr/bin/luet + RUN luet util unpack $BUNDLE_IMAGE build + SAVE ARTIFACT build AS LOCAL build + +push-build-artifacts: + ARG OSBUILDER_IMAGE + FROM $OSBUILDER_IMAGE + RUN zypper in -y jq docker + COPY +uuidgen/UUIDGEN ./ + COPY +version/VERSION ./ + ARG UUIDGEN=$(cat UUIDGEN) + ARG BUNDLE_IMAGE=ttl.sh/$UUIDGEN:8h + + COPY . . + COPY +luet/luet /usr/bin/luet + + RUN cd build && tar cvf ../build.tar ./ + RUN luet util pack $BUNDLE_IMAGE build.tar image.tar + WITH DOCKER + RUN docker load -i image.tar && docker push $BUNDLE_IMAGE + END + # bundles tests needs to run in sequence: # +prepare-bundles-tests # +run-bundles-tests From d1b646c5b8de101f9b7d765c2ed8e3a801b8c2fc Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 3 Oct 2022 21:36:43 +0000 Subject: [PATCH 2/9] :robot: Run bundles tests on CircleCI --- .circleci/config.yml | 25 ++++++- .github/workflows/image.yaml | 140 +++++++++++++++++------------------ 2 files changed, 94 insertions(+), 71 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eb7ff9686..e2fbaaed4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -78,7 +78,24 @@ jobs: sudo mv $ISO build/kairos.iso ./earthly.sh +datasource-iso --CLOUD_CONFIG=tests/assets/<< parameters.cloud_config >>.yaml ./earthly.sh +run-qemu-datasource-tests --TEST_SUITE=<< parameters.test_suite >> --FLAVOR=<< parameters.flavor >> - + run-bundles-test: + parameters: + flavor: + type: string + machine: + image: ubuntu-2004:current + resource_class: large + steps: + - checkout + - run: + name: Build + command: | + ./earthly.sh +pull-build-artifacts --BUNDLE_IMAGE=ttl.sh/<< parameters.flavor >>-$CIRCLE_SHA1:8h + ls -liah + export ISO=$(ls build/*.iso) + sudo mv $ISO build/kairos.iso + ./earthly.sh +prepare-bundles-tests + ./earthly.sh +run-qemu-bundles-tests --FLAVOR=<< parameters.flavor >> build-iso: parameters: flavor: @@ -194,6 +211,12 @@ workflows: test_suite: ["reset-test", "autoinstall-test"] requires: - build-iso + - run-bundles-test: + matrix: + parameters: + flavor: ["opensuse"] + requires: + - build-iso - build-iso: matrix: parameters: diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index f982763e8..e65fe39c8 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -146,78 +146,78 @@ jobs: path: last-release if-no-files-found: error - qemu-autoinstall-tests: - needs: - - build - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - flavor: "alpine" - - flavor: "opensuse" - - flavor: "ubuntu" - steps: - - uses: actions/checkout@v2 - - name: Download artifacts - uses: actions/download-artifact@v2 - with: - name: kairos-${{ matrix.flavor }}.iso.zip - - run: | - ls -liah - export ISO=$PWD/$(ls *.iso) - mkdir build - mv $ISO build/kairos.iso - ./earthly.sh +datasource-iso --CLOUD_CONFIG=tests/assets/autoinstall.yaml - ./earthly.sh +run-qemu-datasource-tests --FLAVOR=${{ matrix.flavor }} + # qemu-autoinstall-tests: + # needs: + # - build + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # include: + # - flavor: "alpine" + # - flavor: "opensuse" + # - flavor: "ubuntu" + # steps: + # - uses: actions/checkout@v2 + # - name: Download artifacts + # uses: actions/download-artifact@v2 + # with: + # name: kairos-${{ matrix.flavor }}.iso.zip + # - run: | + # ls -liah + # export ISO=$PWD/$(ls *.iso) + # mkdir build + # mv $ISO build/kairos.iso + # ./earthly.sh +datasource-iso --CLOUD_CONFIG=tests/assets/autoinstall.yaml + # ./earthly.sh +run-qemu-datasource-tests --FLAVOR=${{ matrix.flavor }} - qemu-bundles-tests: - needs: - - build - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - flavor: "opensuse" - steps: - - uses: actions/checkout@v2 - - name: Download artifacts - uses: actions/download-artifact@v2 - with: - name: kairos-${{ matrix.flavor }}.iso.zip - - run: | - ls -liah - export ISO=$PWD/$(ls *.iso) - mkdir build - mv $ISO build/kairos.iso - ./earthly.sh +prepare-bundles-tests - ./earthly.sh +run-qemu-bundles-tests --FLAVOR=${{ matrix.flavor }} + # qemu-bundles-tests: + # needs: + # - build + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # include: + # - flavor: "opensuse" + # steps: + # - uses: actions/checkout@v2 + # - name: Download artifacts + # uses: actions/download-artifact@v2 + # with: + # name: kairos-${{ matrix.flavor }}.iso.zip + # - run: | + # ls -liah + # export ISO=$PWD/$(ls *.iso) + # mkdir build + # mv $ISO build/kairos.iso + # ./earthly.sh +prepare-bundles-tests + # ./earthly.sh +run-qemu-bundles-tests --FLAVOR=${{ matrix.flavor }} - qemu-reset-tests: - needs: - - build - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - flavor: "alpine" - - flavor: "opensuse" - - flavor: "ubuntu" - steps: - - uses: actions/checkout@v2 - - name: Download artifacts - uses: actions/download-artifact@v2 - with: - name: kairos-${{ matrix.flavor }}.iso.zip - - run: | - ls -liah - export ISO=$PWD/$(ls *.iso) - mkdir build - mv $ISO build/kairos.iso - ./earthly.sh +datasource-iso --CLOUD_CONFIG=tests/assets/autoinstall.yaml - ./earthly.sh +run-qemu-datasource-tests --TEST_SUITE=reset-test --FLAVOR=${{ matrix.flavor }} + # qemu-reset-tests: + # needs: + # - build + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # include: + # - flavor: "alpine" + # - flavor: "opensuse" + # - flavor: "ubuntu" + # steps: + # - uses: actions/checkout@v2 + # - name: Download artifacts + # uses: actions/download-artifact@v2 + # with: + # name: kairos-${{ matrix.flavor }}.iso.zip + # - run: | + # ls -liah + # export ISO=$PWD/$(ls *.iso) + # mkdir build + # mv $ISO build/kairos.iso + # ./earthly.sh +datasource-iso --CLOUD_CONFIG=tests/assets/autoinstall.yaml + # ./earthly.sh +run-qemu-datasource-tests --TEST_SUITE=reset-test --FLAVOR=${{ matrix.flavor }} upgrade-with-cli-test: needs: From 822d822daba851c485d1daa93184fd99023f7330 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 3 Oct 2022 21:43:04 +0000 Subject: [PATCH 3/9] :robot: Fixups --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e2fbaaed4..da17b9bd9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -206,7 +206,7 @@ workflows: - run-datasource-test: matrix: parameters: - cloud_config: ["tests/assets/autoinstall.yaml"] + cloud_config: ["autoinstall"] flavor: ["alpine","opensuse","ubuntu"] test_suite: ["reset-test", "autoinstall-test"] requires: From 69ecf298422eaff61d3ab0fbce86b15fde0e6c5e Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 3 Oct 2022 22:35:32 +0000 Subject: [PATCH 4/9] :robot: Run cli tests to CircleCI --- .circleci/config.yml | 55 +++++++- .github/workflows/image.yaml | 246 +++++++++++++++++------------------ Earthfile | 15 +++ 3 files changed, 192 insertions(+), 124 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index da17b9bd9..ae5f51c0e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -55,7 +55,44 @@ jobs: docker push << parameters.image >>-<< parameters.flavor >>:${TAG} ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${TAG} ./build/ fi - + run-test: + parameters: + flavor: + type: string + test_suite: + type: string + machine: + image: ubuntu-2004:current + resource_class: large + steps: + - checkout + - run: + name: Build + command: | + ./earthly.sh +pull-release --FLAVOR=<< parameters.flavor >> + ls -liah + export ISO=$(ls build/*.iso) + sudo mv $ISO build/kairos.iso + ./earthly.sh +run-qemu-test --FLAVOR=<< parameters.flavor >> --CONTAINER_IMAGE=ttl.sh/tests-<< parameters.flavor >>-$CIRCLE_SHA1:8h --TEST_SUITE=<< parameters.test_suite >> + run-latest-test: + parameters: + flavor: + type: string + test_suite: + type: string + machine: + image: ubuntu-2004:current + resource_class: large + steps: + - checkout + - run: + name: Build + command: | + ./earthly.sh +pull-release --FLAVOR=<< parameters.flavor >> + ls -liah + export ISO=$(ls build/*.iso) + sudo mv $ISO build/kairos.iso + ./earthly.sh +run-qemu-test --FLAVOR=<< parameters.flavor >> --CONTAINER_IMAGE=ttl.sh/tests-<< parameters.flavor >>-$CIRCLE_SHA1:8h --TEST_SUITE=<< parameters.test_suite >> run-datasource-test: parameters: flavor: @@ -125,6 +162,8 @@ jobs: docker push << parameters.image >>-<< parameters.flavor >>:${TAG} ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${TAG} ./build/ fi + docker tag << parameters.image >>-<< parameters.flavor >>:${TAG} ttl.sh/tests-<< parameters.flavor >>-$CIRCLE_SHA1:8h + docker push ttl.sh/tests-<< parameters.flavor >>-$CIRCLE_SHA1:8h lint: machine: @@ -211,6 +250,20 @@ workflows: test_suite: ["reset-test", "autoinstall-test"] requires: - build-iso + - run-latest-test: + matrix: + parameters: + flavor: ["alpine","opensuse","ubuntu"] + test_suite: ["upgrade-latest-with-cli"] + requires: + - build-iso + - run-test: + matrix: + parameters: + flavor: ["alpine","opensuse","ubuntu"] + test_suite: ["upgrade-with-cli"] + requires: + - build-iso - run-bundles-test: matrix: parameters: diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index e65fe39c8..c423a544e 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -219,128 +219,128 @@ jobs: # ./earthly.sh +datasource-iso --CLOUD_CONFIG=tests/assets/autoinstall.yaml # ./earthly.sh +run-qemu-datasource-tests --TEST_SUITE=reset-test --FLAVOR=${{ matrix.flavor }} - upgrade-with-cli-test: - needs: - - build - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - flavor: "alpine" - - flavor: "opensuse" - - flavor: "ubuntu" - steps: - - uses: actions/checkout@v2 - - name: Download artifacts - uses: actions/download-artifact@v2 - with: - name: kairos-${{ matrix.flavor }}.iso.zip - - name: Release space from worker - run: | - echo "Listing top largest packages" - pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) - head -n 30 <<< "${pkgs}" - echo - df -h - echo - sudo apt-get remove -y '^llvm-.*|^libllvm.*' || true - sudo apt-get remove --auto-remove android-sdk-platform-tools || true - sudo apt-get purge --auto-remove android-sdk-platform-tools || true - sudo rm -rf /usr/local/lib/android - sudo apt-get remove -y '^dotnet-.*|^aspnetcore-.*' || true - sudo rm -rf /usr/share/dotnet - sudo apt-get remove -y '^mono-.*' || true - sudo apt-get remove -y '^ghc-.*' || true - sudo apt-get remove -y '.*jdk.*|.*jre.*' || true - sudo apt-get remove -y 'php.*' || true - sudo apt-get remove -y hhvm powershell firefox monodoc-manual msbuild || true - sudo apt-get remove -y '^google-.*' || true - sudo apt-get remove -y azure-cli || true - sudo apt-get remove -y '^mongo.*-.*|^postgresql-.*|^mysql-.*|^mssql-.*' || true - sudo apt-get remove -y '^gfortran-.*' || true - sudo apt-get autoremove -y - sudo apt-get clean - echo - echo "Listing top largest packages" - pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) - head -n 30 <<< "${pkgs}" - echo - sudo rm -rfv build || true - df -h - - run: | - ls -liah - export ISO=$PWD/$(ls *.iso) - sudo mkdir build - sudo mv $ISO build/ - ./earthly.sh +run-qemu-test --FLAVOR=${{ matrix.flavor }} --CONTAINER_IMAGE=ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}:8h --TEST_SUITE=upgrade-with-cli - - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ${{ matrix.flavor }}-upgrade-test.logs.zip - path: tests/**/logs/* - if-no-files-found: warn + # upgrade-with-cli-test: + # needs: + # - build + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # include: + # - flavor: "alpine" + # - flavor: "opensuse" + # - flavor: "ubuntu" + # steps: + # - uses: actions/checkout@v2 + # - name: Download artifacts + # uses: actions/download-artifact@v2 + # with: + # name: kairos-${{ matrix.flavor }}.iso.zip + # - name: Release space from worker + # run: | + # echo "Listing top largest packages" + # pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) + # head -n 30 <<< "${pkgs}" + # echo + # df -h + # echo + # sudo apt-get remove -y '^llvm-.*|^libllvm.*' || true + # sudo apt-get remove --auto-remove android-sdk-platform-tools || true + # sudo apt-get purge --auto-remove android-sdk-platform-tools || true + # sudo rm -rf /usr/local/lib/android + # sudo apt-get remove -y '^dotnet-.*|^aspnetcore-.*' || true + # sudo rm -rf /usr/share/dotnet + # sudo apt-get remove -y '^mono-.*' || true + # sudo apt-get remove -y '^ghc-.*' || true + # sudo apt-get remove -y '.*jdk.*|.*jre.*' || true + # sudo apt-get remove -y 'php.*' || true + # sudo apt-get remove -y hhvm powershell firefox monodoc-manual msbuild || true + # sudo apt-get remove -y '^google-.*' || true + # sudo apt-get remove -y azure-cli || true + # sudo apt-get remove -y '^mongo.*-.*|^postgresql-.*|^mysql-.*|^mssql-.*' || true + # sudo apt-get remove -y '^gfortran-.*' || true + # sudo apt-get autoremove -y + # sudo apt-get clean + # echo + # echo "Listing top largest packages" + # pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) + # head -n 30 <<< "${pkgs}" + # echo + # sudo rm -rfv build || true + # df -h + # - run: | + # ls -liah + # export ISO=$PWD/$(ls *.iso) + # sudo mkdir build + # sudo mv $ISO build/ + # ./earthly.sh +run-qemu-test --FLAVOR=${{ matrix.flavor }} --CONTAINER_IMAGE=ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}:8h --TEST_SUITE=upgrade-with-cli + # - uses: actions/upload-artifact@v2 + # if: failure() + # with: + # name: ${{ matrix.flavor }}-upgrade-test.logs.zip + # path: tests/**/logs/* + # if-no-files-found: warn - upgrade-latest-with-cli-test: - needs: - - build - - latest-release - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - flavor: "alpine" - - flavor: "opensuse" - - flavor: "ubuntu" - steps: - - uses: actions/checkout@v2 - - name: Download artifacts - uses: actions/download-artifact@v2 - with: - name: latest-release.zip - - name: Release space from worker - run: | - echo "Listing top largest packages" - pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) - head -n 30 <<< "${pkgs}" - echo - df -h - echo - sudo apt-get remove -y '^llvm-.*|^libllvm.*' || true - sudo apt-get remove --auto-remove android-sdk-platform-tools || true - sudo apt-get purge --auto-remove android-sdk-platform-tools || true - sudo rm -rf /usr/local/lib/android - sudo apt-get remove -y '^dotnet-.*|^aspnetcore-.*' || true - sudo rm -rf /usr/share/dotnet - sudo apt-get remove -y '^mono-.*' || true - sudo apt-get remove -y '^ghc-.*' || true - sudo apt-get remove -y '.*jdk.*|.*jre.*' || true - sudo apt-get remove -y 'php.*' || true - sudo apt-get remove -y hhvm powershell firefox monodoc-manual msbuild || true - sudo apt-get remove -y '^google-.*' || true - sudo apt-get remove -y azure-cli || true - sudo apt-get remove -y '^mongo.*-.*|^postgresql-.*|^mysql-.*|^mssql-.*' || true - sudo apt-get remove -y '^gfortran-.*' || true - sudo apt-get autoremove -y - sudo apt-get clean - echo - echo "Listing top largest packages" - pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) - head -n 30 <<< "${pkgs}" - echo - sudo rm -rfv build || true - df -h - - run: | - ls -liah - export ISO=$PWD/$(ls kairos-${{matrix.flavor}}-*.iso) - sudo mkdir build - sudo mv $ISO build/ - ./earthly.sh +run-qemu-test --FLAVOR=${{ matrix.flavor }} --CONTAINER_IMAGE=ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}:8h --TEST_SUITE=upgrade-latest-with-cli - - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ${{ matrix.flavor }}-upgrade-test.logs.zip - path: tests/**/logs/* - if-no-files-found: warn + # upgrade-latest-with-cli-test: + # needs: + # - build + # - latest-release + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # include: + # - flavor: "alpine" + # - flavor: "opensuse" + # - flavor: "ubuntu" + # steps: + # - uses: actions/checkout@v2 + # - name: Download artifacts + # uses: actions/download-artifact@v2 + # with: + # name: latest-release.zip + # - name: Release space from worker + # run: | + # echo "Listing top largest packages" + # pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) + # head -n 30 <<< "${pkgs}" + # echo + # df -h + # echo + # sudo apt-get remove -y '^llvm-.*|^libllvm.*' || true + # sudo apt-get remove --auto-remove android-sdk-platform-tools || true + # sudo apt-get purge --auto-remove android-sdk-platform-tools || true + # sudo rm -rf /usr/local/lib/android + # sudo apt-get remove -y '^dotnet-.*|^aspnetcore-.*' || true + # sudo rm -rf /usr/share/dotnet + # sudo apt-get remove -y '^mono-.*' || true + # sudo apt-get remove -y '^ghc-.*' || true + # sudo apt-get remove -y '.*jdk.*|.*jre.*' || true + # sudo apt-get remove -y 'php.*' || true + # sudo apt-get remove -y hhvm powershell firefox monodoc-manual msbuild || true + # sudo apt-get remove -y '^google-.*' || true + # sudo apt-get remove -y azure-cli || true + # sudo apt-get remove -y '^mongo.*-.*|^postgresql-.*|^mysql-.*|^mssql-.*' || true + # sudo apt-get remove -y '^gfortran-.*' || true + # sudo apt-get autoremove -y + # sudo apt-get clean + # echo + # echo "Listing top largest packages" + # pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) + # head -n 30 <<< "${pkgs}" + # echo + # sudo rm -rfv build || true + # df -h + # - run: | + # ls -liah + # export ISO=$PWD/$(ls kairos-${{matrix.flavor}}-*.iso) + # sudo mkdir build + # sudo mv $ISO build/ + # ./earthly.sh +run-qemu-test --FLAVOR=${{ matrix.flavor }} --CONTAINER_IMAGE=ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}:8h --TEST_SUITE=upgrade-latest-with-cli + # - uses: actions/upload-artifact@v2 + # if: failure() + # with: + # name: ${{ matrix.flavor }}-upgrade-test.logs.zip + # path: tests/**/logs/* + # if-no-files-found: warn diff --git a/Earthfile b/Earthfile index e3b297abf..4d251ce2b 100644 --- a/Earthfile +++ b/Earthfile @@ -453,6 +453,20 @@ run-qemu-test: RUN PATH=$PATH:$GOPATH/bin ginkgo --label-filter "$TEST_SUITE" --fail-fast -r ./tests/ +### +### Artifacts targets +### + +## Gets the latest release artifacts for a given release +pull-release: + FROM alpine + RUN apk add curl wget + RUN curl -s https://api.github.com/repos/kairos-io/kairos/releases/latest | grep "browser_download_url.*${FLAVOR}.*iso" | cut -d : -f 2,3 | tr -d \" | wget -i - + RUN mkdir build + RUN mv *.iso build/ + SAVE ARTIFACT build AS LOCAL build + +## Pull build artifacts from BUNDLE_IMAGE (expected arg) pull-build-artifacts: ARG OSBUILDER_IMAGE FROM $OSBUILDER_IMAGE @@ -466,6 +480,7 @@ pull-build-artifacts: RUN luet util unpack $BUNDLE_IMAGE build SAVE ARTIFACT build AS LOCAL build +## Push build artifacts as BUNDLE_IMAGE (expected arg, common is to use ttl.sh/$(uuidgen):8h) push-build-artifacts: ARG OSBUILDER_IMAGE FROM $OSBUILDER_IMAGE From d800f68a9e1bdacb7042db1ec52c6ce7d99a2fc9 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 4 Oct 2022 08:43:50 +0000 Subject: [PATCH 5/9] :robot: Extend wait time --- tests/upgrade_latest_cli_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/upgrade_latest_cli_test.go b/tests/upgrade_latest_cli_test.go index 5cf2a14aa..2bf472a24 100644 --- a/tests/upgrade_latest_cli_test.go +++ b/tests/upgrade_latest_cli_test.go @@ -87,7 +87,7 @@ var _ = Describe("k3s upgrade manual test", Label("upgrade-latest-with-cli"), fu v, _ = Machine.Command("source /etc/os-release; echo $VERSION") return v // TODO: Add regex semver check here - }, 10*time.Minute, 10*time.Second).ShouldNot(Equal(currentVersion)) + }, 30*time.Minute, 10*time.Second).ShouldNot(Equal(currentVersion)) }) }) }) From 45df6a6fc30630ed21bd94e390501923032f7331 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 4 Oct 2022 12:20:40 +0000 Subject: [PATCH 6/9] :robot: Fail when VM is aborted --- go.mod | 4 ++-- go.sum | 4 ++-- tests/install_test.go | 3 ++- tests/tests_suite_test.go | 10 +++++++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 025775694..c7126f0bf 100644 --- a/go.mod +++ b/go.mod @@ -14,13 +14,14 @@ require ( github.com/joho/godotenv v1.4.0 github.com/mudler/go-nodepair v0.0.0-20220507212557-7d47aa3cc1f1 github.com/mudler/go-pluggable v0.0.0-20220716112424-189d463e3ff3 + github.com/mudler/go-processmanager v0.0.0-20220724164624-c45b5c61312d github.com/mudler/yip v0.0.0-20220725150231-976737b2353c github.com/nxadm/tail v1.4.8 github.com/onsi/ginkgo/v2 v2.1.4 github.com/onsi/gomega v1.20.0 github.com/pterm/pterm v0.12.41 github.com/qeesung/image2ascii v1.0.1 - github.com/spectrocloud/peg v0.0.0-20220928170937-6323fd1d63c4 + github.com/spectrocloud/peg v0.0.0-20221004124828-dc401eb8ddad github.com/twpayne/go-vfs v1.7.2 github.com/urfave/cli v1.22.9 golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b @@ -67,7 +68,6 @@ require ( github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mudler/go-processmanager v0.0.0-20220724164624-c45b5c61312d // indirect github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect github.com/muesli/reflow v0.3.0 // indirect github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 // indirect diff --git a/go.sum b/go.sum index 26b33048f..e0854b957 100644 --- a/go.sum +++ b/go.sum @@ -479,8 +479,8 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9 github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spectrocloud/peg v0.0.0-20220928170937-6323fd1d63c4 h1:HTGwJxg40ELjvAlK86tkAh+kY7PTpPa3iFtN/0ZTjKI= -github.com/spectrocloud/peg v0.0.0-20220928170937-6323fd1d63c4/go.mod h1:H0Vd1P9FdZfrv1QIiQetY4ckDpiD9R71OcUyuvJadno= +github.com/spectrocloud/peg v0.0.0-20221004124828-dc401eb8ddad h1:vb+7fDjQ8GF5QpvL4JUcoN6B7KuyW8V0HjNKBkYOMk8= +github.com/spectrocloud/peg v0.0.0-20221004124828-dc401eb8ddad/go.mod h1:H0Vd1P9FdZfrv1QIiQetY4ckDpiD9R71OcUyuvJadno= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= diff --git a/tests/install_test.go b/tests/install_test.go index 2c91a5e92..9779b9dca 100644 --- a/tests/install_test.go +++ b/tests/install_test.go @@ -1,6 +1,7 @@ package mos_test import ( + "context" "fmt" "io/ioutil" "os" @@ -21,7 +22,7 @@ var _ = Describe("kairos install test", Label("install-test"), func() { AfterEach(func() { Machine.Clean() - Machine.Create() + Machine.Create(context.Background()) EventuallyConnects(720) }) diff --git a/tests/tests_suite_test.go b/tests/tests_suite_test.go index c7543d252..a80b1ec96 100644 --- a/tests/tests_suite_test.go +++ b/tests/tests_suite_test.go @@ -1,11 +1,13 @@ package mos_test import ( + "context" "fmt" "io/ioutil" "os" "testing" + process "github.com/mudler/go-processmanager" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/spectrocloud/peg/matcher" @@ -88,6 +90,12 @@ var _ = BeforeSuite(func() { types.WithID(machineID), types.WithSSHUser(user()), types.WithSSHPass(pass()), + types.OnFailure(func(p *process.Process) { + out, _ := ioutil.ReadFile(p.StdoutPath()) + err, _ := ioutil.ReadFile(p.StderrPath()) + status, _ := p.ExitCode() + Fail(fmt.Sprintf("VM Aborted: %s %s Exit status: %s", out, err, status)) + }), types.WithCPU("3"), types.WithMemory("6000"), types.WithStateDir(t), @@ -107,7 +115,7 @@ var _ = BeforeSuite(func() { Machine = m - if err := Machine.Create(); err != nil { + if err := Machine.Create(context.Background()); err != nil { Fail(err.Error()) } } From 3f968a802db98f6860864715c9ba726a8e454157 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 4 Oct 2022 14:12:02 +0000 Subject: [PATCH 7/9] :robot: Enlart waiting time window --- tests/autoinstall_test.go | 2 +- tests/bundles_test.go | 2 +- tests/install_test.go | 6 +++--- tests/reset_test.go | 2 +- tests/tests_suite_test.go | 4 ++-- tests/upgrade_cli_test.go | 2 +- tests/upgrade_latest_cli_test.go | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/autoinstall_test.go b/tests/autoinstall_test.go index ffa0a9a62..2cc4d3de9 100644 --- a/tests/autoinstall_test.go +++ b/tests/autoinstall_test.go @@ -17,7 +17,7 @@ var _ = Describe("kairos autoinstall test", Label("autoinstall-test"), func() { Fail("CLOUD_INIT must be set and must be pointing to a file as an absolute path") } - EventuallyConnects(720) + EventuallyConnects(1200) }) AfterEach(func() { diff --git a/tests/bundles_test.go b/tests/bundles_test.go index 1c6e8705d..022fed252 100644 --- a/tests/bundles_test.go +++ b/tests/bundles_test.go @@ -17,7 +17,7 @@ var _ = Describe("kairos bundles test", Label("bundles-test"), func() { Fail("CLOUD_INIT must be set and must be pointing to a file as an absolute path") } - EventuallyConnects(720) + EventuallyConnects(1200) }) AfterEach(func() { diff --git a/tests/install_test.go b/tests/install_test.go index 9779b9dca..c522dc0cf 100644 --- a/tests/install_test.go +++ b/tests/install_test.go @@ -17,13 +17,13 @@ import ( var _ = Describe("kairos install test", Label("install-test"), func() { BeforeEach(func() { - EventuallyConnects(720) + EventuallyConnects(1200) }) AfterEach(func() { Machine.Clean() Machine.Create(context.Background()) - EventuallyConnects(720) + EventuallyConnects(1200) }) testInstall := func(cloudConfig string, actual interface{}, m types.GomegaMatcher) { @@ -49,7 +49,7 @@ var _ = Describe("kairos install test", Label("install-test"), func() { detachAndReboot() - EventuallyConnects(720) + EventuallyConnects(1200) Eventually(actual, 5*time.Minute, 10*time.Second).Should(m) } diff --git a/tests/reset_test.go b/tests/reset_test.go index 3a7fa640c..e697d5414 100644 --- a/tests/reset_test.go +++ b/tests/reset_test.go @@ -17,7 +17,7 @@ var _ = Describe("kairos reset test", Label("reset-test"), func() { Fail("CLOUD_INIT must be set and must be pointing to a file as an absolute path") } - EventuallyConnects(720) + EventuallyConnects(1200) }) Context("live cd", func() { diff --git a/tests/tests_suite_test.go b/tests/tests_suite_test.go index a80b1ec96..7b3c2a2cb 100644 --- a/tests/tests_suite_test.go +++ b/tests/tests_suite_test.go @@ -96,8 +96,8 @@ var _ = BeforeSuite(func() { status, _ := p.ExitCode() Fail(fmt.Sprintf("VM Aborted: %s %s Exit status: %s", out, err, status)) }), - types.WithCPU("3"), - types.WithMemory("6000"), + types.WithCPU("4"), + types.WithMemory("6000M"), types.WithStateDir(t), types.WithDataSource(os.Getenv("DATASOURCE")), } diff --git a/tests/upgrade_cli_test.go b/tests/upgrade_cli_test.go index 729384ae1..0c239be4b 100644 --- a/tests/upgrade_cli_test.go +++ b/tests/upgrade_cli_test.go @@ -15,7 +15,7 @@ var _ = Describe("k3s upgrade manual test", Label("upgrade-with-cli"), func() { containerImage := os.Getenv("CONTAINER_IMAGE") BeforeEach(func() { - EventuallyConnects(720) + EventuallyConnects(1200) }) Context("live cd", func() { diff --git a/tests/upgrade_latest_cli_test.go b/tests/upgrade_latest_cli_test.go index 2bf472a24..6f605515f 100644 --- a/tests/upgrade_latest_cli_test.go +++ b/tests/upgrade_latest_cli_test.go @@ -15,7 +15,7 @@ var _ = Describe("k3s upgrade manual test", Label("upgrade-latest-with-cli"), fu containerImage := os.Getenv("CONTAINER_IMAGE") BeforeEach(func() { - EventuallyConnects(720) + EventuallyConnects(1200) }) Context("live cd", func() { From 6ebe70414bde520481bcbf8eef555e7a51488b5f Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 4 Oct 2022 15:04:53 +0000 Subject: [PATCH 8/9] :robot: Do not set VM specs --- tests/tests_suite_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/tests_suite_test.go b/tests/tests_suite_test.go index 7b3c2a2cb..daa77ee56 100644 --- a/tests/tests_suite_test.go +++ b/tests/tests_suite_test.go @@ -96,8 +96,6 @@ var _ = BeforeSuite(func() { status, _ := p.ExitCode() Fail(fmt.Sprintf("VM Aborted: %s %s Exit status: %s", out, err, status)) }), - types.WithCPU("4"), - types.WithMemory("6000M"), types.WithStateDir(t), types.WithDataSource(os.Getenv("DATASOURCE")), } From b9aec598b5c35f786c452826bca5fc2bf8ee27d6 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 4 Oct 2022 16:37:38 +0000 Subject: [PATCH 9/9] :robot: Shift just some of the tests --- .circleci/config.yml | 117 +++--------- .github/workflows/image.yaml | 344 +++++++++++++++++------------------ 2 files changed, 193 insertions(+), 268 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ae5f51c0e..8fc7d99f2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -242,28 +242,28 @@ workflows: image: ["quay.io/kairos/framework"] flavor: ["opensuse"] release: ["no"] - - run-datasource-test: - matrix: - parameters: - cloud_config: ["autoinstall"] - flavor: ["alpine","opensuse","ubuntu"] - test_suite: ["reset-test", "autoinstall-test"] - requires: - - build-iso - - run-latest-test: - matrix: - parameters: - flavor: ["alpine","opensuse","ubuntu"] - test_suite: ["upgrade-latest-with-cli"] - requires: - - build-iso - - run-test: - matrix: - parameters: - flavor: ["alpine","opensuse","ubuntu"] - test_suite: ["upgrade-with-cli"] - requires: - - build-iso + # - run-datasource-test: + # matrix: + # parameters: + # cloud_config: ["autoinstall"] + # flavor: ["alpine","opensuse","ubuntu"] + # test_suite: ["reset-test", "autoinstall-test"] + # requires: + # - build-iso + # - run-latest-test: + # matrix: + # parameters: + # flavor: ["alpine","opensuse","ubuntu"] + # test_suite: ["upgrade-latest-with-cli"] + # requires: + # - build-iso + # - run-test: + # matrix: + # parameters: + # flavor: ["alpine","opensuse","ubuntu"] + # test_suite: ["upgrade-with-cli"] + # requires: + # - build-iso - run-bundles-test: matrix: parameters: @@ -283,77 +283,4 @@ workflows: jobs: - unit-test - build-bin - # - build-iso: - # matrix: - # parameters: - # image: [quay.io/kairos/core] - # flavor: ["alpine","opensuse","ubuntu"] - # release: ["no"] - # - build-framework: - # matrix: - # parameters: - # image: [quay.io/kairos/framework] - # flavor: ["opensuse"] - # release: ["no"] - # - build-arm: - # matrix: - # parameters: - # image: [quay.io/kairos/core] - # flavor: ["opensuse-arm-rpi", "alpine-arm-rpi"] - # model: ["rpi64"] - # release: ["no"] - # release: - # jobs: - # - lint: - # filters: - # branches: - # ignore: /.*/ - # tags: - # only: /^v.*/ - # - unit-test: - # filters: - # branches: - # ignore: /.*/ - # tags: - # only: /^v.*/ - # - build-bin: - # filters: - # branches: - # ignore: /.*/ - # tags: - # only: /^v.*/ - # - build-iso: - # matrix: - # parameters: - # image: [quay.io/kairos/core] - # flavor: ["alpine","opensuse","ubuntu"] - # release: ["yes"] - # filters: - # branches: - # ignore: /.*/ - # tags: - # only: /^v.*/ - # - build-framework: - # matrix: - # parameters: - # image: [quay.io/kairos/framework] - # flavor: ["opensuse"] - # release: ["yes"] - # filters: - # branches: - # ignore: /.*/ - # tags: - # only: /^v.*/ - # - build-arm: - # matrix: - # parameters: - # image: [quay.io/kairos/core] - # flavor: ["opensuse-arm-rpi", "alpine-arm-rpi"] - # model: ["rpi64"] - # release: ["yes"] - # filters: - # branches: - # ignore: /.*/ - # tags: - # only: /^v.*/ diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index c423a544e..2ec667181 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -127,8 +127,6 @@ jobs: path: tests/**/logs/* if-no-files-found: warn - - latest-release: runs-on: ubuntu-latest steps: @@ -146,30 +144,30 @@ jobs: path: last-release if-no-files-found: error - # qemu-autoinstall-tests: - # needs: - # - build - # runs-on: ubuntu-latest - # strategy: - # fail-fast: false - # matrix: - # include: - # - flavor: "alpine" - # - flavor: "opensuse" - # - flavor: "ubuntu" - # steps: - # - uses: actions/checkout@v2 - # - name: Download artifacts - # uses: actions/download-artifact@v2 - # with: - # name: kairos-${{ matrix.flavor }}.iso.zip - # - run: | - # ls -liah - # export ISO=$PWD/$(ls *.iso) - # mkdir build - # mv $ISO build/kairos.iso - # ./earthly.sh +datasource-iso --CLOUD_CONFIG=tests/assets/autoinstall.yaml - # ./earthly.sh +run-qemu-datasource-tests --FLAVOR=${{ matrix.flavor }} + qemu-autoinstall-tests: + needs: + - build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - flavor: "alpine" + - flavor: "opensuse" + - flavor: "ubuntu" + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: kairos-${{ matrix.flavor }}.iso.zip + - run: | + ls -liah + export ISO=$PWD/$(ls *.iso) + mkdir build + mv $ISO build/kairos.iso + ./earthly.sh +datasource-iso --CLOUD_CONFIG=tests/assets/autoinstall.yaml + ./earthly.sh +run-qemu-datasource-tests --FLAVOR=${{ matrix.flavor }} # qemu-bundles-tests: # needs: @@ -194,153 +192,153 @@ jobs: # ./earthly.sh +prepare-bundles-tests # ./earthly.sh +run-qemu-bundles-tests --FLAVOR=${{ matrix.flavor }} - # qemu-reset-tests: - # needs: - # - build - # runs-on: ubuntu-latest - # strategy: - # fail-fast: false - # matrix: - # include: - # - flavor: "alpine" - # - flavor: "opensuse" - # - flavor: "ubuntu" - # steps: - # - uses: actions/checkout@v2 - # - name: Download artifacts - # uses: actions/download-artifact@v2 - # with: - # name: kairos-${{ matrix.flavor }}.iso.zip - # - run: | - # ls -liah - # export ISO=$PWD/$(ls *.iso) - # mkdir build - # mv $ISO build/kairos.iso - # ./earthly.sh +datasource-iso --CLOUD_CONFIG=tests/assets/autoinstall.yaml - # ./earthly.sh +run-qemu-datasource-tests --TEST_SUITE=reset-test --FLAVOR=${{ matrix.flavor }} + qemu-reset-tests: + needs: + - build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - flavor: "alpine" + - flavor: "opensuse" + - flavor: "ubuntu" + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: kairos-${{ matrix.flavor }}.iso.zip + - run: | + ls -liah + export ISO=$PWD/$(ls *.iso) + mkdir build + mv $ISO build/kairos.iso + ./earthly.sh +datasource-iso --CLOUD_CONFIG=tests/assets/autoinstall.yaml + ./earthly.sh +run-qemu-datasource-tests --TEST_SUITE=reset-test --FLAVOR=${{ matrix.flavor }} - # upgrade-with-cli-test: - # needs: - # - build - # runs-on: ubuntu-latest - # strategy: - # fail-fast: false - # matrix: - # include: - # - flavor: "alpine" - # - flavor: "opensuse" - # - flavor: "ubuntu" - # steps: - # - uses: actions/checkout@v2 - # - name: Download artifacts - # uses: actions/download-artifact@v2 - # with: - # name: kairos-${{ matrix.flavor }}.iso.zip - # - name: Release space from worker - # run: | - # echo "Listing top largest packages" - # pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) - # head -n 30 <<< "${pkgs}" - # echo - # df -h - # echo - # sudo apt-get remove -y '^llvm-.*|^libllvm.*' || true - # sudo apt-get remove --auto-remove android-sdk-platform-tools || true - # sudo apt-get purge --auto-remove android-sdk-platform-tools || true - # sudo rm -rf /usr/local/lib/android - # sudo apt-get remove -y '^dotnet-.*|^aspnetcore-.*' || true - # sudo rm -rf /usr/share/dotnet - # sudo apt-get remove -y '^mono-.*' || true - # sudo apt-get remove -y '^ghc-.*' || true - # sudo apt-get remove -y '.*jdk.*|.*jre.*' || true - # sudo apt-get remove -y 'php.*' || true - # sudo apt-get remove -y hhvm powershell firefox monodoc-manual msbuild || true - # sudo apt-get remove -y '^google-.*' || true - # sudo apt-get remove -y azure-cli || true - # sudo apt-get remove -y '^mongo.*-.*|^postgresql-.*|^mysql-.*|^mssql-.*' || true - # sudo apt-get remove -y '^gfortran-.*' || true - # sudo apt-get autoremove -y - # sudo apt-get clean - # echo - # echo "Listing top largest packages" - # pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) - # head -n 30 <<< "${pkgs}" - # echo - # sudo rm -rfv build || true - # df -h - # - run: | - # ls -liah - # export ISO=$PWD/$(ls *.iso) - # sudo mkdir build - # sudo mv $ISO build/ - # ./earthly.sh +run-qemu-test --FLAVOR=${{ matrix.flavor }} --CONTAINER_IMAGE=ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}:8h --TEST_SUITE=upgrade-with-cli - # - uses: actions/upload-artifact@v2 - # if: failure() - # with: - # name: ${{ matrix.flavor }}-upgrade-test.logs.zip - # path: tests/**/logs/* - # if-no-files-found: warn + upgrade-with-cli-test: + needs: + - build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - flavor: "alpine" + - flavor: "opensuse" + - flavor: "ubuntu" + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: kairos-${{ matrix.flavor }}.iso.zip + - name: Release space from worker + run: | + echo "Listing top largest packages" + pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) + head -n 30 <<< "${pkgs}" + echo + df -h + echo + sudo apt-get remove -y '^llvm-.*|^libllvm.*' || true + sudo apt-get remove --auto-remove android-sdk-platform-tools || true + sudo apt-get purge --auto-remove android-sdk-platform-tools || true + sudo rm -rf /usr/local/lib/android + sudo apt-get remove -y '^dotnet-.*|^aspnetcore-.*' || true + sudo rm -rf /usr/share/dotnet + sudo apt-get remove -y '^mono-.*' || true + sudo apt-get remove -y '^ghc-.*' || true + sudo apt-get remove -y '.*jdk.*|.*jre.*' || true + sudo apt-get remove -y 'php.*' || true + sudo apt-get remove -y hhvm powershell firefox monodoc-manual msbuild || true + sudo apt-get remove -y '^google-.*' || true + sudo apt-get remove -y azure-cli || true + sudo apt-get remove -y '^mongo.*-.*|^postgresql-.*|^mysql-.*|^mssql-.*' || true + sudo apt-get remove -y '^gfortran-.*' || true + sudo apt-get autoremove -y + sudo apt-get clean + echo + echo "Listing top largest packages" + pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) + head -n 30 <<< "${pkgs}" + echo + sudo rm -rfv build || true + df -h + - run: | + ls -liah + export ISO=$PWD/$(ls *.iso) + sudo mkdir build + sudo mv $ISO build/ + ./earthly.sh +run-qemu-test --FLAVOR=${{ matrix.flavor }} --CONTAINER_IMAGE=ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}:8h --TEST_SUITE=upgrade-with-cli + - uses: actions/upload-artifact@v2 + if: failure() + with: + name: ${{ matrix.flavor }}-upgrade-test.logs.zip + path: tests/**/logs/* + if-no-files-found: warn - # upgrade-latest-with-cli-test: - # needs: - # - build - # - latest-release - # runs-on: ubuntu-latest - # strategy: - # fail-fast: false - # matrix: - # include: - # - flavor: "alpine" - # - flavor: "opensuse" - # - flavor: "ubuntu" - # steps: - # - uses: actions/checkout@v2 - # - name: Download artifacts - # uses: actions/download-artifact@v2 - # with: - # name: latest-release.zip - # - name: Release space from worker - # run: | - # echo "Listing top largest packages" - # pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) - # head -n 30 <<< "${pkgs}" - # echo - # df -h - # echo - # sudo apt-get remove -y '^llvm-.*|^libllvm.*' || true - # sudo apt-get remove --auto-remove android-sdk-platform-tools || true - # sudo apt-get purge --auto-remove android-sdk-platform-tools || true - # sudo rm -rf /usr/local/lib/android - # sudo apt-get remove -y '^dotnet-.*|^aspnetcore-.*' || true - # sudo rm -rf /usr/share/dotnet - # sudo apt-get remove -y '^mono-.*' || true - # sudo apt-get remove -y '^ghc-.*' || true - # sudo apt-get remove -y '.*jdk.*|.*jre.*' || true - # sudo apt-get remove -y 'php.*' || true - # sudo apt-get remove -y hhvm powershell firefox monodoc-manual msbuild || true - # sudo apt-get remove -y '^google-.*' || true - # sudo apt-get remove -y azure-cli || true - # sudo apt-get remove -y '^mongo.*-.*|^postgresql-.*|^mysql-.*|^mssql-.*' || true - # sudo apt-get remove -y '^gfortran-.*' || true - # sudo apt-get autoremove -y - # sudo apt-get clean - # echo - # echo "Listing top largest packages" - # pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) - # head -n 30 <<< "${pkgs}" - # echo - # sudo rm -rfv build || true - # df -h - # - run: | - # ls -liah - # export ISO=$PWD/$(ls kairos-${{matrix.flavor}}-*.iso) - # sudo mkdir build - # sudo mv $ISO build/ - # ./earthly.sh +run-qemu-test --FLAVOR=${{ matrix.flavor }} --CONTAINER_IMAGE=ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}:8h --TEST_SUITE=upgrade-latest-with-cli - # - uses: actions/upload-artifact@v2 - # if: failure() - # with: - # name: ${{ matrix.flavor }}-upgrade-test.logs.zip - # path: tests/**/logs/* - # if-no-files-found: warn + upgrade-latest-with-cli-test: + needs: + - build + - latest-release + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - flavor: "alpine" + - flavor: "opensuse" + - flavor: "ubuntu" + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: latest-release.zip + - name: Release space from worker + run: | + echo "Listing top largest packages" + pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) + head -n 30 <<< "${pkgs}" + echo + df -h + echo + sudo apt-get remove -y '^llvm-.*|^libllvm.*' || true + sudo apt-get remove --auto-remove android-sdk-platform-tools || true + sudo apt-get purge --auto-remove android-sdk-platform-tools || true + sudo rm -rf /usr/local/lib/android + sudo apt-get remove -y '^dotnet-.*|^aspnetcore-.*' || true + sudo rm -rf /usr/share/dotnet + sudo apt-get remove -y '^mono-.*' || true + sudo apt-get remove -y '^ghc-.*' || true + sudo apt-get remove -y '.*jdk.*|.*jre.*' || true + sudo apt-get remove -y 'php.*' || true + sudo apt-get remove -y hhvm powershell firefox monodoc-manual msbuild || true + sudo apt-get remove -y '^google-.*' || true + sudo apt-get remove -y azure-cli || true + sudo apt-get remove -y '^mongo.*-.*|^postgresql-.*|^mysql-.*|^mssql-.*' || true + sudo apt-get remove -y '^gfortran-.*' || true + sudo apt-get autoremove -y + sudo apt-get clean + echo + echo "Listing top largest packages" + pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) + head -n 30 <<< "${pkgs}" + echo + sudo rm -rfv build || true + df -h + - run: | + ls -liah + export ISO=$PWD/$(ls kairos-${{matrix.flavor}}-*.iso) + sudo mkdir build + sudo mv $ISO build/ + ./earthly.sh +run-qemu-test --FLAVOR=${{ matrix.flavor }} --CONTAINER_IMAGE=ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}:8h --TEST_SUITE=upgrade-latest-with-cli + - uses: actions/upload-artifact@v2 + if: failure() + with: + name: ${{ matrix.flavor }}-upgrade-test.logs.zip + path: tests/**/logs/* + if-no-files-found: warn