Skip to content

Commit 7bded69

Browse files
committed
feat(sdk): monorepo repository to add new otel plugin package
1 parent 168cee9 commit 7bded69

202 files changed

Lines changed: 511 additions & 120 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/ci-checks.sh

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
1-
21
#!/bin/sh
32

43
set -e
54

6-
hatch run test:cov
7-
echo SUCCESS: tests + coverage
5+
REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
6+
7+
PACKAGES=(
8+
"packages/aws-durable-execution-sdk-python"
9+
"packages/aws-durable-execution-sdk-python-otel"
10+
)
11+
12+
for package_dir in "${PACKAGES[@]}"; do
13+
full_path="$REPO_ROOT/$package_dir"
14+
if [ -d "$full_path" ]; then
15+
echo "=========================================="
16+
echo "Running checks for $package_dir"
17+
echo "=========================================="
18+
cd "$full_path"
19+
20+
hatch run test:cov
21+
echo "SUCCESS: tests + coverage ($package_dir)"
822

9-
# type checks
10-
hatch run types:check
11-
echo SUCCESS: typings
23+
# type checks
24+
hatch run types:check
25+
echo "SUCCESS: typings ($package_dir)"
1226

13-
# static analysis
14-
hatch fmt
15-
echo SUCCESS: linting/fmt
27+
# static analysis
28+
hatch fmt
29+
echo "SUCCESS: linting/fmt ($package_dir)"
30+
else
31+
echo "WARNING: $package_dir does not exist, skipping"
32+
fi
33+
done
1634

17-
# commit message validation
35+
# commit message validation (run once from repo root)
36+
cd "$REPO_ROOT"
1837
hatch run python .github/scripts/lintcommit.py

.github/workflows/ci.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,42 @@ jobs:
4343
run: |
4444
python -m pip install hatch==1.16.5
4545
- name: static analysis
46-
run: hatch fmt --check
46+
run: |
47+
for pkg in packages/*/; do
48+
if [ -f "$pkg/pyproject.toml" ]; then
49+
echo "=== Checking format: $pkg ==="
50+
cd "$pkg"
51+
hatch fmt --check
52+
cd "$GITHUB_WORKSPACE"
53+
fi
54+
done
4755
- name: type checking
48-
run: hatch run types:check
56+
run: |
57+
for pkg in packages/*/; do
58+
if [ -f "$pkg/pyproject.toml" ]; then
59+
echo "=== Type checking: $pkg ==="
60+
cd "$pkg"
61+
hatch run types:check
62+
cd "$GITHUB_WORKSPACE"
63+
fi
64+
done
4965
- name: Run tests + coverage
50-
run: hatch run test:cov
66+
run: |
67+
for pkg in packages/*/; do
68+
if [ -f "$pkg/pyproject.toml" ]; then
69+
echo "=== Testing: $pkg ==="
70+
cd "$pkg"
71+
hatch run test:cov
72+
cd "$GITHUB_WORKSPACE"
73+
fi
74+
done
5175
- name: Build distribution
52-
run: hatch build
76+
run: |
77+
for pkg in packages/*/; do
78+
if [ -f "$pkg/pyproject.toml" ]; then
79+
echo "=== Building: $pkg ==="
80+
cd "$pkg"
81+
hatch build
82+
cd "$GITHUB_WORKSPACE"
83+
fi
84+
done

.github/workflows/deploy-examples.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
pull_request:
55
branches: [ "main", "development"]
66
paths:
7-
- 'src/aws_durable_execution_sdk_python/**'
8-
- 'examples/**'
7+
- 'packages/aws-durable-execution-sdk-python/src/**'
8+
- 'packages/aws-durable-execution-sdk-python/examples/**'
99
- '.github/workflows/deploy-examples.yml'
1010
workflow_dispatch:
1111

@@ -26,7 +26,7 @@ jobs:
2626

2727
- name: Get examples from catalog
2828
id: get-examples
29-
working-directory: ./examples
29+
working-directory: ./packages/aws-durable-execution-sdk-python/examples
3030
run: |
3131
echo "examples=$(jq -c '.examples | map(select(.integration == true))' examples-catalog.json)" >> $GITHUB_OUTPUT
3232
@@ -58,10 +58,12 @@ jobs:
5858
- name: Install Hatch
5959
run: pip install hatch
6060
- name: Build examples
61+
working-directory: ./packages/aws-durable-execution-sdk-python
6162
run: hatch run examples:build
6263

6364
- name: Deploy Lambda function - ${{ matrix.example.name }}
6465
id: deploy
66+
working-directory: ./packages/aws-durable-execution-sdk-python
6567
env:
6668
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
6769
LAMBDA_ENDPOINT: "https://lambda.us-west-2.amazonaws.com"
@@ -99,6 +101,7 @@ jobs:
99101
echo "QUALIFIED_FUNCTION_NAME=$QUALIFIED_FUNCTION_NAME" >> $GITHUB_OUTPUT
100102
101103
- name: Run Integration Tests - ${{ matrix.example.name }}
104+
working-directory: ./packages/aws-durable-execution-sdk-python
102105
env:
103106
AWS_REGION: ${{ env.AWS_REGION }}
104107
LAMBDA_ENDPOINT: "https://lambda.us-west-2.amazonaws.com"

