Skip to content

fix(serve): pass data_capture_config when creating inference-component endpoints - #6311

Closed
ryansteakley wants to merge 1 commit into
aws:masterfrom
ryansteakley:fix/serve-ic-data-capture
Closed

ryansteakley wants to merge 1 commit into
aws:masterfrom
ryansteakley:fix/serve-ic-data-capture

Conversation

@ryansteakley

@ryansteakley ryansteakley commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Related issue: none found; searched open and closed issues and PRs for data_capture_config on 2026-09-24.

What changed

ModelBuilder.deploy(data_capture_config=...) is silently ignored for INFERENCE_COMPONENT_BASED endpoints. _deploy_core_endpoint builds data_capture_config_dict only inside the model-based branch, so the inference-component branch calls Session.endpoint_from_production_variants(...) without it. The endpoint is created without a DataCaptureConfig, and no error or warning is raised.

This change computes data_capture_config_dict once, 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_variants already accepts data_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

  • Two unit tests added to sagemaker-serve/tests/unit/test_model_builder_deploy.py:
    • test_deploy_core_endpoint_ic_based_passes_data_capture_config: the data_capture_config_dict passed to endpoint_from_production_variants equals DataCaptureConfig._to_request_dict().
    • test_deploy_core_endpoint_ic_based_without_data_capture_passes_none: it is None when no config is given.
  • Both new tests fail against current master and pass with the fix. test_model_builder_deploy.py: 23 passed, 6 skipped.
  • Full sagemaker-serve/tests/unit run 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 --check and flake8==7.1.2 (the versions in requirements/tox/) report nothing on both changed files.

…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.

This branch had an error being deployed

1 failed deployment
manual-approval — d5072939 Deployed Sep 24, 2026 by ryansteakley via wait-for-approval #1794
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant