From c75f315bc3190df833b4dd3ecf18bc75e1f31ead Mon Sep 17 00:00:00 2001 From: Malte Reimann Date: Fri, 12 Sep 2025 16:54:28 +0200 Subject: [PATCH 1/5] test: adds unit test for djl lmi regions --- tests/unit/sagemaker/image_uris/test_djl.py | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/unit/sagemaker/image_uris/test_djl.py b/tests/unit/sagemaker/image_uris/test_djl.py index 887b575fdf..e9f46e2f0c 100644 --- a/tests/unit/sagemaker/image_uris/test_djl.py +++ b/tests/unit/sagemaker/image_uris/test_djl.py @@ -41,3 +41,29 @@ def _test_djl_uris(account, region, version, tag, djl_framework): region, ) assert expected == uri + +# Expected regions for DJL LMI based on documentation +# https://github.com/aws/deep-learning-containers/blob/master/available_images.md +EXPECTED_DJL_LMI_REGIONS = { + "us-east-1", "us-east-2", "us-west-1", "us-west-2", + "af-south-1", "ap-east-1", "ap-east-2", "ap-south-1", "ap-south-2", + "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ap-southeast-4", + "ap-southeast-5", "ap-southeast-7", "ap-northeast-1", "ap-northeast-2", + "ap-northeast-3", "ca-central-1", "ca-west-1", "eu-central-1", + "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "eu-north-1", + "eu-south-1", "eu-south-2", "il-central-1", "mx-central-1", + "me-south-1", "me-central-1", "sa-east-1", "cn-north-1", "cn-northwest-1" +} + + +def test_djl_lmi_config_for_framework_has_all_regions(): + """Test that config_for_framework('djl-lmi') returns all expected regions for each version.""" + config = image_uris.config_for_framework("djl-lmi") + + # Check that each version has all expected regions + for version, version_config in config["versions"].items(): + actual_regions = set(version_config["registries"].keys()) + missing_regions = EXPECTED_DJL_LMI_REGIONS - actual_regions + + assert not missing_regions, f"Version {version} missing regions: {missing_regions}" + From a08dc841623d5a98f79c8342526be63aa2d0d50f Mon Sep 17 00:00:00 2001 From: Malte Reimann Date: Mon, 15 Sep 2025 00:58:10 +0200 Subject: [PATCH 2/5] test: adds regions in which djl images do not exist --- tests/unit/sagemaker/image_uris/test_djl.py | 66 +++++++++++++++++++-- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/tests/unit/sagemaker/image_uris/test_djl.py b/tests/unit/sagemaker/image_uris/test_djl.py index e9f46e2f0c..61a83f1b6b 100644 --- a/tests/unit/sagemaker/image_uris/test_djl.py +++ b/tests/unit/sagemaker/image_uris/test_djl.py @@ -55,15 +55,69 @@ def _test_djl_uris(account, region, version, tag, djl_framework): "me-south-1", "me-central-1", "sa-east-1", "cn-north-1", "cn-northwest-1" } +# Known missing framework:version:region combinations that don't exist in ECR +KNOWN_MISSING_COMBINATIONS = { + "djl-lmi": { + "0.30.0-lmi12.0.0-cu124": {"ap-east-2"}, + "0.29.0-lmi11.0.0-cu124": {"ap-east-2"}, + "0.28.0-lmi10.0.0-cu124": {"ap-east-2"}, + }, + "djl-neuronx": { + "0.29.0-neuronx-sdk2.19.1": {"ap-east-1", "me-central-1", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, + "0.28.0-neuronx-sdk2.18.2": {"ap-east-1", "me-central-1", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, + "0.27.0-neuronx-sdk2.18.1": {"ap-east-1", "me-central-1", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, + "0.26.0-neuronx-sdk2.16.0": {"ap-east-1", "me-central-1", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, + "0.25.0-neuronx-sdk2.15.0": {"eu-north-1", "ap-east-1", "me-central-1", "eu-west-2", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, + "0.24.0-neuronx-sdk2.14.1": {"eu-north-1", "ap-east-1", "me-central-1", "eu-west-2", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, + "0.23.0-neuronx-sdk2.12.0": {"eu-north-1", "ap-east-1", "me-central-1", "eu-west-2", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, + "0.22.1-neuronx-sdk2.10.0": {"eu-north-1", "ap-east-1", "me-central-1", "eu-west-2", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, + }, + "djl-tensorrtllm": { + "0.30.0-tensorrtllm0.12.0-cu125": {"ap-east-2"}, + "0.29.0-tensorrtllm0.11.0-cu124": {"ap-east-2"}, + "0.28.0-tensorrtllm0.9.0-cu122": {"ap-east-2"}, + "0.27.0-tensorrtllm0.8.0-cu122": {"ap-east-2"}, + "0.26.0-tensorrtllm0.7.1-cu122": {"ap-east-2"}, + "0.25.0-tensorrtllm0.5.0-cu122": {"ap-east-2"}, + }, + "djl-fastertransformer": { + "0.24.0-fastertransformer5.3.0-cu118": {"ap-east-2"}, + "0.23.0-fastertransformer5.3.0-cu118": {"ap-east-2"}, + "0.22.1-fastertransformer5.3.0-cu118": {"ap-east-2"}, + "0.21.0-fastertransformer5.3.0-cu117": {"ap-east-2"}, + }, + "djl-deepspeed": { + "0.27.0-deepspeed0.12.6-cu121": {"ap-east-2"}, + "0.26.0-deepspeed0.12.6-cu121": {"ap-east-2"}, + "0.25.0-deepspeed0.11.0-cu118": {"ap-east-2"}, + "0.24.0-deepspeed0.10.0-cu118": {"ap-east-2"}, + "0.23.0-deepspeed0.9.5-cu118": {"ap-east-2"}, + "0.22.1-deepspeed0.9.2-cu118": {"ap-east-2"}, + "0.21.0-deepspeed0.8.3-cu117": {"ap-east-2"}, + "0.20.0-deepspeed0.7.5-cu116": {"ap-east-2"}, + "0.19.0-deepspeed0.7.3-cu113": {"ap-east-2"}, + } +} + -def test_djl_lmi_config_for_framework_has_all_regions(): - """Test that config_for_framework('djl-lmi') returns all expected regions for each version.""" - config = image_uris.config_for_framework("djl-lmi") +@pytest.mark.parametrize("framework", ["djl-deepspeed", "djl-fastertransformer", "djl-lmi", "djl-neuronx", "djl-tensorrtllm"]) +def test_djl_lmi_config_for_framework_has_all_regions(framework): + """Test that config_for_framework returns all expected regions for each version.""" + config = image_uris.config_for_framework(framework) - # Check that each version has all expected regions + # Check that each version has all expected regions, excluding known missing combinations for version, version_config in config["versions"].items(): actual_regions = set(version_config["registries"].keys()) - missing_regions = EXPECTED_DJL_LMI_REGIONS - actual_regions + expected_regions_for_version = EXPECTED_DJL_LMI_REGIONS.copy() + + # Use tag_prefix for lookup if available, otherwise fall back to version + lookup_key = version_config.get("tag_prefix", version) + + # Remove regions that are known to be missing for this framework:version combination + missing_regions_for_version = KNOWN_MISSING_COMBINATIONS.get(framework, {}).get(lookup_key, set()) + expected_regions_for_version -= missing_regions_for_version + + missing_regions = expected_regions_for_version - actual_regions - assert not missing_regions, f"Version {version} missing regions: {missing_regions}" + assert not missing_regions, f"Framework {framework} version {version} missing regions: {missing_regions}" From 6b0bd1c4cff37a0b011f56b89d50207e61c7963b Mon Sep 17 00:00:00 2001 From: Malte Reimann Date: Mon, 15 Sep 2025 00:59:23 +0200 Subject: [PATCH 3/5] fix: adds djl missing regions --- .../image_uri_config/djl-deepspeed.json | 90 +++++++++++++++++-- .../djl-fastertransformer.json | 42 +++++++-- src/sagemaker/image_uri_config/djl-lmi.json | 27 +++++- .../image_uri_config/djl-neuronx.json | 76 ++++++++++++---- .../image_uri_config/djl-tensorrtllm.json | 60 +++++++++++-- 5 files changed, 254 insertions(+), 41 deletions(-) diff --git a/src/sagemaker/image_uri_config/djl-deepspeed.json b/src/sagemaker/image_uri_config/djl-deepspeed.json index e98e382b0b..51b34c9d20 100644 --- a/src/sagemaker/image_uri_config/djl-deepspeed.json +++ b/src/sagemaker/image_uri_config/djl-deepspeed.json @@ -32,7 +32,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.27.0-deepspeed0.12.6-cu121" @@ -66,7 +74,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.26.0-deepspeed0.12.6-cu121" @@ -100,7 +116,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.25.0-deepspeed0.11.0-cu118" @@ -134,7 +158,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.24.0-deepspeed0.10.0-cu118" @@ -168,7 +200,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.23.0-deepspeed0.9.5-cu118" @@ -202,7 +242,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.22.1-deepspeed0.9.2-cu118" @@ -236,7 +284,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.21.0-deepspeed0.8.3-cu117" @@ -270,7 +326,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.20.0-deepspeed0.7.5-cu116" @@ -304,7 +368,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.19.0-deepspeed0.7.3-cu113" diff --git a/src/sagemaker/image_uri_config/djl-fastertransformer.json b/src/sagemaker/image_uri_config/djl-fastertransformer.json index fd9ced32fe..97689a386f 100644 --- a/src/sagemaker/image_uri_config/djl-fastertransformer.json +++ b/src/sagemaker/image_uri_config/djl-fastertransformer.json @@ -30,7 +30,15 @@ "us-east-2": "763104351884", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.24.0-fastertransformer5.3.0-cu118" @@ -62,7 +70,15 @@ "us-east-2": "763104351884", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.23.0-fastertransformer5.3.0-cu118" @@ -94,7 +110,15 @@ "us-east-2": "763104351884", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.22.1-fastertransformer5.3.0-cu118" @@ -126,10 +150,18 @@ "us-east-2": "763104351884", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.21.0-fastertransformer5.3.0-cu117" } } -} \ No newline at end of file +} diff --git a/src/sagemaker/image_uri_config/djl-lmi.json b/src/sagemaker/image_uri_config/djl-lmi.json index 0a741036c1..d1a5ac2107 100644 --- a/src/sagemaker/image_uri_config/djl-lmi.json +++ b/src/sagemaker/image_uri_config/djl-lmi.json @@ -36,7 +36,14 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.30.0-lmi12.0.0-cu124" @@ -71,7 +78,14 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.29.0-lmi11.0.0-cu124" @@ -106,7 +120,14 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "ap-south-2": "772153158452", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.28.0-lmi10.0.0-cu124" diff --git a/src/sagemaker/image_uri_config/djl-neuronx.json b/src/sagemaker/image_uri_config/djl-neuronx.json index 1fd7492ff4..dda4c6755f 100644 --- a/src/sagemaker/image_uri_config/djl-neuronx.json +++ b/src/sagemaker/image_uri_config/djl-neuronx.json @@ -20,14 +20,20 @@ "eu-central-2": "380420809688", "eu-west-1": "763104351884", "eu-west-3": "763104351884", - "mx-central-1":"637423239942", + "mx-central-1": "637423239942", "sa-east-1": "763104351884", "us-east-1": "763104351884", "us-east-2": "763104351884", "us-gov-east-1": "446045086412", "us-gov-west-1": "442386744353", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-north-1": "763104351884", + "il-central-1": "780543022126", + "eu-west-2": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-4": "457447274322", + "eu-south-2": "503227376785" }, "repository": "djl-inference", "tag_prefix": "0.29.0-neuronx-sdk2.19.1" @@ -46,19 +52,25 @@ "eu-central-2": "380420809688", "eu-west-1": "763104351884", "eu-west-3": "763104351884", - "mx-central-1":"637423239942", + "mx-central-1": "637423239942", "sa-east-1": "763104351884", "us-east-1": "763104351884", "us-east-2": "763104351884", "us-gov-east-1": "446045086412", "us-gov-west-1": "442386744353", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-north-1": "763104351884", + "il-central-1": "780543022126", + "eu-west-2": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-4": "457447274322", + "eu-south-2": "503227376785" }, "repository": "djl-inference", "tag_prefix": "0.28.0-neuronx-sdk2.18.2" }, - "0.27.0": { + "0.27.0": { "registries": { "ap-northeast-1": "763104351884", "ap-south-1": "763104351884", @@ -72,19 +84,25 @@ "eu-central-2": "380420809688", "eu-west-1": "763104351884", "eu-west-3": "763104351884", - "mx-central-1":"637423239942", + "mx-central-1": "637423239942", "sa-east-1": "763104351884", "us-east-1": "763104351884", "us-east-2": "763104351884", "us-gov-east-1": "446045086412", "us-gov-west-1": "442386744353", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-north-1": "763104351884", + "il-central-1": "780543022126", + "eu-west-2": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-4": "457447274322", + "eu-south-2": "503227376785" }, "repository": "djl-inference", "tag_prefix": "0.27.0-neuronx-sdk2.18.1" }, - "0.26.0": { + "0.26.0": { "registries": { "ap-northeast-1": "763104351884", "ap-south-1": "763104351884", @@ -98,14 +116,20 @@ "eu-central-2": "380420809688", "eu-west-1": "763104351884", "eu-west-3": "763104351884", - "mx-central-1":"637423239942", + "mx-central-1": "637423239942", "sa-east-1": "763104351884", "us-east-1": "763104351884", "us-east-2": "763104351884", "us-gov-east-1": "446045086412", "us-gov-west-1": "442386744353", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-north-1": "763104351884", + "il-central-1": "780543022126", + "eu-west-2": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-4": "457447274322", + "eu-south-2": "503227376785" }, "repository": "djl-inference", "tag_prefix": "0.26.0-neuronx-sdk2.16.0" @@ -124,14 +148,18 @@ "eu-central-2": "380420809688", "eu-west-1": "763104351884", "eu-west-3": "763104351884", - "mx-central-1":"637423239942", + "mx-central-1": "637423239942", "sa-east-1": "763104351884", "us-east-1": "763104351884", "us-east-2": "763104351884", "us-gov-east-1": "446045086412", "us-gov-west-1": "442386744353", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "il-central-1": "780543022126", + "ap-south-2": "772153158452", + "ap-southeast-4": "457447274322", + "eu-south-2": "503227376785" }, "repository": "djl-inference", "tag_prefix": "0.25.0-neuronx-sdk2.15.0" @@ -150,14 +178,18 @@ "eu-central-2": "380420809688", "eu-west-1": "763104351884", "eu-west-3": "763104351884", - "mx-central-1":"637423239942", + "mx-central-1": "637423239942", "sa-east-1": "763104351884", "us-east-1": "763104351884", "us-east-2": "763104351884", "us-gov-east-1": "446045086412", "us-gov-west-1": "442386744353", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "il-central-1": "780543022126", + "ap-south-2": "772153158452", + "ap-southeast-4": "457447274322", + "eu-south-2": "503227376785" }, "repository": "djl-inference", "tag_prefix": "0.24.0-neuronx-sdk2.14.1" @@ -176,14 +208,18 @@ "eu-central-2": "380420809688", "eu-west-1": "763104351884", "eu-west-3": "763104351884", - "mx-central-1":"637423239942", + "mx-central-1": "637423239942", "sa-east-1": "763104351884", "us-east-1": "763104351884", "us-east-2": "763104351884", "us-gov-east-1": "446045086412", "us-gov-west-1": "442386744353", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "il-central-1": "780543022126", + "ap-south-2": "772153158452", + "ap-southeast-4": "457447274322", + "eu-south-2": "503227376785" }, "repository": "djl-inference", "tag_prefix": "0.23.0-neuronx-sdk2.12.0" @@ -202,14 +238,18 @@ "eu-central-2": "380420809688", "eu-west-1": "763104351884", "eu-west-3": "763104351884", - "mx-central-1":"637423239942", + "mx-central-1": "637423239942", "sa-east-1": "763104351884", "us-east-1": "763104351884", "us-east-2": "763104351884", "us-gov-east-1": "446045086412", "us-gov-west-1": "442386744353", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "il-central-1": "780543022126", + "ap-south-2": "772153158452", + "ap-southeast-4": "457447274322", + "eu-south-2": "503227376785" }, "repository": "djl-inference", "tag_prefix": "0.22.1-neuronx-sdk2.10.0" diff --git a/src/sagemaker/image_uri_config/djl-tensorrtllm.json b/src/sagemaker/image_uri_config/djl-tensorrtllm.json index cd1e59bad8..edb20a6e4a 100644 --- a/src/sagemaker/image_uri_config/djl-tensorrtllm.json +++ b/src/sagemaker/image_uri_config/djl-tensorrtllm.json @@ -35,7 +35,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-south-2": "772153158452", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.30.0-tensorrtllm0.12.0-cu125" @@ -69,7 +77,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-south-2": "772153158452", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.29.0-tensorrtllm0.11.0-cu124" @@ -103,7 +119,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-south-2": "772153158452", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.28.0-tensorrtllm0.9.0-cu122" @@ -137,7 +161,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-south-2": "772153158452", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.27.0-tensorrtllm0.8.0-cu122" @@ -171,7 +203,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-south-2": "772153158452", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.26.0-tensorrtllm0.7.1-cu122" @@ -205,7 +245,15 @@ "us-gov-west-1": "442386744353", "us-west-1": "763104351884", "us-west-2": "763104351884", - "ca-west-1": "204538143572" + "ca-west-1": "204538143572", + "eu-central-2": "380420809688", + "me-central-1": "914824155844", + "eu-south-2": "503227376785", + "ap-southeast-7": "590183813437", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-south-2": "772153158452", + "mx-central-1": "637423239942" }, "repository": "djl-inference", "tag_prefix": "0.25.0-tensorrtllm0.5.0-cu122" From 4477343b26f126fd9d4a9ad2e750a6a98fd1b514 Mon Sep 17 00:00:00 2001 From: Malte Reimann Date: Tue, 23 Sep 2025 18:52:06 +0200 Subject: [PATCH 4/5] fix: linting --- tests/unit/sagemaker/image_uris/test_djl.py | 188 +++++++++++++++++--- 1 file changed, 163 insertions(+), 25 deletions(-) diff --git a/tests/unit/sagemaker/image_uris/test_djl.py b/tests/unit/sagemaker/image_uris/test_djl.py index 61a83f1b6b..1631ae8bd1 100644 --- a/tests/unit/sagemaker/image_uris/test_djl.py +++ b/tests/unit/sagemaker/image_uris/test_djl.py @@ -42,17 +42,45 @@ def _test_djl_uris(account, region, version, tag, djl_framework): ) assert expected == uri + # Expected regions for DJL LMI based on documentation # https://github.com/aws/deep-learning-containers/blob/master/available_images.md EXPECTED_DJL_LMI_REGIONS = { - "us-east-1", "us-east-2", "us-west-1", "us-west-2", - "af-south-1", "ap-east-1", "ap-east-2", "ap-south-1", "ap-south-2", - "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ap-southeast-4", - "ap-southeast-5", "ap-southeast-7", "ap-northeast-1", "ap-northeast-2", - "ap-northeast-3", "ca-central-1", "ca-west-1", "eu-central-1", - "eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "eu-north-1", - "eu-south-1", "eu-south-2", "il-central-1", "mx-central-1", - "me-south-1", "me-central-1", "sa-east-1", "cn-north-1", "cn-northwest-1" + "us-east-1", + "us-east-2", + "us-west-1", + "us-west-2", + "af-south-1", + "ap-east-1", + "ap-east-2", + "ap-south-1", + "ap-south-2", + "ap-southeast-1", + "ap-southeast-2", + "ap-southeast-3", + "ap-southeast-4", + "ap-southeast-5", + "ap-southeast-7", + "ap-northeast-1", + "ap-northeast-2", + "ap-northeast-3", + "ca-central-1", + "ca-west-1", + "eu-central-1", + "eu-central-2", + "eu-west-1", + "eu-west-2", + "eu-west-3", + "eu-north-1", + "eu-south-1", + "eu-south-2", + "il-central-1", + "mx-central-1", + "me-south-1", + "me-central-1", + "sa-east-1", + "cn-north-1", + "cn-northwest-1", } # Known missing framework:version:region combinations that don't exist in ECR @@ -63,14 +91,118 @@ def _test_djl_uris(account, region, version, tag, djl_framework): "0.28.0-lmi10.0.0-cu124": {"ap-east-2"}, }, "djl-neuronx": { - "0.29.0-neuronx-sdk2.19.1": {"ap-east-1", "me-central-1", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, - "0.28.0-neuronx-sdk2.18.2": {"ap-east-1", "me-central-1", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, - "0.27.0-neuronx-sdk2.18.1": {"ap-east-1", "me-central-1", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, - "0.26.0-neuronx-sdk2.16.0": {"ap-east-1", "me-central-1", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, - "0.25.0-neuronx-sdk2.15.0": {"eu-north-1", "ap-east-1", "me-central-1", "eu-west-2", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, - "0.24.0-neuronx-sdk2.14.1": {"eu-north-1", "ap-east-1", "me-central-1", "eu-west-2", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, - "0.23.0-neuronx-sdk2.12.0": {"eu-north-1", "ap-east-1", "me-central-1", "eu-west-2", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, - "0.22.1-neuronx-sdk2.10.0": {"eu-north-1", "ap-east-1", "me-central-1", "eu-west-2", "ap-east-2", "ap-southeast-3", "eu-south-1", "ca-central-1", "us-west-1", "ap-northeast-3", "ap-northeast-2", "af-south-1", "me-south-1"}, + "0.29.0-neuronx-sdk2.19.1": { + "ap-east-1", + "me-central-1", + "ap-east-2", + "ap-southeast-3", + "eu-south-1", + "ca-central-1", + "us-west-1", + "ap-northeast-3", + "ap-northeast-2", + "af-south-1", + "me-south-1", + }, + "0.28.0-neuronx-sdk2.18.2": { + "ap-east-1", + "me-central-1", + "ap-east-2", + "ap-southeast-3", + "eu-south-1", + "ca-central-1", + "us-west-1", + "ap-northeast-3", + "ap-northeast-2", + "af-south-1", + "me-south-1", + }, + "0.27.0-neuronx-sdk2.18.1": { + "ap-east-1", + "me-central-1", + "ap-east-2", + "ap-southeast-3", + "eu-south-1", + "ca-central-1", + "us-west-1", + "ap-northeast-3", + "ap-northeast-2", + "af-south-1", + "me-south-1", + }, + "0.26.0-neuronx-sdk2.16.0": { + "ap-east-1", + "me-central-1", + "ap-east-2", + "ap-southeast-3", + "eu-south-1", + "ca-central-1", + "us-west-1", + "ap-northeast-3", + "ap-northeast-2", + "af-south-1", + "me-south-1", + }, + "0.25.0-neuronx-sdk2.15.0": { + "eu-north-1", + "ap-east-1", + "me-central-1", + "eu-west-2", + "ap-east-2", + "ap-southeast-3", + "eu-south-1", + "ca-central-1", + "us-west-1", + "ap-northeast-3", + "ap-northeast-2", + "af-south-1", + "me-south-1", + }, + "0.24.0-neuronx-sdk2.14.1": { + "eu-north-1", + "ap-east-1", + "me-central-1", + "eu-west-2", + "ap-east-2", + "ap-southeast-3", + "eu-south-1", + "ca-central-1", + "us-west-1", + "ap-northeast-3", + "ap-northeast-2", + "af-south-1", + "me-south-1", + }, + "0.23.0-neuronx-sdk2.12.0": { + "eu-north-1", + "ap-east-1", + "me-central-1", + "eu-west-2", + "ap-east-2", + "ap-southeast-3", + "eu-south-1", + "ca-central-1", + "us-west-1", + "ap-northeast-3", + "ap-northeast-2", + "af-south-1", + "me-south-1", + }, + "0.22.1-neuronx-sdk2.10.0": { + "eu-north-1", + "ap-east-1", + "me-central-1", + "eu-west-2", + "ap-east-2", + "ap-southeast-3", + "eu-south-1", + "ca-central-1", + "us-west-1", + "ap-northeast-3", + "ap-northeast-2", + "af-south-1", + "me-south-1", + }, }, "djl-tensorrtllm": { "0.30.0-tensorrtllm0.12.0-cu125": {"ap-east-2"}, @@ -96,28 +228,34 @@ def _test_djl_uris(account, region, version, tag, djl_framework): "0.21.0-deepspeed0.8.3-cu117": {"ap-east-2"}, "0.20.0-deepspeed0.7.5-cu116": {"ap-east-2"}, "0.19.0-deepspeed0.7.3-cu113": {"ap-east-2"}, - } + }, } -@pytest.mark.parametrize("framework", ["djl-deepspeed", "djl-fastertransformer", "djl-lmi", "djl-neuronx", "djl-tensorrtllm"]) +@pytest.mark.parametrize( + "framework", + ["djl-deepspeed", "djl-fastertransformer", "djl-lmi", "djl-neuronx", "djl-tensorrtllm"], +) def test_djl_lmi_config_for_framework_has_all_regions(framework): """Test that config_for_framework returns all expected regions for each version.""" config = image_uris.config_for_framework(framework) - + # Check that each version has all expected regions, excluding known missing combinations for version, version_config in config["versions"].items(): actual_regions = set(version_config["registries"].keys()) expected_regions_for_version = EXPECTED_DJL_LMI_REGIONS.copy() - + # Use tag_prefix for lookup if available, otherwise fall back to version lookup_key = version_config.get("tag_prefix", version) - + # Remove regions that are known to be missing for this framework:version combination - missing_regions_for_version = KNOWN_MISSING_COMBINATIONS.get(framework, {}).get(lookup_key, set()) + missing_regions_for_version = KNOWN_MISSING_COMBINATIONS.get(framework, {}).get( + lookup_key, set() + ) expected_regions_for_version -= missing_regions_for_version - + missing_regions = expected_regions_for_version - actual_regions - - assert not missing_regions, f"Framework {framework} version {version} missing regions: {missing_regions}" + assert ( + not missing_regions + ), f"Framework {framework} version {version} missing regions: {missing_regions}" From f791cbfb440070abc8aae5945179e4eccf40c3f7 Mon Sep 17 00:00:00 2001 From: Malte Reimann Date: Tue, 23 Sep 2025 18:55:24 +0200 Subject: [PATCH 5/5] docs: update contributing to add linting section --- CONTRIBUTING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 65b7c0ee0c..6a78a25c21 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,6 +16,7 @@ information to effectively respond to your bug report or contribution. * [Run the Unit Tests](#run-the-unit-tests) * [Run the Integration Tests](#run-the-integration-tests) * [Make and Test Your Change](#make-and-test-your-change) + * [Lint Your Change](#lint-your-change) * [Commit Your Change](#commit-your-change) * [Send a Pull Request](#send-a-pull-request) * [Documentation Guidelines](#documentation-guidelines) @@ -117,6 +118,13 @@ If you are writing or modifying a test that creates a SageMaker job (training, t 1. If your changes include documentation changes, please see the [Documentation Guidelines](#documentation-guidelines). 1. If you include integration tests, do not mark them as canaries if they will not run in all regions. +### Lint Your Change + +Before submitting, ensure your code meets our quality and style guidelines. Run: +```shell +tox -e flake8,pylint,docstyle,black-check,twine --parallel all +``` +Address any errors or warnings before opening a pull request. ### Commit Your Change