Run Performance Metrics Cron Job #3110
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: | |
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} | |
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} | |
ARM_ENVIRONMENT: public | |
ARM_LOCATION: westus | |
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} | |
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} | |
AWS_ACCESS_KEY_ID: ' ${{ secrets.AWS_ACCESS_KEY_ID }}' | |
AWS_REGION: us-west-2 | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
CLOUDSDK_CORE_DISABLE_PROMPTS: 1 | |
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }} | |
GOOGLE_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }} | |
GOOGLE_PROJECT: ${{ secrets.GCP_PROJECT_ID }} | |
GOOGLE_REGION: us-central1 | |
GOOGLE_ZONE: us-central1-a | |
PACKET_AUTH_TOKEN: ${{ secrets.PACKET_AUTH_TOKEN }} | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
PULUMI_API: https://api.pulumi-staging.io | |
PULUMI_ENABLE_RESOURCE_REFERENCES: "1" | |
PULUMI_TEST_OWNER: moolumi | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
jobs: | |
performance_metrics_cron: | |
name: performance_metrics_cron | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Install Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v1 | |
with: | |
go-version: ${{matrix.go-version}} | |
- name: Install DotNet ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{matrix.dotnet-version}} | |
- name: Install Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{matrix.node-version}} | |
- name: Install Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{matrix.python-version}} | |
- name: Install Python Deps | |
run: |- | |
pip3 install virtualenv==20.0.23 | |
pip3 install pipenv | |
- 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: 7200 | |
role-session-name: examples@githubActions | |
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} | |
- uses: actions/checkout@v2 | |
- name: Install Latest Stable Pulumi CLI | |
uses: pulumi/setup-pulumi@v2 | |
- run: echo "Currently Pulumi $(pulumi version) is installed" | |
- name: Install Testing Dependencies | |
run: make ensure | |
- name: Install gotestfmt | |
uses: jaxxstorm/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
repo: gotesttools/gotestfmt | |
tag: v2.3.2 | |
cache: enable | |
- 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: Run Performance Matrix | |
# Even if some Go tests fail, others may have succeded and | |
# produced perf data; continue to try to upload it. | |
continue-on-error: true | |
shell: bash | |
run: | | |
set -euo pipefail | |
cd misc/test && go test . --timeout 4h -count=1 -json -short -parallel 40 --tags=Performance 2>&1 | tee /tmp/gotest.log | gotestfmt | |
- 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" | |
strategy: | |
fail-fast: false | |
matrix: | |
dotnet-version: | |
- 6.0.114 | |
go-version: | |
- 1.19.x | |
node-version: | |
- 16.x | |
platform: | |
- ubuntu-latest | |
python-version: | |
- "3.9" |