diff --git a/.github/actions/build-test-image/action.yml b/.github/actions/build-test-image/action.yml new file mode 100644 index 00000000000..b1c694ea8bc --- /dev/null +++ b/.github/actions/build-test-image/action.yml @@ -0,0 +1,62 @@ +name: Build Test Image +description: A composite action that allows building and publishing the test remote runner image + +inputs: + repository: + description: The docker repository for the image + default: chainlink-tests + required: false + tag: + description: The tag to use by default and to use for checking image existance + default: ${{ github.sha }} + required: false + other_tags: + description: Other tags to push if needed + required: false + suites: + description: The test suites to build into the image + default: chaos migration performance reorg smoke soak benchmark + required: false + QA_AWS_ROLE_TO_ASSUME: + description: The AWS role to assume as the CD user, if any. Used in configuring the docker/login-action + required: true + QA_AWS_REGION: + description: The AWS region the ECR repository is located in, should only be needed for public ECR repositories, used in configuring docker/login-action + required: true + QA_AWS_ACCOUNT_NUMBER: + description: The AWS region the ECR repository is located in, should only be needed for public ECR repositories, used in configuring docker/login-action + required: true + +runs: + using: composite + steps: + - name: Check if image exists + id: check-image + uses: smartcontractkit/chainlink-github-actions/docker/image-exists@ab595504ae9cf10c60eb8d2c5ce025284e58b210 #v2.1.5 + with: + repository: ${{ inputs.repository }} + tag: ${{ inputs.tag }} + AWS_REGION: ${{ inputs.QA_AWS_REGION }} + AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }} + - name: Build and Publish Test Runner + if: steps.check-image.outputs.exists == 'false' + uses: smartcontractkit/chainlink-github-actions/docker/build-push@ab595504ae9cf10c60eb8d2c5ce025284e58b210 #v2.1.5 + with: + tags: | + ${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/${{ inputs.repository }}:${{ inputs.tag }} + ${{ inputs.other_tags }} + file: ./integration-tests/test.Dockerfile + build-args: | + BASE_IMAGE=${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/test-base-image + IMAGE_VERSION=v0.3.29 + SUITES="${{ inputs.suites }}" + AWS_REGION: ${{ inputs.QA_AWS_REGION }} + AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }} + - name: Print Image Built + shell: sh + env: + INPUTS_REPOSITORY: ${{ inputs.repository }} + INPUTS_TAG: ${{ inputs.tag }} + run: | + echo "### ${INPUTS_REPOSITORY} image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY + echo "\`${INPUTS_TAG}\`" >>$GITHUB_STEP_SUMMARY diff --git a/.github/workflows/automation-benchmark-tests.yml b/.github/workflows/automation-benchmark-tests.yml index d3d2b0af42b..9e79f290a4b 100644 --- a/.github/workflows/automation-benchmark-tests.yml +++ b/.github/workflows/automation-benchmark-tests.yml @@ -63,24 +63,15 @@ jobs: TEST_INPUTS: ${{ inputs.TestInputs }} CHAINLINK_ENV_USER: ${{ github.actor }} REF_NAME: ${{ github.head_ref || github.ref_name }} - ENV_JOB_IMAGE_BASE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests steps: - name: Setup Push Tag - id: push shell: bash run: | echo "### chainlink image used for this test run :link:" >>$GITHUB_STEP_SUMMARY echo "\`${{ inputs.chainlinkVersion }}\`" >>$GITHUB_STEP_SUMMARY echo "### chainlink-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY - if [ "${{ env.REF_NAME }}" != "develop" ]; then - # use sha if not on develop - echo "tag=${{ env.ENV_JOB_IMAGE_BASE }}:benchmark.${{ github.sha }}" >>$GITHUB_OUTPUT - echo "\`benchmark.${{ github.sha }}\`" >>$GITHUB_STEP_SUMMARY - else - # default to develop - echo "tag=${{ env.ENV_JOB_IMAGE_BASE }}:develop" >>$GITHUB_OUTPUT - echo "\`develop\`" >>$GITHUB_STEP_SUMMARY - fi + echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY + - name: Add mask run: | EVM_URLS=$(jq -r '.inputs.wsURL' $GITHUB_EVENT_PATH) @@ -109,25 +100,19 @@ jobs: uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: ref: ${{ env.REF_NAME }} - - name: build test runner - if: ${{ env.REF_NAME != 'develop' }} - uses: smartcontractkit/chainlink-github-actions/docker/build-push@ab595504ae9cf10c60eb8d2c5ce025284e58b210 # v2.1.5 + - name: Build Test Image + uses: ./.github/actions/build-test-image with: - tags: ${{ steps.push.outputs.tag }} - file: ./integration-tests/test.Dockerfile - build-args: | - BASE_IMAGE=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/test-base-image - IMAGE_VERSION=v0.3.24 - SUITES="benchmark" - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - name: Run Tests uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ab595504ae9cf10c60eb8d2c5ce025284e58b210 # v2.1.5 env: DETACH_RUNNER: true TEST_SUITE: benchmark TEST_ARGS: -test.timeout 720h - ENV_JOB_IMAGE: ${{ steps.push.outputs.tag }} + ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }} with: test_command_to_run: cd integration-tests && go test -timeout 30m -v -run ^TestAutomationBenchmark$ ./benchmark -count=1 test_download_vendor_packages_command: make gomod diff --git a/.github/workflows/integration-chaos-tests.yml b/.github/workflows/integration-chaos-tests.yml index f84f6cc4fa0..a9f8ecd6829 100644 --- a/.github/workflows/integration-chaos-tests.yml +++ b/.github/workflows/integration-chaos-tests.yml @@ -7,11 +7,8 @@ on: - "*" env: - REF_NAME: ${{ github.head_ref || github.ref_name }} - DEVELOP_REF: develop - BUILD_SHA_REF: chaos.${{ github.sha }} - CHAINLINK_ECR_BASE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink - ENV_JOB_IMAGE_BASE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests + CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink + ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }} TEST_SUITE: chaos TEST_ARGS: -test.timeout 1h SELECTED_NETWORKS: SIMULATED @@ -27,33 +24,31 @@ jobs: contents: read name: Build Chainlink Image runs-on: ubuntu-latest - outputs: - push: ${{ steps.push.outputs.tag }} steps: - name: Checkout the repo uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - name: Check if image exists + id: check-image + uses: smartcontractkit/chainlink-github-actions/docker/image-exists@ab595504ae9cf10c60eb8d2c5ce025284e58b210 #v2.1.5 + with: + repository: chainlink + tag: ${{ github.sha }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - name: Build Image - if: ${{ env.REF_NAME != env.DEVELOP_REF }} + if: steps.check-image.outputs.exists == 'false' uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@ab595504ae9cf10c60eb8d2c5ce025284e58b210 # v2.1.5 with: cl_repo: smartcontractkit/chainlink cl_ref: ${{ github.sha }} - push_tag: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink:${{ env.BUILD_SHA_REF }} + push_tag: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink:${{ github.sha }} QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - name: Print Chainlink Image Built id: push run: | - echo "### chainlink image tag used for this test run :link:" >>$GITHUB_STEP_SUMMARY - if [ "${{ env.REF_NAME }}" != "${{ env.DEVELOP_REF }}" ]; then - # use sha if not on ${{ env.DEVELOP_REF }} - echo "tag=${{ env.BUILD_SHA_REF }}" >>$GITHUB_OUTPUT - echo "\`${{ env.BUILD_SHA_REF }}\`" >>$GITHUB_STEP_SUMMARY - else - # default to ${{ env.DEVELOP_REF }} - echo "tag=${{ env.DEVELOP_REF }}" >>$GITHUB_OUTPUT - echo "\`${{ env.DEVELOP_REF }}\`" >>$GITHUB_STEP_SUMMARY - fi + echo "### chainlink node image tag used for this test run :link:" >>$GITHUB_STEP_SUMMARY + echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY - name: Collect Metrics if: always() id: collect-gha-metrics @@ -71,36 +66,15 @@ jobs: contents: read name: Build Test Runner Image runs-on: ubuntu-latest - outputs: - testtag: ${{ steps.testtag.outputs.tag }} steps: - name: Checkout the repo uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - name: build test runner - if: ${{ env.REF_NAME != env.DEVELOP_REF }} - uses: smartcontractkit/chainlink-github-actions/docker/build-push@ab595504ae9cf10c60eb8d2c5ce025284e58b210 # v2.1.5 + - name: Build Test Image + uses: ./.github/actions/build-test-image with: - tags: ${{ env.ENV_JOB_IMAGE_BASE }}:${{ env.BUILD_SHA_REF }} - file: ./integration-tests/test.Dockerfile - build-args: | - BASE_IMAGE=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/test-base-image - IMAGE_VERSION=v0.3.24 - SUITES="${{ env.TEST_SUITE }}" - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - id: testtag - name: Print Chainlink Image Built - run: | - echo "### chainlink-tests image tag used for this test run :link:" >>$GITHUB_STEP_SUMMARY - if [ "${{ env.REF_NAME }}" != "${{ env.DEVELOP_REF }}" ]; then - # use sha if not on ${{ env.DEVELOP_REF }} - echo "tag=${{ env.BUILD_SHA_REF }}" >>$GITHUB_OUTPUT - echo "\`${{ env.BUILD_SHA_REF }}\`" >>$GITHUB_STEP_SUMMARY - else - # default to ${{ env.DEVELOP_REF }} - echo "tag=${{ env.DEVELOP_REF }}" >>$GITHUB_OUTPUT - echo "\`${{ env.DEVELOP_REF }}\`" >>$GITHUB_STEP_SUMMARY - fi + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - name: Collect Metrics if: always() id: collect-gha-metrics @@ -130,16 +104,15 @@ jobs: hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} this-job-name: EVM Pods Chaos Tests continue-on-error: true - - run: echo "${{ needs.build-test-runner.outputs.testtag }}" - name: Checkout the repo uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Run Tests uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ab595504ae9cf10c60eb8d2c5ce025284e58b210 # v2.1.5 with: - test_command_to_run: export ENV_JOB_IMAGE=${{ env.ENV_JOB_IMAGE_BASE }}:${{ needs.build-test-runner.outputs.testtag }} && make test_need_operator_assets && cd integration-tests && go test -timeout 1h -count=1 -json -test.parallel 11 ./chaos 2>&1 | tee /tmp/gotest.log | gotestfmt + test_command_to_run: make test_need_operator_assets && cd integration-tests && go test -timeout 1h -count=1 -json -test.parallel 11 ./chaos 2>&1 | tee /tmp/gotest.log | gotestfmt test_download_vendor_packages_command: cd ./integration-tests && go mod download - cl_repo: ${{ env.CHAINLINK_ECR_BASE }} - cl_image_tag: ${{ needs.build-chainlink.outputs.push }} + cl_repo: ${{ env.CHAINLINK_IMAGE }} + cl_image_tag: ${{ github.sha }} artifacts_location: ./integration-tests/chaos/logs publish_check_name: EVM Pods Chaos Test Results token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/integration-tests-publish.yml b/.github/workflows/integration-tests-publish.yml index 2634c432ac4..1cd9d4a3939 100644 --- a/.github/workflows/integration-tests-publish.yml +++ b/.github/workflows/integration-tests-publish.yml @@ -30,14 +30,10 @@ jobs: uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: ref: ${{ github.event.pull_request.head.sha }} - - name: build test runner - uses: smartcontractkit/chainlink-github-actions/docker/build-push@ab595504ae9cf10c60eb8d2c5ce025284e58b210 # v2.1.5 + - name: Build Image + uses: ./.github/actions/build-test-image with: - tags: ${{ env.ECR_TAG }} - file: ./integration-tests/test.Dockerfile - build-args: | - BASE_IMAGE=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/test-base-image - IMAGE_VERSION=v0.3.24 - SUITES="chaos migration performance reorg smoke soak benchmark" - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + other_tags: ${{ env.ECR_TAG }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index c20145f8b64..68551d54b3a 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -11,15 +11,9 @@ concurrency: cancel-in-progress: true env: - # for test image builds - SOLANA_TEST_ECR: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests - TEST_BASE_ECR: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/test-base-image - TEST_BASE_VERSION: v0.3.24 - # for run-test variables and environment - ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:ci.${{ github.sha }} + ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }} CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink - CHAINLINK_VERSION: ci.${{ github.sha }} TEST_SUITE: smoke TEST_ARGS: -test.timeout 30m @@ -62,32 +56,42 @@ jobs: runs-on: ubuntu20.04-16cores-64GB needs: [changes] steps: + - name: Collect Metrics + if: needs.changes.outputs.src == 'true' + id: collect-gha-metrics + uses: smartcontractkit/push-gha-metrics-action@808c183d1f5c26a4f3fd50b75d3cf7b58d9aa293 + with: + basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} + this-job-name: Build Chainlink Image + continue-on-error: true - name: Checkout the repo uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: ref: ${{ github.event.pull_request.head.sha }} - - name: Build Image + - name: Check if image exists if: needs.changes.outputs.src == 'true' + id: check-image + uses: smartcontractkit/chainlink-github-actions/docker/image-exists@ab595504ae9cf10c60eb8d2c5ce025284e58b210 #v2.1.5 + with: + repository: chainlink + tag: ${{ github.sha }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + - name: Build Image + if: steps.check-image.outputs.exists == 'false' && needs.changes.outputs.src == 'true' uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@ab595504ae9cf10c60eb8d2c5ce025284e58b210 # v2.1.5 with: cl_repo: smartcontractkit/chainlink cl_ref: ${{ github.sha }} - push_tag: ${{ env.CHAINLINK_IMAGE }}:${{ env.CHAINLINK_VERSION }} + push_tag: ${{ env.CHAINLINK_IMAGE }}:${{ github.sha }} QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - name: Print Chainlink Image Built + if: needs.changes.outputs.src == 'true' run: | - echo "### chainlink image tag used for this test run :link:" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.CHAINLINK_VERSION }}\`" >>$GITHUB_STEP_SUMMARY - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@808c183d1f5c26a4f3fd50b75d3cf7b58d9aa293 - with: - basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} - this-job-name: Build Chainlink Image - continue-on-error: true + echo "### chainlink node image tag used for this test run :link:" >>$GITHUB_STEP_SUMMARY + echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY build-test-image: environment: integration @@ -99,6 +103,7 @@ jobs: needs: [changes] steps: - name: Collect Metrics + if: needs.changes.outputs.src == 'true' id: collect-gha-metrics uses: smartcontractkit/push-gha-metrics-action@v1 with: @@ -110,30 +115,13 @@ jobs: uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: ref: ${{ github.event.pull_request.head.sha }} - - name: Check if image exists - id: check-image - uses: smartcontractkit/chainlink-github-actions/docker/image-exists@ab595504ae9cf10c60eb8d2c5ce025284e58b210 #v2.1.5 - with: - repository: chainlink-tests - tag: ${{ env.CHAINLINK_VERSION }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - name: build test runner - if: steps.check-image.outputs.exists == 'false' - uses: smartcontractkit/chainlink-github-actions/docker/build-push@ab595504ae9cf10c60eb8d2c5ce025284e58b210 #v2.1.5 + - name: Build Test Image + if: needs.changes.outputs.src == 'true' + uses: ./.github/actions/build-test-image with: - tags: ${{ env.ENV_JOB_IMAGE }} - file: ./integration-tests/test.Dockerfile - build-args: | - BASE_IMAGE=${{ env.TEST_BASE_ECR }} - IMAGE_VERSION=${{ env.TEST_BASE_VERSION }} - SUITES="smoke soak chaos benchmark migration performance" - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - name: Print Image Built - run: | - echo "### chainlink-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY - echo "\`${{ env.CHAINLINK_VERSION }}\`" >>$GITHUB_STEP_SUMMARY + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} eth-smoke-tests-matrix: environment: integration @@ -211,7 +199,7 @@ jobs: test_command_to_run: make test_need_operator_assets && cd ./integration-tests && go test -timeout 30m -count=1 -json -test.parallel=${{ matrix.product.nodes }} ./smoke/${{ matrix.product.name }}_test.go 2>&1 | tee /tmp/gotest.log | gotestfmt test_download_vendor_packages_command: cd ./integration-tests && go mod download cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ env.CHAINLINK_VERSION }} + cl_image_tag: ${{ github.sha }} artifacts_location: ./integration-tests/smoke/logs publish_check_name: EVM Smoke Test Results ${{ matrix.product.name }} token: ${{ secrets.GITHUB_TOKEN }} @@ -327,7 +315,7 @@ jobs: uses: smartcontractkit/chainlink-github-actions/docker/image-exists@ab595504ae9cf10c60eb8d2c5ce025284e58b210 #v2.1.5 with: repository: chainlink-solana-tests - tag: ci.${{ needs.get_solana_sha.outputs.sha }} + tag: ${{ needs.get_solana_sha.outputs.sha }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} @@ -347,6 +335,15 @@ jobs: RUSTUP_HOME: "/root/.rustup" FORCE_COLOR: 1 steps: + - name: Collect Metrics + if: needs.changes.outputs.src == 'true' + id: collect-gha-metrics + uses: smartcontractkit/push-gha-metrics-action@808c183d1f5c26a4f3fd50b75d3cf7b58d9aa293 + with: + basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} + this-job-name: Solana Build Artifacts + continue-on-error: true - name: Checkout the solana repo uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: @@ -354,18 +351,46 @@ jobs: ref: ${{ needs.get_solana_sha.outputs.sha }} - name: Build contracts if: needs.changes.outputs.src == 'true' && needs.solana-test-image-exists.outputs.exists == 'false' - uses: smartcontractkit/chainlink-solana/.github/actions/build_contract_artifacts@4b971869e26b79c7ce3fb7c98005cc2e3f350915 # stable action on Oct 12 2022 + uses: smartcontractkit/chainlink-solana/.github/actions/build_contract_artifacts@23816fcf7d380a30c87b6d87e4fb0ca94419b259 # stable action on April 17 2023 with: ref: ${{ needs.get_solana_sha.outputs.sha }} + + solana-build-test-image: + environment: integration + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + name: Solana Build Test Image + runs-on: ubuntu20.04-16cores-64GB + needs: [solana-build-contracts, solana-test-image-exists, changes, get_solana_sha] + env: + CONTRACT_ARTIFACTS_PATH: contracts/target/deploy + steps: - name: Collect Metrics - if: always() + if: needs.changes.outputs.src == 'true' id: collect-gha-metrics uses: smartcontractkit/push-gha-metrics-action@808c183d1f5c26a4f3fd50b75d3cf7b58d9aa293 with: basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} - this-job-name: Solana Build Artifacts + this-job-name: Solana Smoke Tests continue-on-error: true + - name: Checkout the repo + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + with: + repository: smartcontractkit/chainlink-solana + ref: 23816fcf7d380a30c87b6d87e4fb0ca94419b259 # swtich back to this after the next solana release${{ needs.get_solana_sha.outputs.sha }} + - name: Build Test Image + if: needs.changes.outputs.src == 'true' && needs.solana-test-image-exists.outputs.exists == 'false' + uses: ./.github/actions/build-test-image + with: + tag: ${{ needs.get_solana_sha.outputs.sha }} + artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} solana-smoke-tests: environment: integration @@ -376,47 +401,34 @@ jobs: contents: read name: Solana Smoke Tests runs-on: ubuntu-latest - needs: [build-chainlink, solana-build-contracts, solana-test-image-exists, changes, get_solana_sha] + needs: [build-chainlink, solana-build-contracts, solana-test-image-exists, changes, get_solana_sha, solana-build-test-image] env: CHAINLINK_COMMIT_SHA: ${{ github.sha }} CHAINLINK_ENV_USER: ${{ github.actor }} TEST_LOG_LEVEL: debug CONTRACT_ARTIFACTS_PATH: contracts/target/deploy steps: + - name: Collect Metrics + if: needs.changes.outputs.src == 'true' + id: collect-gha-metrics + uses: smartcontractkit/push-gha-metrics-action@808c183d1f5c26a4f3fd50b75d3cf7b58d9aa293 + with: + basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} + this-job-name: Solana Smoke Tests + continue-on-error: true - name: Checkout the repo uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: repository: smartcontractkit/chainlink-solana ref: ${{ needs.get_solana_sha.outputs.sha }} - - name: Download Artifacts - if: needs.changes.outputs.src == 'true' && needs.solana-test-image-exists.outputs.exists == 'false' - uses: actions/download-artifact@v3 - with: - name: artifacts - path: ${{ env.CONTRACT_ARTIFACTS_PATH }} - - name: Build Test Runner - if: needs.changes.outputs.src == 'true' && needs.solana-test-image-exists.outputs.exists == 'false' - uses: smartcontractkit/chainlink-github-actions/docker/build-push@ab595504ae9cf10c60eb8d2c5ce025284e58b210 #v2.1.5 - with: - tags: ${{ env.SOLANA_TEST_ECR }}:ci.${{ needs.get_solana_sha.outputs.sha }} - file: ./integration-tests/test.Dockerfile - build-args: | - BASE_IMAGE=${{ env.TEST_BASE_ECR }} - IMAGE_VERSION=${{ env.TEST_BASE_VERSION }} - SUITES="smoke" - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} - - name: Print Solana Tests Image - run: | - echo "### chainlink-solana-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY - echo "\`ci.${{ needs.get_solana_sha.outputs.sha }}\`" >>$GITHUB_STEP_SUMMARY - name: Run Tests if: needs.changes.outputs.src == 'true' uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ab595504ae9cf10c60eb8d2c5ce025284e58b210 #v2.1.5 with: - test_command_to_run: export ENV_JOB_IMAGE=${{ env.SOLANA_TEST_ECR }}:ci.${{ needs.get_solana_sha.outputs.sha }} && make test_smoke + test_command_to_run: export ENV_JOB_IMAGE=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} && make test_smoke cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ env.CHAINLINK_VERSION }} + cl_image_tag: ${{ github.sha }} artifacts_location: /home/runner/work/chainlink-solana/chainlink-solana/integration-tests/logs publish_check_name: Solana Smoke Test Results go_mod_path: ./integration-tests/go.mod @@ -424,15 +436,6 @@ jobs: QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} - - name: Collect Metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@808c183d1f5c26a4f3fd50b75d3cf7b58d9aa293 - with: - basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} - this-job-name: Solana Smoke Tests - continue-on-error: true ### End Solana Section ### Start Live Testnet Section @@ -487,7 +490,7 @@ jobs: test_command_to_run: make test_need_operator_assets && cd ./integration-tests && go test -timeout 30m -count=1 -json -test.parallel=1 ./smoke/ocr_test.go 2>&1 | tee /tmp/gotest.log | gotestfmt test_download_vendor_packages_command: make gomod cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ env.CHAINLINK_VERSION }} + cl_image_tag: ${{ github.sha }} artifacts_location: ./integration-tests/smoke/logs publish_check_name: ${{ matrix.testnet }} OCR Smoke Test Results token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/on-demand-ocr-soak-test.yml b/.github/workflows/on-demand-ocr-soak-test.yml index 95751df666d..6fd2442ace4 100644 --- a/.github/workflows/on-demand-ocr-soak-test.yml +++ b/.github/workflows/on-demand-ocr-soak-test.yml @@ -100,40 +100,25 @@ jobs: with: ref: ${{ env.REF_NAME }} - name: Setup Push Tag - id: push shell: bash run: | echo "### chainlink image used for this test run :link:" >>$GITHUB_STEP_SUMMARY echo "\`${{ inputs.chainlinkVersion }}\`" >>$GITHUB_STEP_SUMMARY echo "### chainlink-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY - if [ "${{ env.REF_NAME }}" != "develop" ]; then - # use sha if not on develop - echo "tag=${{ env.ENV_JOB_IMAGE_BASE }}:soak.${{ github.sha }}" >>$GITHUB_OUTPUT - echo "\`soak.${{ github.sha }}\`" >>$GITHUB_STEP_SUMMARY - else - # default to develop - echo "tag=${{ env.ENV_JOB_IMAGE_BASE }}:develop" >>$GITHUB_OUTPUT - echo "\`develop\`" >>$GITHUB_STEP_SUMMARY - fi - - name: Build Test Runner - if: ${{ env.REF_NAME != 'develop' }} - uses: smartcontractkit/chainlink-github-actions/docker/build-push@ab595504ae9cf10c60eb8d2c5ce025284e58b210 # v2.1.5 + echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY + - name: Build Image + uses: ./.github/actions/build-test-image with: - tags: ${{ steps.push.outputs.tag }} - file: ./integration-tests/test.Dockerfile - build-args: | - BASE_IMAGE=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/test-base-image - IMAGE_VERSION=v0.3.24 - SUITES="soak" - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} - name: Run Tests uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ab595504ae9cf10c60eb8d2c5ce025284e58b210 # v2.1.5 env: DETACH_RUNNER: true TEST_SUITE: soak TEST_ARGS: -test.timeout 900h -test.memprofile memprofile.out -test.cpuprofile profile.out - ENV_JOB_IMAGE: ${{ steps.push.outputs.tag }} + ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }} # We can comment these out when we have a stable soak test and aren't worried about resource consumption TEST_UPLOAD_CPU_PROFILE: true TEST_UPLOAD_MEM_PROFILE: true