From 335507f67780ca69c7a701b058ed9ec86f6378cd Mon Sep 17 00:00:00 2001 From: Amulyam24 Date: Fri, 24 Nov 2023 11:57:11 +0530 Subject: [PATCH] workflow --- .../build-kata-static-tarball-ppc64le.yaml | 16 ++---- .github/workflows/ci.yaml | 28 ++++++++++ .github/workflows/payload-after-push.yaml | 7 +++ .../publish-kata-deploy-payload-ppc64le.yaml | 6 --- .github/workflows/release-ppc64le.yaml | 2 +- .../run-cri-containerd-tests-ppc64le.yaml | 54 +++++++++++++++++++ tests/integration/cri-containerd/gha-run.sh | 2 +- .../cri-containerd/integration-tests.sh | 6 ++- .../kata-deploy-binaries-in-docker.sh | 2 +- tools/packaging/static-build/qemu.blacklist | 1 - .../packaging/static-build/qemu/build-qemu.sh | 4 +- tools/packaging/static-build/shim-v2/build.sh | 7 +-- 12 files changed, 105 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/run-cri-containerd-tests-ppc64le.yaml diff --git a/.github/workflows/build-kata-static-tarball-ppc64le.yaml b/.github/workflows/build-kata-static-tarball-ppc64le.yaml index 0de2665dc974..f5075f682f32 100644 --- a/.github/workflows/build-kata-static-tarball-ppc64le.yaml +++ b/.github/workflows/build-kata-static-tarball-ppc64le.yaml @@ -23,7 +23,7 @@ on: jobs: build-asset: - runs-on: ppc64le + runs-on: ppc strategy: matrix: asset: @@ -39,6 +39,9 @@ jobs: run: | sudo chown -R $USER:$USER $GITHUB_WORKSPACE + - name: Prepare runner + run: ${HOME}/scripts/runner.sh + - name: Login to Kata Containers quay.io if: ${{ inputs.push-to-registry == 'yes' }} uses: docker/login-action@v2 @@ -52,12 +55,6 @@ jobs: ref: ${{ inputs.commit-hash }} fetch-depth: 0 # This is needed in order to keep the commit ids history - # - name: Rebase atop of the latest target branch - # run: | - # ./tests/git-helper.sh "rebase-atop-of-the-latest-target-branch" - # env: - # TARGET_BRANCH: ${{ inputs.target-branch }} - - name: Build ${{ matrix.asset }} run: | make "${KATA_ASSET}-tarball" @@ -94,11 +91,6 @@ jobs: with: ref: ${{ inputs.commit-hash }} fetch-depth: 0 - # - name: Rebase atop of the latest target branch - # run: | - # ./tests/git-helper.sh "rebase-atop-of-the-latest-target-branch" - # env: - # TARGET_BRANCH: ${{ inputs.target-branch }} - name: get-artifacts uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8cb8c71199b9..ca016a79cd4d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,6 +43,14 @@ jobs: commit-hash: ${{ inputs.commit-hash }} target-branch: ${{ inputs.target-branch }} + build-kata-static-tarball-ppc64le: + uses: ./.github/workflows/build-kata-static-tarball-ppc64le.yaml + with: + tarball-suffix: -${{ inputs.tag }} + commit-hash: ${{ inputs.commit-hash }} + target-branch: ${{ inputs.target-branch }} + + publish-kata-deploy-payload-s390x: needs: build-kata-static-tarball-s390x uses: ./.github/workflows/publish-kata-deploy-payload-s390x.yaml @@ -55,6 +63,18 @@ jobs: target-branch: ${{ inputs.target-branch }} secrets: inherit + publish-kata-deploy-payload-ppc64le: + needs: build-kata-static-tarball-ppc64le + uses: ./.github/workflows/publish-kata-deploy-payload-ppc64le.yaml + with: + tarball-suffix: -${{ inputs.tag }} + registry: ghcr.io + repo: ${{ github.repository_owner }}/kata-deploy-ci + tag: ${{ inputs.tag }}-ppc64le + commit-hash: ${{ inputs.commit-hash }} + target-branch: ${{ inputs.target-branch }} + secrets: inherit + build-and-publish-tee-confidential-unencrypted-image: runs-on: ubuntu-latest steps: @@ -205,3 +225,11 @@ jobs: tarball-suffix: -${{ inputs.tag }} commit-hash: ${{ inputs.commit-hash }} target-branch: ${{ inputs.target-branch }} + + run-cri-containerd-tests-ppc64le: + needs: build-kata-static-tarball-ppc64le + uses: ./.github/workflows/run-cri-containerd-tests-ppc64le.yaml + with: + tarball-suffix: -${{ inputs.tag }} + commit-hash: ${{ inputs.commit-hash }} + target-branch: ${{ inputs.target-branch }} diff --git a/.github/workflows/payload-after-push.yaml b/.github/workflows/payload-after-push.yaml index d04b6b317ce3..6350de5dde9e 100644 --- a/.github/workflows/payload-after-push.yaml +++ b/.github/workflows/payload-after-push.yaml @@ -43,6 +43,13 @@ jobs: target-branch: ${{ github.ref_name }} secrets: inherit + run-cri-containerd-tests-ppc64le: + needs: build-assets-ppc64le + uses: ./.github/workflows/run-cri-containerd-tests-ppc64le.yaml + with: + commit-hash: ${{ github.event.pull_request.head.sha }} + target-branch: ${{ github.event.pull_request.base.ref }} + publish-kata-deploy-payload-amd64: needs: build-assets-amd64 uses: ./.github/workflows/publish-kata-deploy-payload-amd64.yaml diff --git a/.github/workflows/publish-kata-deploy-payload-ppc64le.yaml b/.github/workflows/publish-kata-deploy-payload-ppc64le.yaml index 555f70145c69..5fa7b4aa01a0 100644 --- a/.github/workflows/publish-kata-deploy-payload-ppc64le.yaml +++ b/.github/workflows/publish-kata-deploy-payload-ppc64le.yaml @@ -35,12 +35,6 @@ jobs: ref: ${{ inputs.commit-hash }} fetch-depth: 0 - # - name: Rebase atop of the latest target branch - # run: | - # ./tests/git-helper.sh "rebase-atop-of-the-latest-target-branch" - # env: - # TARGET_BRANCH: ${{ inputs.target-branch }} - - name: get-kata-tarball uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/release-ppc64le.yaml b/.github/workflows/release-ppc64le.yaml index c0476178230d..3081da9c3d9c 100644 --- a/.github/workflows/release-ppc64le.yaml +++ b/.github/workflows/release-ppc64le.yaml @@ -14,7 +14,7 @@ jobs: kata-deploy: needs: build-kata-static-tarball-ppc64le - runs-on: ppc64le + runs-on: ppc steps: - name: Login to Kata Containers docker.io uses: docker/login-action@v2 diff --git a/.github/workflows/run-cri-containerd-tests-ppc64le.yaml b/.github/workflows/run-cri-containerd-tests-ppc64le.yaml new file mode 100644 index 000000000000..67b13280967c --- /dev/null +++ b/.github/workflows/run-cri-containerd-tests-ppc64le.yaml @@ -0,0 +1,54 @@ +name: CI | Run cri-containerd tests on ppc64le +on: + workflow_call: + inputs: + tarball-suffix: + required: false + type: string + commit-hash: + required: false + type: string + target-branch: + required: false + type: string + default: "" + +jobs: + run-cri-containerd: + strategy: + # We can set this to true whenever we're 100% sure that + # the all the tests are not flaky, otherwise we'll fail + # all the tests due to a single flaky instance + fail-fast: false + matrix: + containerd_version: ['active'] + vmm: ['qemu'] + runs-on: ppc + env: + CONTAINERD_VERSION: ${{ matrix.containerd_version }} + GOPATH: ${{ github.workspace }} + KATA_HYPERVISOR: ${{ matrix.vmm }} + steps: + - name: Adjust a permission for repo + run: | + sudo chown -R $USER:$USER $GITHUB_WORKSPACE + - uses: actions/checkout@v3 + with: + ref: ${{ inputs.commit-hash }} + fetch-depth: 0 + + - name: Install dependencies + run: bash tests/integration/cri-containerd/gha-run.sh install-dependencies + + - name: get-kata-tarball + uses: actions/download-artifact@v3 + with: + name: kata-static-tarball-ppc64le${{ inputs.tarball-suffix }} + path: kata-artifacts + + - name: Install kata + run: bash tests/integration/cri-containerd/gha-run.sh install-kata kata-artifacts + + - name: Run cri-containerd tests + run: bash tests/integration/cri-containerd/gha-run.sh run + diff --git a/tests/integration/cri-containerd/gha-run.sh b/tests/integration/cri-containerd/gha-run.sh index 542964423837..6181deede7f0 100755 --- a/tests/integration/cri-containerd/gha-run.sh +++ b/tests/integration/cri-containerd/gha-run.sh @@ -35,7 +35,7 @@ function install_dependencies() { sudo apt-get -y install "${system_deps[@]}" ensure_yq - ${repo_root_dir}/tests/install_go.sh -p + ${repo_root_dir}/tests/install_go.sh -p -f # Dependency list of projects that we can install them # directly from their releases on GitHub: diff --git a/tests/integration/cri-containerd/integration-tests.sh b/tests/integration/cri-containerd/integration-tests.sh index 58d28dcb71f3..147a717ac430 100755 --- a/tests/integration/cri-containerd/integration-tests.sh +++ b/tests/integration/cri-containerd/integration-tests.sh @@ -630,8 +630,10 @@ function main() { TestContainerMemoryUpdate 0 fi - TestKilledVmmCleanup - TestDeviceCgroup + if [[ "${ARCH}" != "ppc64le" ]]; then + TestKilledVmmCleanup + TestDeviceCgroup + fi popd } diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh index 1af3fc62eee8..19653720ea69 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh @@ -124,7 +124,7 @@ docker run \ --env ARCH="${ARCH}" \ --rm \ -w ${script_dir} \ - build-kata-deploy bash -x "${kata_deploy_create}" $@ + build-kata-deploy "${kata_deploy_create}" $@ if [ $remove_dot_docker_dir == true ]; then rm -rf "$HOME/.docker" diff --git a/tools/packaging/static-build/qemu.blacklist b/tools/packaging/static-build/qemu.blacklist index 31f6ab23ce52..c5362686e56c 100644 --- a/tools/packaging/static-build/qemu.blacklist +++ b/tools/packaging/static-build/qemu.blacklist @@ -29,7 +29,6 @@ qemu_black_list=( */share/*/qemu_vga.ndrv */share/*/sgabios.bin */share/*/skiboot.lid -*/share/*/slof.bin */share/*/trace-events-all */share/*/u-boot* */share/*/vgabios* diff --git a/tools/packaging/static-build/qemu/build-qemu.sh b/tools/packaging/static-build/qemu/build-qemu.sh index 50a4b4c2f3c0..7c3a42e077c2 100755 --- a/tools/packaging/static-build/qemu/build-qemu.sh +++ b/tools/packaging/static-build/qemu/build-qemu.sh @@ -24,9 +24,7 @@ scripts/git-submodule.sh update meson capstone ${kata_packaging_scripts}/patch_qemu.sh "${QEMU_VERSION_NUM}" "${kata_packaging_dir}/qemu/patches" if [ "$(uname -m)" != "${ARCH}" ] && [ "${ARCH}" == "s390x" ]; then PREFIX="${PREFIX}" ${kata_packaging_scripts}/configure-hypervisor.sh -s "${HYPERVISOR_NAME}" "${ARCH}" | xargs ./configure --with-pkgversion="${PKGVERSION}" --cc=s390x-linux-gnu-gcc --cross-prefix=s390x-linux-gnu- --prefix="${PREFIX}" --target-list=s390x-softmmu -elif [ "${ARCH}" == "ppc64le" ]; then - PREFIX="${PREFIX}" ${kata_packaging_scripts}/configure-hypervisor.sh "${HYPERVISOR_NAME}" "${ARCH}" | xargs ./configure --with-pkgversion="${PKGVERSION}" -else + else PREFIX="${PREFIX}" ${kata_packaging_scripts}/configure-hypervisor.sh -s "${HYPERVISOR_NAME}" "${ARCH}" | xargs ./configure --with-pkgversion="${PKGVERSION}" fi make -j"$(nproc +--ignore 1)" diff --git a/tools/packaging/static-build/shim-v2/build.sh b/tools/packaging/static-build/shim-v2/build.sh index 799a5c9b586e..24695c4f3d89 100755 --- a/tools/packaging/static-build/shim-v2/build.sh +++ b/tools/packaging/static-build/shim-v2/build.sh @@ -12,7 +12,7 @@ script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${script_dir}/../../scripts/lib.sh" -VMM_CONFIGS="qemu" +VMM_CONFIGS="qemu fc" GO_VERSION=${GO_VERSION} RUST_VERSION=${RUST_VERSION} @@ -75,9 +75,10 @@ for vmm in ${VMM_CONFIGS}; do config_file="${DESTDIR}/${PREFIX}/share/defaults/kata-containers/configuration-${vmm}.toml" if [ -f ${config_file} ]; then if [ ${ARCH} == "ppc64le" ]; then - sudo sed -i -e '/^initrd =/d' ${config_file} - else sudo sed -i -e '/^image =/d' ${config_file} + sudo sed -i 's/^# \(initrd =.*\)/\1/g' ${config_file} + else + sudo sed -i -e '/^initrd =/d' ${config_file} fi fi done