Skip to content

Commit

Permalink
[TT-1396] [CCIP-2804] Migrates CCIP To testsecrets (#14135)
Browse files Browse the repository at this point in the history
* Ports Over testsecrets

* Fixes CCIP Config

* Use chain-selectors v1.0.21

* Remove old keys in workflow

* Fix go mods

---------

Co-authored-by: lukaszcl <[email protected]>
  • Loading branch information
kalverra and lukaszcl authored Aug 19, 2024
1 parent 6ef1d6e commit 326c1d4
Show file tree
Hide file tree
Showing 17 changed files with 504 additions and 1,355 deletions.
70 changes: 17 additions & 53 deletions .github/actions/setup-create-base64-config-ccip/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,62 +11,39 @@ inputs:
default: "false"
selectedNetworks:
description: The networks to run tests against
chainlinkImage:
description: The chainlink image to use
default: "public.ecr.aws/chainlink/chainlink"
chainlinkVersion:
description: The git commit sha to use for the image tag
upgradeImage:
description: The chainlink image to upgrade to
default: ""
upgradeVersion:
description: The git commit sha to use for the image tag
lokiEndpoint:
description: Loki push endpoint
lokiTenantId:
description: Loki tenant id
lokiBasicAuth:
description: Loki basic auth
description: The git commit sha to use for the image tag
logstreamLogTargets:
description: Where to send logs (e.g. file, loki)
grafanaUrl:
description: Grafana URL
grafanaDashboardUrl:
description: Grafana dashboard URL
grafanaBearerToken:
description: Grafana bearer token
customEvmNodes:
description: Custom EVM nodes to use in key=value format, where key is chain id and value is docker image to use. If they are provided the number of networksSelected must be equal to the number of customEvmNodes
evmNodeLogLevel:
description: Log level for the custom EVM nodes
default: "info"
outputs:
base64_config:
description: The base64-encoded config
value: ${{ steps.base64_config_override.outputs.base64_config }}

runs:
using: composite
steps:
- name: Prepare Base64 TOML override
shell: bash
id: base64-config-override
id: base64_config_override
env:
RUN_ID: ${{ inputs.runId }}
SELECTED_NETWORKS: ${{ inputs.selectedNetworks }}
EXISTING_NAMESPACE: ${{ inputs.existingNamespace }}
TEST_LOG_COLLECT: ${{ inputs.testLogCollect }}
CHAINLINK_IMAGE: ${{ inputs.chainlinkImage }}
CHAINLINK_VERSION: ${{ inputs.chainlinkVersion }}
UPGRADE_IMAGE: ${{ inputs.upgradeImage }}
UPGRADE_VERSION: ${{ inputs.upgradeVersion }}
LOKI_ENDPOINT: ${{ inputs.lokiEndpoint }}
LOKI_TENANT_ID: ${{ inputs.lokiTenantId }}
LOKI_BASIC_AUTH: ${{ inputs.lokiBasicAuth }}
LOGSTREAM_LOG_TARGETS: ${{ inputs.logstreamLogTargets }}
GRAFANA_URL: ${{ inputs.grafanaUrl }}
GRAFANA_DASHBOARD_URL: ${{ inputs.grafanaDashboardUrl }}
GRAFANA_BEARER_TOKEN: ${{ inputs.grafanaBearerToken }}
CUSTOM_EVM_NODES: ${{ inputs.customEvmNodes }}
EVM_NODE_LOG_LEVEL: ${{ inputs.evmNodeLogLevel }}
run: |
echo ::add-mask::$CHAINLINK_IMAGE
function convert_to_toml_array() {
local IFS=','
local input_array=($1)
Expand Down Expand Up @@ -133,11 +110,6 @@ runs:
fi
fi
grafana_bearer_token=""
if [ -n "$GRAFANA_BEARER_TOKEN" ]; then
grafana_bearer_token="bearer_token_secret=\"$GRAFANA_BEARER_TOKEN\""
fi
cat << EOF > config.toml
[CCIP]
[CCIP.Env]
Expand All @@ -147,13 +119,8 @@ runs:
[CCIP.Env.NewCLCluster]
[CCIP.Env.NewCLCluster.Common]
[CCIP.Env.NewCLCluster.Common.ChainlinkImage]
image="$CHAINLINK_IMAGE"
version="$CHAINLINK_VERSION"
[CCIP.Env.NewCLCluster.Common.ChainlinkUpgradeImage]
image="$UPGRADE_IMAGE"
version="$UPGRADE_VERSION"
$custom_nodes_toml
[CCIP.Env.Logging]
Expand All @@ -163,16 +130,6 @@ runs:
[CCIP.Env.Logging.LogStream]
log_targets=$log_targets
[CCIP.Env.Logging.Loki]
tenant_id="$LOKI_TENANT_ID"
endpoint="$LOKI_ENDPOINT"
basic_auth_secret="$LOKI_BASIC_AUTH"
[CCIP.Env.Logging.Grafana]
base_url="$GRAFANA_URL"
dashboard_url="$GRAFANA_DASHBOARD_URL"
$grafana_bearer_token
[CCIP.Groups.load]
TestRunName = '$EXISTING_NAMESPACE'
Expand All @@ -181,7 +138,14 @@ runs:
EOF
BASE64_CCIP_SECRETS_CONFIG=$(cat config.toml | base64 -w 0)
echo ::add-mask::$BASE64_CCIP_SECRETS_CONFIG
echo "BASE64_CCIP_SECRETS_CONFIG=$BASE64_CCIP_SECRETS_CONFIG" >> $GITHUB_ENV
echo "TEST_BASE64_CCIP_SECRETS_CONFIG=$BASE64_CCIP_SECRETS_CONFIG" >> $GITHUB_ENV
# Check if UPGRADE_VERSION is not empty and append to config.toml
if [ -n "$UPGRADE_VERSION" ]; then
cat << EOF >> config.toml
[CCIP.Env.NewCLCluster.Common.ChainlinkUpgradeImage]
version="$UPGRADE_VERSION"
EOF
fi
BASE64_CONFIG=$(cat config.toml | base64 -w 0)
echo ::add-mask::$BASE64_CONFIG
echo "base64_config=$BASE64_CONFIG" >> $GITHUB_OUTPUT
45 changes: 25 additions & 20 deletions .github/workflows/ccip-chaos-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
branches: [ develop ]
workflow_dispatch:



# Only run 1 of this workflow at a time per PR
concurrency:
group: chaos-ccip-tests-chainlink-${{ github.ref }}
Expand All @@ -16,7 +14,7 @@ concurrency:
env:
# TODO: TT-1470 - Update image names as we solidify new realease strategy
CL_ECR: ${{ 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-ccip-tests:${{ github.sha }}
ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }}
MOD_CACHE_VERSION: 1

jobs:
Expand Down Expand Up @@ -124,23 +122,20 @@ jobs:
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Prepare Base64 TOML override for CCIP secrets
uses: ./.github/actions/setup-create-base64-config-ccip
id: setup_create_base64_config_ccip
with:
runId: ${{ github.run_id }}
testLogCollect: ${{ vars.TEST_LOG_COLLECT }}
chainlinkImage: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
chainlinkVersion: ${{ github.sha }}
lokiEndpoint: ${{ secrets.LOKI_URL }}
lokiTenantId: ${{ vars.LOKI_TENANT_ID }}
logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }}
grafanaUrl: ${{ vars.GRAFANA_URL }}
grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs"
- name: Run Chaos Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@b49a9d04744b0237908831730f8553f26d73a94b # v2.3.17
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@d38226be720c5ccc1ff4d3cee40608ebf264cd59 # v2.3.26
env:
BASE64_CCIP_CONFIG_OVERRIDE: ${{ steps.setup_create_base64_config_ccip.outputs.base64_config }}
TEST_BASE64_CCIP_CONFIG_OVERRIDE: ${{ steps.setup_create_base64_config_ccip.outputs.base64_config }}
with:
test_command_to_run: cd ./integration-tests && go test -timeout 1h -count=1 -json -test.parallel 11 -run 'TestChaosCCIP' ./chaos 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci
test_download_vendor_packages_command: make gomod
cl_repo: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
cl_image_tag: ${{ github.sha }}
artifacts_location: ./integration-tests/chaos/logs
publish_check_name: CCIP Chaos Test Results
publish_report_paths: ./tests-chaos-report.xml
Expand All @@ -154,6 +149,13 @@ jobs:
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
cache_key_id: ccip-load-${{ env.MOD_CACHE_VERSION }}
cache_restore_only: "true"
DEFAULT_LOKI_TENANT_ID: ${{ vars.LOKI_TENANT_ID }}
DEFAULT_LOKI_ENDPOINT: ${{ secrets.LOKI_URL }}
DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }}
DEFAULT_CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
DEFAULT_GRAFANA_BASE_URL: ${{ vars.GRAFANA_URL }}
DEFAULT_GRAFANA_DASHBOARD_URL: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs"

