Skip to content

Commit 0359910

Browse files
committed
test(jumpstart): cover EU Sovereign Cloud model setup
Exercise the reported DeepSeek setup against live public metadata. Document why draft-model bucket selection can return no Neo bucket. --- X-AI-Prompt: Can you add integration tests for the screenshot error and address the review comments? X-AI-Tool: claude-code
1 parent b9d88bd commit 0359910

2 files changed

Lines changed: 62 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,12 @@ def _add_model_access_configs_to_model_data_sources(
16991699

17001700

17011701
def get_draft_model_content_bucket(provider: Dict, region: str) -> Optional[str]:
1702-
"""Returns the correct content bucket for a 1p draft model."""
1702+
"""Returns the draft-model bucket selected by provider metadata, if available.
1703+
1704+
Returns:
1705+
Optional[str]: A JumpStart bucket for JumpStart metadata, or a Neo bucket for
1706+
Neo and legacy metadata. Returns ``None`` when the selected Neo bucket is absent.
1707+
"""
17031708
provider_name = provider.get("name", "") if provider else ""
17041709
if provider_name == "JumpStart":
17051710
classification = provider.get("classification", "ungated")
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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 setup in EU Sovereign Cloud."""
14+
from __future__ import absolute_import
15+
16+
import boto3
17+
import pytest
18+
from botocore import UNSIGNED
19+
from botocore.config import Config
20+
21+
from sagemaker.core.jumpstart.accessors import JumpStartModelsAccessor
22+
from sagemaker.core.jumpstart.factory.utils import _add_additional_model_data_sources_to_kwargs
23+
from sagemaker.core.jumpstart.types import JumpStartModelInitKwargs
24+
25+
EUSC_REGION = "eusc-de-east-1"
26+
DEEPSEEK_MODEL_ID = "deepseek-llm-r1-distill-llama-8b"
27+
28+
29+
@pytest.fixture
30+
def model_specs():
31+
s3_client = boto3.client(
32+
"s3",
33+
region_name=EUSC_REGION,
34+
config=Config(signature_version=UNSIGNED),
35+
)
36+
JumpStartModelsAccessor.reset_cache({"s3_client": s3_client}, region=EUSC_REGION)
37+
return JumpStartModelsAccessor.get_model_specs(
38+
region=EUSC_REGION,
39+
model_id=DEEPSEEK_MODEL_ID,
40+
version="*",
41+
)
42+
43+
44+
@pytest.mark.serial
45+
def test_deepseek_without_speculative_metadata_does_not_require_neo(model_specs):
46+
assert model_specs.get_speculative_decoding_s3_data_sources() == []
47+
kwargs = JumpStartModelInitKwargs(
48+
model_id=DEEPSEEK_MODEL_ID,
49+
model_version=model_specs.version,
50+
region=EUSC_REGION,
51+
)
52+
kwargs.specs = model_specs
53+
54+
result = _add_additional_model_data_sources_to_kwargs(kwargs)
55+
56+
assert result.additional_model_data_sources is None

0 commit comments

Comments
 (0)