Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUTO-7258] Setup log trigger load test using wasp #11267

Merged
merged 33 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ed55e0c
add simple log upkeep counter contract
anirudhwarrier Nov 10, 2023
c9d322d
WIP- add automationv2_1 load test
anirudhwarrier Nov 10, 2023
bc97eab
update contract
anirudhwarrier Nov 13, 2023
a34fee8
working state
anirudhwarrier Nov 13, 2023
f77d418
add config
anirudhwarrier Nov 13, 2023
33477da
try GHA
anirudhwarrier Nov 13, 2023
1751ba4
disable reads inside loadgen
anirudhwarrier Nov 13, 2023
6c416c2
updates
anirudhwarrier Nov 13, 2023
344b9e7
add specs
anirudhwarrier Nov 13, 2023
ac4275f
fix linkfunds
anirudhwarrier Nov 14, 2023
4640373
detach runner, add loglevel config
anirudhwarrier Nov 14, 2023
75e0935
increase geth capacity
anirudhwarrier Nov 14, 2023
9a17756
fix batching - test end FilterLogs
anirudhwarrier Nov 14, 2023
725e6f5
fix batching
anirudhwarrier Nov 14, 2023
342dabd
fix log filter context and batching
anirudhwarrier Nov 14, 2023
3ee2fff
increase upkeep funding, fix event count calc
anirudhwarrier Nov 15, 2023
f119f53
increase GasLimitPerReport to 10.3M
anirudhwarrier Nov 15, 2023
d470dcd
Decrease PerformLockoutWindow to 80k
anirudhwarrier Nov 15, 2023
abed6e8
reduce sleep time - log filter batch
anirudhwarrier Nov 15, 2023
684fee0
use ConcurrentEVMClients
anirudhwarrier Nov 15, 2023
7e5ae97
increase RR CPU and Mem
anirudhwarrier Nov 15, 2023
19b8b7d
add pyroscope, add slack notifications
anirudhwarrier Nov 16, 2023
6817492
add tag and image to test config
anirudhwarrier Nov 16, 2023
ab30343
fix dashbord URL
anirudhwarrier Nov 16, 2023
66a443d
contracts prettier
anirudhwarrier Nov 16, 2023
86a8428
Merge branch 'develop' into AUTO/log-trigger-ga-load-test
anirudhwarrier Nov 16, 2023
51ce1e5
run lint
anirudhwarrier Nov 16, 2023
1bf08ba
add new load test workflow
anirudhwarrier Nov 16, 2023
36623f8
Merge branch 'develop' into AUTO/log-trigger-ga-load-test
anirudhwarrier Nov 16, 2023
ef1bb11
fix AddNetworksConfig
anirudhwarrier Nov 16, 2023
aebcefa
undo changes to benchmark test workflow
anirudhwarrier Nov 16, 2023
cec85da
add load/automationv2_1 to build test image steps
anirudhwarrier Nov 16, 2023
19f277f
lint
anirudhwarrier Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/build-test-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inputs:
required: false
suites:
description: The test suites to build into the image
default: chaos migration performance reorg smoke soak benchmark
default: chaos migration performance reorg smoke soak benchmark load/automationv2_1
required: false
base_image_tag:
description: The test base image version to use, if not provided it will use the version from the ./integration-tests/go.mod file
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/automation-benchmark-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
description: Chainlink image version to use
required: true
type: string
default: 2.5.0
default: 2.6.0
chainlinkImage:
description: Chainlink image repo to use
required: true
Expand Down Expand Up @@ -108,6 +108,7 @@ jobs:
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 }}
suites: benchmark load/automationv2_1 chaos reorg
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@7d541cbbca52d45b8a718257af86d9cf49774d1f # v2.2.15
env:
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/automation-load-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Automation Load Test
on:
workflow_dispatch:
inputs:
chainlinkVersion:
description: Chainlink image version to use
required: true
type: string
default: 2.6.0
chainlinkImage:
description: Chainlink image repo to use
required: true
type: string
default: public.ecr.aws/chainlink/chainlink
network:
description: Network to run tests on
required: true
type: choice
options:
- SIMULATED
TestInputs:
description: TestInputs
required: false
type: string
slackMemberID:
description: Notifies test results (Not your @)
required: true
default: U02Q14G80TY
type: string

