-
Notifications
You must be signed in to change notification settings - Fork 109
[CLIENT-3541] CI/CD: Add workflows to run QE bob tests for performance regression targeting the Python / C client #930
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
Draft
juliannguyen4
wants to merge
176
commits into
dev
Choose a base branch
from
CLIENT-3541-cicd-performance-regression-tests-using-asmikas-qe-env
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
176 commits
Select commit
Hold shift + click to select a range
3990aec
finish step 1
juliannguyen4 8874083
fix
juliannguyen4 cb602a9
do this way
juliannguyen4 af6406e
2nd repo probably needs to be cd'd into
juliannguyen4 1a0bc99
forgot yaml
juliannguyen4 48b3360
install testctl
juliannguyen4 c221ab7
fix
juliannguyen4 ad02e19
use jf cli instead
juliannguyen4 89a502a
+x
juliannguyen4 c383595
chmod inside new shell
juliannguyen4 47f93c9
.local/bin doesnt exist in PATH?
juliannguyen4 97d75f1
just install in default loc
juliannguyen4 46b25fc
just install in qe-tools/bin
juliannguyen4 e1a8f44
debug
juliannguyen4 7b3950a
action only supports env, but we need the cred file
juliannguyen4 7c34a09
fix
juliannguyen4 01cb334
debug
juliannguyen4 41165de
show version
juliannguyen4 5b14066
add qe section
juliannguyen4 276537a
print out test runs
juliannguyen4 1518ff3
Potential fix for code scanning alert no. 76: Workflow does not conta…
juliannguyen4 07c701a
try running custom test now
juliannguyen4 a2060f1
use test definition registered in bob
juliannguyen4 a10524a
use env var to always get the right test run id
juliannguyen4 6b8cab4
poll test run, then download and print test results
juliannguyen4 a661af2
print cmds for debugging
juliannguyen4 81005fe
fix
juliannguyen4 0b20963
wrong output name
juliannguyen4 e8f9b3b
rm debug step
juliannguyen4 7278491
disable color to fix
juliannguyen4 a87759b
show test run string
juliannguyen4 2057362
trim whitespace
juliannguyen4 4366903
testctl wrong configf
juliannguyen4 7933e37
try skipping downloading build packages since we dont have vpn access
juliannguyen4 6799c6b
flag not in right order
juliannguyen4 99ed17e
fix order of args
juliannguyen4 a28094c
workaround
juliannguyen4 0151a54
revise commenting
juliannguyen4 29d8a8f
set job status
juliannguyen4 53de49d
fail fast on test-enqueue step
juliannguyen4 d6e57fa
set test def to a bogus one
juliannguyen4 48c1976
revert
juliannguyen4 f13043b
improve err msg
juliannguyen4 173d5fd
use heredoc to add aws credentials
juliannguyen4 682a668
heredoc contents maybe needs to be tabbed?
juliannguyen4 891afb3
leading tabs since this is in a for loop
juliannguyen4 a0ac884
rm leading space up to first EOF. <<- will not remove leading whitesp…
juliannguyen4 92dc1c4
rm leading space for 2nd EOF
juliannguyen4 85bfa06
print debug
juliannguyen4 aeca494
fix
juliannguyen4 b361c5e
hide debugging
juliannguyen4 4b208c0
add workflow to enqueue qe tests
juliannguyen4 044416e
rm automatic trigger
juliannguyen4 0f0e9b5
fix order
juliannguyen4 1a0d69d
fix
juliannguyen4 38c6df3
print stderr as well
juliannguyen4 2278a1a
use echo, set -x does not print in the right order
juliannguyen4 d494d8e
use rclone to fetch binaries from google drive
juliannguyen4 51a80df
wrong syntax
juliannguyen4 0983843
fix incorrect names for binaries
juliannguyen4 d7e1136
debug print
juliannguyen4 c498a5f
use the prev version of testctl and test-enqueue. we already register…
juliannguyen4 63c6c3e
fix
juliannguyen4 bcbe93a
Merge remote-tracking branch 'origin/dev' into cicd-performance-regre…
juliannguyen4 3eec83a
update redirected links. double timeout delay
juliannguyen4 9a84c25
Revert "update redirected links. double timeout delay"
juliannguyen4 919d0f0
replace redirected link
juliannguyen4 a22ca22
Revert "replace redirected link"
juliannguyen4 9c10e6c
tail logs
juliannguyen4 08f4a73
Merge remote-tracking branch 'origin/dev' into cicd-performance-regre…
juliannguyen4 7dcbd99
rm dup
juliannguyen4 db9b843
Merge remote-tracking branch 'origin/dev' into cicd-performance-regre…
juliannguyen4 ba313ba
Clear up
juliannguyen4 a4dc5b2
Merge remote-tracking branch 'origin/dev' into cicd-performance-regre…
juliannguyen4 78eb266
Test all the features in our test suite
juliannguyen4 a1fbc38
Merge remote-tracking branch 'origin/dev' into cicd-performance-regre…
juliannguyen4 818b357
add test def for raising exceptions
juliannguyen4 3974005
Skeleton code for building qe docker test image. Add expression test
juliannguyen4 8384aa7
Grant least permissions to GITHUB_TOKEN to stop warnings
juliannguyen4 7b0e13d
Fix syntax
juliannguyen4 ae246b1
ci/cd manual testing
juliannguyen4 4dd28e0
Merge remote-tracking branch 'origin/master' into cicd-performance-re…
juliannguyen4 42d6438
only allow read permissions for getting the repo
juliannguyen4 2f785c8
clone qe-docker using PAT since it is a private repo, and public repo…
juliannguyen4 93dea91
fix
juliannguyen4 5228f86
fix
juliannguyen4 d97ea62
try using bin/build
juliannguyen4 6a0e6ca
Package docker image with wheel to use for performance testing
juliannguyen4 5d3021a
fix syntax
juliannguyen4 f3f7fab
fix
juliannguyen4 e0151b7
fix
juliannguyen4 7450113
fix
juliannguyen4 9466d2c
fix
juliannguyen4 921366f
token registered under jfrog handle?
juliannguyen4 99df934
fix endpoint
juliannguyen4 02f8266
reuse composite action to dl wheel from jfrog
juliannguyen4 f0515c0
fix
juliannguyen4 87b62f8
download wheel in the right place
juliannguyen4 0b14488
wheel in workspace folder?
juliannguyen4 f9cd712
fix
juliannguyen4 a706d16
Setup qemu and buildx to build arm64 images on x86_64, and use gha to…
juliannguyen4 a3aa439
fix tag
juliannguyen4 68f68a8
build on free linux arm runners to avoid emulating arm
juliannguyen4 4697379
follow example
juliannguyen4 4b5aa93
fix dockerfile path
juliannguyen4 b5739ab
code example uses rel path
juliannguyen4 22167d8
under qe-docker folder
juliannguyen4 b95320d
add github sha to docker image tag
juliannguyen4 889cdb1
Revert "add github sha to docker image tag". have to re-register test…
juliannguyen4 6672e34
test e2e
juliannguyen4 7213cac
make test scenario input required. then rename to test definition
juliannguyen4 79fe4a0
client perf hardware uses x86, not arm
juliannguyen4 287bbad
fix
juliannguyen4 50ad071
fix
juliannguyen4 d73803e
push tag prefixed with arm- since *.186 probably looks for image dige…
juliannguyen4 1a9044c
add separate workflow for building wheel from ft branch and running p…
juliannguyen4 d82a730
add new workflow to gh
juliannguyen4 fddbd86
Revert "add new workflow to gh"
juliannguyen4 0929fcf
fix
juliannguyen4 fddfa61
fix
juliannguyen4 50850b0
Give called workflow read content permissions
juliannguyen4 ffb1de5
allow pulling custom manylinux image from ghcr.io/aerospike
juliannguyen4 fb1b217
no longer needed
juliannguyen4 bc76834
calling workflow may be dev-to-stage
juliannguyen4 caaebd4
workflow should only be run manually when we want to use a jfrog wheel
juliannguyen4 1117ba8
prevent race condition
juliannguyen4 552d133
Set at workflow level. A subsequent docker image build job may overri…
juliannguyen4 61bd884
Show run name with inputs
juliannguyen4 7d5a0ae
Merge remote-tracking branch 'origin/dev' into cicd-performance-regre…
juliannguyen4 2d48795
Copy register file from test repo. This should be used as a template …
juliannguyen4 fffe7a6
Add ability to parametrize QE tests at runtime without pushing commit…
juliannguyen4 801227e
Fix
juliannguyen4 09434b7
fix
juliannguyen4 096c7ab
Fix
juliannguyen4 b1b3829
fix
juliannguyen4 31da5db
fix
juliannguyen4 0d4bb06
fix
juliannguyen4 ab66a65
rm
juliannguyen4 29e72ff
debug
juliannguyen4 832a3f0
Add proper attributes
juliannguyen4 30ca2a9
Merge remote-tracking branch 'origin/dev' into cicd-performance-regre…
juliannguyen4 47357c7
Add title so we can more easily identify workflow inputs
juliannguyen4 3a4b470
Add intermediate step to print stdout while also saving stdout to var…
juliannguyen4 010ea1b
Workaround: use intermediate file
juliannguyen4 0b1c04e
debug
juliannguyen4 eeb50fb
Log into tailscale
juliannguyen4 c68af95
Reuse ACMS's credentials for tailscale login. Make exit node a variable
juliannguyen4 31a3830
Merge remote-tracking branch 'origin/dev' into cicd-performance-regre…
juliannguyen4 a7c7ecc
Add stepsecurity steps
juliannguyen4 58e8377
Devops team has now set up OIDC
juliannguyen4 3b6a034
Merge remote-tracking branch 'origin/dev' into cicd-performance-regre…
juliannguyen4 e16f8b3
Merge remote-tracking branch 'origin/dev' into cicd-performance-regre…
juliannguyen4 bd85ec1
fix permissions
juliannguyen4 0911c05
Merge remote-tracking branch 'origin/dev' into cicd-performance-regre…
juliannguyen4 e8c15a2
Temporary workaround until test-register returns an error code when i…
juliannguyen4 5e42215
Fail if error str not found
juliannguyen4 c8a5257
Pipe has higher precedence than or operator
juliannguyen4 b2864d7
Just wait for Minting to add a fix to test-register
juliannguyen4 7ba3e61
Add digest to test container using env var...
juliannguyen4 b9ba057
fix
juliannguyen4 2498a13
Fix
juliannguyen4 3965e24
path already includes perf_regression
juliannguyen4 a5df6b5
Add ability to run any revision of the qe tests
juliannguyen4 976e72b
When running test-enqueue we need to specify the correct test code re…
juliannguyen4 3bcea64
fix
juliannguyen4 e9dd0bc
Add ability to build from any qe-docker revision
juliannguyen4 ff465a0
Print logs in real time
juliannguyen4 7765d64
Revert "Print logs in real time". Does not work
juliannguyen4 e2eade5
Merge remote-tracking branch 'origin/dev' into CLIENT-3541-cicd-perfo…
juliannguyen4 691d6a8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] dff08a0
Address actionlint errors.
juliannguyen4 cfe381b
Merge remote-tracking branch 'origin/dev' into CLIENT-3541-cicd-perfo…
juliannguyen4 b309d27
Merge remote-tracking branch 'origin/dev' into CLIENT-3541-cicd-perfo…
juliannguyen4 ad751a3
Remove outdated CI/CD code before release bundle support was added to…
juliannguyen4 83b9b95
Have build and run perf workflow allow requesting id-token to build t…
juliannguyen4 3601045
Merge remote-tracking branch 'origin/dev' into CLIENT-3541-cicd-perfo…
juliannguyen4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
.github/workflows/build-wheel-and-run-perf-regression-test.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| permissions: | ||
| statuses: write | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| test-definition: | ||
| required: true | ||
| description: Test definition | ||
|
|
||
| jobs: | ||
| build-wheel-for-feature-branch: | ||
| uses: ./.github/workflows/build-and-optionally-test-wheels-on-one-platform.yml | ||
| with: | ||
| # TODO: single source | ||
| platform-tag: manylinux_x86_64 | ||
| python-versions: '["3.10"]' | ||
| secrets: inherit | ||
|
|
||
| run-qe-test: | ||
| needs: build-wheel-for-feature-branch | ||
| uses: ./.github/workflows/run-qe-test.yml | ||
| with: | ||
| test-definition: ${{ inputs.test-definition }} | ||
| # CLIENT-4733-migrate-from-internal-ansible-api-to-ansible-runner-to-clean-up-technical-debt | ||
| test-code-revision: af16b3a63c8852760ad78c64301135adb55dfdeb | ||
| qe-docker-revision: cicd-client-performance-regression-tests-requirements-txt | ||
| secrets: inherit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,344 @@ | ||
| run-name: "Run QE test (feature=${{ inputs.feature }}, num_records=${{ inputs.num_records }}, insert_mode=${{ inputs.insert_mode }})" | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| test-definition: | ||
| type: string | ||
| required: true | ||
| description: "Test definition without the branch (i.e remove '<branch>@')" | ||
| test-code-revision: | ||
| type: string | ||
| required: true | ||
| description: "Test code revision" | ||
| qe-docker-revision: | ||
| type: string | ||
| required: true | ||
| description: "qe-docker revision containing image" | ||
| feature: | ||
| required: true | ||
| description: "Client feature to test" | ||
| num_records: | ||
| type: number | ||
| default: 1000000 | ||
| description: Number of records to use in workload | ||
| insert_mode: | ||
| required: true | ||
| type: choice | ||
| description: Insert mode means don't check for outliers. | ||
| options: | ||
| - insert | ||
| - outlier | ||
| workflow_call: | ||
| inputs: | ||
| # workflow_call hack | ||
| is-workflow-call: | ||
| type: boolean | ||
| default: true | ||
| required: false | ||
| test-code-revision: | ||
| type: string | ||
| required: true | ||
| description: "Test code revision" | ||
| qe-docker-revision: | ||
| type: string | ||
| required: true | ||
| description: "qe-docker revision containing image" | ||
| test-definition: | ||
| type: string | ||
| required: true | ||
| description: "Test definition without the branch (i.e remove '<branch>@')" | ||
|
|
||
| # Prevent another job from overriding the Docker image | ||
| concurrency: | ||
| group: ${{ github.workflow }} | ||
|
|
||
| jobs: | ||
| # For this job, I used Andrew Kim's workflow in qe-docker repo as a reference | ||
| # https://github.com/citrusleaf/qe-docker/commit/d72f2d3fda70e199e24f4f670811d6e33e7f92be | ||
| add-python-client-to-qe-test-image-for-performance-regression-tests: | ||
| env: | ||
| WHEEL_ARCH: x86_64 | ||
| outputs: | ||
| new-test-image-digest: ${{ steps.build.outputs.digest }} | ||
| runs-on: ubuntu-24.04-arm | ||
| steps: | ||
| - name: Harden the runner (Audit all outbound calls) | ||
| uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 | ||
| with: | ||
| egress-policy: audit | ||
| - name: Get Github action to download wheel from JFrog | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| path: aerospike-client-python | ||
|
|
||
| - name: Get Github actions workflow to build Docker image | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| repository: citrusleaf/qe-docker | ||
| path: qe-docker | ||
| ref: ${{ inputs.qe-docker-revision }} | ||
| token: ${{ secrets.CLIENT_BOT_PAT }} | ||
|
|
||
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| # TODO: shouldn't hardcode | ||
| pattern: ${{ vars.GH_ARTIFACT_NAME_PREFIX_FOR_BUILDS }}-3.10-manylinux_x86_64 | ||
|
|
||
| - name: Add wheel to staging folder for building Docker image | ||
| run: mv ./*linux*${{ env.WHEEL_ARCH }}*.whl qe-docker/test/python/_files/ | ||
|
|
||
| - name: Log in to QE's Docker registry to download base image and publish new image | ||
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | ||
| with: | ||
| registry: ${{ secrets.QE_DOCKER_REGISTRY_URL }} | ||
| username: ${{ secrets.QE_DOCKER_REGISTRY_USERNAME }} | ||
| password: ${{ secrets.QE_DOCKER_REGISTRY_PASSWORD }} | ||
|
|
||
| # No way to set our own tag | ||
| # - run: ./bin/build -b -p -m test/python/3.11-mavenAnsible-client.Dockerfile | ||
|
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | ||
| id: build | ||
| with: | ||
| push: true | ||
| # TODO: set branch in tag | ||
| file: ./qe-docker/test/python/${{ env.TEST_IMAGE_TAG }}.Dockerfile | ||
| # Although our client perf test definitions state the test images where the tag doesn't have the arm- prefix | ||
| # Bob seems to look for the same tag from the test definition, but prefixed with arm- | ||
| tags: ${{ secrets.QE_DOCKER_REGISTRY_URL }}/test/python:arm-${{ env.TEST_IMAGE_TAG }} | ||
| context: ./qe-docker/test/python/_files | ||
| env: | ||
| TEST_IMAGE_TAG: 3.11-mavenAnsible-client | ||
|
|
||
| register-test-definition-with-custom-env-var-parameters: | ||
| needs: add-python-client-to-qe-test-image-for-performance-regression-tests | ||
| runs-on: ubuntu-24.04 | ||
| env: | ||
| REGISTER_FILE_PATH_IN_REPO: perf_regression/register-client-tests.yaml | ||
| steps: | ||
| - name: Harden the runner (Audit all outbound calls) | ||
| uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 | ||
| with: | ||
| egress-policy: audit | ||
| # TODO: composite action for this would be helpful | ||
| # TODO: need special testctl not in jfrog yet | ||
| - name: Get test-register | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| repository: citrusleaf/qe-tools | ||
| token: ${{ secrets.CLIENT_BOT_PAT }} | ||
| path: qe-tools | ||
| sparse-checkout: | | ||
| bin/test-register | ||
| sparse-checkout-cone-mode: false | ||
|
|
||
| - name: Add test-register to PATH | ||
| run: realpath qe-tools/bin >> "$GITHUB_PATH" | ||
|
|
||
| - uses: jfrog/setup-jfrog-cli@5b06f730cc5a6f55d78b30753f8583454b08c0aa # v4.8.1 | ||
| env: | ||
| JF_URL: ${{ secrets.JFROG_PLATFORM_URL }} | ||
| JF_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }} | ||
|
|
||
| - run: jf rt download --fail-no-op qe-go-dev-local/testctl.amd64.linux qe-tools/bin/testctl | ||
| - run: chmod u+x ./testctl | ||
| working-directory: qe-tools/bin | ||
|
|
||
| - name: Add AWS credentials | ||
| run: | | ||
| mkdir -p ~/.aws | ||
| cd ~/.aws | ||
| sections=("default" "qe") | ||
| for section in "${sections[@]}"; | ||
| do | ||
| cat <<-EOF >> credentials | ||
| [$section] | ||
| aws_access_key_id = ${{ secrets.QE_TEST_ENQUEUE_AWS_ACCESS_KEY_ID }} | ||
| aws_secret_access_key = ${{ secrets.QE_TEST_ENQUEUE_AWS_SECRET_ACCESS_KEY }} | ||
| region = us-west-1 | ||
| EOF | ||
| done | ||
| shell: bash | ||
|
|
||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| # Entire repo must be cloned because the test definition includes this repo | ||
| repository: citrusleaf/aerospike-tests-python | ||
| token: ${{ secrets.CLIENT_BOT_PAT }} | ||
| path: aerospike-tests-python | ||
| ref: ${{ inputs.test-code-revision }} | ||
| fetch-depth: 0 | ||
|
|
||
| - run: cp ${{ env.REGISTER_FILE_PATH_IN_REPO }}.template ${{ env.REGISTER_FILE_PATH_IN_REPO }} | ||
| working-directory: aerospike-tests-python/ | ||
|
|
||
| - name: Environment variable overrides | ||
| run: | | ||
| yq eval ".perf_regression/client_centered.environment.MODE = \"${{ inputs.insert_mode }}\"" -i ${{ env.REGISTER_FILE_PATH_IN_REPO }} | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can use shared var |
||
| yq eval ".perf_regression/client_centered.environment.NUM_RECORDS = \"${{ inputs.num_records }}\"" -i ${{ env.REGISTER_FILE_PATH_IN_REPO }} | ||
| yq eval ".perf_regression/client_centered.environment.FEATURE = \"${{ inputs.feature }}\"" -i ${{ env.REGISTER_FILE_PATH_IN_REPO }} | ||
| yq eval ".perf_regression/client_centered.environment.TEST_IMAGE_DIGEST = \"${{ needs.add-python-client-to-qe-test-image-for-performance-regression-tests.outputs.new-test-image-digest }}\"" -i ${{ env.REGISTER_FILE_PATH_IN_REPO }} | ||
| cat ${{ env.REGISTER_FILE_PATH_IN_REPO }} | ||
| working-directory: aerospike-tests-python | ||
|
|
||
| - uses: tailscale/github-action@53acf823325fe9ca47f4cdaa951f90b4b0de5bb9 | ||
| with: | ||
| oauth-client-id: ${{ vars.TAILSCALE_OIDC_CLIENT_ID }} | ||
| audience: ${{ vars.TAILSCALE_OIDC_AUDIENCE }} | ||
| tags: tag:aerospike-oidc | ||
| args: --exit-node=${{ vars.TAILSCALE_EXIT_NODE}} | ||
| version: 1.92.5 | ||
|
|
||
| - run: test-register --config staging ./${{ env.REGISTER_FILE_PATH_IN_REPO }} | ||
| working-directory: aerospike-tests-python | ||
|
|
||
| run-qe-test: | ||
| env: | ||
| TEST_CONFIG_FILE_NAME: client_perf.yaml | ||
| TESTCTL_BINARY_NAME: testctl | ||
| runs-on: ubuntu-24.04 | ||
| needs: [ | ||
| register-test-definition-with-custom-env-var-parameters | ||
| ] | ||
| steps: | ||
| - name: Harden the runner (Audit all outbound calls) | ||
| uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 | ||
| with: | ||
| egress-policy: audit | ||
| # - name: Setup Rclone | ||
| # uses: AnimMouse/setup-rclone@0d99fa3878a334d3e307c1a8372ad55550fdaea7 | ||
| # with: | ||
| # rclone_config: ${{ secrets.RCLONE_CONFIG }} | ||
|
|
||
| # - name: Download test-enqueue and testctl | ||
| # run: 'rclone --drive-root-folder-id ${{ secrets.TEST_ENQUEUE_PERF_GOOGLE_DRIVE_FOLDER_ID }} copy remote:/ ~/bin' | ||
|
|
||
| # - name: Add test-enqueue and testctl to PATH | ||
| # run: | | ||
| # ls -l ~/bin | ||
| # echo "$(realpath ~/bin)" >> $GITHUB_PATH | ||
|
|
||
| - name: Get test-enqueue | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| repository: citrusleaf/qe-tools | ||
| token: ${{ secrets.CLIENT_BOT_PAT }} | ||
| path: qe-tools | ||
| sparse-checkout: | | ||
| bin/test-enqueue | ||
| sparse-checkout-cone-mode: false | ||
|
|
||
| - name: Add test-enqueue to PATH | ||
| run: realpath qe-tools/bin >> "$GITHUB_PATH" | ||
|
|
||
| - uses: jfrog/setup-jfrog-cli@5b06f730cc5a6f55d78b30753f8583454b08c0aa # v4.8.1 | ||
| env: | ||
| JF_URL: ${{ secrets.JFROG_PLATFORM_URL }} | ||
| JF_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }} | ||
|
|
||
| - run: jf rt download qe-go-dev-local/testctl.amd64.linux qe-tools/bin/testctl | ||
| - run: chmod u+x ./testctl | ||
| working-directory: qe-tools/bin | ||
|
|
||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| path: aerospike-client-python | ||
| sparse-checkout: | | ||
| test/${{ env.TEST_CONFIG_FILE_NAME }} | ||
| sparse-checkout-cone-mode: false | ||
|
|
||
| - name: Add AWS credentials | ||
| run: | | ||
| mkdir -p ~/.aws | ||
| cd ~/.aws | ||
| sections=("default" "qe") | ||
| for section in "${sections[@]}"; | ||
| do | ||
| cat <<-EOF >> credentials | ||
| [$section] | ||
| aws_access_key_id = ${{ secrets.QE_TEST_ENQUEUE_AWS_ACCESS_KEY_ID }} | ||
| aws_secret_access_key = ${{ secrets.QE_TEST_ENQUEUE_AWS_SECRET_ACCESS_KEY }} | ||
| region = us-west-1 | ||
| EOF | ||
| done | ||
| shell: bash | ||
|
|
||
| - run: testctl --version | ||
|
|
||
| # test-enqueue hides testctl's output, so this can be helpful for debugging | ||
| # - run: testctl --config staging run 901b1178-0159-452d-9b36-64d455e568f2 --deployment perf_client | ||
| working-directory: aerospike-client-python/test/ | ||
|
|
||
| - name: Allows us to get the exact test run id that was created by test-enqueue. | ||
| run: echo "TESTCTL_USER=$(uuidgen)" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Set the test code revision to run. | ||
| run: yq -i '.definitions.std.[0] = "${{ inputs.test-code-revision }}@${{ inputs.test-definition }}"' ${{ env.TEST_CONFIG_FILE_NAME }} | ||
| working-directory: aerospike-client-python/test/ | ||
|
|
||
| - name: Tailscale VPN | ||
| uses: tailscale/github-action@53acf823325fe9ca47f4cdaa951f90b4b0de5bb9 | ||
| with: | ||
| oauth-client-id: ${{ vars.TAILSCALE_OIDC_CLIENT_ID }} | ||
| audience: ${{ vars.TAILSCALE_OIDC_AUDIENCE }} | ||
| tags: tag:aerospike-oidc | ||
| args: --exit-node=${{ vars.TAILSCALE_EXIT_NODE}} | ||
| version: 1.92.5 | ||
|
|
||
| - name: Enqueue test run and fail fast if unable to enqueue | ||
| # if: ${{ false }} | ||
| run: | | ||
| test-enqueue --config staging --deployment perf_client ${{ env.TEST_CONFIG_FILE_NAME }} | tee test-enqueue-output.log | ||
| enqueue_count=$(grep "COUNT:" test-enqueue-output.log | sed 's/COUNT\://' | xargs) | ||
| if [[ "$enqueue_count" != "1" ]]; then | ||
| echo "We expected 1 test run to be enqueued, but $enqueue_count was actually enqueued." | ||
| exit 1 | ||
| fi | ||
| working-directory: aerospike-client-python/test/ | ||
|
|
||
| # - name: Print test logs in real time | ||
| # run: sshpass -p ${{ secrets.PERF_PASSWORD }} ssh ${{ secrets.PERF_USERNAME }}@${{ secrets.PERF_HOST }} docker logs -f test_0 | ||
|
|
||
| - name: Wait for test run to finish | ||
| id: poll-run-id | ||
| run: | | ||
| while true; do | ||
| # Color messes up the run_id's string | ||
| # Use xargs to trim whitespace from testctl's output | ||
| run_id=$(${{ env.TESTCTL_BINARY_NAME }} --config staging ps --no-color --user ${{ env.TESTCTL_USER }} -n 1 -status completed --columns RUN_ID | sed '1d' | xargs) | ||
| if [[ -z "$run_id" ]]; then | ||
| echo "Test run has not finished yet..." | ||
| sleep 2 | ||
| else | ||
| echo "Test run $run_id has finished." | ||
| break | ||
| fi | ||
| done | ||
| echo "run_id=$run_id" >> "$GITHUB_OUTPUT" | ||
|
|
||
| # Downloading builds doesn't work here, so we disable it | ||
| - run: ${{ env.TESTCTL_BINARY_NAME }} --config staging download --skip-build-download ${{ steps.poll-run-id.outputs.run_id }} | ||
|
|
||
| - name: Print test run logs | ||
| run: | | ||
| cd ${{ steps.poll-run-id.outputs.run_id }}*/work/test_0 | ||
| echo "stdout:" | ||
| cat stdout | ||
| echo "stderr:" | ||
| cat stderr | ||
|
|
||
| - name: Set Github job status | ||
| run: | | ||
| run_status="$("$TESTCTL_BINARY_NAME" --config staging ps --no-color --user "$TESTCTL_USER" -n 1 -status completed --columns STATUS | sed '1d' | xargs)" | ||
| echo "$run_status" | ||
| if [[ "$run_status" == "Failure" ]]; then | ||
| exit 1 | ||
| else | ||
| exit 0 | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be revoked