diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1ffa99e74a..43666ccd98 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -285,9 +285,6 @@ jobs: scripts/ebuild_logs.tar.xz test: - name: "Run kola tests" needs: packages + name: "Run kola tests" uses: ./.github/workflows/run-kola-tests.yaml - with: - workflow_name_or_id: ${{ github.event.workflow_run.workflow_id }} - workflow_run_id: ${{ github.event.workflow_run.id }} diff --git a/.github/workflows/run-kola-tests.yaml b/.github/workflows/run-kola-tests.yaml index ed39632248..56efbfe3ff 100644 --- a/.github/workflows/run-kola-tests.yaml +++ b/.github/workflows/run-kola-tests.yaml @@ -4,19 +4,19 @@ on: inputs: workflow_name_or_id: type: string - required: true + required: false default: ci.yaml description: | The workflow ID from where we'll download the artifacts to be tested. workflow_run_id: type: string - required: true + required: false description: | The run ID of the workflow specified in workflow_name_or_id jobs: tests: - name: "Build Flatcar packages" + name: "Run Kola tests" runs-on: - self-hosted - debian @@ -34,7 +34,7 @@ jobs: run: | sudo rm /bin/sh sudo ln -s /bin/bash /bin/sh - sudo apt-get install -y ca-certificates curl gnupg lsb-release qemu-system qemu-user-static git bzip2 jq dnsmasq + sudo apt-get install -y ca-certificates curl gnupg lsb-release qemu-system git bzip2 jq dnsmasq sudo systemctl stop dnsmasq sudo systemctl mask dnsmasq @@ -45,13 +45,7 @@ jobs: "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update - sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin - - # Install latest Go - VERSION=$(curl -s -L https://golang.org/dl/?mode=json | jq -r .[0].version) - curl -s -L https://dl.google.com/go/$VERSION.linux-amd64.tar.gz | sudo tar -xz -C /usr/local - sudo ln -s /usr/local/go/bin/go /usr/local/bin/ - sudo ln -s /usr/local/go/bin/gofmt /usr/local/bin/ + sudo apt-get install -y docker-ce docker-ce-cli containerd.io # Set up MASQUERADE. Don't care much to secure it. # This is needed for the VMs kola spins up to have internet access. @@ -60,19 +54,24 @@ jobs: sudo iptables -I FORWARD -o $DEFAULT_ROUTE_DEVICE -j ACCEPT sudo iptables -I FORWARD -i $DEFAULT_ROUTE_DEVICE -j ACCEPT - # Enable IP forward - echo 'net.ipv4.ip_forward=1' | sudo tee /etc/sysctl.d/ip_forward.conf - # Enable unprivileged bpf - echo 'kernel.unprivileged_bpf_disabled=0' | sudo tee /etc/sysctl.d/enable_unprivileged_bpf.conf - sudo sysctl --system - sysctl -p + # ARM64 tests run inside an LXD container instead of an LXD Virtual machine + # There are some limitations in terms of what we can customize. + if [ "${{ matrix.arch }}" == "amd64" ];then + # Enable IP forward + echo 'net.ipv4.ip_forward=1' | sudo tee /etc/sysctl.d/ip_forward.conf - # Enable extra SWAP - sudo fallocate /swap.img -l 8GiB - sudo chmod 600 /swap.img - sudo mkswap /swap.img - sudo swapon /swap.img + # Enable unprivileged bpf + echo 'kernel.unprivileged_bpf_disabled=0' | sudo tee /etc/sysctl.d/enable_unprivileged_bpf.conf + sudo sysctl --system + sysctl -p + + # Enable extra SWAP + sudo fallocate /swap.img -l 8GiB + sudo chmod 600 /swap.img + sudo mkswap /swap.img + sudo swapon /swap.img + fi - uses: actions/checkout@v3 with: @@ -80,12 +79,19 @@ jobs: fetch-depth: 0 submodules: true - - name: Download artifacts - uses: gabriel-samfira/action-download-artifact@v5 + - name: Download artifact + if: ${{ !inputs.workflow_run_id }} + uses: actions/download-artifact@v3 with: - workflow: ${{ github.event.inputs.workflow_name_or_id }} + name: images-${{ matrix.arch }} + + - name: Download artifacts from other workflow + uses: gabriel-samfira/action-download-artifact@v5 + if: ${{ inputs.workflow_run_id }} + with: + workflow: ${{ inputs.workflow_name_or_id }} workflow_conclusion: success - run_id: ${{ github.event.inputs.workflow_run_id }} + run_id: ${{ inputs.workflow_run_id }} name: images-${{ matrix.arch }} - name: Run tests @@ -97,21 +103,33 @@ jobs: # extract the image. IMG_ARCHIVE=$(readlink -f images/**/flatcar_production_image.bin.bz2) + QEMU_UEFI_BIOS_FILE=$(readlink -f images/**/flatcar_production_qemu_uefi_efi_code.fd) bzip2 --decompress ${IMG_ARCHIVE} - # export the QEMU_IMAGE_NAME to avoid to download it. cp ${IMG_ARCHIVE%%.bz2} ./scripts/ + cp ${QEMU_UEFI_BIOS_FILE} ./scripts/ + pushd scripts - pwd source ci-automation/test.sh + + PARALLEL_ARCH=2 + if [ "${{ matrix.arch }}" == "arm64" ];then + # ARM64 servers have more memory and CPUs + PARALLEL_ARCH=10 + fi + cat > sdk_container/.env <