File tree 1 file changed +9
-10
lines changed
1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 20
20
from sagemaker .utils import unique_name_from_base
21
21
22
22
# See tests/data/serverless for the image source code.
23
- IMAGE_URI = "142577830533.dkr.ecr.us-west-2.amazonaws.com/serverless-integ-test:latest"
24
- ROLE = "arn:aws:iam::142577830533:role/lambda_basic_execution"
25
- URL = "https://c.files.bbci.co.uk/12A9B/production/_111434467_gettyimages-1143489763.jpg"
23
+ ACCOUNT_ID = 142577830533
24
+ IMAGE_URI = f"{ ACCOUNT_ID } .dkr.ecr.us-west-2.amazonaws.com/serverless-integ-test:latest"
25
+ ROLE = f"arn:aws:iam::{ ACCOUNT_ID } :role/lambda_basic_execution"
26
+ URL = "https://sagemaker-integ-tests-data.s3.us-east-1.amazonaws.com/cat.jpeg"
26
27
27
- print ('"CODEBUILD_BUILD_ID" in os.environ =' , "CODEBUILD_BUILD_ID" in os .environ )
28
28
29
-
30
- @pytest .mark .skipif (
31
- "CODEBUILD_BUILD_ID" not in os .environ ,
32
- reason = "The container image is private to the CI account." ,
33
- )
34
29
def test_lambda ():
35
- model = LambdaModel (image_uri = IMAGE_URI , role = ROLE )
30
+ client = boto3 .client ("lambda" )
31
+ if client .get_caller_identity ().get ("Account" ) != ACCOUNT_ID :
32
+ pytest .skip ("The container image is private to the CI account." )
33
+
34
+ model = LambdaModel (image_uri = IMAGE_URI , role = ROLE , client = client )
36
35
37
36
predictor = model .deploy (
38
37
unique_name_from_base ("my-lambda-function" ), timeout = 60 , memory_size = 4092
You can’t perform that action at this time.
0 commit comments