jobs:
automation_load:
environment: integration
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
name: ${{ inputs.network }} Automation Load Test
runs-on: ubuntu20.04-16cores-64GB
env:
SELECTED_NETWORKS: ${{ inputs.network }}
SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }}
SLACK_CHANNEL: C03KJ5S7KEK
TEST_INPUTS: ${{ inputs.TestInputs }}
CHAINLINK_ENV_USER: ${{ github.actor }}
REF_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- name: Setup Push Tag
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
echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY

- name: Add mask
run: |
SLACK_USER=$(jq -r '.inputs.slackMemberID' $GITHUB_EVENT_PATH)
echo ::add-mask::$SLACK_USER
echo SLACK_USER=$SLACK_USER >> $GITHUB_ENV
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ env.REF_NAME }}
- name: Build Test Image
uses: ./.github/actions/build-test-image
with:
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 }}
suites: benchmark load/automationv2_1 chaos reorg
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@7d541cbbca52d45b8a718257af86d9cf49774d1f # v2.2.15
env:
RR_CPU: 4000m
RR_MEM: 4Gi
DETACH_RUNNER: true
TEST_SUITE: automationv2_1
TEST_ARGS: -test.timeout 720h
ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }}
INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com
PYROSCOPE_SERVER: ${{ secrets.QA_PYROSCOPE_INSTANCE }}
PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }}
with:
test_command_to_run: cd integration-tests && go test -timeout 1h -v -run TestLogTrigger ./load/automationv2_1 -count=1
test_download_vendor_packages_command: make gomod
cl_repo: ${{ inputs.chainlinkImage }}
cl_image_tag: ${{ inputs.chainlinkVersion }}
token: ${{ secrets.GITHUB_TOKEN }}
should_cleanup: false
go_mod_path: ./integration-tests/go.mod
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@d1618b772a97fd87e6505de97b872ee0b1f1729a # v2.0.2
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: ${{ inputs.network }} Automation Load Test
test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}'
continue-on-error: true
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ core/scripts/gateway @bolekk @pinebit
/.github/workflows/performance-tests.yml @smartcontractkit/test-tooling-team
/.github/workflows/automation-ondemand-tests.yml @smartcontractkit/keepers
/.github/workflows/automation-benchmark-tests.yml @smartcontractkit/keepers
/.github/workflows/automation-load-tests.yml @smartcontractkit/keepers

/core/chainlink.Dockerfile @smartcontractkit/prodsec-public

Expand Down
1 change: 1 addition & 0 deletions contracts/scripts/native_solc_compile_all_automation
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ compileContract automation/v2_0/KeeperRegistryLogic2_0.sol
compileContract automation/UpkeepTranscoder.sol
compileContract automation/mocks/MockAggregatorProxy.sol
compileContract automation/testhelpers/LogUpkeepCounter.sol
compileContract automation/testhelpers/SimpleLogUpkeepCounter.sol

compileContract automation/mocks/KeeperRegistrar1_2Mock.sol
compileContract automation/mocks/KeeperRegistryCheckUpkeepGasUsageWrapper1_2Mock.sol
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.6;

import {ILogAutomation, Log} from "../interfaces/ILogAutomation.sol";

contract SimpleLogUpkeepCounter is ILogAutomation {
event PerformingUpkeep(
address indexed from,
uint256 initialBlock,
uint256 lastBlock,
uint256 previousBlock,
uint256 counter,
uint256 timeToPerform
);

uint256 public lastBlock;
uint256 public previousPerformBlock;
uint256 public initialBlock;
uint256 public counter;
uint256 public timeToPerform;

constructor() {
previousPerformBlock = 0;
lastBlock = block.number;
initialBlock = 0;
counter = 0;
}

function checkLog(Log calldata log, bytes memory) external view override returns (bool, bytes memory) {
return (true, abi.encode(log));
}

function performUpkeep(bytes calldata performData) external override {
if (initialBlock == 0) {
initialBlock = block.number;
}
lastBlock = block.number;
counter = counter + 1;
previousPerformBlock = lastBlock;
Log memory log = abi.decode(performData, (Log));
timeToPerform = block.timestamp - log.timestamp;
emit PerformingUpkeep(tx.origin, initialBlock, lastBlock, previousPerformBlock, counter, timeToPerform);
}
}
Loading
Loading