From 75c401f6c14a313793487395cf622e7eb1414fee Mon Sep 17 00:00:00 2001 From: Nikola Jokic Date: Tue, 25 Nov 2025 00:37:32 +0100 Subject: [PATCH] Remove old e2e tests (#4325) --- .../execute-assert-arc-e2e/action.yaml | 215 ---- .github/actions/setup-arc-e2e/action.yaml | 65 -- .../setup-docker-environment/action.yaml | 51 - .github/workflows/gha-e2e-tests.yaml | 984 +----------------- 4 files changed, 9 insertions(+), 1306 deletions(-) delete mode 100644 .github/actions/execute-assert-arc-e2e/action.yaml delete mode 100644 .github/actions/setup-arc-e2e/action.yaml delete mode 100644 .github/actions/setup-docker-environment/action.yaml diff --git a/.github/actions/execute-assert-arc-e2e/action.yaml b/.github/actions/execute-assert-arc-e2e/action.yaml deleted file mode 100644 index 872d02d9..00000000 --- a/.github/actions/execute-assert-arc-e2e/action.yaml +++ /dev/null @@ -1,215 +0,0 @@ -name: 'Execute and Assert ARC E2E Test Action' -description: 'Queue E2E test workflow and assert workflow run result to be succeed' - -inputs: - auth-token: - description: 'GitHub access token to queue workflow run' - required: true - repo-owner: - description: "The repository owner name that has the test workflow file, ex: actions" - required: true - repo-name: - description: "The repository name that has the test workflow file, ex: test" - required: true - workflow-file: - description: 'The file name of the workflow yaml, ex: test.yml' - required: true - arc-name: - description: 'The name of the configured gha-runner-scale-set' - required: true - arc-namespace: - description: 'The namespace of the configured gha-runner-scale-set' - required: true - arc-controller-namespace: - description: 'The namespace of the configured gha-runner-scale-set-controller' - required: true - wait-to-finish: - description: 'Wait for the workflow run to finish' - required: true - default: "true" - wait-to-running: - description: 'Wait for the workflow run to start running' - required: true - default: "false" - -runs: - using: "composite" - steps: - - name: Queue test workflow - shell: bash - id: queue_workflow - run: | - queue_time=`date +%FT%TZ` - echo "queue_time=$queue_time" >> $GITHUB_OUTPUT - curl -X POST https://api.github.com/repos/${{inputs.repo-owner}}/${{inputs.repo-name}}/actions/workflows/${{inputs.workflow-file}}/dispatches \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token ${{inputs.auth-token}}" \ - -d '{"ref": "main", "inputs": { "arc_name": "${{inputs.arc-name}}" } }' - - - name: Fetch workflow run & job ids - uses: actions/github-script@v7 - id: query_workflow - with: - script: | - // Try to find the workflow run triggered by the previous step using the workflow_dispatch event. - // - Find recently create workflow runs in the test repository - // - For each workflow run, list its workflow job and see if the job's labels contain `inputs.arc-name` - // - Since the inputs.arc-name should be unique per e2e workflow run, once we find the job with the label, we find the workflow that we just triggered. - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)) - } - const owner = '${{inputs.repo-owner}}' - const repo = '${{inputs.repo-name}}' - const workflow_id = '${{inputs.workflow-file}}' - let workflow_run_id = 0 - let workflow_job_id = 0 - let workflow_run_html_url = "" - let count = 0 - while (count++<12) { - await sleep(10 * 1000); - let listRunResponse = await github.rest.actions.listWorkflowRuns({ - owner: owner, - repo: repo, - workflow_id: workflow_id, - created: '>${{steps.queue_workflow.outputs.queue_time}}' - }) - if (listRunResponse.data.total_count > 0) { - console.log(`Found some new workflow runs for ${workflow_id}`) - for (let i = 0; i 0) { - for (let j = 0; j 0) { - break; - } - } - } - - if (workflow_job_id > 0) { - break; - } - } - if (workflow_job_id == 0) { - core.setFailed(`Can't find workflow run and workflow job triggered to 'runs-on ${{inputs.arc-name}}'`) - } else { - core.setOutput('workflow_run', workflow_run_id); - core.setOutput('workflow_job', workflow_job_id); - core.setOutput('workflow_run_url', workflow_run_html_url); - } - - - name: Generate summary about the triggered workflow run - shell: bash - run: | - cat <<-EOF > $GITHUB_STEP_SUMMARY - | **Triggered workflow run** | - |:--------------------------:| - | ${{steps.query_workflow.outputs.workflow_run_url}} | - EOF - - - name: Wait for workflow to start running - if: inputs.wait-to-running == 'true' && inputs.wait-to-finish == 'false' - uses: actions/github-script@v7 - with: - script: | - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)) - } - const owner = '${{inputs.repo-owner}}' - const repo = '${{inputs.repo-name}}' - const workflow_run_id = ${{steps.query_workflow.outputs.workflow_run}} - const workflow_job_id = ${{steps.query_workflow.outputs.workflow_job}} - let count = 0 - while (count++<10) { - await sleep(30 * 1000); - let getRunResponse = await github.rest.actions.getWorkflowRun({ - owner: owner, - repo: repo, - run_id: workflow_run_id - }) - console.log(`${getRunResponse.data.html_url}: ${getRunResponse.data.status} (${getRunResponse.data.conclusion})`); - if (getRunResponse.data.status == 'in_progress') { - console.log(`Workflow run is in progress.`) - return - } - } - core.setFailed(`The triggered workflow run didn't start properly using ${{inputs.arc-name}}`) - - - name: Wait for workflow to finish successfully - if: inputs.wait-to-finish == 'true' - uses: actions/github-script@v7 - with: - script: | - // Wait 5 minutes and make sure the workflow run we triggered completed with result 'success' - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)) - } - const owner = '${{inputs.repo-owner}}' - const repo = '${{inputs.repo-name}}' - const workflow_run_id = ${{steps.query_workflow.outputs.workflow_run}} - const workflow_job_id = ${{steps.query_workflow.outputs.workflow_job}} - let count = 0 - while (count++<10) { - await sleep(30 * 1000); - let getRunResponse = await github.rest.actions.getWorkflowRun({ - owner: owner, - repo: repo, - run_id: workflow_run_id - }) - console.log(`${getRunResponse.data.html_url}: ${getRunResponse.data.status} (${getRunResponse.data.conclusion})`); - if (getRunResponse.data.status == 'completed') { - if ( getRunResponse.data.conclusion == 'success') { - console.log(`Workflow run finished properly.`) - return - } else { - core.setFailed(`The triggered workflow run finish with result ${getRunResponse.data.conclusion}`) - return - } - } - } - core.setFailed(`The triggered workflow run didn't finish properly using ${{inputs.arc-name}}`) - - - name: Gather listener logs - shell: bash - if: always() - run: | - LISTENER_POD="$(kubectl get autoscalinglisteners.actions.github.com -n arc-systems -o jsonpath='{.items[*].metadata.name}')" - kubectl logs $LISTENER_POD -n ${{inputs.arc-controller-namespace}} - - - name: Gather coredns logs - shell: bash - if: always() - run: | - kubectl logs deployments/coredns -n kube-system - - - name: cleanup - if: inputs.wait-to-finish == 'true' - shell: bash - run: | - helm uninstall ${{ inputs.arc-name }} --namespace ${{inputs.arc-namespace}} --debug - kubectl wait --timeout=30s --for=delete AutoScalingRunnerSet -n ${{inputs.arc-namespace}} -l app.kubernetes.io/instance=${{ inputs.arc-name }} - - - name: Gather controller logs - shell: bash - if: always() - run: | - kubectl logs deployment/arc-gha-rs-controller -n ${{inputs.arc-controller-namespace}} \ No newline at end of file diff --git a/.github/actions/setup-arc-e2e/action.yaml b/.github/actions/setup-arc-e2e/action.yaml deleted file mode 100644 index dbcd4762..00000000 --- a/.github/actions/setup-arc-e2e/action.yaml +++ /dev/null @@ -1,65 +0,0 @@ -name: "Setup ARC E2E Test Action" -description: "Build controller image, create kind cluster, load the image, and exchange ARC configure token." - -inputs: - app-id: - description: "GitHub App Id for exchange access token" - required: true - app-pk: - description: "GitHub App private key for exchange access token" - required: true - image-name: - description: "Local docker image name for building" - required: true - image-tag: - description: "Tag of ARC Docker image for building" - required: true - target-org: - description: "The test organization for ARC e2e test" - required: true - -outputs: - token: - description: "Token to use for configure ARC" - value: ${{steps.config-token.outputs.token}} - -runs: - using: "composite" - steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 - with: - # Pinning v0.9.1 for Buildx and BuildKit v0.10.6 - # BuildKit v0.11 which has a bug causing intermittent - # failures pushing images to GHCR - version: v0.9.1 - driver-opts: image=moby/buildkit:v0.10.6 - - - name: Build controller image - # https://github.com/docker/build-push-action/releases/tag/v6.18.0 - uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 - with: - file: Dockerfile - platforms: linux/amd64 - load: true - build-args: | - DOCKER_IMAGE_NAME=${{inputs.image-name}} - VERSION=${{inputs.image-tag}} - tags: | - ${{inputs.image-name}}:${{inputs.image-tag}} - no-cache: true - - - name: Create minikube cluster and load image - shell: bash - run: | - minikube start - minikube image load ${{inputs.image-name}}:${{inputs.image-tag}} - - - name: Get configure token - id: config-token - # https://github.com/peter-murray/workflow-application-token-action/releases/tag/v3.0.0 - uses: peter-murray/workflow-application-token-action@dc0413987a085fa17d19df9e47d4677cf81ffef3 - with: - application_id: ${{ inputs.app-id }} - application_private_key: ${{ inputs.app-pk }} - organization: ${{ inputs.target-org}} diff --git a/.github/actions/setup-docker-environment/action.yaml b/.github/actions/setup-docker-environment/action.yaml deleted file mode 100644 index 6053125e..00000000 --- a/.github/actions/setup-docker-environment/action.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: "Setup Docker" - -inputs: - username: - description: "Username" - required: true - password: - description: "Password" - required: true - ghcr_username: - description: "GHCR username. Usually set from the github.actor variable" - required: true - ghcr_password: - description: "GHCR password. Usually set from the secrets.GITHUB_TOKEN variable" - required: true - -runs: - using: "composite" - steps: - - name: Get Short SHA - id: vars - run: | - echo "sha_short=${GITHUB_SHA::7}" >> $GITHUB_ENV - shell: bash - - - name: Set up QEMU - # https://github.com/docker/setup-qemu-action/releases/tag/v3.6.0 - uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 - - - name: Set up Docker Buildx - # https://github.com/docker/setup-buildx-action/releases/tag/v3.10.0 - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 - with: - version: latest - - - name: Login to DockerHub - if: ${{ github.event_name == 'release' || github.event_name == 'push' && github.ref == 'refs/heads/master' && inputs.password != '' }} - # https://github.com/docker/login-action/releases/tag/v3.4.0 - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 - with: - username: ${{ inputs.username }} - password: ${{ inputs.password }} - - - name: Login to GitHub Container Registry - if: ${{ github.event_name == 'release' || github.event_name == 'push' && github.ref == 'refs/heads/master' && inputs.ghcr_password != '' }} - # https://github.com/docker/login-action/releases/tag/v3.4.0 - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 - with: - registry: ghcr.io - username: ${{ inputs.ghcr_username }} - password: ${{ inputs.ghcr_password }} diff --git a/.github/workflows/gha-e2e-tests.yaml b/.github/workflows/gha-e2e-tests.yaml index 5fd3af44..795b7796 100644 --- a/.github/workflows/gha-e2e-tests.yaml +++ b/.github/workflows/gha-e2e-tests.yaml @@ -26,7 +26,7 @@ concurrency: cancel-in-progress: true jobs: - default-setup-v2: + default-setup: runs-on: ubuntu-latest timeout-minutes: 20 if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id @@ -49,98 +49,7 @@ jobs: GITHUB_TOKEN: "${{steps.config-token.outputs.token}}" shell: bash - default-setup: - runs-on: ubuntu-latest - timeout-minutes: 20 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id - env: - WORKFLOW_FILE: "arc-test-workflow.yaml" - steps: - - uses: actions/checkout@v5 - with: - ref: ${{github.head_ref}} - - - uses: ./.github/actions/setup-arc-e2e - id: setup - with: - app-id: ${{secrets.E2E_TESTS_ACCESS_APP_ID}} - app-pk: ${{secrets.E2E_TESTS_ACCESS_PK}} - image-name: ${{env.IMAGE_NAME}} - image-tag: ${{env.IMAGE_VERSION}} - target-org: ${{env.TARGET_ORG}} - - - name: Install gha-runner-scale-set-controller - id: install_arc_controller - run: | - helm install arc \ - --namespace "arc-systems" \ - --create-namespace \ - --set image.repository=${{ env.IMAGE_NAME }} \ - --set image.tag=${{ env.IMAGE_VERSION }} \ - ./charts/gha-runner-scale-set-controller \ - --debug - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l app.kubernetes.io/name=gha-rs-controller -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for controller pod with label app.kubernetes.io/name=gha-rs-controller" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l app.kubernetes.io/name=gha-rs-controller - kubectl get pod -n arc-systems - kubectl describe deployment arc-gha-rs-controller -n arc-systems - - - name: Install gha-runner-scale-set - id: install_arc - run: | - ARC_NAME=${{github.job}}-$(date +'%M%S')$((($RANDOM + 100) % 100 + 1)) - helm install "$ARC_NAME" \ - --namespace "arc-runners" \ - --create-namespace \ - --set githubConfigUrl="https://github.com/${{ env.TARGET_ORG }}/${{env.TARGET_REPO}}" \ - --set githubConfigSecret.github_token="${{ steps.setup.outputs.token }}" \ - ./charts/gha-runner-scale-set \ - --debug - echo "ARC_NAME=$ARC_NAME" >> $GITHUB_OUTPUT - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for listener pod with label actions.github.com/scale-set-name=$ARC_NAME" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME - kubectl get pod -n arc-systems - - sleep 60 - - - name: Test ARC E2E - uses: ./.github/actions/execute-assert-arc-e2e - timeout-minutes: 10 - with: - auth-token: ${{ steps.setup.outputs.token }} - repo-owner: ${{ env.TARGET_ORG }} - repo-name: ${{env.TARGET_REPO}} - workflow-file: ${{env.WORKFLOW_FILE}} - arc-name: ${{steps.install_arc.outputs.ARC_NAME}} - arc-namespace: "arc-runners" - arc-controller-namespace: "arc-systems" - - single-namespace-setup-v2: + single-namespace-setup: runs-on: ubuntu-latest timeout-minutes: 20 if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id @@ -163,100 +72,7 @@ jobs: GITHUB_TOKEN: "${{steps.config-token.outputs.token}}" shell: bash - single-namespace-setup: - runs-on: ubuntu-latest - timeout-minutes: 20 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id - env: - WORKFLOW_FILE: "arc-test-workflow.yaml" - steps: - - uses: actions/checkout@v5 - with: - ref: ${{github.head_ref}} - - - uses: ./.github/actions/setup-arc-e2e - id: setup - with: - app-id: ${{secrets.E2E_TESTS_ACCESS_APP_ID}} - app-pk: ${{secrets.E2E_TESTS_ACCESS_PK}} - image-name: ${{env.IMAGE_NAME}} - image-tag: ${{env.IMAGE_VERSION}} - target-org: ${{env.TARGET_ORG}} - - - name: Install gha-runner-scale-set-controller - id: install_arc_controller - run: | - kubectl create namespace arc-runners - helm install arc \ - --namespace "arc-systems" \ - --create-namespace \ - --set image.repository=${{ env.IMAGE_NAME }} \ - --set image.tag=${{ env.IMAGE_VERSION }} \ - --set flags.watchSingleNamespace=arc-runners \ - ./charts/gha-runner-scale-set-controller \ - --debug - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l app.kubernetes.io/name=gha-rs-controller -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for controller pod with label app.kubernetes.io/name=gha-rs-controller" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l app.kubernetes.io/name=gha-rs-controller - kubectl get pod -n arc-systems - kubectl describe deployment arc-gha-rs-controller -n arc-systems - - - name: Install gha-runner-scale-set - id: install_arc - run: | - ARC_NAME=${{github.job}}-$(date +'%M%S')$((($RANDOM + 100) % 100 + 1)) - helm install "$ARC_NAME" \ - --namespace "arc-runners" \ - --create-namespace \ - --set githubConfigUrl="https://github.com/${{ env.TARGET_ORG }}/${{env.TARGET_REPO}}" \ - --set githubConfigSecret.github_token="${{ steps.setup.outputs.token }}" \ - ./charts/gha-runner-scale-set \ - --debug - echo "ARC_NAME=$ARC_NAME" >> $GITHUB_OUTPUT - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for listener pod with label actions.github.com/scale-set-name=$ARC_NAME" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME - kubectl get pod -n arc-systems - - sleep 60 - - - name: Test ARC E2E - uses: ./.github/actions/execute-assert-arc-e2e - timeout-minutes: 10 - with: - auth-token: ${{ steps.setup.outputs.token }} - repo-owner: ${{ env.TARGET_ORG }} - repo-name: ${{env.TARGET_REPO}} - workflow-file: ${{env.WORKFLOW_FILE}} - arc-name: ${{steps.install_arc.outputs.ARC_NAME}} - arc-namespace: "arc-runners" - arc-controller-namespace: "arc-systems" - - dind-mode-setup-v2: + dind-mode-setup: runs-on: ubuntu-latest timeout-minutes: 20 if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id @@ -279,99 +95,7 @@ jobs: GITHUB_TOKEN: "${{steps.config-token.outputs.token}}" shell: bash - dind-mode-setup: - runs-on: ubuntu-latest - timeout-minutes: 20 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id - env: - WORKFLOW_FILE: arc-test-dind-workflow.yaml - steps: - - uses: actions/checkout@v5 - with: - ref: ${{github.head_ref}} - - - uses: ./.github/actions/setup-arc-e2e - id: setup - with: - app-id: ${{secrets.E2E_TESTS_ACCESS_APP_ID}} - app-pk: ${{secrets.E2E_TESTS_ACCESS_PK}} - image-name: ${{env.IMAGE_NAME}} - image-tag: ${{env.IMAGE_VERSION}} - target-org: ${{env.TARGET_ORG}} - - - name: Install gha-runner-scale-set-controller - id: install_arc_controller - run: | - helm install arc \ - --namespace "arc-systems" \ - --create-namespace \ - --set image.repository=${{ env.IMAGE_NAME }} \ - --set image.tag=${{ env.IMAGE_VERSION }} \ - ./charts/gha-runner-scale-set-controller \ - --debug - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l app.kubernetes.io/name=gha-rs-controller -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for controller pod with label app.kubernetes.io/name=gha-rs-controller" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l app.kubernetes.io/name=gha-rs-controller - kubectl get pod -n arc-systems - kubectl describe deployment arc-gha-rs-controller -n arc-systems - - - name: Install gha-runner-scale-set - id: install_arc - run: | - ARC_NAME=${{github.job}}-$(date +'%M%S')$((($RANDOM + 100) % 100 + 1)) - helm install "$ARC_NAME" \ - --namespace "arc-runners" \ - --create-namespace \ - --set githubConfigUrl="https://github.com/${{ env.TARGET_ORG }}/${{env.TARGET_REPO}}" \ - --set githubConfigSecret.github_token="${{ steps.setup.outputs.token }}" \ - --set containerMode.type="dind" \ - ./charts/gha-runner-scale-set \ - --debug - echo "ARC_NAME=$ARC_NAME" >> $GITHUB_OUTPUT - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for listener pod with label actions.github.com/scale-set-name=$ARC_NAME" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME - kubectl get pod -n arc-systems - - sleep 60 - - - name: Test ARC E2E - uses: ./.github/actions/execute-assert-arc-e2e - timeout-minutes: 10 - with: - auth-token: ${{ steps.setup.outputs.token }} - repo-owner: ${{ env.TARGET_ORG }} - repo-name: ${{env.TARGET_REPO}} - workflow-file: ${{env.WORKFLOW_FILE}} - arc-name: ${{steps.install_arc.outputs.ARC_NAME}} - arc-namespace: "arc-runners" - arc-controller-namespace: "arc-systems" - - kubernetes-mode-setup-v2: + kubernetes-mode-setup: runs-on: ubuntu-latest timeout-minutes: 20 if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id @@ -394,108 +118,7 @@ jobs: GITHUB_TOKEN: "${{steps.config-token.outputs.token}}" shell: bash - kubernetes-mode-setup: - runs-on: ubuntu-latest - timeout-minutes: 20 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id - env: - WORKFLOW_FILE: "arc-test-kubernetes-workflow.yaml" - steps: - - uses: actions/checkout@v5 - with: - ref: ${{github.head_ref}} - - - uses: ./.github/actions/setup-arc-e2e - id: setup - with: - app-id: ${{secrets.E2E_TESTS_ACCESS_APP_ID}} - app-pk: ${{secrets.E2E_TESTS_ACCESS_PK}} - image-name: ${{env.IMAGE_NAME}} - image-tag: ${{env.IMAGE_VERSION}} - target-org: ${{env.TARGET_ORG}} - - - name: Install gha-runner-scale-set-controller - id: install_arc_controller - run: | - echo "Install openebs/dynamic-localpv-provisioner" - helm repo add openebs https://openebs.github.io/charts - helm repo update - helm install openebs openebs/openebs -n openebs --create-namespace - - helm install arc \ - --namespace "arc-systems" \ - --create-namespace \ - --set image.repository=${{ env.IMAGE_NAME }} \ - --set image.tag=${{ env.IMAGE_VERSION }} \ - ./charts/gha-runner-scale-set-controller \ - --debug - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l app.kubernetes.io/name=gha-rs-controller -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for controller pod with label app.kubernetes.io/name=gha-rs-controller" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l app.kubernetes.io/name=gha-rs-controller - kubectl get pod -n arc-systems - kubectl describe deployment arc-gha-rs-controller -n arc-systems - kubectl wait --timeout=30s --for=condition=ready pod -n openebs -l name=openebs-localpv-provisioner - - - name: Install gha-runner-scale-set - id: install_arc - run: | - ARC_NAME=${{github.job}}-$(date +'%M%S')$((($RANDOM + 100) % 100 + 1)) - helm install "$ARC_NAME" \ - --namespace "arc-runners" \ - --create-namespace \ - --set githubConfigUrl="https://github.com/${{ env.TARGET_ORG }}/${{env.TARGET_REPO}}" \ - --set githubConfigSecret.github_token="${{ steps.setup.outputs.token }}" \ - --set containerMode.type="kubernetes" \ - --set containerMode.kubernetesModeWorkVolumeClaim.accessModes={"ReadWriteOnce"} \ - --set containerMode.kubernetesModeWorkVolumeClaim.storageClassName="openebs-hostpath" \ - --set containerMode.kubernetesModeWorkVolumeClaim.resources.requests.storage="1Gi" \ - ./charts/gha-runner-scale-set \ - --debug - echo "ARC_NAME=$ARC_NAME" >> $GITHUB_OUTPUT - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for listener pod with label actions.github.com/scale-set-name=$ARC_NAME" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME - kubectl get pod -n arc-systems - - sleep 60 - - - name: Test ARC E2E - uses: ./.github/actions/execute-assert-arc-e2e - timeout-minutes: 10 - with: - auth-token: ${{ steps.setup.outputs.token }} - repo-owner: ${{ env.TARGET_ORG }} - repo-name: ${{env.TARGET_REPO}} - workflow-file: ${{env.WORKFLOW_FILE}} - arc-name: ${{steps.install_arc.outputs.ARC_NAME}} - arc-namespace: "arc-runners" - arc-controller-namespace: "arc-systems" - - auth-proxy-setup-v2: + auth-proxy-setup: runs-on: ubuntu-latest timeout-minutes: 20 if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id @@ -518,110 +141,7 @@ jobs: GITHUB_TOKEN: "${{steps.config-token.outputs.token}}" shell: bash - auth-proxy-setup: - runs-on: ubuntu-latest - timeout-minutes: 20 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id - env: - WORKFLOW_FILE: "arc-test-workflow.yaml" - steps: - - uses: actions/checkout@v5 - with: - ref: ${{github.head_ref}} - - - uses: ./.github/actions/setup-arc-e2e - id: setup - with: - app-id: ${{secrets.E2E_TESTS_ACCESS_APP_ID}} - app-pk: ${{secrets.E2E_TESTS_ACCESS_PK}} - image-name: ${{env.IMAGE_NAME}} - image-tag: ${{env.IMAGE_VERSION}} - target-org: ${{env.TARGET_ORG}} - - - name: Install gha-runner-scale-set-controller - id: install_arc_controller - run: | - helm install arc \ - --namespace "arc-systems" \ - --create-namespace \ - --set image.repository=${{ env.IMAGE_NAME }} \ - --set image.tag=${{ env.IMAGE_VERSION }} \ - ./charts/gha-runner-scale-set-controller \ - --debug - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l app.kubernetes.io/name=gha-rs-controller -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for controller pod with label app.kubernetes.io/name=gha-rs-controller" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l app.kubernetes.io/name=gha-rs-controller - kubectl get pod -n arc-systems - kubectl describe deployment arc-gha-rs-controller -n arc-systems - - - name: Install gha-runner-scale-set - id: install_arc - run: | - docker run -d \ - --name squid \ - --publish 3128:3128 \ - huangtingluo/squid-proxy:latest - kubectl create namespace arc-runners - kubectl create secret generic proxy-auth \ - --namespace=arc-runners \ - --from-literal=username=github \ - --from-literal=password='actions' - ARC_NAME=${{github.job}}-$(date +'%M%S')$((($RANDOM + 100) % 100 + 1)) - helm install "$ARC_NAME" \ - --namespace "arc-runners" \ - --create-namespace \ - --set githubConfigUrl="https://github.com/${{ env.TARGET_ORG }}/${{env.TARGET_REPO}}" \ - --set githubConfigSecret.github_token="${{ steps.setup.outputs.token }}" \ - --set proxy.https.url="http://host.minikube.internal:3128" \ - --set proxy.https.credentialSecretRef="proxy-auth" \ - --set "proxy.noProxy[0]=10.96.0.1:443" \ - ./charts/gha-runner-scale-set \ - --debug - echo "ARC_NAME=$ARC_NAME" >> $GITHUB_OUTPUT - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for listener pod with label actions.github.com/scale-set-name=$ARC_NAME" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME - kubectl get pod -n arc-systems - - sleep 60 - - - name: Test ARC E2E - uses: ./.github/actions/execute-assert-arc-e2e - timeout-minutes: 10 - with: - auth-token: ${{ steps.setup.outputs.token }} - repo-owner: ${{ env.TARGET_ORG }} - repo-name: ${{env.TARGET_REPO}} - workflow-file: ${{env.WORKFLOW_FILE}} - arc-name: ${{steps.install_arc.outputs.ARC_NAME}} - arc-namespace: "arc-runners" - arc-controller-namespace: "arc-systems" - - anonymous-proxy-setup-v2: + anonymous-proxy-setup: runs-on: ubuntu-latest timeout-minutes: 20 if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id @@ -644,104 +164,7 @@ jobs: GITHUB_TOKEN: "${{steps.config-token.outputs.token}}" shell: bash - anonymous-proxy-setup: - runs-on: ubuntu-latest - timeout-minutes: 20 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id - env: - WORKFLOW_FILE: "arc-test-workflow.yaml" - steps: - - uses: actions/checkout@v5 - with: - ref: ${{github.head_ref}} - - - uses: ./.github/actions/setup-arc-e2e - id: setup - with: - app-id: ${{secrets.E2E_TESTS_ACCESS_APP_ID}} - app-pk: ${{secrets.E2E_TESTS_ACCESS_PK}} - image-name: ${{env.IMAGE_NAME}} - image-tag: ${{env.IMAGE_VERSION}} - target-org: ${{env.TARGET_ORG}} - - - name: Install gha-runner-scale-set-controller - id: install_arc_controller - run: | - helm install arc \ - --namespace "arc-systems" \ - --create-namespace \ - --set image.repository=${{ env.IMAGE_NAME }} \ - --set image.tag=${{ env.IMAGE_VERSION }} \ - ./charts/gha-runner-scale-set-controller \ - --debug - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l app.kubernetes.io/name=gha-rs-controller -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for controller pod with label app.kubernetes.io/name=gha-rs-controller" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l app.kubernetes.io/name=gha-rs-controller - kubectl get pod -n arc-systems - kubectl describe deployment arc-gha-rs-controller -n arc-systems - - - name: Install gha-runner-scale-set - id: install_arc - run: | - docker run -d \ - --name squid \ - --publish 3128:3128 \ - ubuntu/squid:latest - ARC_NAME=${{github.job}}-$(date +'%M%S')$((($RANDOM + 100) % 100 + 1)) - helm install "$ARC_NAME" \ - --namespace "arc-runners" \ - --create-namespace \ - --set githubConfigUrl="https://github.com/${{ env.TARGET_ORG }}/${{env.TARGET_REPO}}" \ - --set githubConfigSecret.github_token="${{ steps.setup.outputs.token }}" \ - --set proxy.https.url="http://host.minikube.internal:3128" \ - --set "proxy.noProxy[0]=10.96.0.1:443" \ - ./charts/gha-runner-scale-set \ - --debug - echo "ARC_NAME=$ARC_NAME" >> $GITHUB_OUTPUT - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for listener pod with label actions.github.com/scale-set-name=$ARC_NAME" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME - kubectl get pod -n arc-systems - - sleep 60 - - - name: Test ARC E2E - uses: ./.github/actions/execute-assert-arc-e2e - timeout-minutes: 10 - with: - auth-token: ${{ steps.setup.outputs.token }} - repo-owner: ${{ env.TARGET_ORG }} - repo-name: ${{env.TARGET_REPO}} - workflow-file: ${{env.WORKFLOW_FILE}} - arc-name: ${{steps.install_arc.outputs.ARC_NAME}} - arc-namespace: "arc-runners" - arc-controller-namespace: "arc-systems" - - self-signed-ca-setup-v2: + self-signed-ca-setup: runs-on: ubuntu-latest timeout-minutes: 20 if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id @@ -764,129 +187,7 @@ jobs: GITHUB_TOKEN: "${{steps.config-token.outputs.token}}" shell: bash - self-signed-ca-setup: - runs-on: ubuntu-latest - timeout-minutes: 20 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id - env: - WORKFLOW_FILE: "arc-test-workflow.yaml" - steps: - - uses: actions/checkout@v5 - with: - ref: ${{github.head_ref}} - - - uses: ./.github/actions/setup-arc-e2e - id: setup - with: - app-id: ${{secrets.E2E_TESTS_ACCESS_APP_ID}} - app-pk: ${{secrets.E2E_TESTS_ACCESS_PK}} - image-name: ${{env.IMAGE_NAME}} - image-tag: ${{env.IMAGE_VERSION}} - target-org: ${{env.TARGET_ORG}} - - - name: Install gha-runner-scale-set-controller - id: install_arc_controller - run: | - helm install arc \ - --namespace "arc-systems" \ - --create-namespace \ - --set image.repository=${{ env.IMAGE_NAME }} \ - --set image.tag=${{ env.IMAGE_VERSION }} \ - ./charts/gha-runner-scale-set-controller \ - --debug - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l app.kubernetes.io/name=gha-rs-controller -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for controller pod with label app.kubernetes.io/name=gha-rs-controller" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l app.kubernetes.io/name=gha-rs-controller - kubectl get pod -n arc-systems - kubectl describe deployment arc-gha-rs-controller -n arc-systems - - - name: Install gha-runner-scale-set - id: install_arc - run: | - docker run -d \ - --rm \ - --name mitmproxy \ - --publish 8080:8080 \ - -v ${{ github.workspace }}/mitmproxy:/home/mitmproxy/.mitmproxy \ - mitmproxy/mitmproxy:latest \ - mitmdump - count=0 - while true; do - if [ -f "${{ github.workspace }}/mitmproxy/mitmproxy-ca-cert.pem" ]; then - echo "CA cert generated" - cat ${{ github.workspace }}/mitmproxy/mitmproxy-ca-cert.pem - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for mitmproxy generate its CA cert" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - sudo cp ${{ github.workspace }}/mitmproxy/mitmproxy-ca-cert.pem ${{ github.workspace }}/mitmproxy/mitmproxy-ca-cert.crt - sudo chown runner ${{ github.workspace }}/mitmproxy/mitmproxy-ca-cert.crt - kubectl create namespace arc-runners - kubectl -n arc-runners create configmap ca-cert --from-file="${{ github.workspace }}/mitmproxy/mitmproxy-ca-cert.crt" - kubectl -n arc-runners get configmap ca-cert -o yaml - ARC_NAME=${{github.job}}-$(date +'%M%S')$((($RANDOM + 100) % 100 + 1)) - helm install "$ARC_NAME" \ - --namespace "arc-runners" \ - --create-namespace \ - --set githubConfigUrl="https://github.com/${{ env.TARGET_ORG }}/${{env.TARGET_REPO}}" \ - --set githubConfigSecret.github_token="${{ steps.setup.outputs.token }}" \ - --set proxy.https.url="http://host.minikube.internal:8080" \ - --set "proxy.noProxy[0]=10.96.0.1:443" \ - --set "githubServerTLS.certificateFrom.configMapKeyRef.name=ca-cert" \ - --set "githubServerTLS.certificateFrom.configMapKeyRef.key=mitmproxy-ca-cert.crt" \ - --set "githubServerTLS.runnerMountPath=/usr/local/share/ca-certificates/" \ - ./charts/gha-runner-scale-set \ - --debug - echo "ARC_NAME=$ARC_NAME" >> $GITHUB_OUTPUT - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for listener pod with label actions.github.com/scale-set-name=$ARC_NAME" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME - kubectl get pod -n arc-systems - - sleep 60 - - - name: Test ARC E2E - uses: ./.github/actions/execute-assert-arc-e2e - timeout-minutes: 10 - with: - auth-token: ${{ steps.setup.outputs.token }} - repo-owner: ${{ env.TARGET_ORG }} - repo-name: ${{env.TARGET_REPO}} - workflow-file: ${{env.WORKFLOW_FILE}} - arc-name: ${{steps.install_arc.outputs.ARC_NAME}} - arc-namespace: "arc-runners" - arc-controller-namespace: "arc-systems" - - update-strategy-tests-v2: + update-strategy-tests: runs-on: ubuntu-latest timeout-minutes: 20 if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id @@ -909,179 +210,7 @@ jobs: GITHUB_TOKEN: "${{steps.config-token.outputs.token}}" shell: bash - update-strategy-tests: - runs-on: ubuntu-latest - timeout-minutes: 20 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id - env: - WORKFLOW_FILE: "arc-test-sleepy-matrix.yaml" - steps: - - uses: actions/checkout@v5 - with: - ref: ${{github.head_ref}} - - - uses: ./.github/actions/setup-arc-e2e - id: setup - with: - app-id: ${{secrets.E2E_TESTS_ACCESS_APP_ID}} - app-pk: ${{secrets.E2E_TESTS_ACCESS_PK}} - image-name: ${{env.IMAGE_NAME}} - image-tag: ${{env.IMAGE_VERSION}} - target-org: ${{env.TARGET_ORG}} - - - name: Install gha-runner-scale-set-controller - id: install_arc_controller - run: | - helm install arc \ - --namespace "arc-systems" \ - --create-namespace \ - --set image.repository=${{ env.IMAGE_NAME }} \ - --set image.tag=${{ env.IMAGE_VERSION }} \ - --set flags.updateStrategy="eventual" \ - ./charts/gha-runner-scale-set-controller \ - --debug - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l app.kubernetes.io/name=gha-rs-controller -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for controller pod with label app.kubernetes.io/name=gha-rs-controller" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l app.kubernetes.io/name=gha-rs-controller - kubectl get pod -n arc-systems - kubectl describe deployment arc-gha-rs-controller -n arc-systems - - - name: Install gha-runner-scale-set - id: install_arc - run: | - ARC_NAME=${{github.job}}-$(date +'%M%S')$((($RANDOM + 100) % 100 + 1)) - helm install "$ARC_NAME" \ - --namespace "arc-runners" \ - --create-namespace \ - --set githubConfigUrl="https://github.com/${{ env.TARGET_ORG }}/${{env.TARGET_REPO}}" \ - --set githubConfigSecret.github_token="${{ steps.setup.outputs.token }}" \ - ./charts/gha-runner-scale-set \ - --debug - echo "ARC_NAME=$ARC_NAME" >> $GITHUB_OUTPUT - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for listener pod with label actions.github.com/scale-set-name=$ARC_NAME" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME - kubectl get pod -n arc-systems - - sleep 60 - - - name: Trigger long running jobs and wait for runners to pick them up - uses: ./.github/actions/execute-assert-arc-e2e - timeout-minutes: 10 - with: - auth-token: ${{ steps.setup.outputs.token }} - repo-owner: ${{ env.TARGET_ORG }} - repo-name: ${{env.TARGET_REPO}} - workflow-file: ${{env.WORKFLOW_FILE}} - arc-name: ${{steps.install_arc.outputs.ARC_NAME}} - arc-namespace: "arc-runners" - arc-controller-namespace: "arc-systems" - wait-to-running: "true" - wait-to-finish: "false" - - - name: Upgrade the gha-runner-scale-set - shell: bash - run: | - helm upgrade --install "${{ steps.install_arc.outputs.ARC_NAME }}" \ - --namespace "arc-runners" \ - --create-namespace \ - --set githubConfigUrl="https://github.com/${{ env.TARGET_ORG }}/${{ env.TARGET_REPO }}" \ - --set githubConfigSecret.github_token="${{ steps.setup.outputs.token }}" \ - --set template.spec.containers[0].name="runner" \ - --set template.spec.containers[0].image="ghcr.io/actions/actions-runner:latest" \ - --set template.spec.containers[0].command={"/home/runner/run.sh"} \ - --set template.spec.containers[0].env[0].name="TEST" \ - --set template.spec.containers[0].env[0].value="E2E TESTS" \ - ./charts/gha-runner-scale-set \ - --debug - - - name: Assert that the listener is deleted while jobs are running - shell: bash - run: | - count=0 - while true; do - LISTENER_COUNT="$(kubectl get pods -l actions.github.com/scale-set-name=${{ steps.install_arc.outputs.ARC_NAME }} -n arc-systems --field-selector=status.phase=Running -o=jsonpath='{.items}' | jq 'length')" - RUNNERS_COUNT="$(kubectl get pods -l app.kubernetes.io/component=runner -n arc-runners --field-selector=status.phase=Running -o=jsonpath='{.items}' | jq 'length')" - RESOURCES="$(kubectl get pods -A)" - - if [ "$LISTENER_COUNT" -eq 0 ]; then - echo "Listener has been deleted" - echo "$RESOURCES" - exit 0 - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for listener to be deleted" - echo "$RESOURCES" - exit 1 - fi - - echo "Waiting for listener to be deleted" - echo "Listener count: $LISTENER_COUNT target: 0 | Runners count: $RUNNERS_COUNT target: 3" - - sleep 1 - count=$((count+1)) - done - - - name: Assert that the listener goes back up after the jobs are done - shell: bash - run: | - count=0 - while true; do - LISTENER_COUNT="$(kubectl get pods -l actions.github.com/scale-set-name=${{ steps.install_arc.outputs.ARC_NAME }} -n arc-systems --field-selector=status.phase=Running -o=jsonpath='{.items}' | jq 'length')" - RUNNERS_COUNT="$(kubectl get pods -l app.kubernetes.io/component=runner -n arc-runners --field-selector=status.phase=Running -o=jsonpath='{.items}' | jq 'length')" - RESOURCES="$(kubectl get pods -A)" - - if [ "$LISTENER_COUNT" -eq 1 ]; then - echo "Listener is up!" - echo "$RESOURCES" - exit 0 - fi - if [ "$count" -ge 120 ]; then - echo "Timeout waiting for listener to be recreated" - echo "$RESOURCES" - exit 1 - fi - - echo "Waiting for listener to be recreated" - echo "Listener count: $LISTENER_COUNT target: 1 | Runners count: $RUNNERS_COUNT target: 0" - - sleep 1 - count=$((count+1)) - done - - - name: Gather logs and cleanup - shell: bash - if: always() - run: | - helm uninstall "${{ steps.install_arc.outputs.ARC_NAME }}" --namespace "arc-runners" --debug - kubectl wait --timeout=10s --for=delete AutoScalingRunnerSet -n "${{ steps.install_arc.outputs.ARC_NAME }}" -l app.kubernetes.io/instance="${{ steps.install_arc.outputs.ARC_NAME }}" - kubectl logs deployment/arc-gha-rs-controller -n "arc-systems" - - init-with-min-runners-v2: + init-with-min-runners: runs-on: ubuntu-latest timeout-minutes: 20 if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id @@ -1103,98 +232,3 @@ jobs: env: GITHUB_TOKEN: "${{steps.config-token.outputs.token}}" shell: bash - - init-with-min-runners: - runs-on: ubuntu-latest - timeout-minutes: 20 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id - env: - WORKFLOW_FILE: arc-test-workflow.yaml - steps: - - uses: actions/checkout@v5 - with: - ref: ${{ github.head_ref }} - - - uses: ./.github/actions/setup-arc-e2e - id: setup - with: - app-id: ${{secrets.E2E_TESTS_ACCESS_APP_ID}} - app-pk: ${{secrets.E2E_TESTS_ACCESS_PK}} - image-name: ${{env.IMAGE_NAME}} - image-tag: ${{env.IMAGE_VERSION}} - target-org: ${{env.TARGET_ORG}} - - - name: Install gha-runner-scale-set-controller - id: install_arc_controller - run: | - helm install arc \ - --namespace "arc-systems" \ - --create-namespace \ - --set image.repository=${{ env.IMAGE_NAME }} \ - --set image.tag=${{ env.IMAGE_VERSION }} \ - --set flags.updateStrategy="eventual" \ - ./charts/gha-runner-scale-set-controller \ - --debug - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l app.kubernetes.io/name=gha-rs-controller -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for controller pod with label app.kubernetes.io/name=gha-rs-controller" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l app.kubernetes.io/name=gha-rs-controller - kubectl get pod -n arc-systems - kubectl describe deployment arc-gha-rs-controller -n arc-systems - - - name: Install gha-runner-scale-set - id: install_arc - run: | - ARC_NAME=${{github.job}}-$(date +'%M%S')$((($RANDOM + 100) % 100 + 1)) - helm install "$ARC_NAME" \ - --namespace "arc-runners" \ - --create-namespace \ - --set githubConfigUrl="https://github.com/${{ env.TARGET_ORG }}/${{env.TARGET_REPO}}" \ - --set githubConfigSecret.github_token="${{ steps.setup.outputs.token }}" \ - --set minRunners=5 \ - ./charts/gha-runner-scale-set \ - --debug - echo "ARC_NAME=$ARC_NAME" >> $GITHUB_OUTPUT - count=0 - while true; do - POD_NAME=$(kubectl get pods -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME -o name) - if [ -n "$POD_NAME" ]; then - echo "Pod found: $POD_NAME" - break - fi - if [ "$count" -ge 60 ]; then - echo "Timeout waiting for listener pod with label actions.github.com/scale-set-name=$ARC_NAME" - exit 1 - fi - sleep 1 - count=$((count+1)) - done - kubectl wait --timeout=30s --for=condition=ready pod -n arc-systems -l actions.github.com/scale-set-name=$ARC_NAME - kubectl get pod -n arc-systems - - name: Ensure 5 runners are up - run: | - count=0 - while true; do - pod_count=$(kubectl get pods -n arc-runners --no-headers | wc -l) - if [[ "$pod_count" = 5 ]]; then - echo "5 pods are up!" - break - fi - if [[ "$count" -ge 30 ]]; then - echo "Timeout waiting for 5 pods to be created" - exit 1 - fi - sleep 1 - count=$((count+1)) - done