From 6f7b1cb1edeeae27232b8e2617ed60cb7289d118 Mon Sep 17 00:00:00 2001 From: Benjamin Farley Date: Tue, 6 Apr 2021 11:27:06 -0600 Subject: [PATCH 01/11] chore: Make examples a sub-module This lets us use the examples during release validation -- simply update the dynamodb-encryption-sdk dependency to point to the specific version we want to validate. --- examples/requirements.txt | 1 + examples/setup.py | 62 +++++++++++++++++++ .../__init__.py | 1 + .../aws_kms_encrypted_client.py | 0 .../aws_kms_encrypted_item.py | 0 .../aws_kms_encrypted_resource.py | 0 .../aws_kms_encrypted_table.py | 0 .../most_recent_provider_encrypted_table.py | 0 .../pylintrc | 0 .../wrapped_rsa_encrypted_table.py | 0 .../wrapped_symmetric_encrypted_table.py | 0 examples/test/requirements.txt | 2 + .../test/test_aws_kms_encrypted_examples.py | 2 +- ...most_recent_provider_encrypted_examples.py | 2 +- .../test/test_wrapped_encrypted_examples.py | 2 +- examples/tox.ini | 25 ++++++++ 16 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 examples/requirements.txt create mode 100644 examples/setup.py rename examples/src/{ => dynamodb_encryption_sdk_examples}/__init__.py (96%) rename examples/src/{ => dynamodb_encryption_sdk_examples}/aws_kms_encrypted_client.py (100%) rename examples/src/{ => dynamodb_encryption_sdk_examples}/aws_kms_encrypted_item.py (100%) rename examples/src/{ => dynamodb_encryption_sdk_examples}/aws_kms_encrypted_resource.py (100%) rename examples/src/{ => dynamodb_encryption_sdk_examples}/aws_kms_encrypted_table.py (100%) rename examples/src/{ => dynamodb_encryption_sdk_examples}/most_recent_provider_encrypted_table.py (100%) rename examples/src/{ => dynamodb_encryption_sdk_examples}/pylintrc (100%) rename examples/src/{ => dynamodb_encryption_sdk_examples}/wrapped_rsa_encrypted_table.py (100%) rename examples/src/{ => dynamodb_encryption_sdk_examples}/wrapped_symmetric_encrypted_table.py (100%) create mode 100644 examples/test/requirements.txt create mode 100644 examples/tox.ini diff --git a/examples/requirements.txt b/examples/requirements.txt new file mode 100644 index 00000000..138d8645 --- /dev/null +++ b/examples/requirements.txt @@ -0,0 +1 @@ +dynamodb-encryption-sdk diff --git a/examples/setup.py b/examples/setup.py new file mode 100644 index 00000000..c89435e8 --- /dev/null +++ b/examples/setup.py @@ -0,0 +1,62 @@ +"""DynamoDB Encryption Client for Python examples.""" +import io +import os +import re + +from setuptools import find_packages, setup + +VERSION_RE = re.compile(r"""__version__ = ['"]([0-9.]+)['"]""") +HERE = os.path.abspath(os.path.dirname(__file__)) + + +def read(*args): + """Reads complete file contents.""" + return io.open(os.path.join(HERE, *args), encoding="utf-8").read() + + +def get_version(): + """Reads the version from this module.""" + init = read("src", "dynamodb_encryption_sdk_examples", "__init__.py") + return VERSION_RE.search(init).group(1) + + +def get_requirements(): + """Reads the requirements file.""" + requirements = read("requirements.txt") + return requirements.strip().splitlines() + + +setup( + name="dynamodb-encryption-sdk-examples", + version=get_version(), + packages=find_packages("src"), + package_dir={"": "src"}, + url="https://github.com/aws/aws-dynamodb-encryption-python", + author="Amazon Web Services", + author_email="aws-cryptools@amazon.com", + maintainer="Amazon Web Services", + description="DynamoDB Encryption Client for Python examples", + #long_description=read("README.rst"), + keywords="dynamodb-encryption-sdk aws kms encryption dynamodb", + data_files=["requirements.txt"], + license="Apache License 2.0", + install_requires=get_requirements(), + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Natural Language :: English", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Security", + "Topic :: Security :: Cryptography", + ], +) diff --git a/examples/src/__init__.py b/examples/src/dynamodb_encryption_sdk_examples/__init__.py similarity index 96% rename from examples/src/__init__.py rename to examples/src/dynamodb_encryption_sdk_examples/__init__.py index b08a227c..887f4840 100644 --- a/examples/src/__init__.py +++ b/examples/src/dynamodb_encryption_sdk_examples/__init__.py @@ -11,3 +11,4 @@ # ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. """Stub module indicator to make linter configuration simpler.""" +__version__ = "1.0.0" diff --git a/examples/src/aws_kms_encrypted_client.py b/examples/src/dynamodb_encryption_sdk_examples/aws_kms_encrypted_client.py similarity index 100% rename from examples/src/aws_kms_encrypted_client.py rename to examples/src/dynamodb_encryption_sdk_examples/aws_kms_encrypted_client.py diff --git a/examples/src/aws_kms_encrypted_item.py b/examples/src/dynamodb_encryption_sdk_examples/aws_kms_encrypted_item.py similarity index 100% rename from examples/src/aws_kms_encrypted_item.py rename to examples/src/dynamodb_encryption_sdk_examples/aws_kms_encrypted_item.py diff --git a/examples/src/aws_kms_encrypted_resource.py b/examples/src/dynamodb_encryption_sdk_examples/aws_kms_encrypted_resource.py similarity index 100% rename from examples/src/aws_kms_encrypted_resource.py rename to examples/src/dynamodb_encryption_sdk_examples/aws_kms_encrypted_resource.py diff --git a/examples/src/aws_kms_encrypted_table.py b/examples/src/dynamodb_encryption_sdk_examples/aws_kms_encrypted_table.py similarity index 100% rename from examples/src/aws_kms_encrypted_table.py rename to examples/src/dynamodb_encryption_sdk_examples/aws_kms_encrypted_table.py diff --git a/examples/src/most_recent_provider_encrypted_table.py b/examples/src/dynamodb_encryption_sdk_examples/most_recent_provider_encrypted_table.py similarity index 100% rename from examples/src/most_recent_provider_encrypted_table.py rename to examples/src/dynamodb_encryption_sdk_examples/most_recent_provider_encrypted_table.py diff --git a/examples/src/pylintrc b/examples/src/dynamodb_encryption_sdk_examples/pylintrc similarity index 100% rename from examples/src/pylintrc rename to examples/src/dynamodb_encryption_sdk_examples/pylintrc diff --git a/examples/src/wrapped_rsa_encrypted_table.py b/examples/src/dynamodb_encryption_sdk_examples/wrapped_rsa_encrypted_table.py similarity index 100% rename from examples/src/wrapped_rsa_encrypted_table.py rename to examples/src/dynamodb_encryption_sdk_examples/wrapped_rsa_encrypted_table.py diff --git a/examples/src/wrapped_symmetric_encrypted_table.py b/examples/src/dynamodb_encryption_sdk_examples/wrapped_symmetric_encrypted_table.py similarity index 100% rename from examples/src/wrapped_symmetric_encrypted_table.py rename to examples/src/dynamodb_encryption_sdk_examples/wrapped_symmetric_encrypted_table.py diff --git a/examples/test/requirements.txt b/examples/test/requirements.txt new file mode 100644 index 00000000..882624b6 --- /dev/null +++ b/examples/test/requirements.txt @@ -0,0 +1,2 @@ +dynamodb-encryption-sdk +pytest diff --git a/examples/test/test_aws_kms_encrypted_examples.py b/examples/test/test_aws_kms_encrypted_examples.py index f7df24b3..2e3ace65 100644 --- a/examples/test/test_aws_kms_encrypted_examples.py +++ b/examples/test/test_aws_kms_encrypted_examples.py @@ -13,7 +13,7 @@ """Test ``aws_kms_encrypted_*`` examples.""" import pytest -from ..src import aws_kms_encrypted_client, aws_kms_encrypted_item, aws_kms_encrypted_resource, aws_kms_encrypted_table +from dynamodb_encryption_sdk_examples import aws_kms_encrypted_client, aws_kms_encrypted_item, aws_kms_encrypted_resource, aws_kms_encrypted_table from .examples_test_utils import cmk_arn, ddb_table_name # noqa pylint: disable=unused-import pytestmark = [pytest.mark.examples] diff --git a/examples/test/test_most_recent_provider_encrypted_examples.py b/examples/test/test_most_recent_provider_encrypted_examples.py index 8894001c..b5618640 100644 --- a/examples/test/test_most_recent_provider_encrypted_examples.py +++ b/examples/test/test_most_recent_provider_encrypted_examples.py @@ -18,7 +18,7 @@ from dynamodb_encryption_sdk.material_providers.store.meta import MetaStore -from ..src import most_recent_provider_encrypted_table +from dynamodb_encryption_sdk_examples import most_recent_provider_encrypted_table from .examples_test_utils import cmk_arn, ddb_table_name # noqa pylint: disable=unused-import pytestmark = [pytest.mark.examples] diff --git a/examples/test/test_wrapped_encrypted_examples.py b/examples/test/test_wrapped_encrypted_examples.py index f6bb7aa2..52dbe915 100644 --- a/examples/test/test_wrapped_encrypted_examples.py +++ b/examples/test/test_wrapped_encrypted_examples.py @@ -15,7 +15,7 @@ from dynamodb_encryption_sdk.delegated_keys.jce import JceNameLocalDelegatedKey -from ..src import wrapped_rsa_encrypted_table, wrapped_symmetric_encrypted_table +from dynamodb_encryption_sdk_examples import wrapped_rsa_encrypted_table, wrapped_symmetric_encrypted_table from .examples_test_utils import ddb_table_name # noqa pylint: disable=unused-import pytestmark = [pytest.mark.examples] diff --git a/examples/tox.ini b/examples/tox.ini new file mode 100644 index 00000000..5f6ce4be --- /dev/null +++ b/examples/tox.ini @@ -0,0 +1,25 @@ +# Basic environments for running examples against various versions of Python + +[tox] +envlist = + py{27,35,36,37,38,39}-examples + +[testenv:base-command] +commands = python -m pytest --basetemp={envtmpdir} -l {posargs} + +[testenv] +passenv = + # Identifies AWS KMS key id to use in integration tests + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID \ + # DynamoDB Table to use in integration tests + 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 container URI + AWS_CONTAINER_CREDENTIALS_RELATIVE_URI +sitepackages = False +deps = -rtest/requirements.txt +# 'download' forces tox to always upgrade pip to the latest +download = true +commands = + examples: {[testenv:base-command]commands} test/ -m "examples" From 3cc0d546fa5ee863652ad08ab3a8ec059148d086 Mon Sep 17 00:00:00 2001 From: Benjamin Farley Date: Tue, 18 May 2021 09:27:25 -0600 Subject: [PATCH 02/11] Fix CI --- examples/test/test_aws_kms_encrypted_examples.py | 7 ++++++- .../test_most_recent_provider_encrypted_examples.py | 2 +- examples/test/test_wrapped_encrypted_examples.py | 2 +- tox.ini | 10 ++++++---- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/examples/test/test_aws_kms_encrypted_examples.py b/examples/test/test_aws_kms_encrypted_examples.py index 2e3ace65..fabf0b16 100644 --- a/examples/test/test_aws_kms_encrypted_examples.py +++ b/examples/test/test_aws_kms_encrypted_examples.py @@ -12,8 +12,13 @@ # language governing permissions and limitations under the License. """Test ``aws_kms_encrypted_*`` examples.""" import pytest +from dynamodb_encryption_sdk_examples import ( + aws_kms_encrypted_client, + aws_kms_encrypted_item, + aws_kms_encrypted_resource, + aws_kms_encrypted_table, +) -from dynamodb_encryption_sdk_examples import aws_kms_encrypted_client, aws_kms_encrypted_item, aws_kms_encrypted_resource, aws_kms_encrypted_table from .examples_test_utils import cmk_arn, ddb_table_name # noqa pylint: disable=unused-import pytestmark = [pytest.mark.examples] diff --git a/examples/test/test_most_recent_provider_encrypted_examples.py b/examples/test/test_most_recent_provider_encrypted_examples.py index b5618640..1821bf32 100644 --- a/examples/test/test_most_recent_provider_encrypted_examples.py +++ b/examples/test/test_most_recent_provider_encrypted_examples.py @@ -15,10 +15,10 @@ import boto3 import pytest +from dynamodb_encryption_sdk_examples import most_recent_provider_encrypted_table from dynamodb_encryption_sdk.material_providers.store.meta import MetaStore -from dynamodb_encryption_sdk_examples import most_recent_provider_encrypted_table from .examples_test_utils import cmk_arn, ddb_table_name # noqa pylint: disable=unused-import pytestmark = [pytest.mark.examples] diff --git a/examples/test/test_wrapped_encrypted_examples.py b/examples/test/test_wrapped_encrypted_examples.py index 52dbe915..1c06e813 100644 --- a/examples/test/test_wrapped_encrypted_examples.py +++ b/examples/test/test_wrapped_encrypted_examples.py @@ -12,10 +12,10 @@ # language governing permissions and limitations under the License. """Test ``wrapped_*_encrypted_*`` examples.""" import pytest +from dynamodb_encryption_sdk_examples import wrapped_rsa_encrypted_table, wrapped_symmetric_encrypted_table from dynamodb_encryption_sdk.delegated_keys.jce import JceNameLocalDelegatedKey -from dynamodb_encryption_sdk_examples import wrapped_rsa_encrypted_table, wrapped_symmetric_encrypted_table from .examples_test_utils import ddb_table_name # noqa pylint: disable=unused-import pytestmark = [pytest.mark.examples] diff --git a/tox.ini b/tox.ini index 0377291f..a8e0545c 100644 --- a/tox.ini +++ b/tox.ini @@ -245,7 +245,7 @@ commands = flake8 \ # Ignore C901 complexity requirements (examples optimize for straightforward readability) --ignore C901 \ - examples/src/ + examples/src/dynamodb_encryption_sdk_examples/ flake8 \ # Ignore F811 redefinition errors in tests (breaks with fixture use) # Ignore D103 docstring requirements for tests @@ -282,7 +282,7 @@ commands = basepython = {[testenv:pylint]basepython} deps = {[testenv:pylint]deps} commands = - pylint --rcfile=examples/src/pylintrc examples/src/ + pylint --rcfile=examples/src/dynamodb_encryption_sdk_examples/pylintrc examples/src/dynamodb_encryption_sdk_examples pylint --rcfile=examples/test/pylintrc examples/test/ [testenv:blacken-src] @@ -295,7 +295,8 @@ commands = setup.py \ doc/conf.py \ test/ \ - examples/ \ + examples/src \ + examples/test \ {posargs} @@ -326,7 +327,8 @@ deps = isort>=5.0.0 commands = isort \ src \ test \ - examples/ \ + examples/src \ + examples/test \ doc \ setup.py \ --skip examples/test/examples_test_utils.py \ From 4bea5f66d1e0c4be457e04f104de67cc5435abee Mon Sep 17 00:00:00 2001 From: Benjamin Farley Date: Tue, 18 May 2021 09:46:39 -0600 Subject: [PATCH 03/11] Further CI fixes --- examples/src/{dynamodb_encryption_sdk_examples => }/pylintrc | 0 tox.ini | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename examples/src/{dynamodb_encryption_sdk_examples => }/pylintrc (100%) diff --git a/examples/src/dynamodb_encryption_sdk_examples/pylintrc b/examples/src/pylintrc similarity index 100% rename from examples/src/dynamodb_encryption_sdk_examples/pylintrc rename to examples/src/pylintrc diff --git a/tox.ini b/tox.ini index a8e0545c..4cbdb6ec 100644 --- a/tox.ini +++ b/tox.ini @@ -104,7 +104,7 @@ passenv = setenv = ######################################################### deps = -rtest/requirements.txt -commands = {[testenv:base-command]commands} -m "local and not slow and not veryslow and not nope" +commands = {[testenv:base-command]commands} -m "local and not slow and not veryslow and not nope" --ignore=examples # Collect requirements for use in upstream tests [testenv:freeze-upstream-requirements-base] @@ -282,7 +282,7 @@ commands = basepython = {[testenv:pylint]basepython} deps = {[testenv:pylint]deps} commands = - pylint --rcfile=examples/src/dynamodb_encryption_sdk_examples/pylintrc examples/src/dynamodb_encryption_sdk_examples + pylint --rcfile=examples/src/pylintrc examples/src/dynamodb_encryption_sdk_examples pylint --rcfile=examples/test/pylintrc examples/test/ [testenv:blacken-src] From 8c6ac59d5f0586dcd6c68abaef337497c191cd13 Mon Sep 17 00:00:00 2001 From: Benjamin Farley Date: Tue, 18 May 2021 10:06:43 -0600 Subject: [PATCH 04/11] More explicit ignores --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 4cbdb6ec..0d435d13 100644 --- a/tox.ini +++ b/tox.ini @@ -137,7 +137,7 @@ commands = {[testenv:freeze-upstream-requirements-base]commands} test/upstream-r sitepackages = False recreate = True passenv = -commands = {[testenv:base-command]commands} -m "local and not slow and not veryslow and not nope" +commands = {[testenv:base-command]commands} -m "local and not slow and not veryslow and not nope" --ignore=examples # Test frozen upstream requirements for Python 2.7 [testenv:test-upstream-requirements-py27] From bb54c68b085819bffd0ea6274d54e2792ed4977f Mon Sep 17 00:00:00 2001 From: Benjamin Farley Date: Tue, 6 Apr 2021 12:27:57 -0600 Subject: [PATCH 05/11] chore: Add codebuild specs for releasing --- codebuild/release/prod-release.yml | 41 ++++++++++++++++++++++++++++ codebuild/release/test-release.yml | 43 ++++++++++++++++++++++++++++++ codebuild/release/validate.yml | 23 ++++++++++++++++ examples/tox.ini | 5 +++- 4 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 codebuild/release/prod-release.yml create mode 100644 codebuild/release/test-release.yml create mode 100644 codebuild/release/validate.yml diff --git a/codebuild/release/prod-release.yml b/codebuild/release/prod-release.yml new file mode 100644 index 00000000..c729c96c --- /dev/null +++ b/codebuild/release/prod-release.yml @@ -0,0 +1,41 @@ +version: 0.2 + +env: + variables: + BRANCH: "master" + secrets-manager: + TWINE_USERNAME: PyPiAdmin:username + TWINE_PASSWORD: PyPiAdmin:password + +phases: + install: + commands: + - pip install tox + - pip install --upgrade pip + runtime-versions: + python: latest + pre_build: + commands: + - git checkout $COMMIT_ID + - FOUND_VERSION=$(sed -n 's/__version__ = "\(.*\)"/\1/p' src/dynamodb_encryption_sdk/identifiers.py) + - | + if expr ${FOUND_VERSION} != ${VERSION}; then + echo "identifiers.py version (${FOUND_VERSION}) does not match expected version (${VERSION}), stopping" + exit 1; + fi + build: + commands: + - tox -e park + - tox -e release + +batch: + fast-fail: true + build-graph: + - identifier: release_to_prod + - identifier: validate_prod_release + depend-on: + - release_to_prod + buildspec: codebuild/release/validate.yml + env: + variables: + PIP_INDEX_URL: https://pypi.python.org/simple/ diff --git a/codebuild/release/test-release.yml b/codebuild/release/test-release.yml new file mode 100644 index 00000000..1dc9feae --- /dev/null +++ b/codebuild/release/test-release.yml @@ -0,0 +1,43 @@ +version: 0.2 + +env: + variables: + BRANCH: "master" + secrets-manager: + TWINE_USERNAME: TestPyPiCryptoTools:username + TWINE_PASSWORD: TestPyPiCryptoTools:password + +phases: + install: + commands: + - pip install tox + - pip install --upgrade pip + runtime-versions: + python: latest + pre_build: + commands: + - git checkout $COMMIT_ID + - FOUND_VERSION=$(sed -n 's/__version__ = "\(.*\)"/\1/p' src/dynamodb_encryption_sdk/identifiers.py) + - | + if expr ${FOUND_VERSION} != ${VERSION}; then + echo "identifiers.py version (${FOUND_VERSION}) does not match expected version (${VERSION}), stopping" + exit 1; + fi + build: + commands: + - tox -e park + - tox -e test-release + + +batch: + fast-fail: true + build-graph: + - identifier: release_to_staging + - identifier: validate_staging_release + depend-on: + - release_to_staging + buildspec: codebuild/release/validate.yml + env: + variables: + PIP_INDEX_URL: https://test.pypi.org/simple/ + PIP_EXTRA_INDEX_URL: https://pypi.python.org/simple/ diff --git a/codebuild/release/validate.yml b/codebuild/release/validate.yml new file mode 100644 index 00000000..0457b933 --- /dev/null +++ b/codebuild/release/validate.yml @@ -0,0 +1,23 @@ +version: 0.2 + +env: + variables: + BRANCH: "master" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + DDB_ENCRYPTION_CLIENT_TEST_TABLE_NAME: ddbec-release-validation + + +phases: + install: + commands: + - pip install tox + runtime-versions: + python: latest + pre_build: + commands: + - cd examples + - sed -i "s/dynamodb_encryption_sdk/dynamodb_encryption_sdk==$VERSION/" test/requirements.txt + build: + commands: + - tox -e py38-examples diff --git a/examples/tox.ini b/examples/tox.ini index 5f6ce4be..261df1b9 100644 --- a/examples/tox.ini +++ b/examples/tox.ini @@ -16,7 +16,10 @@ passenv = # Pass through AWS credentials AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN \ # AWS Role access in CodeBuild is via the container URI - AWS_CONTAINER_CREDENTIALS_RELATIVE_URI + AWS_CONTAINER_CREDENTIALS_RELATIVE_URI \ + # Pass through the default AWS region + AWS_DEFAULT_REGION + sitepackages = False deps = -rtest/requirements.txt # 'download' forces tox to always upgrade pip to the latest From babd331da2c44639faa1a11d624e9c50ee52a347 Mon Sep 17 00:00:00 2001 From: Benjamin Farley Date: Fri, 28 May 2021 16:22:49 -0600 Subject: [PATCH 06/11] More robust handling of failures in validation --- codebuild/release/validate.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/codebuild/release/validate.yml b/codebuild/release/validate.yml index 0457b933..c21086c3 100644 --- a/codebuild/release/validate.yml +++ b/codebuild/release/validate.yml @@ -20,4 +20,20 @@ phases: - sed -i "s/dynamodb_encryption_sdk/dynamodb_encryption_sdk==$VERSION/" test/requirements.txt build: commands: - - tox -e py38-examples + - NUM_RETRIES=3 + - | + while [ $NUM_RETRIES -gt 0 ] + do + tox -re py38-examples + if [ $? -eq 0 ]; then + break + fi + NUM_RETRIES=$((NUM_RETRIES-1)) + if [ $NUM_RETRIES -eq 0 ]; then + echo "All validation attempts failed, stopping" + exit 1; + else + echo "Validation failed, retrying in 60 seconds; will retry $NUM_RETRIES more times" && sleep 60 + fi + done + From 2833ae0c5d301d2547f391b344ba6b5851da8fb5 Mon Sep 17 00:00:00 2001 From: Benjamin Farley Date: Tue, 1 Jun 2021 12:24:01 -0600 Subject: [PATCH 07/11] Fix README link --- examples/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/setup.py b/examples/setup.py index ceb22c19..8f1fa53d 100644 --- a/examples/setup.py +++ b/examples/setup.py @@ -36,7 +36,7 @@ def get_requirements(): author_email="aws-cryptools@amazon.com", maintainer="Amazon Web Services", description="DynamoDB Encryption Client for Python examples", - long_description=read("README.rst"), + long_description=read("README.md"), keywords="dynamodb-encryption-sdk aws kms encryption dynamodb", data_files=["requirements.txt"], license="Apache License 2.0", From 3c5ca5e174f374744bae8fc678eec1b3f67b4d0b Mon Sep 17 00:00:00 2001 From: Benjamin Farley Date: Tue, 1 Jun 2021 12:52:28 -0600 Subject: [PATCH 08/11] temporary breakage to test failure scenario --- codebuild/release/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild/release/validate.yml b/codebuild/release/validate.yml index c21086c3..a3e8298d 100644 --- a/codebuild/release/validate.yml +++ b/codebuild/release/validate.yml @@ -17,7 +17,7 @@ phases: pre_build: commands: - cd examples - - sed -i "s/dynamodb_encryption_sdk/dynamodb_encryption_sdk==$VERSION/" test/requirements.txt + - sed -i "s/dynamodb_encryption_sdk/dynamodb_encryption_sdk==42.42.0/" test/requirements.txt build: commands: - NUM_RETRIES=3 From 4d93966b8fe8d4761d53de175b548f5ff87443ce Mon Sep 17 00:00:00 2001 From: Benjamin Farley Date: Tue, 1 Jun 2021 13:23:36 -0600 Subject: [PATCH 09/11] debug --- codebuild/release/validate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/codebuild/release/validate.yml b/codebuild/release/validate.yml index a3e8298d..e4ecbd0d 100644 --- a/codebuild/release/validate.yml +++ b/codebuild/release/validate.yml @@ -18,6 +18,7 @@ phases: commands: - cd examples - sed -i "s/dynamodb_encryption_sdk/dynamodb_encryption_sdk==42.42.0/" test/requirements.txt + - cat test/requirements.txt build: commands: - NUM_RETRIES=3 From ca551bc45ca265ec94bd7b371e4ff2ced2afa798 Mon Sep 17 00:00:00 2001 From: Benjamin Farley Date: Tue, 1 Jun 2021 13:31:38 -0600 Subject: [PATCH 10/11] underscore to dash --- codebuild/release/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebuild/release/validate.yml b/codebuild/release/validate.yml index e4ecbd0d..40d979da 100644 --- a/codebuild/release/validate.yml +++ b/codebuild/release/validate.yml @@ -17,7 +17,7 @@ phases: pre_build: commands: - cd examples - - sed -i "s/dynamodb_encryption_sdk/dynamodb_encryption_sdk==42.42.0/" test/requirements.txt + - sed -i "s/dynamodb-encryption-sdk/dynamodb-encryption-sdk==42.42.0/" test/requirements.txt - cat test/requirements.txt build: commands: From bf3ef7c4f24e9fbbbf634181b3064f7dbf014d8a Mon Sep 17 00:00:00 2001 From: Benjamin Farley Date: Tue, 1 Jun 2021 13:35:55 -0600 Subject: [PATCH 11/11] Remove temporary breakage and debugging --- codebuild/release/validate.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/codebuild/release/validate.yml b/codebuild/release/validate.yml index 40d979da..9c242630 100644 --- a/codebuild/release/validate.yml +++ b/codebuild/release/validate.yml @@ -17,8 +17,7 @@ phases: pre_build: commands: - cd examples - - sed -i "s/dynamodb-encryption-sdk/dynamodb-encryption-sdk==42.42.0/" test/requirements.txt - - cat test/requirements.txt + - sed -i "s/dynamodb-encryption-sdk/dynamodb-encryption-sdk==$VERSION/" test/requirements.txt build: commands: - NUM_RETRIES=3