This repository was archived by the owner on Apr 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
69 lines (61 loc) · 2 KB
/
sagemaker_tests.yml
File metadata and controls
69 lines (61 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: SageMaker Tests
# All tests in this file:
# 1. Run when launched manually
# 2. Require AWS credentials and launch training jobs
on:
workflow_dispatch:
# pull_request: # UNCOMMENT FOR TESTING
# branches: # UNCOMMENT FOR TESTING
# - main # UNCOMMENT FOR TESTING
# - dev # UNCOMMENT FOR TESTING
env:
AWS_DEFAULT_REGION: us-west-2
AWS_ROLE: ${{ secrets.PROD_AWS_END_TO_END_TEST_ROLE_ARN }}
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
launch-sagemaker-jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
cache: 'pip'
- name: Install Renate
run: |
python -m pip install --upgrade pip
python -m pip install -e '.[dev]'
- name: Install toml library
run: pip install toml
- name: Write requirements.txt for SageMaker training jobs
run: |
python test/integration_tests/generate_requirements.py
- name: Get Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.PROD_AWS_END_TO_END_TEST_ROLE_ARN }}
role-session-name: integtestsession
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Launch SageMaker Jobs
run: |
import os
import subprocess
target_directory = 'test/integration_tests/configs/suites/main'
files = [f for f in os.listdir(target_directory) if os.path.isfile(os.path.join(target_directory, f))]
for file in files:
process = subprocess.Popen(
[
"python",
"test/integration_tests/run_test.py",
"--test-file",
file,
"--seed",
"0",
"--requirements-file",
"test/integration_tests/requirements.txt",
]
)
process.wait()
shell: python