@@ -239,6 +239,7 @@ def get_ami_id_ssm(region_name, parameter_path):
239239SAGEMAKER_REMOTE_TEST_TYPE = "sagemaker"
240240
241241PUBLIC_DLC_REGISTRY = "763104351884"
242+ DLC_PUBLIC_REGISTRY_ALIAS = "public.ecr.aws/deep-learning-containers"
242243
243244SAGEMAKER_EXECUTION_REGIONS = ["us-west-2" , "us-east-1" , "eu-west-1" ]
244245# Before SM GA with Trn1, they support launch of ml.trn1 instance only in us-east-1. After SM GA this can be removed
@@ -1318,6 +1319,7 @@ def get_dlc_images():
13181319 canary_arch_type = get_test_job_arch_type (),
13191320 canary_region = os .getenv ("AWS_REGION" ),
13201321 canary_region_prod_account = os .getenv ("REGIONAL_PROD_ACCOUNT" , PUBLIC_DLC_REGISTRY ),
1322+ is_public_registry = os .getenv ("IS_PUBLIC_REGISTRY_CANARY" , "false" ).lower () == "true" ,
13211323 )
13221324 return " " .join (deep_canary_images )
13231325 elif is_pr_context () or is_empty_build_context ():
@@ -1345,6 +1347,7 @@ def get_deep_canary_images(
13451347 canary_arch_type ,
13461348 canary_region ,
13471349 canary_region_prod_account ,
1350+ is_public_registry = False ,
13481351):
13491352 """
13501353 For an input combination of canary job specs, find a matching list of image uris to be tested
@@ -1382,9 +1385,17 @@ def get_deep_canary_images(
13821385 and canary_image_type == image_type
13831386 and canary_arch_type == image_arch_type
13841387 ):
1385- regionalized_image_uri = image_uri .replace (image_region , canary_region ).replace (
1386- image_account_id , canary_region_prod_account
1387- )
1388+ if is_public_registry :
1389+ # For public registry, we use the public account ID
1390+ image_repository = image_uri .split ("/" )[- 1 ].split (":" )[0 ]
1391+ image_tag = image_uri .split (":" )[- 1 ]
1392+ regionalized_image_uri = (
1393+ f"{ DLC_PUBLIC_REGISTRY_ALIAS } /{ image_repository } :{ image_tag } "
1394+ )
1395+ else :
1396+ regionalized_image_uri = image_uri .replace (image_region , canary_region ).replace (
1397+ image_account_id , canary_region_prod_account
1398+ )
13881399 matching_images .append (regionalized_image_uri )
13891400 return matching_images
13901401
0 commit comments