Skip to content

Commit 132fb94

Browse files
Merge branch 'aws:master' into master
2 parents 65eb64e + 1e679b4 commit 132fb94

File tree

1,546 files changed

+292730
-22269
lines changed

Some content is hidden

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

1,546 files changed

+292730
-22269
lines changed

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
concurrency = threading
33
omit = sagemaker/tests/*
44
timid = True
5+
disable_warnings = module-not-measured

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ application_import_names = sagemaker, tests
33
import-order-style = google
44
per-file-ignores =
55
tests/unit/test_tuner.py: F405
6+
src/sagemaker/config/config_schema.py: E501

.githooks/pre-push

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
# this pre-push hook runs style checks and unit tests in python 3.8, 3.9, and 3.10 using tox.
3+
4+
set -e
5+
6+
TOX_PARALLEL_NO_SPINNER=1,
7+
PY_COLORS=0
8+
start_time=`date +%s`
9+
tox -e flake8,pylint,docstyle,black-check,twine --parallel all
10+
./ci-scripts/displaytime.sh 'flake8,pylint,docstyle,black-check,twine' $start_time
11+
start_time=`date +%s`
12+
tox -e sphinx,doc8 --parallel all
13+
./ci-scripts/displaytime.sh 'sphinx,doc8' $start_time
14+
start_time=`date +%s`
15+
tox -e py38,py39,py310 --parallel all -- tests/unit
16+
./ci-scripts/displaytime.sh 'py38,py39,py310 unit' $start_time

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug report
33
about: File a report to help us reproduce and fix the problem
44
title: ''
5-
labels: ''
5+
labels: 'bug'
66
assignees: ''
77

88
---
@@ -12,6 +12,7 @@ A clear and concise description of what the bug is.
1212

1313
**To reproduce**
1414
A clear, step-by-step set of instructions to reproduce the bug.
15+
The provided code need to be **complete** and **runnable**, if additional data is needed, please include them in the issue.
1516

1617
**Expected behavior**
1718
A clear and concise description of what you expected to happen.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Feature request
33
about: Suggest new functionality for this library
44
title: ''
5-
labels: ''
5+
labels: 'feature request'
66
assignees: ''
77

88
---

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ _Put an `x` in the boxes that apply. You can also fill these out after creating
1111
#### General
1212

1313
- [ ] I have read the [CONTRIBUTING](https://github.com/aws/sagemaker-python-sdk/blob/master/CONTRIBUTING.md) doc
14+
- [ ] I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
1415
- [ ] I used the commit message format described in [CONTRIBUTING](https://github.com/aws/sagemaker-python-sdk/blob/master/CONTRIBUTING.md#committing-your-change)
1516
- [ ] I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
1617
- [ ] I have updated any necessary documentation, including [READMEs](https://github.com/aws/sagemaker-python-sdk/blob/master/README.rst) and [API docs](https://github.com/aws/sagemaker-python-sdk/tree/master/doc) (if appropriate)
1718

1819
#### Tests
1920

2021
- [ ] I have added tests that prove my fix is effective or that my feature works (if appropriate)
22+
- [ ] I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes
2123
- [ ] I have checked that my tests are not configured for a specific region or account (if appropriate)
2224
- [ ] I have used [`unique_name_from_base`](https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/utils.py#L77) to create resource names in integ tests (if appropriate)
25+
- [ ] If adding any dependency in requirements.txt files, I have spell checked and ensured they exist in PyPi
2326

2427
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: CI Health
2+
on:
3+
schedule:
4+
- cron: "0 */3 * * *"
5+
workflow_dispatch:
6+
7+
permissions:
8+
id-token: write # This is required for requesting the JWT
9+
10+
jobs:
11+
codestyle-doc-tests:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Configure AWS Credentials
15+
uses: aws-actions/configure-aws-credentials@v4
16+
with:
17+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
18+
aws-region: us-west-2
19+
role-duration-seconds: 10800
20+
- name: Run Codestyle & Doc Tests
21+
uses: aws-actions/aws-codebuild-run-build@v1
22+
with:
23+
project-name: sagemaker-python-sdk-ci-health-codestyle-doc-tests
24+
unit-tests:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
python-version: ["py38", "py39", "py310", "py311"]
30+
steps:
31+
- name: Configure AWS Credentials
32+
uses: aws-actions/configure-aws-credentials@v4
33+
with:
34+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
35+
aws-region: us-west-2
36+
role-duration-seconds: 10800
37+
- name: Run Unit Tests
38+
uses: aws-actions/aws-codebuild-run-build@v1
39+
with:
40+
project-name: sagemaker-python-sdk-ci-health-unit-tests
41+
env-vars-for-codebuild: |
42+
PY_VERSION
43+
env:
44+
PY_VERSION: ${{ matrix.python-version }}
45+
integ-tests:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Configure AWS Credentials
49+
uses: aws-actions/configure-aws-credentials@v4
50+
with:
51+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
52+
aws-region: us-west-2
53+
role-duration-seconds: 10800
54+
- name: Run Integ Tests
55+
uses: aws-actions/aws-codebuild-run-build@v1
56+
id: codebuild
57+
with:
58+
project-name: sagemaker-python-sdk-ci-health-integ-tests
59+
slow-tests:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Configure AWS Credentials
63+
uses: aws-actions/configure-aws-credentials@v4
64+
with:
65+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
66+
aws-region: us-west-2
67+
role-duration-seconds: 10800
68+
- name: Run Slow Tests
69+
uses: aws-actions/aws-codebuild-run-build@v1
70+
with:
71+
project-name: sagemaker-python-sdk-ci-health-slow-tests
72+
localmode-tests:
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Configure AWS Credentials
76+
uses: aws-actions/configure-aws-credentials@v4
77+
with:
78+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
79+
aws-region: us-west-2
80+
role-duration-seconds: 10800
81+
- name: Run Local Mode Tests
82+
uses: aws-actions/aws-codebuild-run-build@v1
83+
with:
84+
project-name: sagemaker-python-sdk-ci-health-localmode-tests

