Repository navigation
fix(serve): pass data_capture_config when creating inference-component endpoints - #6311
Closed
ryansteakley wants to merge 1 commit into
Closed
ryansteakley wants to merge 1 commit into
ryansteakley wants to merge 1 commit into
Conversation
…t endpoints ModelBuilder.deploy(data_capture_config=...) was silently ignored for INFERENCE_COMPONENT_BASED endpoints. _deploy_core_endpoint only built data_capture_config_dict inside the model-based else branch and only passed it to create_endpoint_config()/endpoint_from_production_variants() there. On the inference-component path the dict was never built and never passed, so the endpoint was created without a DataCaptureConfig and no error was raised - data capture simply did not happen. The dict is now computed once, before the endpoint_type branch, and passed to endpoint_from_production_variants() on both branches. The model-based branch keeps passing exactly the value it passed before; no other behavior changes. Adds two unit tests to sagemaker-serve/tests/unit/test_model_builder_deploy.py: test_deploy_core_endpoint_ic_based_passes_data_capture_config asserts the data_capture_config_dict kwarg equals DataCaptureConfig._to_request_dict(), and test_deploy_core_endpoint_ic_based_without_data_capture_passes_none asserts it is None when no config is supplied.
ryansteakley
had a problem deploying
to
manual-approval
September 24, 2026 20:04 — with
GitHub Actions
Failure
ryansteakley
had a problem deploying
to
manual-approval
September 24, 2026 20:06 — with
GitHub Actions
Failure
ryansteakley
had a problem deploying
to
manual-approval
September 24, 2026 20:06 — with
GitHub Actions
Failure
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue: none found; searched open and closed issues and PRs for
data_capture_configon 2026-09-24.What changed
ModelBuilder.deploy(data_capture_config=...)is silently ignored forINFERENCE_COMPONENT_BASEDendpoints._deploy_core_endpointbuildsdata_capture_config_dictonly inside the model-based branch, so the inference-component branch callsSession.endpoint_from_production_variants(...)without it. The endpoint is created without aDataCaptureConfig, and no error or warning is raised.This change computes
data_capture_config_dictonce, before the branch, and passes it on the inference-component path too. The model-based path passes the same value it did before.endpoint_from_production_variantsalready acceptsdata_capture_config_dict, so sagemaker-core needs no change.Why it matters: an endpoint configuration cannot be changed after it is created. A caller who asks for data capture on an inference-component endpoint (including multi-adapter LoRA endpoints) gets an endpoint that Model Monitor cannot use, and the only remedy is a new endpoint configuration and a rolling update.
Testing
sagemaker-serve/tests/unit/test_model_builder_deploy.py:test_deploy_core_endpoint_ic_based_passes_data_capture_config: thedata_capture_config_dictpassed toendpoint_from_production_variantsequalsDataCaptureConfig._to_request_dict().test_deploy_core_endpoint_ic_based_without_data_capture_passes_none: it isNonewhen no config is given.test_model_builder_deploy.py: 23 passed, 6 skipped.sagemaker-serve/tests/unitrun on this branch and on master: the same 70 tests fail on both, and the fix adds 2 passes (2046 vs 2044 passed). All 70 are environmental in my local run: 65 call STS or S3 with an expired local token (ExpiredToken), and 5 need TensorFlow, which is not installed. No test fails only with the change.black==26.3.1 --checkandflake8==7.1.2(the versions inrequirements/tox/) report nothing on both changed files.