From 2d748b9d48dfc8ca204b4a100891681965059915 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:37:33 -0800 Subject: [PATCH 1/8] chore(deps): bump the boto group in /requirements with 4 updates (#6698) Bumps the boto group in /requirements with 4 updates: [boto3](https://github.com/boto/boto3), [boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]](https://github.com/youtype/mypy_boto3_builder), [botocore](https://github.com/boto/botocore) and [botocore-stubs](https://github.com/youtype/botocore-stubs). Updates `boto3` from 1.34.41 to 1.34.42 - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.34.41...1.34.42) Updates `boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]` from 1.34.41 to 1.34.42 - [Release notes](https://github.com/youtype/mypy_boto3_builder/releases) - [Commits](https://github.com/youtype/mypy_boto3_builder/commits) Updates `botocore` from 1.34.41 to 1.34.42 - [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/botocore/compare/1.34.41...1.34.42) Updates `botocore-stubs` from 1.34.41 to 1.34.42 - [Release notes](https://github.com/youtype/botocore-stubs/releases) - [Commits](https://github.com/youtype/botocore-stubs/commits) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray] dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: botocore dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: botocore-stubs dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/base.txt | 2 +- requirements/reproducible-linux.txt | 24 ++++++++++++------------ requirements/reproducible-mac.txt | 24 ++++++++++++------------ requirements/reproducible-win.txt | 24 ++++++++++++------------ 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 507eaddac6..936cb7e732 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -31,4 +31,4 @@ tzlocal==5.2 cfn-lint~=0.85.1 # Type checking boto3 objects -boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.41 +boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.42 diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index 471dc12a02..85affed015 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -38,27 +38,27 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.41 \ - --hash=sha256:9fd66f22a4cdd63165a7a19186fff9b6e3d742e83498ea3f3231bab6ae4bf0f3 \ - --hash=sha256:ae1a974c728c076a49392a695102124f650f45361c654bb7c0bef1bb644c52d5 +boto3==1.34.42 \ + --hash=sha256:2ed136f9cf79e783e12424db23e970d1c50e65a8d7a9077efa71cbf8496fb7a3 \ + --hash=sha256:5069b2c647c73c8428378e88b32bd23f568001f897a6f01179fae25de72a7ca6 # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.41 \ - --hash=sha256:981dcdc642a1b9954d41c042040dfd54436b2c5f35eb970fe1012a316041a1a1 \ - --hash=sha256:fdba64d4d4bf733e9754e763fd5a732d7bbbc08f21cc1942dcdf7eabf4a3fb80 +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.42 \ + --hash=sha256:751041b26076de192657f9d8a916c61f02bff6aece122a8260ce65b676e5b96e \ + --hash=sha256:c20fcb0b1680be89c185951a2c88406e7dcd48a91814231b59f37dad6249108a # via # aws-sam-cli (setup.py) # boto3-stubs -botocore==1.34.41 \ - --hash=sha256:3a6943c75a0d292ab6e008bce58ee6503776969479f991f5ad03a5d877af29ae \ - --hash=sha256:9b5827332da766da487e5a5b14b36e02528be9f2e899f909577afb7001eb441d +botocore==1.34.42 \ + --hash=sha256:93755c3ede4bd9f6180b3118f6b607acca8b633fd2668226794a543ce79a2434 \ + --hash=sha256:cf4fad50d09686f03e44418fcae9dd24369658daa556357cedc0790cfcd6fdac # via # boto3 # s3transfer -botocore-stubs==1.34.41 \ - --hash=sha256:6efa1fa39bd09851fc32869edfe7922a207cc69535aee666956ee5cc0975c87f \ - --hash=sha256:a79315a7b380759a26a9c42533fd3ede3ef42295089563da52add2751344494a +botocore-stubs==1.34.42 \ + --hash=sha256:7f0d783e5c84a378721e5cae0922bb8ef6aad11d748eda3fd48eeb8d22ee6e42 \ + --hash=sha256:d1de9b7f4fd1c3491846862fc635fea8484a2d4c6d92291d736bafed4ab0344b # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index 48c0f52f6b..f1861dfac3 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -56,27 +56,27 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.41 \ - --hash=sha256:9fd66f22a4cdd63165a7a19186fff9b6e3d742e83498ea3f3231bab6ae4bf0f3 \ - --hash=sha256:ae1a974c728c076a49392a695102124f650f45361c654bb7c0bef1bb644c52d5 +boto3==1.34.42 \ + --hash=sha256:2ed136f9cf79e783e12424db23e970d1c50e65a8d7a9077efa71cbf8496fb7a3 \ + --hash=sha256:5069b2c647c73c8428378e88b32bd23f568001f897a6f01179fae25de72a7ca6 # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.41 \ - --hash=sha256:981dcdc642a1b9954d41c042040dfd54436b2c5f35eb970fe1012a316041a1a1 \ - --hash=sha256:fdba64d4d4bf733e9754e763fd5a732d7bbbc08f21cc1942dcdf7eabf4a3fb80 +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.42 \ + --hash=sha256:751041b26076de192657f9d8a916c61f02bff6aece122a8260ce65b676e5b96e \ + --hash=sha256:c20fcb0b1680be89c185951a2c88406e7dcd48a91814231b59f37dad6249108a # via # aws-sam-cli (setup.py) # boto3-stubs -botocore==1.34.41 \ - --hash=sha256:3a6943c75a0d292ab6e008bce58ee6503776969479f991f5ad03a5d877af29ae \ - --hash=sha256:9b5827332da766da487e5a5b14b36e02528be9f2e899f909577afb7001eb441d +botocore==1.34.42 \ + --hash=sha256:93755c3ede4bd9f6180b3118f6b607acca8b633fd2668226794a543ce79a2434 \ + --hash=sha256:cf4fad50d09686f03e44418fcae9dd24369658daa556357cedc0790cfcd6fdac # via # boto3 # s3transfer -botocore-stubs==1.34.41 \ - --hash=sha256:6efa1fa39bd09851fc32869edfe7922a207cc69535aee666956ee5cc0975c87f \ - --hash=sha256:a79315a7b380759a26a9c42533fd3ede3ef42295089563da52add2751344494a +botocore-stubs==1.34.42 \ + --hash=sha256:7f0d783e5c84a378721e5cae0922bb8ef6aad11d748eda3fd48eeb8d22ee6e42 \ + --hash=sha256:d1de9b7f4fd1c3491846862fc635fea8484a2d4c6d92291d736bafed4ab0344b # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index c62f7bde3c..20db2d5f85 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -38,27 +38,27 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.41 \ - --hash=sha256:9fd66f22a4cdd63165a7a19186fff9b6e3d742e83498ea3f3231bab6ae4bf0f3 \ - --hash=sha256:ae1a974c728c076a49392a695102124f650f45361c654bb7c0bef1bb644c52d5 +boto3==1.34.42 \ + --hash=sha256:2ed136f9cf79e783e12424db23e970d1c50e65a8d7a9077efa71cbf8496fb7a3 \ + --hash=sha256:5069b2c647c73c8428378e88b32bd23f568001f897a6f01179fae25de72a7ca6 # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.41 \ - --hash=sha256:981dcdc642a1b9954d41c042040dfd54436b2c5f35eb970fe1012a316041a1a1 \ - --hash=sha256:fdba64d4d4bf733e9754e763fd5a732d7bbbc08f21cc1942dcdf7eabf4a3fb80 +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.42 \ + --hash=sha256:751041b26076de192657f9d8a916c61f02bff6aece122a8260ce65b676e5b96e \ + --hash=sha256:c20fcb0b1680be89c185951a2c88406e7dcd48a91814231b59f37dad6249108a # via # aws-sam-cli (setup.py) # boto3-stubs -botocore==1.34.41 \ - --hash=sha256:3a6943c75a0d292ab6e008bce58ee6503776969479f991f5ad03a5d877af29ae \ - --hash=sha256:9b5827332da766da487e5a5b14b36e02528be9f2e899f909577afb7001eb441d +botocore==1.34.42 \ + --hash=sha256:93755c3ede4bd9f6180b3118f6b607acca8b633fd2668226794a543ce79a2434 \ + --hash=sha256:cf4fad50d09686f03e44418fcae9dd24369658daa556357cedc0790cfcd6fdac # via # boto3 # s3transfer -botocore-stubs==1.34.41 \ - --hash=sha256:6efa1fa39bd09851fc32869edfe7922a207cc69535aee666956ee5cc0975c87f \ - --hash=sha256:a79315a7b380759a26a9c42533fd3ede3ef42295089563da52add2751344494a +botocore-stubs==1.34.42 \ + --hash=sha256:7f0d783e5c84a378721e5cae0922bb8ef6aad11d748eda3fd48eeb8d22ee6e42 \ + --hash=sha256:d1de9b7f4fd1c3491846862fc635fea8484a2d4c6d92291d736bafed4ab0344b # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ From 780fd822c120275c47dce455d586d0d368e54d28 Mon Sep 17 00:00:00 2001 From: Lucas <12496191+lucashuy@users.noreply.github.com> Date: Fri, 16 Feb 2024 09:30:46 -0800 Subject: [PATCH 2/8] chore: Removed the setup.cfg file (#6696) * Removed setup config file * Undo patch bump --- setup.cfg | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 setup.cfg diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index b88034e414..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -description-file = README.md From 03911621e9a3ef2a70578f804c743a4982865a3e Mon Sep 17 00:00:00 2001 From: Lucas <12496191+lucashuy@users.noreply.github.com> Date: Fri, 16 Feb 2024 09:32:27 -0800 Subject: [PATCH 3/8] fix: Raise UserException when an invalid runtime is specified (#6701) * Raise a user exception instead of default Python exception when invalid runtime is used * Commit the exception file * make format --- samcli/local/docker/exceptions.py | 6 ++++++ samcli/local/docker/lambda_container.py | 4 +++- tests/unit/local/docker/test_lambda_container.py | 8 ++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/samcli/local/docker/exceptions.py b/samcli/local/docker/exceptions.py index cc00698083..7cf0cbb3c0 100644 --- a/samcli/local/docker/exceptions.py +++ b/samcli/local/docker/exceptions.py @@ -25,3 +25,9 @@ class ContainerFailureError(UserException): """ Raised when the invoke container fails execution """ + + +class InvalidRuntimeException(UserException): + """ + Raised when an invalid runtime is specified for a Lambda Function + """ diff --git a/samcli/local/docker/lambda_container.py b/samcli/local/docker/lambda_container.py index 3eea56c72d..609d5bfbb3 100644 --- a/samcli/local/docker/lambda_container.py +++ b/samcli/local/docker/lambda_container.py @@ -7,6 +7,7 @@ from typing import List from samcli.lib.utils.packagetype import IMAGE +from samcli.local.docker.exceptions import InvalidRuntimeException from samcli.local.docker.lambda_debug_settings import LambdaDebugSettings from .container import DEFAULT_CONTAINER_HOST_INTERFACE, Container @@ -15,6 +16,7 @@ LOG = logging.getLogger(__name__) RIE_LOG_LEVEL_ENV_VAR = "SAM_CLI_RIE_DEV" +INVALID_RUNTIME_MESSAGE = "Unsupported Lambda runtime: {runtime}. For a list of supported runtimes, please visit https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html" class LambdaContainer(Container): @@ -95,7 +97,7 @@ def __init__( Optional. The function full path, unique in all stacks """ if not Runtime.has_value(runtime) and not packagetype == IMAGE: - raise ValueError("Unsupported Lambda runtime {}".format(runtime)) + raise InvalidRuntimeException(INVALID_RUNTIME_MESSAGE.format(runtime=runtime)) image = LambdaContainer._get_image( lambda_image, runtime, packagetype, imageuri, layers, architecture, function_full_path diff --git a/tests/unit/local/docker/test_lambda_container.py b/tests/unit/local/docker/test_lambda_container.py index 681931402d..f5261ecd13 100644 --- a/tests/unit/local/docker/test_lambda_container.py +++ b/tests/unit/local/docker/test_lambda_container.py @@ -9,6 +9,7 @@ from samcli.commands.local.lib.debug_context import DebugContext from samcli.lib.utils.packagetype import IMAGE, ZIP +from samcli.local.docker.exceptions import InvalidRuntimeException from samcli.local.docker.lambda_container import LambdaContainer, Runtime, RIE_LOG_LEVEL_ENV_VAR from samcli.local.docker.lambda_debug_settings import DebuggingNotSupported from samcli.local.docker.lambda_image import RAPID_IMAGE_TAG_PREFIX @@ -433,7 +434,7 @@ def test_must_fail_for_unsupported_runtime(self): image_builder_mock = Mock() - with self.assertRaises(ValueError) as context: + with self.assertRaises(InvalidRuntimeException) as context: LambdaContainer( runtime=runtime, imageuri=self.imageuri, @@ -446,7 +447,10 @@ def test_must_fail_for_unsupported_runtime(self): architecture="x86_64", ) - self.assertEqual(str(context.exception), "Unsupported Lambda runtime foo") + self.assertEqual( + str(context.exception), + "Unsupported Lambda runtime: foo. For a list of supported runtimes, please visit https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html", + ) @parameterized.expand( [ From 492146c89af3b2328b95ddb7bb2e5f8a9d1cf23a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 17:32:55 +0000 Subject: [PATCH 4/8] chore(deps-dev): bump the types group in /requirements with 1 update (#6699) Bumps the types group in /requirements with 1 update: [types-setuptools](https://github.com/python/typeshed). Updates `types-setuptools` from 69.0.0.20240125 to 69.1.0.20240215 - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-setuptools dependency-type: direct:development update-type: version-update:semver-minor dependency-group: types ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 6bb7e4bbf8..ce59278149 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -12,7 +12,7 @@ types-pywin32==306.0.0.20240130 types-PyYAML==6.0.12.12 types-chevron==0.14.2.20240106 types-psutil==5.9.5.20240205 -types-setuptools==69.0.0.20240125 +types-setuptools==69.1.0.20240215 types-Pygments==2.17.0.20240106 types-colorama==0.4.15.20240205 types-dateparser==1.1.4.20240106 From 7d8e973027e619b2fb39fdb455211a554ef08dd5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 17:42:08 +0000 Subject: [PATCH 5/8] chore(deps): bump the boto group in /requirements with 5 updates (#6704) Bumps the boto group in /requirements with 5 updates: | Package | From | To | | --- | --- | --- | | [boto3](https://github.com/boto/boto3) | `1.34.42` | `1.34.43` | | [boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]](https://github.com/youtype/mypy_boto3_builder) | `1.34.42` | `1.34.43` | | [botocore](https://github.com/boto/botocore) | `1.34.42` | `1.34.43` | | [botocore-stubs](https://github.com/youtype/botocore-stubs) | `1.34.42` | `1.34.43` | | [mypy-boto3-secretsmanager](https://github.com/youtype/mypy_boto3_builder) | `1.34.17` | `1.34.43` | Updates `boto3` from 1.34.42 to 1.34.43 - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.34.42...1.34.43) Updates `boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]` from 1.34.42 to 1.34.43 - [Release notes](https://github.com/youtype/mypy_boto3_builder/releases) - [Commits](https://github.com/youtype/mypy_boto3_builder/commits) Updates `botocore` from 1.34.42 to 1.34.43 - [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/botocore/compare/1.34.42...1.34.43) Updates `botocore-stubs` from 1.34.42 to 1.34.43 - [Release notes](https://github.com/youtype/botocore-stubs/releases) - [Commits](https://github.com/youtype/botocore-stubs/commits) Updates `mypy-boto3-secretsmanager` from 1.34.17 to 1.34.43 - [Release notes](https://github.com/youtype/mypy_boto3_builder/releases) - [Commits](https://github.com/youtype/mypy_boto3_builder/commits) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray] dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: botocore dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: botocore-stubs dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: mypy-boto3-secretsmanager dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/base.txt | 2 +- requirements/reproducible-linux.txt | 30 ++++++++++++++--------------- requirements/reproducible-mac.txt | 30 ++++++++++++++--------------- requirements/reproducible-win.txt | 30 ++++++++++++++--------------- 4 files changed, 46 insertions(+), 46 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 936cb7e732..90b1cc1945 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -31,4 +31,4 @@ tzlocal==5.2 cfn-lint~=0.85.1 # Type checking boto3 objects -boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.42 +boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.43 diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index 85affed015..f2ef2a0201 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -38,27 +38,27 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.42 \ - --hash=sha256:2ed136f9cf79e783e12424db23e970d1c50e65a8d7a9077efa71cbf8496fb7a3 \ - --hash=sha256:5069b2c647c73c8428378e88b32bd23f568001f897a6f01179fae25de72a7ca6 +boto3==1.34.43 \ + --hash=sha256:179cdcff2dee116ff0bbe10c21a374fff8ae0d9ea3842bd8dd2c9f69e8185d91 \ + --hash=sha256:ed646f600b76939d54fa1ff868415793551a5a08b9de0a09696b46d116da7da5 # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.42 \ - --hash=sha256:751041b26076de192657f9d8a916c61f02bff6aece122a8260ce65b676e5b96e \ - --hash=sha256:c20fcb0b1680be89c185951a2c88406e7dcd48a91814231b59f37dad6249108a +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.43 \ + --hash=sha256:0a0bdf96eb42f3b12b9bf159d97c407cf272e0430e5f7b42581ce7124ce9bb78 \ + --hash=sha256:5698322a22e54dbebc6f0010dc0f08271f0c911d7f4c5880af341d5f0323748a # via # aws-sam-cli (setup.py) # boto3-stubs -botocore==1.34.42 \ - --hash=sha256:93755c3ede4bd9f6180b3118f6b607acca8b633fd2668226794a543ce79a2434 \ - --hash=sha256:cf4fad50d09686f03e44418fcae9dd24369658daa556357cedc0790cfcd6fdac +botocore==1.34.43 \ + --hash=sha256:00dea9fd602dc97420318d373079bdfcc8da34501aaa908ab98b477526bdefec \ + --hash=sha256:ab7d8046a8c3326ecf3d9f9884e79aa77fed864416ed8af52b9e22ab055acf4e # via # boto3 # s3transfer -botocore-stubs==1.34.42 \ - --hash=sha256:7f0d783e5c84a378721e5cae0922bb8ef6aad11d748eda3fd48eeb8d22ee6e42 \ - --hash=sha256:d1de9b7f4fd1c3491846862fc635fea8484a2d4c6d92291d736bafed4ab0344b +botocore-stubs==1.34.43 \ + --hash=sha256:6da6730071a83a57200d71bab6b5c2d0033adec5bbb59396113e498de9136aed \ + --hash=sha256:c30aded65547eb339ea4438e7662c4111aee09f360132202bd09e3130f7be956 # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ @@ -439,9 +439,9 @@ mypy-boto3-schemas==1.34.0 \ --hash=sha256:28c016609dcffc606bd8425ee92894c46e943ab77033e1ae46481f00c39b7f75 \ --hash=sha256:3b25a71944192b0980c3bb5132deb7c06ee9b88580ed63f257fad97cf3bf2927 # via boto3-stubs -mypy-boto3-secretsmanager==1.34.17 \ - --hash=sha256:0dbd1cdbe7992324c3414cccf0256e3905827bbf1f6a8d58c255635f6a2b4bfb \ - --hash=sha256:a547932d99c3f711b27b9ea1c38fc063050910c0bf6c8eb346abd96ace61668e +mypy-boto3-secretsmanager==1.34.43 \ + --hash=sha256:64e9df58f71072f0a912ecaca626683f4536da078caa204ac07928c4b1481b8b \ + --hash=sha256:abbf560775c2fe0dc383b7f70c16a1bf753d9b3ffc0caa5e35447e685783a68b # via boto3-stubs mypy-boto3-signer==1.34.0 \ --hash=sha256:c11ed943ccd38ee54fc0ca90ed347ef770d695df49535eab96dd97fb3dbdc592 \ diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index f1861dfac3..9eeeabb258 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -56,27 +56,27 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.42 \ - --hash=sha256:2ed136f9cf79e783e12424db23e970d1c50e65a8d7a9077efa71cbf8496fb7a3 \ - --hash=sha256:5069b2c647c73c8428378e88b32bd23f568001f897a6f01179fae25de72a7ca6 +boto3==1.34.43 \ + --hash=sha256:179cdcff2dee116ff0bbe10c21a374fff8ae0d9ea3842bd8dd2c9f69e8185d91 \ + --hash=sha256:ed646f600b76939d54fa1ff868415793551a5a08b9de0a09696b46d116da7da5 # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.42 \ - --hash=sha256:751041b26076de192657f9d8a916c61f02bff6aece122a8260ce65b676e5b96e \ - --hash=sha256:c20fcb0b1680be89c185951a2c88406e7dcd48a91814231b59f37dad6249108a +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.43 \ + --hash=sha256:0a0bdf96eb42f3b12b9bf159d97c407cf272e0430e5f7b42581ce7124ce9bb78 \ + --hash=sha256:5698322a22e54dbebc6f0010dc0f08271f0c911d7f4c5880af341d5f0323748a # via # aws-sam-cli (setup.py) # boto3-stubs -botocore==1.34.42 \ - --hash=sha256:93755c3ede4bd9f6180b3118f6b607acca8b633fd2668226794a543ce79a2434 \ - --hash=sha256:cf4fad50d09686f03e44418fcae9dd24369658daa556357cedc0790cfcd6fdac +botocore==1.34.43 \ + --hash=sha256:00dea9fd602dc97420318d373079bdfcc8da34501aaa908ab98b477526bdefec \ + --hash=sha256:ab7d8046a8c3326ecf3d9f9884e79aa77fed864416ed8af52b9e22ab055acf4e # via # boto3 # s3transfer -botocore-stubs==1.34.42 \ - --hash=sha256:7f0d783e5c84a378721e5cae0922bb8ef6aad11d748eda3fd48eeb8d22ee6e42 \ - --hash=sha256:d1de9b7f4fd1c3491846862fc635fea8484a2d4c6d92291d736bafed4ab0344b +botocore-stubs==1.34.43 \ + --hash=sha256:6da6730071a83a57200d71bab6b5c2d0033adec5bbb59396113e498de9136aed \ + --hash=sha256:c30aded65547eb339ea4438e7662c4111aee09f360132202bd09e3130f7be956 # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ @@ -467,9 +467,9 @@ mypy-boto3-schemas==1.34.0 \ --hash=sha256:28c016609dcffc606bd8425ee92894c46e943ab77033e1ae46481f00c39b7f75 \ --hash=sha256:3b25a71944192b0980c3bb5132deb7c06ee9b88580ed63f257fad97cf3bf2927 # via boto3-stubs -mypy-boto3-secretsmanager==1.34.17 \ - --hash=sha256:0dbd1cdbe7992324c3414cccf0256e3905827bbf1f6a8d58c255635f6a2b4bfb \ - --hash=sha256:a547932d99c3f711b27b9ea1c38fc063050910c0bf6c8eb346abd96ace61668e +mypy-boto3-secretsmanager==1.34.43 \ + --hash=sha256:64e9df58f71072f0a912ecaca626683f4536da078caa204ac07928c4b1481b8b \ + --hash=sha256:abbf560775c2fe0dc383b7f70c16a1bf753d9b3ffc0caa5e35447e685783a68b # via boto3-stubs mypy-boto3-signer==1.34.0 \ --hash=sha256:c11ed943ccd38ee54fc0ca90ed347ef770d695df49535eab96dd97fb3dbdc592 \ diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index 20db2d5f85..ade6d44817 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -38,27 +38,27 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.42 \ - --hash=sha256:2ed136f9cf79e783e12424db23e970d1c50e65a8d7a9077efa71cbf8496fb7a3 \ - --hash=sha256:5069b2c647c73c8428378e88b32bd23f568001f897a6f01179fae25de72a7ca6 +boto3==1.34.43 \ + --hash=sha256:179cdcff2dee116ff0bbe10c21a374fff8ae0d9ea3842bd8dd2c9f69e8185d91 \ + --hash=sha256:ed646f600b76939d54fa1ff868415793551a5a08b9de0a09696b46d116da7da5 # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.42 \ - --hash=sha256:751041b26076de192657f9d8a916c61f02bff6aece122a8260ce65b676e5b96e \ - --hash=sha256:c20fcb0b1680be89c185951a2c88406e7dcd48a91814231b59f37dad6249108a +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.43 \ + --hash=sha256:0a0bdf96eb42f3b12b9bf159d97c407cf272e0430e5f7b42581ce7124ce9bb78 \ + --hash=sha256:5698322a22e54dbebc6f0010dc0f08271f0c911d7f4c5880af341d5f0323748a # via # aws-sam-cli (setup.py) # boto3-stubs -botocore==1.34.42 \ - --hash=sha256:93755c3ede4bd9f6180b3118f6b607acca8b633fd2668226794a543ce79a2434 \ - --hash=sha256:cf4fad50d09686f03e44418fcae9dd24369658daa556357cedc0790cfcd6fdac +botocore==1.34.43 \ + --hash=sha256:00dea9fd602dc97420318d373079bdfcc8da34501aaa908ab98b477526bdefec \ + --hash=sha256:ab7d8046a8c3326ecf3d9f9884e79aa77fed864416ed8af52b9e22ab055acf4e # via # boto3 # s3transfer -botocore-stubs==1.34.42 \ - --hash=sha256:7f0d783e5c84a378721e5cae0922bb8ef6aad11d748eda3fd48eeb8d22ee6e42 \ - --hash=sha256:d1de9b7f4fd1c3491846862fc635fea8484a2d4c6d92291d736bafed4ab0344b +botocore-stubs==1.34.43 \ + --hash=sha256:6da6730071a83a57200d71bab6b5c2d0033adec5bbb59396113e498de9136aed \ + --hash=sha256:c30aded65547eb339ea4438e7662c4111aee09f360132202bd09e3130f7be956 # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ @@ -443,9 +443,9 @@ mypy-boto3-schemas==1.34.0 \ --hash=sha256:28c016609dcffc606bd8425ee92894c46e943ab77033e1ae46481f00c39b7f75 \ --hash=sha256:3b25a71944192b0980c3bb5132deb7c06ee9b88580ed63f257fad97cf3bf2927 # via boto3-stubs -mypy-boto3-secretsmanager==1.34.17 \ - --hash=sha256:0dbd1cdbe7992324c3414cccf0256e3905827bbf1f6a8d58c255635f6a2b4bfb \ - --hash=sha256:a547932d99c3f711b27b9ea1c38fc063050910c0bf6c8eb346abd96ace61668e +mypy-boto3-secretsmanager==1.34.43 \ + --hash=sha256:64e9df58f71072f0a912ecaca626683f4536da078caa204ac07928c4b1481b8b \ + --hash=sha256:abbf560775c2fe0dc383b7f70c16a1bf753d9b3ffc0caa5e35447e685783a68b # via boto3-stubs mypy-boto3-signer==1.34.0 \ --hash=sha256:c11ed943ccd38ee54fc0ca90ed347ef770d695df49535eab96dd97fb3dbdc592 \ From 681a1de0a90dc56aa475151ac52ae4d8e6e0dbef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 18:02:10 +0000 Subject: [PATCH 6/8] chore(deps): bump cryptography from 42.0.2 to 42.0.3 in /requirements (#6705) Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.2 to 42.0.3. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/42.0.2...42.0.3) --- updated-dependencies: - dependency-name: cryptography dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/reproducible-linux.txt | 66 ++++++++++++++--------------- requirements/reproducible-mac.txt | 66 ++++++++++++++--------------- requirements/reproducible-win.txt | 66 ++++++++++++++--------------- 3 files changed, 99 insertions(+), 99 deletions(-) diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index f2ef2a0201..838869bb09 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -233,39 +233,39 @@ cookiecutter==2.5.0 \ --hash=sha256:8aa2f12ed11bc05628651e9dc4353a10571dd9908aaaaeec959a2b9ea465a5d2 \ --hash=sha256:e61e9034748e3f41b8bd2c11f00d030784b48711c4d5c42363c50989a65331ec # via aws-sam-cli (setup.py) -cryptography==42.0.2 \ - --hash=sha256:087887e55e0b9c8724cf05361357875adb5c20dec27e5816b653492980d20380 \ - --hash=sha256:09a77e5b2e8ca732a19a90c5bca2d124621a1edb5438c5daa2d2738bfeb02589 \ - --hash=sha256:130c0f77022b2b9c99d8cebcdd834d81705f61c68e91ddd614ce74c657f8b3ea \ - --hash=sha256:141e2aa5ba100d3788c0ad7919b288f89d1fe015878b9659b307c9ef867d3a65 \ - --hash=sha256:28cb2c41f131a5758d6ba6a0504150d644054fd9f3203a1e8e8d7ac3aea7f73a \ - --hash=sha256:2f9f14185962e6a04ab32d1abe34eae8a9001569ee4edb64d2304bf0d65c53f3 \ - --hash=sha256:320948ab49883557a256eab46149df79435a22d2fefd6a66fe6946f1b9d9d008 \ - --hash=sha256:36d4b7c4be6411f58f60d9ce555a73df8406d484ba12a63549c88bd64f7967f1 \ - --hash=sha256:3b15c678f27d66d247132cbf13df2f75255627bcc9b6a570f7d2fd08e8c081d2 \ - --hash=sha256:3dbd37e14ce795b4af61b89b037d4bc157f2cb23e676fa16932185a04dfbf635 \ - --hash=sha256:4383b47f45b14459cab66048d384614019965ba6c1a1a141f11b5a551cace1b2 \ - --hash=sha256:44c95c0e96b3cb628e8452ec060413a49002a247b2b9938989e23a2c8291fc90 \ - --hash=sha256:4b063d3413f853e056161eb0c7724822a9740ad3caa24b8424d776cebf98e7ee \ - --hash=sha256:52ed9ebf8ac602385126c9a2fe951db36f2cb0c2538d22971487f89d0de4065a \ - --hash=sha256:55d1580e2d7e17f45d19d3b12098e352f3a37fe86d380bf45846ef257054b242 \ - --hash=sha256:5ef9bc3d046ce83c4bbf4c25e1e0547b9c441c01d30922d812e887dc5f125c12 \ - --hash=sha256:5fa82a26f92871eca593b53359c12ad7949772462f887c35edaf36f87953c0e2 \ - --hash=sha256:61321672b3ac7aade25c40449ccedbc6db72c7f5f0fdf34def5e2f8b51ca530d \ - --hash=sha256:701171f825dcab90969596ce2af253143b93b08f1a716d4b2a9d2db5084ef7be \ - --hash=sha256:841ec8af7a8491ac76ec5a9522226e287187a3107e12b7d686ad354bb78facee \ - --hash=sha256:8a06641fb07d4e8f6c7dda4fc3f8871d327803ab6542e33831c7ccfdcb4d0ad6 \ - --hash=sha256:8e88bb9eafbf6a4014d55fb222e7360eef53e613215085e65a13290577394529 \ - --hash=sha256:a00aee5d1b6c20620161984f8ab2ab69134466c51f58c052c11b076715e72929 \ - --hash=sha256:a047682d324ba56e61b7ea7c7299d51e61fd3bca7dad2ccc39b72bd0118d60a1 \ - --hash=sha256:a7ef8dd0bf2e1d0a27042b231a3baac6883cdd5557036f5e8df7139255feaac6 \ - --hash=sha256:ad28cff53f60d99a928dfcf1e861e0b2ceb2bc1f08a074fdd601b314e1cc9e0a \ - --hash=sha256:b9097a208875fc7bbeb1286d0125d90bdfed961f61f214d3f5be62cd4ed8a446 \ - --hash=sha256:b97fe7d7991c25e6a31e5d5e795986b18fbbb3107b873d5f3ae6dc9a103278e9 \ - --hash=sha256:e0ec52ba3c7f1b7d813cd52649a5b3ef1fc0d433219dc8c93827c57eab6cf888 \ - --hash=sha256:ea2c3ffb662fec8bbbfce5602e2c159ff097a4631d96235fcf0fb00e59e3ece4 \ - --hash=sha256:fa3dec4ba8fb6e662770b74f62f1a0c7d4e37e25b58b2bf2c1be4c95372b4a33 \ - --hash=sha256:fbeb725c9dc799a574518109336acccaf1303c30d45c075c665c0793c2f79a7f +cryptography==42.0.3 \ + --hash=sha256:04859aa7f12c2b5f7e22d25198ddd537391f1695df7057c8700f71f26f47a129 \ + --hash=sha256:069d2ce9be5526a44093a0991c450fe9906cdf069e0e7cd67d9dee49a62b9ebe \ + --hash=sha256:0d3ec384058b642f7fb7e7bff9664030011ed1af8f852540c76a1317a9dd0d20 \ + --hash=sha256:0fab2a5c479b360e5e0ea9f654bcebb535e3aa1e493a715b13244f4e07ea8eec \ + --hash=sha256:0fea01527d4fb22ffe38cd98951c9044400f6eff4788cf52ae116e27d30a1ba3 \ + --hash=sha256:1b797099d221df7cce5ff2a1d272761d1554ddf9a987d3e11f6459b38cd300fd \ + --hash=sha256:1e935c2900fb53d31f491c0de04f41110351377be19d83d908c1fd502ae8daa5 \ + --hash=sha256:20100c22b298c9eaebe4f0b9032ea97186ac2555f426c3e70670f2517989543b \ + --hash=sha256:20180da1b508f4aefc101cebc14c57043a02b355d1a652b6e8e537967f1e1b46 \ + --hash=sha256:25b09b73db78facdfd7dd0fa77a3f19e94896197c86e9f6dc16bce7b37a96504 \ + --hash=sha256:2619487f37da18d6826e27854a7f9d4d013c51eafb066c80d09c63cf24505306 \ + --hash=sha256:2eb6368d5327d6455f20327fb6159b97538820355ec00f8cc9464d617caecead \ + --hash=sha256:35772a6cffd1f59b85cb670f12faba05513446f80352fe811689b4e439b5d89e \ + --hash=sha256:39d5c93e95bcbc4c06313fc6a500cee414ee39b616b55320c1904760ad686938 \ + --hash=sha256:3d96ea47ce6d0055d5b97e761d37b4e84195485cb5a38401be341fabf23bc32a \ + --hash=sha256:4dcab7c25e48fc09a73c3e463d09ac902a932a0f8d0c568238b3696d06bf377b \ + --hash=sha256:5fbf0f3f0fac7c089308bd771d2c6c7b7d53ae909dce1db52d8e921f6c19bb3a \ + --hash=sha256:6c25e1e9c2ce682d01fc5e2dde6598f7313027343bd14f4049b82ad0402e52cd \ + --hash=sha256:762f3771ae40e111d78d77cbe9c1035e886ac04a234d3ee0856bf4ecb3749d54 \ + --hash=sha256:90147dad8c22d64b2ff7331f8d4cddfdc3ee93e4879796f837bdbb2a0b141e0c \ + --hash=sha256:935cca25d35dda9e7bd46a24831dfd255307c55a07ff38fd1a92119cffc34857 \ + --hash=sha256:93fbee08c48e63d5d1b39ab56fd3fdd02e6c2431c3da0f4edaf54954744c718f \ + --hash=sha256:9541c69c62d7446539f2c1c06d7046aef822940d248fa4b8962ff0302862cc1f \ + --hash=sha256:c23f03cfd7d9826cdcbad7850de67e18b4654179e01fe9bc623d37c2638eb4ef \ + --hash=sha256:c3d1f5a1d403a8e640fa0887e9f7087331abb3f33b0f2207d2cc7f213e4a864c \ + --hash=sha256:d1998e545081da0ab276bcb4b33cce85f775adb86a516e8f55b3dac87f469548 \ + --hash=sha256:d5cf11bc7f0b71fb71af26af396c83dfd3f6eed56d4b6ef95d57867bf1e4ba65 \ + --hash=sha256:db0480ffbfb1193ac4e1e88239f31314fe4c6cdcf9c0b8712b55414afbf80db4 \ + --hash=sha256:de4ae486041878dc46e571a4c70ba337ed5233a1344c14a0790c4c4be4bbb8b4 \ + --hash=sha256:de5086cd475d67113ccb6f9fae6d8fe3ac54a4f9238fd08bfdb07b03d791ff0a \ + --hash=sha256:df34312149b495d9d03492ce97471234fd9037aa5ba217c2a6ea890e9166f151 \ + --hash=sha256:ead69ba488f806fe1b1b4050febafdbf206b81fa476126f3e16110c818bac396 # via pyopenssl dateparser==1.2.0 \ --hash=sha256:0b21ad96534e562920a0083e97fd45fa959882d4162acc358705144520a35830 \ diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index 9eeeabb258..5f57db1d02 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -251,39 +251,39 @@ cookiecutter==2.5.0 \ --hash=sha256:8aa2f12ed11bc05628651e9dc4353a10571dd9908aaaaeec959a2b9ea465a5d2 \ --hash=sha256:e61e9034748e3f41b8bd2c11f00d030784b48711c4d5c42363c50989a65331ec # via aws-sam-cli (setup.py) -cryptography==42.0.2 \ - --hash=sha256:087887e55e0b9c8724cf05361357875adb5c20dec27e5816b653492980d20380 \ - --hash=sha256:09a77e5b2e8ca732a19a90c5bca2d124621a1edb5438c5daa2d2738bfeb02589 \ - --hash=sha256:130c0f77022b2b9c99d8cebcdd834d81705f61c68e91ddd614ce74c657f8b3ea \ - --hash=sha256:141e2aa5ba100d3788c0ad7919b288f89d1fe015878b9659b307c9ef867d3a65 \ - --hash=sha256:28cb2c41f131a5758d6ba6a0504150d644054fd9f3203a1e8e8d7ac3aea7f73a \ - --hash=sha256:2f9f14185962e6a04ab32d1abe34eae8a9001569ee4edb64d2304bf0d65c53f3 \ - --hash=sha256:320948ab49883557a256eab46149df79435a22d2fefd6a66fe6946f1b9d9d008 \ - --hash=sha256:36d4b7c4be6411f58f60d9ce555a73df8406d484ba12a63549c88bd64f7967f1 \ - --hash=sha256:3b15c678f27d66d247132cbf13df2f75255627bcc9b6a570f7d2fd08e8c081d2 \ - --hash=sha256:3dbd37e14ce795b4af61b89b037d4bc157f2cb23e676fa16932185a04dfbf635 \ - --hash=sha256:4383b47f45b14459cab66048d384614019965ba6c1a1a141f11b5a551cace1b2 \ - --hash=sha256:44c95c0e96b3cb628e8452ec060413a49002a247b2b9938989e23a2c8291fc90 \ - --hash=sha256:4b063d3413f853e056161eb0c7724822a9740ad3caa24b8424d776cebf98e7ee \ - --hash=sha256:52ed9ebf8ac602385126c9a2fe951db36f2cb0c2538d22971487f89d0de4065a \ - --hash=sha256:55d1580e2d7e17f45d19d3b12098e352f3a37fe86d380bf45846ef257054b242 \ - --hash=sha256:5ef9bc3d046ce83c4bbf4c25e1e0547b9c441c01d30922d812e887dc5f125c12 \ - --hash=sha256:5fa82a26f92871eca593b53359c12ad7949772462f887c35edaf36f87953c0e2 \ - --hash=sha256:61321672b3ac7aade25c40449ccedbc6db72c7f5f0fdf34def5e2f8b51ca530d \ - --hash=sha256:701171f825dcab90969596ce2af253143b93b08f1a716d4b2a9d2db5084ef7be \ - --hash=sha256:841ec8af7a8491ac76ec5a9522226e287187a3107e12b7d686ad354bb78facee \ - --hash=sha256:8a06641fb07d4e8f6c7dda4fc3f8871d327803ab6542e33831c7ccfdcb4d0ad6 \ - --hash=sha256:8e88bb9eafbf6a4014d55fb222e7360eef53e613215085e65a13290577394529 \ - --hash=sha256:a00aee5d1b6c20620161984f8ab2ab69134466c51f58c052c11b076715e72929 \ - --hash=sha256:a047682d324ba56e61b7ea7c7299d51e61fd3bca7dad2ccc39b72bd0118d60a1 \ - --hash=sha256:a7ef8dd0bf2e1d0a27042b231a3baac6883cdd5557036f5e8df7139255feaac6 \ - --hash=sha256:ad28cff53f60d99a928dfcf1e861e0b2ceb2bc1f08a074fdd601b314e1cc9e0a \ - --hash=sha256:b9097a208875fc7bbeb1286d0125d90bdfed961f61f214d3f5be62cd4ed8a446 \ - --hash=sha256:b97fe7d7991c25e6a31e5d5e795986b18fbbb3107b873d5f3ae6dc9a103278e9 \ - --hash=sha256:e0ec52ba3c7f1b7d813cd52649a5b3ef1fc0d433219dc8c93827c57eab6cf888 \ - --hash=sha256:ea2c3ffb662fec8bbbfce5602e2c159ff097a4631d96235fcf0fb00e59e3ece4 \ - --hash=sha256:fa3dec4ba8fb6e662770b74f62f1a0c7d4e37e25b58b2bf2c1be4c95372b4a33 \ - --hash=sha256:fbeb725c9dc799a574518109336acccaf1303c30d45c075c665c0793c2f79a7f +cryptography==42.0.3 \ + --hash=sha256:04859aa7f12c2b5f7e22d25198ddd537391f1695df7057c8700f71f26f47a129 \ + --hash=sha256:069d2ce9be5526a44093a0991c450fe9906cdf069e0e7cd67d9dee49a62b9ebe \ + --hash=sha256:0d3ec384058b642f7fb7e7bff9664030011ed1af8f852540c76a1317a9dd0d20 \ + --hash=sha256:0fab2a5c479b360e5e0ea9f654bcebb535e3aa1e493a715b13244f4e07ea8eec \ + --hash=sha256:0fea01527d4fb22ffe38cd98951c9044400f6eff4788cf52ae116e27d30a1ba3 \ + --hash=sha256:1b797099d221df7cce5ff2a1d272761d1554ddf9a987d3e11f6459b38cd300fd \ + --hash=sha256:1e935c2900fb53d31f491c0de04f41110351377be19d83d908c1fd502ae8daa5 \ + --hash=sha256:20100c22b298c9eaebe4f0b9032ea97186ac2555f426c3e70670f2517989543b \ + --hash=sha256:20180da1b508f4aefc101cebc14c57043a02b355d1a652b6e8e537967f1e1b46 \ + --hash=sha256:25b09b73db78facdfd7dd0fa77a3f19e94896197c86e9f6dc16bce7b37a96504 \ + --hash=sha256:2619487f37da18d6826e27854a7f9d4d013c51eafb066c80d09c63cf24505306 \ + --hash=sha256:2eb6368d5327d6455f20327fb6159b97538820355ec00f8cc9464d617caecead \ + --hash=sha256:35772a6cffd1f59b85cb670f12faba05513446f80352fe811689b4e439b5d89e \ + --hash=sha256:39d5c93e95bcbc4c06313fc6a500cee414ee39b616b55320c1904760ad686938 \ + --hash=sha256:3d96ea47ce6d0055d5b97e761d37b4e84195485cb5a38401be341fabf23bc32a \ + --hash=sha256:4dcab7c25e48fc09a73c3e463d09ac902a932a0f8d0c568238b3696d06bf377b \ + --hash=sha256:5fbf0f3f0fac7c089308bd771d2c6c7b7d53ae909dce1db52d8e921f6c19bb3a \ + --hash=sha256:6c25e1e9c2ce682d01fc5e2dde6598f7313027343bd14f4049b82ad0402e52cd \ + --hash=sha256:762f3771ae40e111d78d77cbe9c1035e886ac04a234d3ee0856bf4ecb3749d54 \ + --hash=sha256:90147dad8c22d64b2ff7331f8d4cddfdc3ee93e4879796f837bdbb2a0b141e0c \ + --hash=sha256:935cca25d35dda9e7bd46a24831dfd255307c55a07ff38fd1a92119cffc34857 \ + --hash=sha256:93fbee08c48e63d5d1b39ab56fd3fdd02e6c2431c3da0f4edaf54954744c718f \ + --hash=sha256:9541c69c62d7446539f2c1c06d7046aef822940d248fa4b8962ff0302862cc1f \ + --hash=sha256:c23f03cfd7d9826cdcbad7850de67e18b4654179e01fe9bc623d37c2638eb4ef \ + --hash=sha256:c3d1f5a1d403a8e640fa0887e9f7087331abb3f33b0f2207d2cc7f213e4a864c \ + --hash=sha256:d1998e545081da0ab276bcb4b33cce85f775adb86a516e8f55b3dac87f469548 \ + --hash=sha256:d5cf11bc7f0b71fb71af26af396c83dfd3f6eed56d4b6ef95d57867bf1e4ba65 \ + --hash=sha256:db0480ffbfb1193ac4e1e88239f31314fe4c6cdcf9c0b8712b55414afbf80db4 \ + --hash=sha256:de4ae486041878dc46e571a4c70ba337ed5233a1344c14a0790c4c4be4bbb8b4 \ + --hash=sha256:de5086cd475d67113ccb6f9fae6d8fe3ac54a4f9238fd08bfdb07b03d791ff0a \ + --hash=sha256:df34312149b495d9d03492ce97471234fd9037aa5ba217c2a6ea890e9166f151 \ + --hash=sha256:ead69ba488f806fe1b1b4050febafdbf206b81fa476126f3e16110c818bac396 # via pyopenssl dateparser==1.2.0 \ --hash=sha256:0b21ad96534e562920a0083e97fd45fa959882d4162acc358705144520a35830 \ diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index ade6d44817..ebf8ed5df3 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -237,39 +237,39 @@ cookiecutter==2.5.0 \ --hash=sha256:8aa2f12ed11bc05628651e9dc4353a10571dd9908aaaaeec959a2b9ea465a5d2 \ --hash=sha256:e61e9034748e3f41b8bd2c11f00d030784b48711c4d5c42363c50989a65331ec # via aws-sam-cli (setup.py) -cryptography==42.0.2 \ - --hash=sha256:087887e55e0b9c8724cf05361357875adb5c20dec27e5816b653492980d20380 \ - --hash=sha256:09a77e5b2e8ca732a19a90c5bca2d124621a1edb5438c5daa2d2738bfeb02589 \ - --hash=sha256:130c0f77022b2b9c99d8cebcdd834d81705f61c68e91ddd614ce74c657f8b3ea \ - --hash=sha256:141e2aa5ba100d3788c0ad7919b288f89d1fe015878b9659b307c9ef867d3a65 \ - --hash=sha256:28cb2c41f131a5758d6ba6a0504150d644054fd9f3203a1e8e8d7ac3aea7f73a \ - --hash=sha256:2f9f14185962e6a04ab32d1abe34eae8a9001569ee4edb64d2304bf0d65c53f3 \ - --hash=sha256:320948ab49883557a256eab46149df79435a22d2fefd6a66fe6946f1b9d9d008 \ - --hash=sha256:36d4b7c4be6411f58f60d9ce555a73df8406d484ba12a63549c88bd64f7967f1 \ - --hash=sha256:3b15c678f27d66d247132cbf13df2f75255627bcc9b6a570f7d2fd08e8c081d2 \ - --hash=sha256:3dbd37e14ce795b4af61b89b037d4bc157f2cb23e676fa16932185a04dfbf635 \ - --hash=sha256:4383b47f45b14459cab66048d384614019965ba6c1a1a141f11b5a551cace1b2 \ - --hash=sha256:44c95c0e96b3cb628e8452ec060413a49002a247b2b9938989e23a2c8291fc90 \ - --hash=sha256:4b063d3413f853e056161eb0c7724822a9740ad3caa24b8424d776cebf98e7ee \ - --hash=sha256:52ed9ebf8ac602385126c9a2fe951db36f2cb0c2538d22971487f89d0de4065a \ - --hash=sha256:55d1580e2d7e17f45d19d3b12098e352f3a37fe86d380bf45846ef257054b242 \ - --hash=sha256:5ef9bc3d046ce83c4bbf4c25e1e0547b9c441c01d30922d812e887dc5f125c12 \ - --hash=sha256:5fa82a26f92871eca593b53359c12ad7949772462f887c35edaf36f87953c0e2 \ - --hash=sha256:61321672b3ac7aade25c40449ccedbc6db72c7f5f0fdf34def5e2f8b51ca530d \ - --hash=sha256:701171f825dcab90969596ce2af253143b93b08f1a716d4b2a9d2db5084ef7be \ - --hash=sha256:841ec8af7a8491ac76ec5a9522226e287187a3107e12b7d686ad354bb78facee \ - --hash=sha256:8a06641fb07d4e8f6c7dda4fc3f8871d327803ab6542e33831c7ccfdcb4d0ad6 \ - --hash=sha256:8e88bb9eafbf6a4014d55fb222e7360eef53e613215085e65a13290577394529 \ - --hash=sha256:a00aee5d1b6c20620161984f8ab2ab69134466c51f58c052c11b076715e72929 \ - --hash=sha256:a047682d324ba56e61b7ea7c7299d51e61fd3bca7dad2ccc39b72bd0118d60a1 \ - --hash=sha256:a7ef8dd0bf2e1d0a27042b231a3baac6883cdd5557036f5e8df7139255feaac6 \ - --hash=sha256:ad28cff53f60d99a928dfcf1e861e0b2ceb2bc1f08a074fdd601b314e1cc9e0a \ - --hash=sha256:b9097a208875fc7bbeb1286d0125d90bdfed961f61f214d3f5be62cd4ed8a446 \ - --hash=sha256:b97fe7d7991c25e6a31e5d5e795986b18fbbb3107b873d5f3ae6dc9a103278e9 \ - --hash=sha256:e0ec52ba3c7f1b7d813cd52649a5b3ef1fc0d433219dc8c93827c57eab6cf888 \ - --hash=sha256:ea2c3ffb662fec8bbbfce5602e2c159ff097a4631d96235fcf0fb00e59e3ece4 \ - --hash=sha256:fa3dec4ba8fb6e662770b74f62f1a0c7d4e37e25b58b2bf2c1be4c95372b4a33 \ - --hash=sha256:fbeb725c9dc799a574518109336acccaf1303c30d45c075c665c0793c2f79a7f +cryptography==42.0.3 \ + --hash=sha256:04859aa7f12c2b5f7e22d25198ddd537391f1695df7057c8700f71f26f47a129 \ + --hash=sha256:069d2ce9be5526a44093a0991c450fe9906cdf069e0e7cd67d9dee49a62b9ebe \ + --hash=sha256:0d3ec384058b642f7fb7e7bff9664030011ed1af8f852540c76a1317a9dd0d20 \ + --hash=sha256:0fab2a5c479b360e5e0ea9f654bcebb535e3aa1e493a715b13244f4e07ea8eec \ + --hash=sha256:0fea01527d4fb22ffe38cd98951c9044400f6eff4788cf52ae116e27d30a1ba3 \ + --hash=sha256:1b797099d221df7cce5ff2a1d272761d1554ddf9a987d3e11f6459b38cd300fd \ + --hash=sha256:1e935c2900fb53d31f491c0de04f41110351377be19d83d908c1fd502ae8daa5 \ + --hash=sha256:20100c22b298c9eaebe4f0b9032ea97186ac2555f426c3e70670f2517989543b \ + --hash=sha256:20180da1b508f4aefc101cebc14c57043a02b355d1a652b6e8e537967f1e1b46 \ + --hash=sha256:25b09b73db78facdfd7dd0fa77a3f19e94896197c86e9f6dc16bce7b37a96504 \ + --hash=sha256:2619487f37da18d6826e27854a7f9d4d013c51eafb066c80d09c63cf24505306 \ + --hash=sha256:2eb6368d5327d6455f20327fb6159b97538820355ec00f8cc9464d617caecead \ + --hash=sha256:35772a6cffd1f59b85cb670f12faba05513446f80352fe811689b4e439b5d89e \ + --hash=sha256:39d5c93e95bcbc4c06313fc6a500cee414ee39b616b55320c1904760ad686938 \ + --hash=sha256:3d96ea47ce6d0055d5b97e761d37b4e84195485cb5a38401be341fabf23bc32a \ + --hash=sha256:4dcab7c25e48fc09a73c3e463d09ac902a932a0f8d0c568238b3696d06bf377b \ + --hash=sha256:5fbf0f3f0fac7c089308bd771d2c6c7b7d53ae909dce1db52d8e921f6c19bb3a \ + --hash=sha256:6c25e1e9c2ce682d01fc5e2dde6598f7313027343bd14f4049b82ad0402e52cd \ + --hash=sha256:762f3771ae40e111d78d77cbe9c1035e886ac04a234d3ee0856bf4ecb3749d54 \ + --hash=sha256:90147dad8c22d64b2ff7331f8d4cddfdc3ee93e4879796f837bdbb2a0b141e0c \ + --hash=sha256:935cca25d35dda9e7bd46a24831dfd255307c55a07ff38fd1a92119cffc34857 \ + --hash=sha256:93fbee08c48e63d5d1b39ab56fd3fdd02e6c2431c3da0f4edaf54954744c718f \ + --hash=sha256:9541c69c62d7446539f2c1c06d7046aef822940d248fa4b8962ff0302862cc1f \ + --hash=sha256:c23f03cfd7d9826cdcbad7850de67e18b4654179e01fe9bc623d37c2638eb4ef \ + --hash=sha256:c3d1f5a1d403a8e640fa0887e9f7087331abb3f33b0f2207d2cc7f213e4a864c \ + --hash=sha256:d1998e545081da0ab276bcb4b33cce85f775adb86a516e8f55b3dac87f469548 \ + --hash=sha256:d5cf11bc7f0b71fb71af26af396c83dfd3f6eed56d4b6ef95d57867bf1e4ba65 \ + --hash=sha256:db0480ffbfb1193ac4e1e88239f31314fe4c6cdcf9c0b8712b55414afbf80db4 \ + --hash=sha256:de4ae486041878dc46e571a4c70ba337ed5233a1344c14a0790c4c4be4bbb8b4 \ + --hash=sha256:de5086cd475d67113ccb6f9fae6d8fe3ac54a4f9238fd08bfdb07b03d791ff0a \ + --hash=sha256:df34312149b495d9d03492ce97471234fd9037aa5ba217c2a6ea890e9166f151 \ + --hash=sha256:ead69ba488f806fe1b1b4050febafdbf206b81fa476126f3e16110c818bac396 # via pyopenssl dateparser==1.2.0 \ --hash=sha256:0b21ad96534e562920a0083e97fd45fa959882d4162acc358705144520a35830 \ From 8c7a339df1c63bfdbccab3e97115bb69f20cc9c7 Mon Sep 17 00:00:00 2001 From: Daniel Mil <84205762+mildaniel@users.noreply.github.com> Date: Fri, 16 Feb 2024 12:27:43 -0800 Subject: [PATCH 7/8] fix: Handle SIGTERM process kill signal (#6697) * fix: Handle SIGTERM process kill * Remove debug trace * Format files --- samcli/commands/local/start_api/cli.py | 4 ++- samcli/commands/local/start_lambda/cli.py | 4 ++- samcli/local/docker/exceptions.py | 6 ++++ samcli/local/services/base_local_service.py | 10 ++++++ .../local/start_api/start_api_integ_base.py | 6 +++- .../local/start_api/test_start_api.py | 30 +++++++++++++++++ .../start_lambda_api_integ_base.py | 6 +++- .../local/start_lambda/test_start_lambda.py | 32 +++++++++++++++++++ .../local/services/test_base_local_service.py | 17 +++++++++- 9 files changed, 110 insertions(+), 5 deletions(-) diff --git a/samcli/commands/local/start_api/cli.py b/samcli/commands/local/start_api/cli.py index cba1ebe7ea..fc42468d9d 100644 --- a/samcli/commands/local/start_api/cli.py +++ b/samcli/commands/local/start_api/cli.py @@ -28,7 +28,7 @@ from samcli.commands.local.start_api.core.command import InvokeAPICommand from samcli.lib.telemetry.metric import track_command from samcli.lib.utils.version_checker import check_newer_version -from samcli.local.docker.exceptions import ContainerNotStartableException, PortAlreadyInUse +from samcli.local.docker.exceptions import ContainerNotStartableException, PortAlreadyInUse, ProcessSigTermException LOG = logging.getLogger(__name__) @@ -290,3 +290,5 @@ def do_cli( # pylint: disable=R0914 raise UserException(str(ex), wrapped_from=ex.__class__.__name__) from ex except ContainerNotStartableException as ex: raise UserException(str(ex), wrapped_from=ex.__class__.__name__) from ex + except ProcessSigTermException: + LOG.debug("Successfully exited SIGTERM terminated process") diff --git a/samcli/commands/local/start_lambda/cli.py b/samcli/commands/local/start_lambda/cli.py index 88a5078d7e..275afa7f1c 100644 --- a/samcli/commands/local/start_lambda/cli.py +++ b/samcli/commands/local/start_lambda/cli.py @@ -26,7 +26,7 @@ from samcli.commands.local.start_lambda.core.command import InvokeLambdaCommand from samcli.lib.telemetry.metric import track_command from samcli.lib.utils.version_checker import check_newer_version -from samcli.local.docker.exceptions import ContainerNotStartableException, PortAlreadyInUse +from samcli.local.docker.exceptions import ContainerNotStartableException, PortAlreadyInUse, ProcessSigTermException LOG = logging.getLogger(__name__) @@ -228,3 +228,5 @@ def do_cli( # pylint: disable=R0914 raise UserException(str(ex), wrapped_from=ex.__class__.__name__) from ex except ContainerNotStartableException as ex: raise UserException(str(ex), wrapped_from=ex.__class__.__name__) from ex + except ProcessSigTermException: + LOG.debug("Successfully exited SIGTERM terminated process") diff --git a/samcli/local/docker/exceptions.py b/samcli/local/docker/exceptions.py index 7cf0cbb3c0..6ff7ad3850 100644 --- a/samcli/local/docker/exceptions.py +++ b/samcli/local/docker/exceptions.py @@ -27,6 +27,12 @@ class ContainerFailureError(UserException): """ +class ProcessSigTermException(Exception): + """ + Raises by a SIGTERM interrupt handler. Will unblock the thread and exit the program gracefully + """ + + class InvalidRuntimeException(UserException): """ Raised when an invalid runtime is specified for a Lambda Function diff --git a/samcli/local/services/base_local_service.py b/samcli/local/services/base_local_service.py index 638d55c17b..b2033c91f4 100644 --- a/samcli/local/services/base_local_service.py +++ b/samcli/local/services/base_local_service.py @@ -3,10 +3,13 @@ import io import json import logging +import signal from typing import Optional, Tuple, Union from flask import Response +from samcli.local.docker.exceptions import ProcessSigTermException + LOG = logging.getLogger(__name__) @@ -66,6 +69,13 @@ def run(self): flask.cli.show_server_banner = lambda *args: None + def interrupt_handler(sig, frame): + LOG.debug("Caught SIGTERM interrupt") + raise ProcessSigTermException() + + LOG.debug("Setting SIGTERM interrupt handler") + signal.signal(signal.SIGTERM, interrupt_handler) + self._app.run(threaded=multi_threaded, host=self.host, port=self.port, ssl_context=self.ssl_context) @staticmethod diff --git a/tests/integration/local/start_api/start_api_integ_base.py b/tests/integration/local/start_api/start_api_integ_base.py index 91483d1d46..306365b8d9 100644 --- a/tests/integration/local/start_api/start_api_integ_base.py +++ b/tests/integration/local/start_api/start_api_integ_base.py @@ -10,6 +10,7 @@ import docker from docker.errors import APIError +from psutil import NoSuchProcess from tests.integration.local.common_utils import InvalidAddressException, random_port, wait_for_local_process from tests.testing_utils import kill_process, get_sam_command @@ -145,7 +146,10 @@ def _make_parameter_override_arg(self, overrides): def tearDownClass(cls): # After all the tests run, we need to kill the start-api process. cls.stop_reading_thread = True - kill_process(cls.start_api_process) + try: + kill_process(cls.start_api_process) + except NoSuchProcess: + LOG.info("Process has already been terminated") @staticmethod def get_binary_data(filename): diff --git a/tests/integration/local/start_api/test_start_api.py b/tests/integration/local/start_api/test_start_api.py index 984a4c639e..a3f8684155 100644 --- a/tests/integration/local/start_api/test_start_api.py +++ b/tests/integration/local/start_api/test_start_api.py @@ -1,10 +1,12 @@ import base64 import shutil +import signal import uuid import random from pathlib import Path from typing import Dict +import docker.errors import requests from http.client import HTTPConnection from concurrent.futures import ThreadPoolExecutor, as_completed @@ -2158,6 +2160,34 @@ def test_can_invoke_lambda_function_successfully(self): self.assertEqual(response.json(), {"hello": "world"}) +class TestWarmContainersHandlesSigTerm(TestWarmContainersBaseClass): + template_path = "/testdata/start_api/template-warm-containers.yaml" + container_mode = ContainersInitializationMode.EAGER.value + mode_env_variable = str(uuid.uuid4()) + parameter_overrides = {"ModeEnvVariable": mode_env_variable} + + @pytest.mark.flaky(reruns=3) + @pytest.mark.timeout(timeout=600, method="thread") + def test_can_invoke_lambda_function_successfully(self): + response = requests.post(self.url + "/id", timeout=300) + initiated_containers = self.count_running_containers() + + self.assertEqual(response.status_code, 200) + self.assertEqual(response.json(), {"hello": "world"}) + self.assertEqual(initiated_containers, 2) + + service_process = self.start_api_process + service_process.send_signal(signal.SIGTERM) + + # Sleep for 10 seconds since this is the default time that Docker + # allows for a process to handle a SIGTERM before sending a SIGKILL + sleep(10) + + remaining_containers = self.count_running_containers() + self.assertEqual(remaining_containers, 0) + self.assertEqual(service_process.poll(), 0) + + @parameterized_class( ("template_path",), [ diff --git a/tests/integration/local/start_lambda/start_lambda_api_integ_base.py b/tests/integration/local/start_lambda/start_lambda_api_integ_base.py index a6cdb4f838..a29cdd0a0f 100644 --- a/tests/integration/local/start_lambda/start_lambda_api_integ_base.py +++ b/tests/integration/local/start_lambda/start_lambda_api_integ_base.py @@ -10,6 +10,7 @@ import docker from docker.errors import APIError +from psutil import NoSuchProcess from tests.integration.local.common_utils import random_port, InvalidAddressException, wait_for_local_process from tests.testing_utils import ( @@ -178,7 +179,10 @@ def _make_parameter_override_arg(self, overrides): def tearDownClass(cls): # After all the tests run, we need to kill the start_lambda process. cls.stop_reading_thread = True - kill_process(cls.start_lambda_process) + try: + kill_process(cls.start_lambda_process) + except NoSuchProcess: + LOG.info("Process has already been terminated") class WatchWarmContainersIntegBaseClass(StartLambdaIntegBaseClass): diff --git a/tests/integration/local/start_lambda/test_start_lambda.py b/tests/integration/local/start_lambda/test_start_lambda.py index 79393ce8eb..3599029018 100644 --- a/tests/integration/local/start_lambda/test_start_lambda.py +++ b/tests/integration/local/start_lambda/test_start_lambda.py @@ -1,3 +1,4 @@ +import signal import uuid from concurrent.futures import ThreadPoolExecutor, as_completed from time import time, sleep @@ -339,6 +340,37 @@ def test_can_invoke_lambda_function_successfully(self): self.assertEqual(json.loads(response.get("body")), {"hello": "world"}) +class TestWarmContainersHandlesSigTermInterrupt(TestWarmContainersBaseClass): + template_path = "/testdata/start_api/template-warm-containers.yaml" + container_mode = ContainersInitializationMode.EAGER.value + mode_env_variable = str(uuid.uuid4()) + parameter_overrides = {"ModeEnvVariable": mode_env_variable} + + @pytest.mark.flaky(reruns=3) + @pytest.mark.timeout(timeout=600, method="thread") + def test_can_invoke_lambda_function_successfully(self): + result = self.lambda_client.invoke(FunctionName="HelloWorldFunction") + self.assertEqual(result.get("StatusCode"), 200) + + response = json.loads(result.get("Payload").read().decode("utf-8")) + self.assertEqual(response.get("statusCode"), 200) + self.assertEqual(json.loads(response.get("body")), {"hello": "world"}) + + initiated_containers = self.count_running_containers() + self.assertEqual(initiated_containers, 2) + + service_process = self.start_lambda_process + service_process.send_signal(signal.SIGTERM) + + # Sleep for 10 seconds since this is the default time that Docker + # allows for a process to handle a SIGTERM before sending a SIGKILL + sleep(10) + + remaining_containers = self.count_running_containers() + self.assertEqual(remaining_containers, 0) + self.assertEqual(service_process.poll(), 0) + + @parameterized_class( ("template_path",), [ diff --git a/tests/unit/local/services/test_base_local_service.py b/tests/unit/local/services/test_base_local_service.py index 0469b592e4..b1513177c5 100644 --- a/tests/unit/local/services/test_base_local_service.py +++ b/tests/unit/local/services/test_base_local_service.py @@ -1,5 +1,6 @@ +import signal from unittest import TestCase -from unittest.mock import Mock, patch +from unittest.mock import Mock, patch, ANY from parameterized import parameterized, param @@ -55,6 +56,20 @@ def test_service_response(self, flask_response_patch): self.assertEqual(actual_response.status_code, 200) self.assertEqual(actual_response.headers, {"Content-Type": "application/json"}) + @patch("samcli.local.services.base_local_service.signal.signal") + def test_service_registers_sigterm_interrupt(self, signal_mock): + service = BaseLocalService(is_debugging=False, port=3000, host="127.0.0.1", ssl_context=None) + + service._app = Mock() + app_run_mock = Mock() + service._app.run = app_run_mock + + service.run() + + signal_mock.assert_called_once_with(signal.SIGTERM, ANY) + + app_run_mock.assert_called_once_with(threaded=True, host="127.0.0.1", port=3000, ssl_context=None) + def test_create_returns_not_implemented(self): is_debugging = False service = BaseLocalService(is_debugging=is_debugging, port=3000, host="127.0.0.1", ssl_context=None) From 3451d0bb62139493b8df82490d6f920d88860212 Mon Sep 17 00:00:00 2001 From: jysheng123 <141280295+jysheng123@users.noreply.github.com> Date: Tue, 20 Feb 2024 14:02:37 -0800 Subject: [PATCH 8/8] Add a Lock for removing decompressed paths (#6695) * bump websocket-client to 1.7.0 * Add Locking for deleting temporary folders * Mock lock function for unit tests * reformat * Initialize own locking * parametrize class * remove redundant test * reformat --- samcli/local/lambdafn/runtime.py | 8 +++++--- .../integration/local/start_api/test_start_api.py | 11 ++++++----- .../integration/testdata/start_api/template.yaml | 14 ++++++++++++++ tests/integration/testdata/start_api/zipped.zip | Bin 0 -> 366 bytes tests/unit/local/lambdafn/test_runtime.py | 4 ++++ 5 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 tests/integration/testdata/start_api/zipped.zip diff --git a/samcli/local/lambdafn/runtime.py b/samcli/local/lambdafn/runtime.py index 5cc276becf..83af384dcf 100644 --- a/samcli/local/lambdafn/runtime.py +++ b/samcli/local/lambdafn/runtime.py @@ -49,6 +49,7 @@ def __init__(self, container_manager, image_builder): self._container_manager = container_manager self._image_builder = image_builder self._temp_uncompressed_paths_to_be_cleaned = [] + self._lock = threading.Lock() def create( self, function_config, debug_context=None, container_host=None, container_host_interface=None, extra_hosts=None @@ -353,9 +354,10 @@ def _clean_decompressed_paths(self): Clean the temporary decompressed code dirs """ LOG.debug("Cleaning all decompressed code dirs") - for decompressed_dir in self._temp_uncompressed_paths_to_be_cleaned: - shutil.rmtree(decompressed_dir) - self._temp_uncompressed_paths_to_be_cleaned = [] + with self._lock: + for decompressed_dir in self._temp_uncompressed_paths_to_be_cleaned: + shutil.rmtree(decompressed_dir) + self._temp_uncompressed_paths_to_be_cleaned = [] class WarmLambdaRuntime(LambdaRuntime): diff --git a/tests/integration/local/start_api/test_start_api.py b/tests/integration/local/start_api/test_start_api.py index a3f8684155..2cd0ae888a 100644 --- a/tests/integration/local/start_api/test_start_api.py +++ b/tests/integration/local/start_api/test_start_api.py @@ -151,11 +151,12 @@ def test_large_input_request_http10(self): @parameterized_class( - ("template_path", "container_mode"), + ("template_path", "container_mode", "endpoint"), [ - ("/testdata/start_api/template.yaml", "LAZY"), - ("/testdata/start_api/template.yaml", "EAGER"), - ("/testdata/start_api/cdk/template_cdk.yaml", "LAZY"), + ("/testdata/start_api/template.yaml", "LAZY", "/sleepfortenseconds/function1"), + ("/testdata/start_api/template.yaml", "LAZY", "/sleepfortensecondszipped"), + ("/testdata/start_api/template.yaml", "EAGER", "/sleepfortenseconds/function1"), + ("/testdata/start_api/cdk/template_cdk.yaml", "LAZY", "/sleepfortenseconds/function1"), ], ) class TestParallelRequests(StartApiIntegBaseClass): @@ -178,7 +179,7 @@ def test_same_endpoint(self): start_time = time() with ThreadPoolExecutor(number_of_requests) as thread_pool: futures = [ - thread_pool.submit(requests.get, self.url + "/sleepfortenseconds/function1", timeout=300) + thread_pool.submit(requests.get, self.url + self.endpoint, timeout=300) for _ in range(0, number_of_requests) ] results = [r.result() for r in as_completed(futures)] diff --git a/tests/integration/testdata/start_api/template.yaml b/tests/integration/testdata/start_api/template.yaml index 7e50dc1d7f..bd26c21c0b 100644 --- a/tests/integration/testdata/start_api/template.yaml +++ b/tests/integration/testdata/start_api/template.yaml @@ -287,3 +287,17 @@ Resources: Properties: Method: GET Path: /multipleheadersoverridesheaders + + ZippedHelloWorldFunction: + Type: AWS::Serverless::Function + Properties: + Handler: zipped.sleep_10_sec_handler + Runtime: python3.9 + CodeUri: ./zipped.zip + Timeout: 600 + Events: + HelloWorld: + Type: Api + Properties: + Path: /sleepfortensecondszipped + Method: get diff --git a/tests/integration/testdata/start_api/zipped.zip b/tests/integration/testdata/start_api/zipped.zip new file mode 100644 index 0000000000000000000000000000000000000000..bd872a1b7c1aa1d34cd10c101bb6ccff9b5ac461 GIT binary patch literal 366 zcmWIWW@Zs#U|`^2m>ugEVN*Dx{1}kO#mKg7HmQpngZ64os#Q2qzy67U zOhxzaW3}uj$2!>gpRW6kHYTe6utC3wPUu`^CKP7~>u)9g*E)uqFM$ z@wzer&B^hLJAmGNWh>4N`N;j8%QA|5c&gY IPLN&(0OB5f