Skip to content

chore: Merge from main #1052

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

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3e56406
chore: bump macos from 12 to 13 in CI (#949)
ajewellamz Nov 4, 2024
000baed
fix(Python): Support Python 3.13 (#953)
lucasmcdonald3 Nov 5, 2024
6f41b59
chore(release): 1.7.4 [skip ci] (#958)
lucasmcdonald3 Nov 6, 2024
deb1ca4
chore(CI): Allow local testing (#961)
lucasmcdonald3 Nov 6, 2024
f9fb3ef
chore(STD-Dafny): HasSubString (#952)
texastony Nov 7, 2024
1312493
chore: repolymorph with latest smithy-dafny (#968)
ajewellamz Nov 8, 2024
697b110
chore: re-polymorph to gain OpaqueWithText (#970)
ajewellamz Nov 11, 2024
41c0c94
fix(Python-Release): Run validate tests from release commit
lucasmcdonald3 Nov 11, 2024
492dccb
chore: re-polymorph to repair Java Opaque to Exception conversion (#977)
ajewellamz Nov 11, 2024
1510b77
fix(Python): CMCs release lock for unhandled runtime exceptions (#979)
lucasmcdonald3 Nov 12, 2024
03fef4d
chore: bump to latest smithy-dafny (#994)
ajewellamz Nov 14, 2024
ac5b472
chore(release): Update Python release scripts (#991)
lucasmcdonald3 Nov 14, 2024
f49460a
fix: return error on interrupted sleep (#993)
ajewellamz Nov 14, 2024
b5cc38b
chore: add rust support (#963)
ajewellamz Nov 15, 2024
8377acf
fix: remove input and output traits on DynamoDB operations (#1012)
ajewellamz Nov 15, 2024
a505a30
feat(Rust): Interop test vectors; bump Dafny to 4.9.0 (#1004)
RitvikKapila Nov 18, 2024
2a1fdc0
chore: remove warning in Rust (#1015)
ajewellamz Nov 18, 2024
33a5e32
Merge from main
rishav-karanjit Nov 25, 2024
ef2cb58
Checkout from same commit as main
rishav-karanjit Nov 25, 2024
495db9b
fix
rishav-karanjit Nov 25, 2024
fc16f77
fix
rishav-karanjit Nov 26, 2024
6047bae
Bring back externs
rishav-karanjit Nov 26, 2024
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
6 changes: 6 additions & 0 deletions .github/workflows/daily_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ jobs:
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
daily-ci-rust:
needs: getVersion
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_rust_tests.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
daily-ci-python:
needs: getVersion
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/library_dafny_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
dafny-version: ${{ inputs.dafny }}

# dafny-reportgenerator requires next6
# but only 7.0 is installed on macos-12-large
# but only 7.0 is installed on macos-13-large
- name: Setup .NET Core SDK '6.0.x'
uses: actions/setup-dotnet@v3
with:
Expand Down
127 changes: 109 additions & 18 deletions .github/workflows/library_interop_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
# https://taskei.amazon.dev/tasks/CrypTool-5283
# windows-latest,
ubuntu-latest,
macos-12,
macos-13,
]
language: [java, net, python]
language: [java, net, python, rust]
# https://taskei.amazon.dev/tasks/CrypTool-5284
dotnet-version: ["6.0.x"]
runs-on: ${{ matrix.os }}
Expand All @@ -37,11 +37,19 @@ jobs:
run: |
git config --global core.longpaths true

# Test Vectors need to call KMS
- name: Configure AWS Credentials for Tests
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-MPL-Dafny-Role-us-west-2
role-session-name: InterOpTests

- uses: actions/checkout@v3
# Not all submodules are needed.
# We manually pull the submodule we DO need.
- run: git submodule update --init libraries
- run: git submodule update --init smithy-dafny
- run: git submodule update --init --recursive smithy-dafny

# Set up runtimes
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
Expand All @@ -50,8 +58,9 @@ jobs:
with:
dotnet-version: ${{ matrix.dotnet-version }}

# Setup Java in Rust is needed for running polymorph
- name: Setup Java 17
if: matrix.language == 'java'
if: matrix.language == 'java' || matrix.language == 'rust'
uses: actions/setup-java@v3
with:
distribution: "corretto"
Expand All @@ -67,8 +76,32 @@ jobs:
pip install --upgrade tox
pip install poetry

- name: Setup Rust Toolchain for GitHub CI
if: matrix.language == 'rust'
uses: actions-rust-lang/[email protected]
with:
components: rustfmt
# TODO - uncomment this after Rust formatter works
# - name: Rustfmt Check
# uses: actions-rust-lang/rustfmt@v1

# TODO: Remove this after the formatting in Rust starts working
- name: smithy-dafny Rust hacks
if: matrix.language == 'rust'
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' smithy-dafny/SmithyDafnyMakefile.mk
else
sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' smithy-dafny/SmithyDafnyMakefile.mk
fi

- name: Setup NASM for Windows in Rust (aws-lc-sys)
if: matrix.language == 'rust' && matrix.os == 'windows-latest'
uses: ilammy/setup-nasm@v1

- name: Setup Dafny
uses: dafny-lang/setup-dafny-action@v1.6.1
uses: dafny-lang/setup-dafny-action@v1.7.0
with:
dafny-version: ${{ inputs.dafny }}

Expand Down Expand Up @@ -108,20 +141,32 @@ jobs:
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_python

- name: Install Smithy-Dafny codegen dependencies
if: matrix.language == 'rust'
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies

# TODO: Remove this after checking in Rust polymorph code
- name: Run make polymorph_rust
if: matrix.language == 'rust'
shell: bash
working-directory: ./${{ matrix.library }}
run: |
make polymorph_rust

- name: Build ${{ matrix.library }} implementation in Rust
if: matrix.language == 'rust'
shell: bash
working-directory: ./${{ matrix.library }}
run: |
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_rust TRANSPILE_TESTS_IN_RUST=1 CORES=$CORES

- name: Setup gradle
if: matrix.language == 'java'
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.2

# Test Vectors need to call KMS
- name: Configure AWS Credentials for Tests
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-MPL-Dafny-Role-us-west-2
role-session-name: InterOpTests

- name: Create Manifests
working-directory: ./${{ matrix.library }}
run: make test_generate_vectors_${{ matrix.language }}
Expand All @@ -145,10 +190,10 @@ jobs:
# TODO just test on mac and ubuntu for now
# windows-latest,
ubuntu-latest,
macos-12,
macos-13,
]
encrypting_language: [java, net, python]
decrypting_language: [java, net, python]
encrypting_language: [java, net, python, rust]
decrypting_language: [java, net, python, rust]
dotnet-version: ["6.0.x"]
runs-on: ${{ matrix.os }}
permissions:
Expand All @@ -158,6 +203,7 @@ jobs:
- name: Support longpaths on Git checkout
run: |
git config --global core.longpaths true

# KMS and MPL tests need to use credentials which can call KMS
- name: Configure AWS Credentials for Tests
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -170,7 +216,7 @@ jobs:
# Not all submodules are needed.
# We manually pull the submodule we DO need.
- run: git submodule update --init libraries
- run: git submodule update --init smithy-dafny
- run: git submodule update --init --recursive smithy-dafny

# Set up runtimes
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
Expand All @@ -179,8 +225,9 @@ jobs:
with:
dotnet-version: ${{ matrix.dotnet-version }}

# Setup Java in Rust is needed for running polymorph
- name: Setup Java 17
if: matrix.decrypting_language == 'java'
if: matrix.decrypting_language == 'java' || matrix.decrypting_language == 'rust'
uses: actions/setup-java@v3
with:
distribution: "corretto"
Expand All @@ -196,6 +243,30 @@ jobs:
pip install --upgrade tox
pip install poetry

- name: Setup Rust Toolchain for GitHub CI
if: matrix.decrypting_language == 'rust'
uses: actions-rust-lang/[email protected]
with:
components: rustfmt
# TODO - uncomment this after Rust formatter works
# - name: Rustfmt Check
# uses: actions-rust-lang/rustfmt@v1

# TODO: Remove this after the formatting in Rust starts working
- name: smithy-dafny Rust hacks
if: matrix.decrypting_language == 'rust'
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' smithy-dafny/SmithyDafnyMakefile.mk
else
sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' smithy-dafny/SmithyDafnyMakefile.mk
fi

- name: Setup NASM for Windows in Rust (aws-lc-sys)
if: matrix.decrypting_language == 'rust' && matrix.os == 'windows-latest'
uses: ilammy/setup-nasm@v1

- name: Setup Dafny
uses: dafny-lang/[email protected]
with:
Expand Down Expand Up @@ -237,6 +308,26 @@ jobs:
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_python

- name: Install Smithy-Dafny codegen dependencies
if: matrix.decrypting_language == 'rust'
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies

# TODO: Remove this after checking in Rust polymorph code
- name: Run make polymorph_rust
if: matrix.decrypting_language == 'rust'
shell: bash
working-directory: ./${{ matrix.library }}
run: |
make polymorph_rust

- name: Build ${{ matrix.library }} implementation in Rust
if: matrix.decrypting_language == 'rust'
shell: bash
working-directory: ./${{ matrix.library }}
run: |
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_rust TRANSPILE_TESTS_IN_RUST=1 CORES=$CORES

- name: Download Encrypt Manifest Artifact
uses: actions/download-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/library_java_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# TODO just test on mac for now
# windows-latest,
ubuntu-latest,
macos-12,
macos-13,
]
runs-on: ${{ matrix.os }}
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/library_net_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
TestVectorsAwsCryptographicMaterialProviders,
]
dotnet-version: ["6.0.x"]
os: [windows-latest, ubuntu-latest, macos-12]
os: [windows-latest, ubuntu-latest, macos-13]
runs-on: ${{ matrix.os }}
defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/library_python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ jobs:
AwsCryptographicMaterialProviders,
TestVectorsAwsCryptographicMaterialProviders,
]
python-version: ["3.11"]
python-version: ["3.11", "3.13"]
os: [
# TODO fix Dafny-generated tests on Windows;
# the sys.path workaround for generated Dafny doesn't work on Windows.
# Note: only tests use the sys.path workaround, not source code.
# Windows source code is tested downstream (ex. ESDK-Python CI).
# windows-latest,
ubuntu-latest,
macos-12,
macos-13,
]
runs-on: ${{ matrix.os }}
defaults:
Expand Down
112 changes: 112 additions & 0 deletions .github/workflows/library_rust_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# This workflow performs tests in Rust.
name: Library Rust tests

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:
testRust:
strategy:
fail-fast: false
matrix:
library:
[
StandardLibrary,
ComAmazonawsDynamodb,
ComAmazonawsKms,
AwsCryptographyPrimitives,
AwsCryptographicMaterialProviders,
TestVectorsAwsCryptographicMaterialProviders,
]
# removed windows-latest because somehow it can't build aws-lc in CI
os: [ubuntu-latest, macos-13]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
env:
RUST_MIN_STACK: 104857600
steps:
- name: Support longpaths on Git checkout
run: |
git config --global core.longpaths true
- uses: actions/checkout@v3
- name: Init Submodules
shell: bash
run: |
git submodule update --init libraries
git submodule update --init --recursive smithy-dafny

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-MPL-Dafny-Role-us-west-2
role-session-name: RustTests

- name: Setup Rust Toolchain for GitHub CI
uses: actions-rust-lang/[email protected]
with:
components: rustfmt
# TODO - uncomment this after Rust formatter works
# - name: Rustfmt Check
# uses: actions-rust-lang/rustfmt@v1

# TODO: Use setup-dafny-actions with correct version when Dafny releases 4.8.2
- name: Setup Dafny
uses: dafny-lang/[email protected]
with:
dafny-version: 4.9.0

# TODO: Remove this after the formatting in Rust starts working
- name: smithy-dafny Rust hacks
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' smithy-dafny/SmithyDafnyMakefile.mk
else
sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' smithy-dafny/SmithyDafnyMakefile.mk
fi

- name: Setup Java 17 for codegen
uses: actions/setup-java@v3
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: 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 TRANSPILE_TESTS_IN_RUST=1 CORES=$CORES

- name: Test ${{ matrix.library }} Rust
shell: bash
working-directory: ./${{ matrix.library }}
run: |
make test_rust
Loading
Loading