.github/workflows/integration-tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
run: python -m pip install hatch==1.16.5
3838

3939
- name: Setup and run tests
40-
working-directory: language-sdk
40+
working-directory: language-sdk/packages/aws-durable-execution-sdk-python
4141
run: |
4242
echo "Running SDK tests..."
43-
hatch run -- test:pip install -e ../testing-sdk
44-
hatch run -- test:pip install -e ../language-sdk
43+
hatch run -- test:pip install -e ../../../testing-sdk
44+
hatch run -- test:pip install -e .
4545
hatch fmt --check
4646
hatch run types:check
4747
hatch run test:cov
@@ -84,7 +84,7 @@ jobs:
8484

8585
- name: Get integration examples
8686
id: get-examples
87-
working-directory: language-sdk/examples
87+
working-directory: language-sdk/packages/aws-durable-execution-sdk-python/examples
8888
run: |
8989
echo "examples=$(jq -c '.examples | map(select(.integration == true)) | .[0:2]' examples-catalog.json)" >> $GITHUB_OUTPUT
9090
@@ -97,15 +97,15 @@ jobs:
9797
rm -rf /tmp/aws/
9898
9999
- name: Deploy and test examples
100-
working-directory: language-sdk
100+
working-directory: language-sdk/packages/aws-durable-execution-sdk-python
101101
env:
102102
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
103103
LAMBDA_ENDPOINT: "https://lambda.us-west-2.amazonaws.com"
104104
INVOKE_ACCOUNT_ID: ${{ secrets.INVOKE_ACCOUNT_ID }}
105105
KMS_KEY_ARN: ${{ secrets.KMS_KEY_ARN }}
106106
run: |
107107
echo "Building examples..."
108-
hatch run -- examples:pip install -e ../testing-sdk
108+
hatch run -- examples:pip install -e ../../../testing-sdk
109109
hatch run examples:build
110110
111111
# Get first integration example for testing

.github/workflows/pypi-publish.yml

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow will upload a Python Package to PyPI when a release is created
1+
# This workflow will upload Python Packages to PyPI when a release is created
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
33

44
# This workflow uses actions that are not certified by GitHub.
@@ -18,59 +18,66 @@ permissions:
1818
jobs:
1919
release-build:
2020
runs-on: ubuntu-latest
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
package:
25+
- name: aws-durable-execution-sdk-python
26+
path: packages/aws-durable-execution-sdk-python
27+
- name: aws-durable-execution-sdk-python-otel
28+
path: packages/aws-durable-execution-sdk-python-otel
2129

2230
steps:
2331
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2432

2533
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2634
with:
2735
python-version: "3.11"
28-
- name: Install Hatch
29-
run: |
30-
python -m pip install --upgrade hatch==1.16.5
36+
37+
- name: Install Hatch
38+
run: python -m pip install --upgrade hatch==1.16.5
39+
3140
- name: Build release distributions
32-
run: |
33-
# NOTE: put your own distribution build steps here.
34-
hatch build
41+
working-directory: ${{ matrix.package.path }}
42+
run: hatch build
3543

3644
- name: Upload distributions
3745
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
3846
with:
39-
name: release-dists
40-
path: dist/
47+
name: release-dists-${{ matrix.package.name }}
48+
path: ${{ matrix.package.path }}/dist/
4149

4250
pypi-publish:
4351
runs-on: ubuntu-latest
4452
needs:
4553
- release-build
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
package:
58+
- name: aws-durable-execution-sdk-python
59+
- name: aws-durable-execution-sdk-python-otel
4660
permissions:
47-
# IMPORTANT: this permission is mandatory for trusted publishing
4861
id-token: write
4962

50-
# Dedicated environments with protections for publishing are strongly recommended.
51-
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
5263
environment:
5364
name: pypi
54-
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
55-
# url: https://pypi.org/p/aws-durable-execution-sdk-python
56-
#
57-
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
58-
# ALTERNATIVE: exactly, uncomment the following line instead:
59-
url: https://pypi.org/project/aws-durable-execution-sdk-python/${{ github.event.release.name }}
65+
url: https://pypi.org/project/${{ matrix.package.name }}/${{ github.event.release.name }}
6066

6167
steps:
6268
- name: Retrieve release distributions
6369
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
6470
with:
65-
name: release-dists
71+
name: release-dists-${{ matrix.package.name }}
6672
path: dist/
6773

68-
- name: Publish release distributions to PyPI
74+
- name: Publish to PyPI
6975
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
7076
with:
7177
packages-dir: dist/
7278

7379
notify-release:
80+
if: always() && contains(needs.pypi-publish.result, 'success')
7481
needs: [pypi-publish]
7582
uses: ./.github/workflows/notify-release.yml
7683
with:

.github/workflows/sync-package.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ __pycache__/
99
*$py.class
1010
*.egg-info/
1111

12+
*.coverage
1213
/.coverage
1314
/.coverage.*
1415
/.cache
@@ -30,7 +31,7 @@ dist/
3031

3132
.kiro/
3233

33-
/examples/build/*
34-
/examples/*.zip
34+
examples/build/*
35+
examples/*.zip
3536

3637
.env

0 commit comments

Comments
 (0)