From ea3c124e0a574a9614cd03c77bc51adbacde2556 Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Wed, 14 Jan 2026 09:14:35 -0800 Subject: [PATCH 01/10] chore: upload performance benchmarks to cloudwatch --- .../workflows/performance-benchmarks-go.yml | 106 ++++++++++++++++++ .github/workflows/performance-benchmarks.yml | 35 ++++++ 2 files changed, 141 insertions(+) create mode 100644 .github/workflows/performance-benchmarks-go.yml create mode 100644 .github/workflows/performance-benchmarks.yml diff --git a/.github/workflows/performance-benchmarks-go.yml b/.github/workflows/performance-benchmarks-go.yml new file mode 100644 index 000000000..802a93d80 --- /dev/null +++ b/.github/workflows/performance-benchmarks-go.yml @@ -0,0 +1,106 @@ +# This workflow performs benchmark testing in Go. +name: Performance Benchmarks Go + +on: + workflow_call: + inputs: + dafny: + description: "The Dafny version to run" + required: true + type: string + regenerate-code: + description: "Regenerate code using smithy-dafny" + required: false + default: false + type: boolean + +jobs: + testGo: + strategy: + fail-fast: false + matrix: + library: [AwsEncryptionSDK] + benchmark-dir: [esdk-performance-testing] + go-version: ["1.23", "1.24", "1.25"] + os: [ + # Sed script doesn't work properly on windows + # windows-latest, + ubuntu-22.04, + # TODO: Re-enable macOS after https://t.corp.amazon.com/P205755286 + # macos-15, + ] + runs-on: ${{ matrix.os }} + permissions: + id-token: write + contents: read + steps: + - name: Support longpaths on Git checkout + run: | + git config --global core.longpaths true + - uses: actions/checkout@v5 + - name: Init Submodules + shell: bash + run: | + git submodule update --init libraries + git submodule update --init --recursive mpl + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v5 + with: + aws-region: us-west-2 + role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2 + role-session-name: GoTests + + - name: Setup Dafny + uses: ./mpl/.github/actions/setup_dafny + with: + dafny-version: ${{ inputs.dafny }} + + - name: Install Smithy-Dafny codegen dependencies + uses: ./.github/actions/install_smithy_dafny_codegen_dependencies + + - name: Setup NASM for Windows (aws-lc-sys) + if: matrix.os == 'windows-latest' + uses: ilammy/setup-nasm@v1 + + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: ${{ matrix.go-version }} + + - name: Compile ${{ matrix.library }} implementation + shell: bash + working-directory: ${{ matrix.library }} + run: | + # This works because `node` is installed by default on GHA runners + CORES=$(node -e 'console.log(os.cpus().length)') + make transpile_go CORES=$CORES + + - name: Run Performance Benchmarks - Quick Mode + shell: bash + working-directory: ./${{matrix.benchmark-dir}}/benchmarks/go + run: | + go run . --config ../config/test-scenarios.yaml --quick + + - name: Parse and Format Logs + working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ + run: | + LOG_FILE="go_results.json" + UPLOAD_FILE="cloudwatch_logs.json" + TIMESTAMP=$(date +%s%3N) + jq -c --arg ts "$(date +%s)000" '.results[] as $result | .metadata as $meta | {timestamp: ($ts | tonumber), message: ({metadata: $meta, result: $result} | tostring)}' $LOG_FILE > $UPLOAD_FILE + + - name: Upload logs to CloudWatch + working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ + run: | + LOG_FILE="cloudwatch_logs.json" + LOG_GROUP="aws-esdk-performance-benchmarks" + LOG_STREAM="go/quick_benchmarks/${{ github.workflow }}/${{ github.run_id }}" + # Create log stream (ignore if exists) + aws logs create-log-stream \ + --log-group-name "$LOG_GROUP" \ + --log-stream-name "$LOG_STREAM" 2>/dev/null || true + aws logs put-log-events \ + --log-group-name "$LOG_GROUP" \ + --log-stream-name "$LOG_STREAM" \ + --log-events file://$LOG_FILE \ No newline at end of file diff --git a/.github/workflows/performance-benchmarks.yml b/.github/workflows/performance-benchmarks.yml new file mode 100644 index 000000000..6ae4fd819 --- /dev/null +++ b/.github/workflows/performance-benchmarks.yml @@ -0,0 +1,35 @@ +# This workflow runs every day 09:00 UTC (1AM PST) +name: Performance Benchmarks + +permissions: + contents: read + +on: + pull_request: + paths: + - ".github/workflows/performance-benchmarks.yml" + schedule: + - cron: "00 09 * * *" + +jobs: + getVersion: + if: github.event_name != 'schedule' || github.repository_owner == 'aws' + uses: ./.github/workflows/dafny_version.yaml + performance-benchmarks-go: + needs: getVersion + uses: ./.github/workflows/performance-benchmarks-go.yml + with: + dafny: ${{needs.getVersion.outputs.version}} + notify: + needs: + [ + getVersion, + performance-benchmarks-go + ] + if: ${{ failure() }} + uses: aws/aws-cryptographic-material-providers-library/.github/workflows/slack-notification.yml@main + with: + message: "Performance Benchmarks failed on `${{ github.repository }}`. View run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_CI }} + From 7d8bc2c9aa662ab1632c656ed4282198ffe5b58c Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Wed, 14 Jan 2026 09:18:43 -0800 Subject: [PATCH 02/10] fix syntax --- .github/workflows/performance-benchmarks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/performance-benchmarks.yml b/.github/workflows/performance-benchmarks.yml index 6ae4fd819..e023ee264 100644 --- a/.github/workflows/performance-benchmarks.yml +++ b/.github/workflows/performance-benchmarks.yml @@ -2,6 +2,7 @@ name: Performance Benchmarks permissions: + id-token: write contents: read on: From 969a42ad5ac3535a80ce3a259714fe9dd19e7c0e Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Wed, 14 Jan 2026 09:29:28 -0800 Subject: [PATCH 03/10] m --- .github/workflows/performance-benchmarks-go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance-benchmarks-go.yml b/.github/workflows/performance-benchmarks-go.yml index 802a93d80..919f98b71 100644 --- a/.github/workflows/performance-benchmarks-go.yml +++ b/.github/workflows/performance-benchmarks-go.yml @@ -80,7 +80,7 @@ jobs: shell: bash working-directory: ./${{matrix.benchmark-dir}}/benchmarks/go run: | - go run . --config ../config/test-scenarios.yaml --quick + go run . --config ../../config/test-scenarios.yaml --quick - name: Parse and Format Logs working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ From 6b11f11d294636966a044915eced6c13d2981506 Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Wed, 14 Jan 2026 09:35:50 -0800 Subject: [PATCH 04/10] m --- .github/workflows/performance-benchmarks-go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance-benchmarks-go.yml b/.github/workflows/performance-benchmarks-go.yml index 919f98b71..35e363f8b 100644 --- a/.github/workflows/performance-benchmarks-go.yml +++ b/.github/workflows/performance-benchmarks-go.yml @@ -95,7 +95,7 @@ jobs: run: | LOG_FILE="cloudwatch_logs.json" LOG_GROUP="aws-esdk-performance-benchmarks" - LOG_STREAM="go/quick_benchmarks/${{ github.workflow }}/${{ github.run_id }}" + LOG_STREAM="go/${{matrix.go-version}}/quick_benchmarks/${{ github.workflow }}/${{ github.run_id }}" # Create log stream (ignore if exists) aws logs create-log-stream \ --log-group-name "$LOG_GROUP" \ From 95119cdb7daf76311bccb9de6a8ba559add776f2 Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Wed, 14 Jan 2026 09:50:20 -0800 Subject: [PATCH 05/10] m --- .github/workflows/performance-benchmarks-go.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/performance-benchmarks-go.yml b/.github/workflows/performance-benchmarks-go.yml index 35e363f8b..b1ae2839f 100644 --- a/.github/workflows/performance-benchmarks-go.yml +++ b/.github/workflows/performance-benchmarks-go.yml @@ -88,7 +88,7 @@ jobs: LOG_FILE="go_results.json" UPLOAD_FILE="cloudwatch_logs.json" TIMESTAMP=$(date +%s%3N) - jq -c --arg ts "$(date +%s)000" '.results[] as $result | .metadata as $meta | {timestamp: ($ts | tonumber), message: ({metadata: $meta, result: $result} | tostring)}' $LOG_FILE > $UPLOAD_FILE + jq -c --arg ts "$(date +%s)000" '[.results[] as $result | .metadata as $meta | {timestamp: ($ts | tonumber), message: ({metadata: $meta, result: $result} | tostring)}]' $LOG_FILE > $UPLOAD_FILE - name: Upload logs to CloudWatch working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ @@ -96,10 +96,12 @@ jobs: LOG_FILE="cloudwatch_logs.json" LOG_GROUP="aws-esdk-performance-benchmarks" LOG_STREAM="go/${{matrix.go-version}}/quick_benchmarks/${{ github.workflow }}/${{ github.run_id }}" + # Create log stream (ignore if exists) aws logs create-log-stream \ --log-group-name "$LOG_GROUP" \ --log-stream-name "$LOG_STREAM" 2>/dev/null || true + aws logs put-log-events \ --log-group-name "$LOG_GROUP" \ --log-stream-name "$LOG_STREAM" \ From 848b4556778c5f106a48d5829330b5721d4960c3 Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Wed, 14 Jan 2026 13:47:04 -0800 Subject: [PATCH 06/10] add other languages --- .../workflows/performance-benchmarks-go.yml | 2 +- .../workflows/performance-benchmarks-java.yml | 79 +++++++++++ .../workflows/performance-benchmarks-net.yml | 119 ++++++++++++++++ .../performance-benchmarks-python.yml | 76 +++++++++++ .../workflows/performance-benchmarks-rust.yml | 127 ++++++++++++++++++ .github/workflows/performance-benchmarks.yml | 22 ++- 6 files changed, 423 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/performance-benchmarks-java.yml create mode 100644 .github/workflows/performance-benchmarks-net.yml create mode 100644 .github/workflows/performance-benchmarks-python.yml create mode 100644 .github/workflows/performance-benchmarks-rust.yml diff --git a/.github/workflows/performance-benchmarks-go.yml b/.github/workflows/performance-benchmarks-go.yml index b1ae2839f..c6d3398d9 100644 --- a/.github/workflows/performance-benchmarks-go.yml +++ b/.github/workflows/performance-benchmarks-go.yml @@ -95,7 +95,7 @@ jobs: run: | LOG_FILE="cloudwatch_logs.json" LOG_GROUP="aws-esdk-performance-benchmarks" - LOG_STREAM="go/${{matrix.go-version}}/quick_benchmarks/${{ github.workflow }}/${{ github.run_id }}" + LOG_STREAM="go/${{matrix.go-version}}/quick_benchmarks/${{ github.workflow }}" # Create log stream (ignore if exists) aws logs create-log-stream \ diff --git a/.github/workflows/performance-benchmarks-java.yml b/.github/workflows/performance-benchmarks-java.yml new file mode 100644 index 000000000..1a424316f --- /dev/null +++ b/.github/workflows/performance-benchmarks-java.yml @@ -0,0 +1,79 @@ +# This workflow performs benchmark testing in Java. +name: Performance Benchmarks Go + +on: + workflow_call: + +jobs: + testGo: + strategy: + fail-fast: false + matrix: + benchmark-dir: [esdk-performance-testing] + java: [8, 11, 17] + os: [ + # Sed script doesn't work properly on windows + # windows-latest, + ubuntu-22.04, + # TODO: Re-enable macOS after https://t.corp.amazon.com/P205755286 + # macos-15, + ] + runs-on: ${{ matrix.os }} + permissions: + id-token: write + contents: read + steps: + - name: Support longpaths on Git checkout + run: | + git config --global core.longpaths true + - uses: actions/checkout@v5 + - name: Init Submodules + shell: bash + run: | + git submodule update --init libraries + git submodule update --init --recursive mpl + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v5 + with: + aws-region: us-west-2 + role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2 + role-session-name: GoTests + + - name: Setup Java Corretto ${{matrix.java}} + uses: actions/setup-java@v5 + with: + distribution: "corretto" + java-version: ${{matrix.java}} + + - name: Run Performance Benchmarks - Quick Mode + shell: bash + working-directory: ./${{matrix.benchmark-dir}}/benchmarks/java + run: | + mvn clean compile + mvn exec:java -Dexec.mainClass="com.amazon.esdk.benchmark.Program" -Dexec.args="--quick" + + - name: Parse and Format Logs + working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ + run: | + LOG_FILE="java_results.json" + UPLOAD_FILE="cloudwatch_logs.json" + TIMESTAMP=$(date +%s%3N) + jq -c --arg ts "$(date +%s)000" '[.results[] as $result | .metadata as $meta | {timestamp: ($ts | tonumber), message: ({metadata: $meta, result: $result} | tostring)}]' $LOG_FILE > $UPLOAD_FILE + + - name: Upload logs to CloudWatch + working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ + run: | + LOG_FILE="cloudwatch_logs.json" + LOG_GROUP="aws-esdk-performance-benchmarks" + LOG_STREAM="java/corretto/${{matrix.java}}/quick_benchmarks/${{ github.workflow }}" + + # Create log stream (ignore if exists) + aws logs create-log-stream \ + --log-group-name "$LOG_GROUP" \ + --log-stream-name "$LOG_STREAM" 2>/dev/null || true + + aws logs put-log-events \ + --log-group-name "$LOG_GROUP" \ + --log-stream-name "$LOG_STREAM" \ + --log-events file://$LOG_FILE \ No newline at end of file diff --git a/.github/workflows/performance-benchmarks-net.yml b/.github/workflows/performance-benchmarks-net.yml new file mode 100644 index 000000000..5b5123f68 --- /dev/null +++ b/.github/workflows/performance-benchmarks-net.yml @@ -0,0 +1,119 @@ +# This workflow performs benchmark testing in Net. +name: Performance Benchmarks Net + +on: + workflow_call: + inputs: + dafny: + description: "The Dafny version to run" + required: true + type: string + regenerate-code: + description: "Regenerate code using smithy-dafny" + required: false + default: false + type: boolean + +jobs: + testGo: + strategy: + fail-fast: false + matrix: + library: [AwsEncryptionSDK] + benchmark-dir: [esdk-performance-testing] + os: [ + windows-latest, + ubuntu-22.04, + # TODO: Re-enable macOS after https://t.corp.amazon.com/P205755286 + # macos-15, + ] + runs-on: ${{ matrix.os }} + permissions: + id-token: write + contents: read + env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_NOLOGO: 1 + steps: + - name: Support longpaths on Git checkout + run: | + git config --global core.longpaths true + - uses: actions/checkout@v5 + - name: Init Submodules + shell: bash + run: | + git submodule update --init libraries + git submodule update --init --recursive mpl + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v5 + with: + aws-region: us-west-2 + role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2 + role-session-name: NetTests + + - name: Setup .NET Core SDK 6 + uses: actions/setup-dotnet@v5 + with: + dotnet-version: "6.0.x" + + - name: Setup Dafny + uses: ./mpl/.github/actions/setup_dafny + with: + dafny-version: ${{ inputs.dafny }} + + - name: Install Smithy-Dafny codegen dependencies + uses: ./.github/actions/install_smithy_dafny_codegen_dependencies + + - name: Regenerate code using smithy-dafny if necessary + if: ${{ inputs.regenerate-code }} + uses: ./.github/actions/polymorph_codegen + with: + dafny: ${{ env.DAFNY_VERSION }} + library: ${{ matrix.library }} + diff-generated-code: false + update-and-regenerate-mpl: true + + - name: Download Dependencies + working-directory: ${{ matrix.library }} + run: make setup_net + + - name: Compile ${{ matrix.library }} implementation + shell: bash + working-directory: ${{ matrix.library }} + run: | + # This works because `node` is installed by default on GHA runners + CORES=$(node -e 'console.log(os.cpus().length)') + make transpile_net CORES=$CORES + + - name: Run Performance Benchmarks - Quick Mode + shell: bash + working-directory: ./${{matrix.benchmark-dir}}/benchmarks/net + run: | + dotnet build --configuration Release + dotnet run --configuration Release -- --quick + + - name: Parse and Format Logs + working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ + run: | + LOG_FILE="net_results.json" + UPLOAD_FILE="cloudwatch_logs.json" + TIMESTAMP=$(date +%s%3N) + jq -c --arg ts "$(date +%s)000" '[.results[] as $result | .metadata as $meta | {timestamp: ($ts | tonumber), message: ({metadata: $meta, result: $result} | tostring)}]' $LOG_FILE > $UPLOAD_FILE + + - name: Upload logs to CloudWatch + working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ + run: | + LOG_FILE="cloudwatch_logs.json" + LOG_GROUP="aws-esdk-performance-benchmarks" + LOG_STREAM="net/${{matrix.os}}/quick_benchmarks/${{ github.workflow }}" + + # Create log stream (ignore if exists) + aws logs create-log-stream \ + --log-group-name "$LOG_GROUP" \ + --log-stream-name "$LOG_STREAM" 2>/dev/null || true + + aws logs put-log-events \ + --log-group-name "$LOG_GROUP" \ + --log-stream-name "$LOG_STREAM" \ + --log-events file://$LOG_FILE \ No newline at end of file diff --git a/.github/workflows/performance-benchmarks-python.yml b/.github/workflows/performance-benchmarks-python.yml new file mode 100644 index 000000000..0c7053b70 --- /dev/null +++ b/.github/workflows/performance-benchmarks-python.yml @@ -0,0 +1,76 @@ +# This workflow performs benchmark testing in Java. +name: Performance Benchmarks Go + +on: + workflow_call: + +jobs: + testGo: + strategy: + fail-fast: false + matrix: + benchmark-dir: [esdk-performance-testing] + python-version: ["3.11", "3.13"] + os: [ + ubuntu-22.04, + macos-14, + ] + runs-on: ${{ matrix.os }} + permissions: + id-token: write + contents: read + steps: + - name: Support longpaths on Git checkout + run: | + git config --global core.longpaths true + - uses: actions/checkout@v5 + - name: Init Submodules + shell: bash + run: | + git submodule update --init libraries + git submodule update --init --recursive mpl + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v5 + with: + aws-region: us-west-2 + role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2 + role-session-name: GoTests + + - name: Setup Python ${{ matrix.python-version }} for running tests + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + + - name: Run Performance Benchmarks - Quick Mode + shell: bash + working-directory: ./${{matrix.benchmark-dir}}/benchmarks/python + run: | + pip install -r requirements.txt + python esdk_benchmark.py --quick + + - name: Parse and Format Logs + working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ + run: | + LOG_FILE="python_results.json" + UPLOAD_FILE="cloudwatch_logs.json" + TIMESTAMP=$(date +%s%3N) + jq -c --arg ts "$(date +%s)000" '[.results[] as $result | .metadata as $meta | {timestamp: ($ts | tonumber), message: ({metadata: $meta, result: $result} | tostring)}]' $LOG_FILE > $UPLOAD_FILE + + - name: Upload logs to CloudWatch + working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ + run: | + LOG_FILE="cloudwatch_logs.json" + LOG_GROUP="aws-esdk-performance-benchmarks" + LOG_STREAM="python/${{matrix.python-version}}}/quick_benchmarks/${{ github.workflow }}" + + # Create log stream (ignore if exists) + aws logs create-log-stream \ + --log-group-name "$LOG_GROUP" \ + --log-stream-name "$LOG_STREAM" 2>/dev/null || true + + aws logs put-log-events \ + --log-group-name "$LOG_GROUP" \ + --log-stream-name "$LOG_STREAM" \ + --log-events file://$LOG_FILE \ No newline at end of file diff --git a/.github/workflows/performance-benchmarks-rust.yml b/.github/workflows/performance-benchmarks-rust.yml new file mode 100644 index 000000000..a20b35a7b --- /dev/null +++ b/.github/workflows/performance-benchmarks-rust.yml @@ -0,0 +1,127 @@ +# This workflow performs benchmark testing in Rust. +name: Performance Benchmarks Rust + +on: + workflow_call: + inputs: + dafny: + description: "The Dafny version to run" + required: true + type: string + regenerate-code: + description: "Regenerate code using smithy-dafny" + required: false + default: false + type: boolean + +jobs: + testGo: + strategy: + fail-fast: false + matrix: + library: [AwsEncryptionSDK] + benchmark-dir: [esdk-performance-testing] + os: [ + windows-latest, + ubuntu-22.04, + # TODO: Re-enable macOS after https://t.corp.amazon.com/P205755286 + # macos-15, + ] + runs-on: ${{ matrix.os }} + permissions: + id-token: write + contents: read + steps: + - name: Support longpaths on Git checkout + run: | + git config --global core.longpaths true + - uses: actions/checkout@v5 + - name: Init Submodules + shell: bash + run: | + git submodule update --init libraries + git submodule update --init --recursive mpl + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v5 + with: + aws-region: us-west-2 + role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2 + role-session-name: RustTests + + - name: Setup Rust Toolchain for GitHub CI + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt + + - name: Setup Dafny + uses: ./mpl/.github/actions/setup_dafny + with: + dafny-version: 4.10.0 + + - name: Setup Java 17 for codegen + uses: actions/setup-java@v5 + with: + distribution: "corretto" + java-version: "17" + + - name: Setup NASM for Windows (aws-lc-sys) + if: matrix.os == 'windows-latest' + uses: ilammy/setup-nasm@v1 + + - name: Install Smithy-Dafny codegen dependencies + uses: ./.github/actions/install_smithy_dafny_codegen_dependencies + + - name: Regenerate code using smithy-dafny if necessary + if: ${{ inputs.regenerate-code }} + uses: ./.github/actions/polymorph_codegen + with: + dafny: ${{ env.DAFNY_VERSION }} + library: ${{ matrix.library }} + diff-generated-code: false + update-and-regenerate-mpl: true + + - name: Run make polymorph_rust + shell: bash + working-directory: ${{ matrix.library }} + run: | + make polymorph_rust + + - name: Compile ${{ matrix.library }} implementation + shell: bash + working-directory: ${{ matrix.library }} + run: | + # This works because `node` is installed by default on GHA runners + CORES=$(node -e 'console.log(os.cpus().length)') + make transpile_rust CORES=$CORES + + - name: Run Performance Benchmarks - Quick Mode + shell: bash + working-directory: ./${{matrix.benchmark-dir}}/benchmarks/rust + run: | + cargo run --release -- --quick + + - name: Parse and Format Logs + working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ + run: | + LOG_FILE="rust_results.json" + UPLOAD_FILE="cloudwatch_logs.json" + TIMESTAMP=$(date +%s%3N) + jq -c --arg ts "$(date +%s)000" '[.results[] as $result | .metadata as $meta | {timestamp: ($ts | tonumber), message: ({metadata: $meta, result: $result} | tostring)}]' $LOG_FILE > $UPLOAD_FILE + + - name: Upload logs to CloudWatch + working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ + run: | + LOG_FILE="cloudwatch_logs.json" + LOG_GROUP="aws-esdk-performance-benchmarks" + LOG_STREAM="rust/${{matrix.os}}/quick_benchmarks/${{ github.workflow }}" + + # Create log stream (ignore if exists) + aws logs create-log-stream \ + --log-group-name "$LOG_GROUP" \ + --log-stream-name "$LOG_STREAM" 2>/dev/null || true + + aws logs put-log-events \ + --log-group-name "$LOG_GROUP" \ + --log-stream-name "$LOG_STREAM" \ + --log-events file://$LOG_FILE \ No newline at end of file diff --git a/.github/workflows/performance-benchmarks.yml b/.github/workflows/performance-benchmarks.yml index e023ee264..89f8b64f4 100644 --- a/.github/workflows/performance-benchmarks.yml +++ b/.github/workflows/performance-benchmarks.yml @@ -21,11 +21,31 @@ jobs: uses: ./.github/workflows/performance-benchmarks-go.yml with: dafny: ${{needs.getVersion.outputs.version}} + performance-benchmarks-java: + needs: getVersion + uses: ./.github/workflows/performance-benchmarks-java.yml + performance-benchmarks-net: + needs: getVersion + uses: ./.github/workflows/performance-benchmarks-net.yml + with: + dafny: ${{needs.getVersion.outputs.version}} + performance-benchmarks-rust: + needs: getVersion + uses: ./.github/workflows/performance-benchmarks-rust.yml + with: + dafny: ${{needs.getVersion.outputs.version}} + performance-benchmarks-python: + needs: getVersion + uses: ./.github/workflows/performance-benchmarks-python.yml notify: needs: [ getVersion, - performance-benchmarks-go + performance-benchmarks-go, + performance-benchmarks-java, + performance-benchmarks-net, + performance-benchmarks-rust, + performance-benchmarks-python ] if: ${{ failure() }} uses: aws/aws-cryptographic-material-providers-library/.github/workflows/slack-notification.yml@main From 1523991118f82843ce59ebbc6c64af07fa65f307 Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Wed, 14 Jan 2026 13:50:29 -0800 Subject: [PATCH 07/10] m --- .github/workflows/performance-benchmarks-java.yml | 4 ++-- .github/workflows/performance-benchmarks-net.yml | 2 +- .github/workflows/performance-benchmarks-python.yml | 2 +- .github/workflows/performance-benchmarks-rust.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/performance-benchmarks-java.yml b/.github/workflows/performance-benchmarks-java.yml index 1a424316f..80535b974 100644 --- a/.github/workflows/performance-benchmarks-java.yml +++ b/.github/workflows/performance-benchmarks-java.yml @@ -5,12 +5,12 @@ on: workflow_call: jobs: - testGo: + testJava: strategy: fail-fast: false matrix: benchmark-dir: [esdk-performance-testing] - java: [8, 11, 17] + java: [17] os: [ # Sed script doesn't work properly on windows # windows-latest, diff --git a/.github/workflows/performance-benchmarks-net.yml b/.github/workflows/performance-benchmarks-net.yml index 5b5123f68..e02f724ae 100644 --- a/.github/workflows/performance-benchmarks-net.yml +++ b/.github/workflows/performance-benchmarks-net.yml @@ -15,7 +15,7 @@ on: type: boolean jobs: - testGo: + testNet: strategy: fail-fast: false matrix: diff --git a/.github/workflows/performance-benchmarks-python.yml b/.github/workflows/performance-benchmarks-python.yml index 0c7053b70..763427466 100644 --- a/.github/workflows/performance-benchmarks-python.yml +++ b/.github/workflows/performance-benchmarks-python.yml @@ -5,7 +5,7 @@ on: workflow_call: jobs: - testGo: + testPython: strategy: fail-fast: false matrix: diff --git a/.github/workflows/performance-benchmarks-rust.yml b/.github/workflows/performance-benchmarks-rust.yml index a20b35a7b..f56d4a0c1 100644 --- a/.github/workflows/performance-benchmarks-rust.yml +++ b/.github/workflows/performance-benchmarks-rust.yml @@ -15,7 +15,7 @@ on: type: boolean jobs: - testGo: + testRust: strategy: fail-fast: false matrix: From 306d2663d4ea79753345a8d5fb6c2d00b2b32cab Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Wed, 14 Jan 2026 13:58:04 -0800 Subject: [PATCH 08/10] m --- .github/workflows/performance-benchmarks-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance-benchmarks-python.yml b/.github/workflows/performance-benchmarks-python.yml index 763427466..fe0480176 100644 --- a/.github/workflows/performance-benchmarks-python.yml +++ b/.github/workflows/performance-benchmarks-python.yml @@ -63,7 +63,7 @@ jobs: run: | LOG_FILE="cloudwatch_logs.json" LOG_GROUP="aws-esdk-performance-benchmarks" - LOG_STREAM="python/${{matrix.python-version}}}/quick_benchmarks/${{ github.workflow }}" + LOG_STREAM="python/${{matrix.python-version}}/quick_benchmarks/${{ github.workflow }}" # Create log stream (ignore if exists) aws logs create-log-stream \ From 3cf2a72f6091fafbc45c3ec6712a360b8a22e9b0 Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Wed, 14 Jan 2026 14:35:33 -0800 Subject: [PATCH 09/10] remove --- .github/workflows/performance-benchmarks-net.yml | 1 - .github/workflows/performance-benchmarks-rust.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/performance-benchmarks-net.yml b/.github/workflows/performance-benchmarks-net.yml index e02f724ae..f1d159e1c 100644 --- a/.github/workflows/performance-benchmarks-net.yml +++ b/.github/workflows/performance-benchmarks-net.yml @@ -22,7 +22,6 @@ jobs: library: [AwsEncryptionSDK] benchmark-dir: [esdk-performance-testing] os: [ - windows-latest, ubuntu-22.04, # TODO: Re-enable macOS after https://t.corp.amazon.com/P205755286 # macos-15, diff --git a/.github/workflows/performance-benchmarks-rust.yml b/.github/workflows/performance-benchmarks-rust.yml index f56d4a0c1..c0ebe5eaa 100644 --- a/.github/workflows/performance-benchmarks-rust.yml +++ b/.github/workflows/performance-benchmarks-rust.yml @@ -22,7 +22,6 @@ jobs: library: [AwsEncryptionSDK] benchmark-dir: [esdk-performance-testing] os: [ - windows-latest, ubuntu-22.04, # TODO: Re-enable macOS after https://t.corp.amazon.com/P205755286 # macos-15, From ef2631051b3937d936ec83d5fdbe519e4c6e77df Mon Sep 17 00:00:00 2001 From: Jose Corella Date: Wed, 14 Jan 2026 15:21:09 -0800 Subject: [PATCH 10/10] m --- .github/workflows/performance-benchmarks-go.yml | 4 ++-- .github/workflows/performance-benchmarks-java.yml | 6 +++--- .github/workflows/performance-benchmarks-net.yml | 6 +++--- .github/workflows/performance-benchmarks-python.yml | 11 ++++------- .github/workflows/performance-benchmarks-rust.yml | 4 ++-- .github/workflows/performance-benchmarks.yml | 3 +-- 6 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/performance-benchmarks-go.yml b/.github/workflows/performance-benchmarks-go.yml index c6d3398d9..15b7f9db9 100644 --- a/.github/workflows/performance-benchmarks-go.yml +++ b/.github/workflows/performance-benchmarks-go.yml @@ -80,7 +80,7 @@ jobs: shell: bash working-directory: ./${{matrix.benchmark-dir}}/benchmarks/go run: | - go run . --config ../../config/test-scenarios.yaml --quick + go run . --config ../../config/test-scenarios.yaml --quick - name: Parse and Format Logs working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ @@ -105,4 +105,4 @@ jobs: aws logs put-log-events \ --log-group-name "$LOG_GROUP" \ --log-stream-name "$LOG_STREAM" \ - --log-events file://$LOG_FILE \ No newline at end of file + --log-events file://$LOG_FILE diff --git a/.github/workflows/performance-benchmarks-java.yml b/.github/workflows/performance-benchmarks-java.yml index 80535b974..7b98182ae 100644 --- a/.github/workflows/performance-benchmarks-java.yml +++ b/.github/workflows/performance-benchmarks-java.yml @@ -50,8 +50,8 @@ jobs: shell: bash working-directory: ./${{matrix.benchmark-dir}}/benchmarks/java run: | - mvn clean compile - mvn exec:java -Dexec.mainClass="com.amazon.esdk.benchmark.Program" -Dexec.args="--quick" + mvn clean compile + mvn exec:java -Dexec.mainClass="com.amazon.esdk.benchmark.Program" -Dexec.args="--quick" - name: Parse and Format Logs working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ @@ -76,4 +76,4 @@ jobs: aws logs put-log-events \ --log-group-name "$LOG_GROUP" \ --log-stream-name "$LOG_STREAM" \ - --log-events file://$LOG_FILE \ No newline at end of file + --log-events file://$LOG_FILE diff --git a/.github/workflows/performance-benchmarks-net.yml b/.github/workflows/performance-benchmarks-net.yml index f1d159e1c..7547073a5 100644 --- a/.github/workflows/performance-benchmarks-net.yml +++ b/.github/workflows/performance-benchmarks-net.yml @@ -89,8 +89,8 @@ jobs: shell: bash working-directory: ./${{matrix.benchmark-dir}}/benchmarks/net run: | - dotnet build --configuration Release - dotnet run --configuration Release -- --quick + dotnet build --configuration Release + dotnet run --configuration Release -- --quick - name: Parse and Format Logs working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ @@ -115,4 +115,4 @@ jobs: aws logs put-log-events \ --log-group-name "$LOG_GROUP" \ --log-stream-name "$LOG_STREAM" \ - --log-events file://$LOG_FILE \ No newline at end of file + --log-events file://$LOG_FILE diff --git a/.github/workflows/performance-benchmarks-python.yml b/.github/workflows/performance-benchmarks-python.yml index fe0480176..e3c40cb73 100644 --- a/.github/workflows/performance-benchmarks-python.yml +++ b/.github/workflows/performance-benchmarks-python.yml @@ -11,10 +11,7 @@ jobs: matrix: benchmark-dir: [esdk-performance-testing] python-version: ["3.11", "3.13"] - os: [ - ubuntu-22.04, - macos-14, - ] + os: [ubuntu-22.04, macos-14] runs-on: ${{ matrix.os }} permissions: id-token: write @@ -47,8 +44,8 @@ jobs: shell: bash working-directory: ./${{matrix.benchmark-dir}}/benchmarks/python run: | - pip install -r requirements.txt - python esdk_benchmark.py --quick + pip install -r requirements.txt + python esdk_benchmark.py --quick - name: Parse and Format Logs working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ @@ -73,4 +70,4 @@ jobs: aws logs put-log-events \ --log-group-name "$LOG_GROUP" \ --log-stream-name "$LOG_STREAM" \ - --log-events file://$LOG_FILE \ No newline at end of file + --log-events file://$LOG_FILE diff --git a/.github/workflows/performance-benchmarks-rust.yml b/.github/workflows/performance-benchmarks-rust.yml index c0ebe5eaa..97f0c4560 100644 --- a/.github/workflows/performance-benchmarks-rust.yml +++ b/.github/workflows/performance-benchmarks-rust.yml @@ -98,7 +98,7 @@ jobs: shell: bash working-directory: ./${{matrix.benchmark-dir}}/benchmarks/rust run: | - cargo run --release -- --quick + cargo run --release -- --quick - name: Parse and Format Logs working-directory: ./${{matrix.benchmark-dir}}/results/raw-data/ @@ -123,4 +123,4 @@ jobs: aws logs put-log-events \ --log-group-name "$LOG_GROUP" \ --log-stream-name "$LOG_STREAM" \ - --log-events file://$LOG_FILE \ No newline at end of file + --log-events file://$LOG_FILE diff --git a/.github/workflows/performance-benchmarks.yml b/.github/workflows/performance-benchmarks.yml index 89f8b64f4..a09705a0c 100644 --- a/.github/workflows/performance-benchmarks.yml +++ b/.github/workflows/performance-benchmarks.yml @@ -45,7 +45,7 @@ jobs: performance-benchmarks-java, performance-benchmarks-net, performance-benchmarks-rust, - performance-benchmarks-python + performance-benchmarks-python, ] if: ${{ failure() }} uses: aws/aws-cryptographic-material-providers-library/.github/workflows/slack-notification.yml@main @@ -53,4 +53,3 @@ jobs: message: "Performance Benchmarks failed on `${{ github.repository }}`. View run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" secrets: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_CI }} -