Skip to content

Commit a08dc84

Browse files
committed
test: adds regions in which djl images do not exist
1 parent c75f315 commit a08dc84

File tree

1 file changed

+60
-6
lines changed

1 file changed

+60
-6
lines changed

tests/unit/sagemaker/image_uris/test_djl.py

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,69 @@ def _test_djl_uris(account, region, version, tag, djl_framework):
5555
"me-south-1", "me-central-1", "sa-east-1", "cn-north-1", "cn-northwest-1"
5656
}
5757

58+
# Known missing framework:version:region combinations that don't exist in ECR
59+
KNOWN_MISSING_COMBINATIONS = {
60+
"djl-lmi": {
61+
"0.30.0-lmi12.0.0-cu124": {"ap-east-2"},
62+
"0.29.0-lmi11.0.0-cu124": {"ap-east-2"},
63+
"0.28.0-lmi10.0.0-cu124": {"ap-east-2"},
64+
},
65+
"djl-neuronx": {
66+
"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"},
67+
"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"},
68+
"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"},
69+
"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"},
70+
"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"},
71+
"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"},
72+
"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"},
73+
"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"},
74+
},
75+
"djl-tensorrtllm": {
76+
"0.30.0-tensorrtllm0.12.0-cu125": {"ap-east-2"},
77+
"0.29.0-tensorrtllm0.11.0-cu124": {"ap-east-2"},
78+
"0.28.0-tensorrtllm0.9.0-cu122": {"ap-east-2"},
79+
"0.27.0-tensorrtllm0.8.0-cu122": {"ap-east-2"},
80+
"0.26.0-tensorrtllm0.7.1-cu122": {"ap-east-2"},
81+
"0.25.0-tensorrtllm0.5.0-cu122": {"ap-east-2"},
82+
},
83+
"djl-fastertransformer": {
84+
"0.24.0-fastertransformer5.3.0-cu118": {"ap-east-2"},
85+
"0.23.0-fastertransformer5.3.0-cu118": {"ap-east-2"},
86+
"0.22.1-fastertransformer5.3.0-cu118": {"ap-east-2"},
87+
"0.21.0-fastertransformer5.3.0-cu117": {"ap-east-2"},
88+
},
89+
"djl-deepspeed": {
90+
"0.27.0-deepspeed0.12.6-cu121": {"ap-east-2"},
91+
"0.26.0-deepspeed0.12.6-cu121": {"ap-east-2"},
92+
"0.25.0-deepspeed0.11.0-cu118": {"ap-east-2"},
93+
"0.24.0-deepspeed0.10.0-cu118": {"ap-east-2"},
94+
"0.23.0-deepspeed0.9.5-cu118": {"ap-east-2"},
95+
"0.22.1-deepspeed0.9.2-cu118": {"ap-east-2"},
96+
"0.21.0-deepspeed0.8.3-cu117": {"ap-east-2"},
97+
"0.20.0-deepspeed0.7.5-cu116": {"ap-east-2"},
98+
"0.19.0-deepspeed0.7.3-cu113": {"ap-east-2"},
99+
}
100+
}
101+
58102

59-
def test_djl_lmi_config_for_framework_has_all_regions():
60-
"""Test that config_for_framework('djl-lmi') returns all expected regions for each version."""
61-
config = image_uris.config_for_framework("djl-lmi")
103+
@pytest.mark.parametrize("framework", ["djl-deepspeed", "djl-fastertransformer", "djl-lmi", "djl-neuronx", "djl-tensorrtllm"])
104+
def test_djl_lmi_config_for_framework_has_all_regions(framework):
105+
"""Test that config_for_framework returns all expected regions for each version."""
106+
config = image_uris.config_for_framework(framework)
62107

63-
# Check that each version has all expected regions
108+
# Check that each version has all expected regions, excluding known missing combinations
64109
for version, version_config in config["versions"].items():
65110
actual_regions = set(version_config["registries"].keys())
66-
missing_regions = EXPECTED_DJL_LMI_REGIONS - actual_regions
111+
expected_regions_for_version = EXPECTED_DJL_LMI_REGIONS.copy()
112+
113+
# Use tag_prefix for lookup if available, otherwise fall back to version
114+
lookup_key = version_config.get("tag_prefix", version)
115+
116+
# Remove regions that are known to be missing for this framework:version combination
117+
missing_regions_for_version = KNOWN_MISSING_COMBINATIONS.get(framework, {}).get(lookup_key, set())
118+
expected_regions_for_version -= missing_regions_for_version
119+
120+
missing_regions = expected_regions_for_version - actual_regions
67121

68-
assert not missing_regions, f"Version {version} missing regions: {missing_regions}"
122+
assert not missing_regions, f"Framework {framework} version {version} missing regions: {missing_regions}"
69123

0 commit comments

Comments
 (0)