Skip to content

Commit 99e72f7

Browse files
committed
fix(jumpstart): name JumpStart in the content bucket error
`get_jumpstart_content_bucket` named Neo in its error for a region without a JumpStart entry. In v2 this message is the user-visible failure for `deepseek-llm-r1-distill-llama-8b` in `eusc-de-east-1` (#6242). Name JumpStart in the error. The integration test loads the DeepSeek public metadata from `eusc-de-east-1` with an unsigned S3 client. --- X-AI-Prompt: What is the minimal source change that fixes the EU Sovereign Cloud JumpStart error? X-AI-Tool: claude-code
1 parent 8e7485a commit 99e72f7

3 files changed

Lines changed: 53 additions & 3 deletions

File tree

‎sagemaker-core/src/sagemaker/core/jumpstart/utils.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
"""This module contains utils for JumpStart."""
14+
1415
from __future__ import absolute_import
1516

1617
from typing import Optional
@@ -204,7 +205,7 @@ def get_jumpstart_content_bucket(
204205
except KeyError:
205206
formatted_launched_regions_str = get_jumpstart_launched_regions_message()
206207
raise ValueError(
207-
f"Unable to get content bucket for Neo in {region} region. "
208+
f"Unable to get content bucket for JumpStart in {region} region. "
208209
f"{formatted_launched_regions_str}"
209210
)
210211

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"). You
4+
# may not use this file except in compliance with the License. A copy of
5+
# the License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is
10+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+
# ANY KIND, either express or implied. See the License for the specific
12+
# language governing permissions and limitations under the License.
13+
"""Regression tests for JumpStart metadata access in EU Sovereign Cloud."""
14+
15+
from __future__ import absolute_import
16+
17+
import boto3
18+
import pytest
19+
from botocore import UNSIGNED
20+
from botocore.config import Config
21+
22+
from sagemaker.core.jumpstart.accessors import JumpStartModelsAccessor
23+
from sagemaker.core.jumpstart.utils import get_jumpstart_content_bucket
24+
25+
EUSC_REGION = "eusc-de-east-1"
26+
EUSC_CONTENT_BUCKET = "jumpstart-cache-prod-eusc-de-east-1"
27+
DEEPSEEK_MODEL_ID = "deepseek-llm-r1-distill-llama-8b"
28+
29+
30+
@pytest.mark.serial
31+
def test_deepseek_public_metadata_loads_in_eusc():
32+
s3_client = boto3.client(
33+
"s3",
34+
region_name=EUSC_REGION,
35+
config=Config(signature_version=UNSIGNED),
36+
)
37+
JumpStartModelsAccessor.reset_cache({"s3_client": s3_client}, region=EUSC_REGION)
38+
39+
model_specs = JumpStartModelsAccessor.get_model_specs(
40+
region=EUSC_REGION,
41+
model_id=DEEPSEEK_MODEL_ID,
42+
version="*",
43+
)
44+
45+
assert get_jumpstart_content_bucket(region=EUSC_REGION) == EUSC_CONTENT_BUCKET
46+
assert model_specs.model_id == DEEPSEEK_MODEL_ID
47+
assert model_specs.get_speculative_decoding_s3_data_sources() == []

‎sagemaker-core/tests/unit/test_jumpstart_utils.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ def test_get_jumpstart_content_bucket_with_override(self):
491491
def test_get_jumpstart_content_bucket_invalid_region(self):
492492
"""Test with invalid region"""
493493
with patch.object(constants, "JUMPSTART_REGION_NAME_TO_LAUNCHED_REGION_DICT", {}):
494-
with pytest.raises(ValueError, match="Unable to get content bucket for Neo"):
494+
with pytest.raises(ValueError, match="Unable to get content bucket for JumpStart"):
495495
utils.get_jumpstart_content_bucket("invalid-region")
496496

497497

@@ -1572,7 +1572,9 @@ def test_add_instance_rate_stats_none_metrics(self):
15721572
result = utils.add_instance_rate_stats_to_benchmark_metrics("us-west-2", None)
15731573
assert result is None
15741574

1575-
@pytest.mark.skip(reason="Requires AWS Pricing API permissions which are not available in CI environment")
1575+
@pytest.mark.skip(
1576+
reason="Requires AWS Pricing API permissions which are not available in CI environment"
1577+
)
15761578
@patch("sagemaker.core.common_utils.get_instance_rate_per_hour")
15771579
def test_add_instance_rate_stats_success(self, mock_get_rate):
15781580
"""Test successfully adding instance rate stats"""

0 commit comments

Comments
 (0)