## Notify in slack if the job fails
- name: Notify Slack
if: failure() && github.event_name != 'workflow_dispatch'
Expand Down Expand Up @@ -206,23 +208,20 @@ jobs:
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Prepare Base64 TOML override for CCIP secrests
uses: ./.github/actions/setup-create-base64-config-ccip
id: setup_create_base64_config_ccip
with:
runId: ${{ github.run_id }}
testLogCollect: ${{ vars.TEST_LOG_COLLECT }}
chainlinkImage: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
chainlinkVersion: ${{ github.sha }}
lokiEndpoint: ${{ secrets.LOKI_URL }}
lokiTenantId: ${{ vars.LOKI_TENANT_ID }}
logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }}
grafanaUrl: ${{ vars.GRAFANA_URL }}
grafanaDashboardUrl: "/d/6vjVx-1V8/ccip-long-running-tests"
- name: Run Load With Chaos Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@b49a9d04744b0237908831730f8553f26d73a94b # v2.3.17
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@d38226be720c5ccc1ff4d3cee40608ebf264cd59 # v2.3.26
env:
BASE64_CCIP_CONFIG_OVERRIDE: ${{ steps.setup_create_base64_config_ccip.outputs.base64_config }}
TEST_BASE64_CCIP_CONFIG_OVERRIDE: ${{ steps.setup_create_base64_config_ccip.outputs.base64_config }}
with:
test_command_to_run: cd ./integration-tests/ccip-tests && go test -timeout 2h -count=1 -json -test.parallel 4 -run '^TestLoadCCIPStableWithPodChaosDiffCommitAndExec' ./load 2>&1 | tee /tmp/gotest.log | gotestfmt
test_download_vendor_packages_command: make gomod
cl_repo: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
cl_image_tag: ${{ github.sha }}
artifacts_location: ./integration-tests/load/logs
publish_check_name: CCIP Chaos With Load Test Results
publish_report_paths: ./tests-chaos-with-load-report.xml
Expand All @@ -236,6 +235,12 @@ jobs:
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
cache_key_id: ccip-load-${{ env.MOD_CACHE_VERSION }}
cache_restore_only: "true"
DEFAULT_LOKI_TENANT_ID: ${{ vars.LOKI_TENANT_ID }}
DEFAULT_LOKI_ENDPOINT: ${{ secrets.LOKI_URL }}
DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }}
DEFAULT_CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
DEFAULT_GRAFANA_BASE_URL: ${{ vars.GRAFANA_URL }}
DEFAULT_GRAFANA_DASHBOARD_URL: "/d/6vjVx-1V8/ccip-long-running-tests"
## Notify in slack if the job fails
- name: Notify Slack
if: failure() && github.event_name != 'workflow_dispatch'
Expand All @@ -250,4 +255,4 @@ jobs:
if: always()
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/cleanup@b49a9d04744b0237908831730f8553f26d73a94b # v2.3.17
with:
triggered_by: ${{ env.TEST_TRIGGERED_BY }}
triggered_by: ${{ env.TEST_TRIGGERED_BY }}
Loading

0 comments on commit 326c1d4

Please sign in to comment.