From cba7d9462d3a955ad1b24497fc5cf8ca516bc53c Mon Sep 17 00:00:00 2001 From: seebees Date: Wed, 16 Dec 2020 19:39:14 -0800 Subject: [PATCH 1/2] chore: Add AWS CodeBuild buildspec Adding buildspec to batch build multiple Python runtimes * Python 2.7 * Python 3.5 * Python 3.6 * Python 3.7 * Python 3.8 --- buildspec.yml | 15 +++++++++++++++ codebuild/python2.7.yml | 18 ++++++++++++++++++ codebuild/python3.5.yml | 20 ++++++++++++++++++++ codebuild/python3.6.yml | 18 ++++++++++++++++++ codebuild/python3.7.yml | 20 ++++++++++++++++++++ codebuild/python3.8.yml | 18 ++++++++++++++++++ tox.ini | 2 ++ 7 files changed, 111 insertions(+) create mode 100644 buildspec.yml create mode 100644 codebuild/python2.7.yml create mode 100644 codebuild/python3.5.yml create mode 100644 codebuild/python3.6.yml create mode 100644 codebuild/python3.7.yml create mode 100644 codebuild/python3.8.yml diff --git a/buildspec.yml b/buildspec.yml new file mode 100644 index 00000000..7bef08e4 --- /dev/null +++ b/buildspec.yml @@ -0,0 +1,15 @@ +version: 0.2 + +batch: + fast-fail: false + build-list: + - identifier: python2_7 + buildspec: codebuild/python2.7.yml + - identifier: python3_5 + buildspec: codebuild/python3.5.yml + - identifier: python3_6 + buildspec: codebuild/python3.6.yml + - identifier: python3_7 + buildspec: codebuild/python3.7.yml + - identifier: python3_8 + buildspec: codebuild/python3.8.yml diff --git a/codebuild/python2.7.yml b/codebuild/python2.7.yml new file mode 100644 index 00000000..fd688d77 --- /dev/null +++ b/codebuild/python2.7.yml @@ -0,0 +1,18 @@ +version: 0.2 + +env: + variables: + TOXENV: "py27-integ-slow" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + +phases: + install: + runtime-versions: + python: latest + build: + commands: + - pip install tox + - tox diff --git a/codebuild/python3.5.yml b/codebuild/python3.5.yml new file mode 100644 index 00000000..5558842f --- /dev/null +++ b/codebuild/python3.5.yml @@ -0,0 +1,20 @@ +version: 0.2 + +env: + variables: + TOXENV: "py35-integ-slow" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + +phases: + install: + runtime-versions: + python: latest + build: + commands: + - pyenv install 3.5.9 + - pyenv local 3.5.9 + - pip install tox tox-pyenv + - tox diff --git a/codebuild/python3.6.yml b/codebuild/python3.6.yml new file mode 100644 index 00000000..602dc113 --- /dev/null +++ b/codebuild/python3.6.yml @@ -0,0 +1,18 @@ +version: 0.2 + +env: + variables: + TOXENV: "py36-integ-slow" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + +phases: + install: + runtime-versions: + python: latest + build: + commands: + - pip install tox + - tox diff --git a/codebuild/python3.7.yml b/codebuild/python3.7.yml new file mode 100644 index 00000000..d6500ade --- /dev/null +++ b/codebuild/python3.7.yml @@ -0,0 +1,20 @@ +version: 0.2 + +env: + variables: + TOXENV: "py37-integ-slow" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + +phases: + install: + runtime-versions: + python: latest + build: + commands: + - pyenv install 3.7.9 + - pyenv local 3.7.9 + - pip install tox tox-pyenv + - tox diff --git a/codebuild/python3.8.yml b/codebuild/python3.8.yml new file mode 100644 index 00000000..1c1524c8 --- /dev/null +++ b/codebuild/python3.8.yml @@ -0,0 +1,18 @@ +version: 0.2 + +env: + variables: + TOXENV: "py38-integ-slow" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + +phases: + install: + runtime-versions: + python: latest + build: + commands: + - pip install tox + - tox diff --git a/tox.ini b/tox.ini index c8b8688d..4fc20467 100644 --- a/tox.ini +++ b/tox.ini @@ -46,6 +46,8 @@ passenv = DDB_ENCRYPTION_CLIENT_TEST_TABLE_NAME \ # Pass through AWS credentials AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN \ + # AWS Role access in CodeBuild is via the contaner URI + AWS_CONTAINER_CREDENTIALS_RELATIVE_URI \ # Pass through AWS profile name (useful for local testing) AWS_PROFILE \ # Pass through the default AWS region (used for integration tests) From ada973df5ca9cbe7052434254860821a156b65a4 Mon Sep 17 00:00:00 2001 From: seebees Date: Mon, 21 Dec 2020 15:24:24 -0800 Subject: [PATCH 2/2] chore: add comments about installed versions --- codebuild/python3.5.yml | 12 ++++++++++++ codebuild/python3.7.yml | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/codebuild/python3.5.yml b/codebuild/python3.5.yml index 5558842f..f2b1dbcd 100644 --- a/codebuild/python3.5.yml +++ b/codebuild/python3.5.yml @@ -14,6 +14,18 @@ phases: python: latest build: commands: + # The specific versions are manually installed + # because they are not installed + # by default in CodeBuild containers. + # `pyenv` does not have + # a nice way to just install + # the latest patch version. + # I have selected the current latest patch + # rather than try + # and manage a one-liner or script. + # Testing every minor version + # is too extreme at this time. + # The choice of versions should be reviewed. - pyenv install 3.5.9 - pyenv local 3.5.9 - pip install tox tox-pyenv diff --git a/codebuild/python3.7.yml b/codebuild/python3.7.yml index d6500ade..1ac0daa6 100644 --- a/codebuild/python3.7.yml +++ b/codebuild/python3.7.yml @@ -14,6 +14,18 @@ phases: python: latest build: commands: + # The specific versions are manually installed + # because they are not installed + # by default in CodeBuild containers. + # `pyenv` does not have + # a nice way to just install + # the latest patch version. + # I have selected the current latest patch + # rather than try + # and manage a one-liner or script. + # Testing every minor version + # is too extreme at this time. + # The choice of versions should be reviewed. - pyenv install 3.7.9 - pyenv local 3.7.9 - pip install tox tox-pyenv