Skip to content

configure for codebuild pr builds #679

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

Merged
merged 3 commits into from
Mar 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: python
python:
- '2.7'
- '3.5'
- '3.6'
install: pip install tox-travis codecov
script:
- tox tests/unit
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Supported Python Versions
SageMaker Python SDK is tested on:

- Python 2.7
- Python 3.5
- Python 3.6

AWS Permissions
~~~~~~~~~~~~~~~
Expand Down
24 changes: 24 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 0.2

phases:
pre_build:
commands:
- start-dockerd

build:
commands:
# run linters
- tox -e flake8,pylint

# run package and docbuild checks
- tox -e twine
- tox -e sphinx

# run unit tests
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
tox -e py27,py36 -- tests/unit

# run integration tests
- if-matching-changes "test/" "tests/" "src/*.py" "docker/*/Dockerfile" &&
IGNORE_COVERAGE=- tox -e py27,py36 -- -n 24 --boxed tests/integ
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def read(fname):
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],

install_requires=required_packages,
Expand Down
6 changes: 3 additions & 3 deletions tests/integ/kms_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"Sid": "Enable IAM User Permissions",
"Effect": "Allow",
"Principal": {{
"AWS": "arn:aws:iam::{account_id}:root"
"AWS": "{account_id}"
}},
"Action": "kms:*",
"Resource": "*"
Expand All @@ -31,7 +31,7 @@
"Sid": "Allow use of the key",
"Effect": "Allow",
"Principal": {{
"AWS": "arn:aws:iam::{account_id}:role/SageMakerRole"
"AWS": "{account_id}"
}},
"Action": [
"kms:Encrypt",
Expand All @@ -46,7 +46,7 @@
"Sid": "Allow attachment of persistent resources",
"Effect": "Allow",
"Principal": {{
"AWS": "arn:aws:iam::{account_id}:role/SageMakerRole"
"AWS": "{account_id}"
}},
"Action": [
"kms:CreateGrant",
Expand Down
13 changes: 6 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
# and then run "tox" from this directory.

[tox]
envlist = py27,py35,flake8,pylint,twine,sphinx
envlist = flake8,pylint,twine,sphinx,py27,py36

skip_missing_interpreters = False

[travis]
python =
3.5: py35, flake8, pylint

[flake8]
max-line-length = 120
Expand All @@ -24,7 +21,9 @@ exclude =
tests/data/
venv/
*service_pb2_grpc.py

max-complexity = 10

ignore =
FI10,
FI12,
Expand All @@ -46,13 +45,13 @@ ignore =
require-code = True

[testenv]
# TEAMCITY_VERSION environment variable exists during build on Teamcity. teamcity-messages uses it in order to enable
# reporting to TeamCity.
passenv =
TEAMCITY_VERSION
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
AWS_DEFAULT_REGION

# {posargs} can be passed in by additional arguments specified when invoking tox.
# Can be used to specify which tests to run, e.g.: tox -- -s
commands =
Expand Down