.github/workflows/codebuild-ci.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: PR Checks
2+
on:
3+
pull_request_target:
4+
branches:
5+
- "master*"
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.head_ref }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
id-token: write # This is required for requesting the JWT
13+
14+
jobs:
15+
collab-check:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
approval-env: ${{ steps.collab-check.outputs.result }}
19+
steps:
20+
- name: Collaborator Check
21+
uses: actions/github-script@v7
22+
id: collab-check
23+
with:
24+
github-token: ${{ secrets.COLLAB_CHECK_TOKEN }}
25+
result-encoding: string
26+
script: |
27+
try {
28+
const res = await github.rest.repos.checkCollaborator({
29+
owner: context.repo.owner,
30+
repo: context.repo.repo,
31+
username: "${{ github.event.pull_request.user.login }}",
32+
});
33+
console.log("Verifed ${{ github.event.pull_request.user.login }} is a repo collaborator. Auto Approving PR Checks.")
34+
return res.status == "204" ? "auto-approve" : "manual-approval"
35+
} catch (error) {
36+
console.log("${{ github.event.pull_request.user.login }} is not a collaborator. Requiring Manual Approval to run PR Checks.")
37+
return "manual-approval"
38+
}
39+
wait-for-approval:
40+
runs-on: ubuntu-latest
41+
needs: [collab-check]
42+
environment: ${{ needs.collab-check.outputs.approval-env }}
43+
steps:
44+
- run: echo "Workflow Approved! Starting PR Checks."
45+
codestyle-doc-tests:
46+
runs-on: ubuntu-latest
47+
needs: [wait-for-approval]
48+
steps:
49+
- name: Configure AWS Credentials
50+
uses: aws-actions/configure-aws-credentials@v4
51+
with:
52+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
53+
aws-region: us-west-2
54+
role-duration-seconds: 10800
55+
- name: Run Codestyle & Doc Tests
56+
uses: aws-actions/aws-codebuild-run-build@v1
57+
with:
58+
project-name: ${{ github.event.repository.name }}-ci-codestyle-doc-tests
59+
source-version-override: 'refs/pull/${{ github.event.pull_request.number }}/head^{${{ github.event.pull_request.head.sha }}}'
60+
unit-tests:
61+
runs-on: ubuntu-latest
62+
needs: [wait-for-approval]
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
python-version: ["py38","py39","py310","py311"]
67+
steps:
68+
- name: Configure AWS Credentials
69+
uses: aws-actions/configure-aws-credentials@v4
70+
with:
71+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
72+
aws-region: us-west-2
73+
role-duration-seconds: 10800
74+
- name: Run Unit Tests
75+
uses: aws-actions/aws-codebuild-run-build@v1
76+
with:
77+
project-name: ${{ github.event.repository.name }}-ci-unit-tests
78+
source-version-override: 'refs/pull/${{ github.event.pull_request.number }}/head^{${{ github.event.pull_request.head.sha }}}'
79+
env-vars-for-codebuild: |
80+
PY_VERSION
81+
env:
82+
PY_VERSION: ${{ matrix.python-version }}
83+
integ-tests:
84+
runs-on: ubuntu-latest
85+
needs: [wait-for-approval]
86+
steps:
87+
- name: Configure AWS Credentials
88+
uses: aws-actions/configure-aws-credentials@v4
89+
with:
90+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
91+
aws-region: us-west-2
92+
role-duration-seconds: 10800
93+
- name: Run Integ Tests
94+
uses: aws-actions/aws-codebuild-run-build@v1
95+
with:
96+
project-name: ${{ github.event.repository.name }}-ci-integ-tests
97+
source-version-override: 'refs/pull/${{ github.event.pull_request.number }}/head^{${{ github.event.pull_request.head.sha }}}'

.github/workflows/codeql.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "CodeQL"
2+
on:
3+
push:
4+
branches: [ "master" ]
5+
pull_request:
6+
branches: [ "master" ]
7+
schedule:
8+
- cron: '30 15 * * *'
9+
jobs:
10+
analyze:
11+
name: Analyze (${{ matrix.language }})
12+
runs-on: ${{ 'ubuntu-latest' }}
13+
permissions:
14+
security-events: write
15+
packages: read
16+
17+
strategy:
18+
matrix:
19+
include:
20+
- language: python
21+
build-mode: none
22+
- language: java-kotlin
23+
build-mode: none
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@6ccd57f4c5d15bdc2fef309bd9fb6cc9db2ef1c6
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@4b1d7da102ff94aca014c0245062b1a463356d72
29+
with:
30+
languages: ${{ matrix.language }}
31+
build-mode: ${{ matrix.build-mode }}
32+
- name: Perform CodeQL Analysis
33+
uses: github/codeql-action/analyze@4b1d7da102ff94aca014c0245062b1a463356d72
34+
with:
35+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)