Skip to content

Commit 01beb54

Browse files
authored
test: disable HF Xet/hf_transfer in serve integ tests to fix endpoint deploy (#5992)
* test: disable HF Xet/hf_transfer in serve integ tests to fix endpoint deploy The schema_builder and serve_tei SAGEMAKER_ENDPOINT tests began failing around 2026-06-29 because HuggingFace Hub migrated model repos to the Xet storage backend. The HF DLC container downloads the model at startup with hf_transfer enabled, which now hits the Xet CDN (us.aws.cdn.hf.co) and gets 403 Forbidden. The container never passes the ping health check, the endpoint enters Failed, and the test hits its 15-minute deploy timeout. Inject HF_HUB_ENABLE_HF_TRANSFER=0 and HF_HUB_DISABLE_XET=1 into the container env so the model is pulled over plain HTTPS, restoring the pre-Xet download path. Evidence: endpoint container logs show hf_transfer 403 against the Xet bridge URL; the same tests passed in build #2712 (2026-06-16) before the rollout. * test: Mock JumpStartModel in optimize/compile JS builder test
1 parent a85423f commit 01beb54

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

‎tests/integ/sagemaker/serve/test_schema_builder.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ def test_model_builder_happy_path_with_task_provided_local_schema_mode(
9292
model_metadata={"HF_TASK": task_provided},
9393
instance_type=instance_type_provided,
9494
sagemaker_session=sagemaker_session,
95+
env_vars={
96+
# Force plain HTTPS model download in the container. HF Hub repos are now
97+
# backed by Xet storage, and the DLC's hf_transfer path returns 403 against
98+
# the Xet CDN, so the container fails the ping health check on startup.
99+
"HF_HUB_ENABLE_HF_TRANSFER": "0",
100+
"HF_HUB_DISABLE_XET": "1",
101+
},
95102
)
96103

97104
model = model_builder.build(sagemaker_session=sagemaker_session)
@@ -169,6 +176,13 @@ def test_model_builder_happy_path_with_task_provided_remote_schema_mode(
169176
model_metadata={"HF_TASK": task_provided},
170177
instance_type=instance_type_provided,
171178
sagemaker_session=sagemaker_session,
179+
env_vars={
180+
# Force plain HTTPS model download in the container. HF Hub repos are now
181+
# backed by Xet storage, and the DLC's hf_transfer path returns 403 against
182+
# the Xet CDN, so the container fails the ping health check on startup.
183+
"HF_HUB_ENABLE_HF_TRANSFER": "0",
184+
"HF_HUB_DISABLE_XET": "1",
185+
},
172186
)
173187
model = model_builder.build(sagemaker_session=sagemaker_session)
174188

‎tests/integ/sagemaker/serve/test_serve_tei.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ def model_builder_model_schema_builder(sagemaker_session):
4747
schema_builder=SchemaBuilder(sample_input, loaded_response),
4848
env_vars={
4949
# Add this to bypass JumpStart model mapping
50-
"HF_MODEL_ID": "BAAI/bge-m3"
50+
"HF_MODEL_ID": "BAAI/bge-m3",
51+
# Force plain HTTPS model download in the container. HF Hub repos are now
52+
# backed by Xet storage, and the DLC's hf_transfer path returns 403 against
53+
# the Xet CDN, so the container fails the ping health check on startup.
54+
"HF_HUB_ENABLE_HF_TRANSFER": "0",
55+
"HF_HUB_DISABLE_XET": "1",
5156
},
5257
)
5358

‎tests/unit/sagemaker/serve/builder/test_js_builder.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,12 +1272,14 @@ def test_jumpstart_model_provider_calls_jumpstart_speculative_decoding(
12721272

12731273
mock_js_speculative_decoding.assert_called_once()
12741274

1275+
@patch("sagemaker.serve.builder.jumpstart_builder.JumpStartModel")
12751276
@patch("sagemaker.serve.builder.jumpstart_builder._capture_telemetry", side_effect=None)
12761277
@patch.object(ModelBuilder, "_get_serve_setting", autospec=True)
12771278
def test_optimize_quantize_and_compile_for_jumpstart(
12781279
self,
12791280
mock_serve_settings,
12801281
mock_telemetry,
1282+
mock_js_model,
12811283
):
12821284
mock_sagemaker_session = Mock()
12831285
mock_metadata_config = Mock()
@@ -1319,6 +1321,10 @@ def test_optimize_quantize_and_compile_for_jumpstart(
13191321

13201322
model_builder.pysdk_model = mock_pysdk_model
13211323

1324+
# Avoid a real JumpStartModel construction (which would hit S3 for the
1325+
# JumpStart manifest); return a deterministic env for neuron lookup.
1326+
mock_js_model.return_value.env = {"SAGEMAKER_ENV": "1"}
1327+
13221328
out_put = model_builder._optimize_for_jumpstart(
13231329
accept_eula=True,
13241330
quantization_config={

0 commit comments

Comments
 (0)