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 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" diff --git a/tests/unit/sagemaker/image_uris/test_djl.py b/tests/unit/sagemaker/image_uris/test_djl.py index 887b575fdf..1631ae8bd1 100644 --- a/tests/unit/sagemaker/image_uris/test_djl.py +++ b/tests/unit/sagemaker/image_uris/test_djl.py @@ -41,3 +41,221 @@ 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", +} + +# 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"}, + }, +} + + +@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() + ) + 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}"