Run Performance Metrics Cron Job #4232
This file contains 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
name: Run Performance Metrics Cron Job | |
"on": | |
workflow_dispatch: {} | |
schedule: | |
- cron: 0 */6 * * * | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PULUMI_TEST_OWNER: moolumi | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
AWS_REGION: us-west-2 | |
GOOGLE_CI_SERVICE_ACCOUNT_EMAIL: [email protected] | |
GOOGLE_CI_WORKLOAD_IDENTITY_POOL: pulumi-ci | |
GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER: pulumi-ci | |
GOOGLE_PROJECT: pulumi-ci-gcp-provider | |
GOOGLE_PROJECT_NUMBER: 895284651812 | |
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }} | |
SKIPPED_BENCHMARKS: "alicloud,digitalocean,kubernetes,openstack,equinix-metal,civo,aiven,auth0,github,oci,java-jbang,java-gradle,azuredevops,static-website,visualbasic,serverless,container-aws,container-azure,container-gcp,vm-aws,vm-azure,vm-gcp" | |
PULUMI_API: https://api.pulumi-staging.io | |
PULUMI_TRACING_NO_PAYLOADS: 1 | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} | |
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} | |
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} | |
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} | |
AZURE_LOCATION: westus | |
jobs: | |
performance_metrics_cron: | |
name: performance_metrics_cron | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-latest] | |
go-version: [1.21.x] | |
node-version: [18.x] | |
python-version: [3.8] | |
dotnet: [6.0.x] | |
runs-on: ${{ matrix.platform }} | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Install Java 11 (temurin) | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Install DotNet ${{ matrix.dotnet }} | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{matrix.dotnet}} | |
- if: contains(matrix.platform, 'windows') | |
name: DotNet clean on windows | |
run: | | |
dotnet nuget locals all --clear | |
- name: Install Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{matrix.node-version}} | |
- name: Install Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{matrix.python-version}} | |
- name: Install Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{matrix.go-version}} | |
- name: Install Python Deps | |
run: |- | |
pip3 install virtualenv==20.0.23 | |
pip3 install pipenv | |
- name: Install gotestfmt | |
uses: jaxxstorm/[email protected] | |
with: | |
repo: gotesttools/gotestfmt | |
- uses: actions/checkout@v3 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-region: ${{ env.AWS_REGION }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
role-duration-seconds: 14400 # 4 hours | |
role-session-name: templates@githubActions | |
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v0 | |
with: | |
workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER | |
}}/locations/global/workloadIdentityPools/${{ | |
env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ | |
env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} | |
- name: Setup gcloud auth | |
uses: google-github-actions/setup-gcloud@v0 | |
with: | |
install_components: gke-gcloud-auth-plugin | |
- name: Install Pulumi CLI | |
uses: pulumi/actions@v5 | |
with: | |
pulumi-version: dev | |
- run: echo "Currently Pulumi $(pulumi version) is installed" | |
- name: Install Testing Dependencies | |
run: make ensure | |
- name: Create a Folder for Collecting Traces | |
run: |- | |
mkdir "$PWD/traces" | |
- name: Add Test Trace Details | |
run: | | |
echo "PULUMI_VERSION=$(pulumi version)" >> $GITHUB_ENV | |
echo "PULUMI_TRACING_TAG_PULUMI_VERSION=$(pulumi version)" >> $GITHUB_ENV | |
echo "PULUMI_TRACING_DIR=$PWD/traces" >> $GITHUB_ENV | |
- name: Running Performance Matrix | |
shell: bash | |
# Even if some Go tests fail, others may have succeded and | |
# produced perf data; continue to try to upload it. | |
continue-on-error: true | |
run: | | |
set -euo pipefail | |
cd tests/perf && go test -v -json -count=1 -timeout 6h -parallel 1 . 2>&1 | gotestfmt | |
env: | |
PULUMI_PYTHON_CMD: python | |
- name: Upload traces GHA artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: traces | |
path: traces | |
retention-days: 14 | |
- name: Upload Traces to s3://cli-performance-metrics | |
run: |- | |
F="$PWD/traces/metrics.parquet.snappy" | |
RAND=$(python -c 'import uuid; print(uuid.uuid4())') | |
aws s3 cp "$F" "s3://cli-performance-metrics/cli_performance_metrics/date_partition/date=$(date -u +'%Y-%m-%d')/cli_performance_metrics_$RAND.parquet.snappy" |