Skip to content

fix(serve): call create_endpoint_config with production variants on update_endpoint - #6402

Open
AkshayShah03 wants to merge 2 commits into
aws:masterfrom
AkshayShah03:fix/update-endpoint-config-signature
Open

AkshayShah03 wants to merge 2 commits into
aws:masterfrom
AkshayShah03:fix/update-endpoint-config-signature

Conversation

@AkshayShah03

Copy link
Copy Markdown

Issue #, if available: Fixes #5609

Description of changes:

With the core Session, ModelBuilder.deploy(update_endpoint=True) cannot work. _deploy_core_endpoint calls Session.create_endpoint_config with per-variant kwargs (model_name, initial_instance_count, instance_type, volume_size, ...). Since create_endpoint_config was added to the core Session, the call raises TypeError instead of the AttributeError in the issue: the method takes (name, production_variants, tags, kms_key, data_capture_config_dict, async_inference_config_dict, explainer_config_dict, ...).

This change:

  • passes the production_variant that _deploy_core_endpoint already builds a few lines earlier, so instance type and count, volume size, timeouts, serverless config, routing config and AMI version all reach the new config as they do on the create path;
  • names the endpoint config with unique_name_from_base(self.model_name). Endpoint config names can't be reused, and the model name stays the same across updates;
  • forwards wait to update_endpoint. It previously always waited.

Testing:

  • New test_deploy_core_endpoint_update_endpoint_creates_config_from_variants: binds the actual call kwargs against the real Session.create_endpoint_config signature, then checks the production variant, the unique config name, and update_endpoint(..., wait=False). It fails before this change.
  • Full sagemaker-serve/tests/unit run: no new failures compared with master. The same 70 tests fail on master and on this branch; they need AWS credentials or depend on test order.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…pdate_endpoint

ModelBuilder.deploy(update_endpoint=True) called Session.create_endpoint_config
with per-variant kwargs (model_name, instance_type, ...) that the core Session
does not accept, so every endpoint update failed with a TypeError.

Pass the production variant that is already built for the deploy, give the new
endpoint config a unique name (the model name is reused across updates), and
forward wait to update_endpoint.

Fixes aws#5609
@lucasjia-aws
lucasjia-aws deployed to manual-approval October 13, 2026 21:50 — with GitHub Actions Active
@lucasjia-aws
lucasjia-aws deployed to manual-approval October 13, 2026 21:51 — with GitHub Actions Active
@lucasjia-aws
lucasjia-aws deployed to manual-approval October 13, 2026 21:51 — with GitHub Actions Active

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI code review

This PR fixes ModelBuilder.deploy(update_endpoint=True) on the core Session by passing the already-built production_variant to Session.create_endpoint_config rather than per-variant kwargs that the core signature no longer accepts. I verified against sagemaker-core/src/sagemaker/core/helper/session_helper.py: the new kwargs (name, production_variants, tags, kms_key, data_capture_config_dict, async_inference_config_dict, explainer_config_dict) match create_endpoint_config's signature, update_endpoint accepts wait, and serverless/routing/AMI settings now reach the config via the production variant. The change is correct, matches the create path's behavior, and is covered by a targeted unit test. No issues found.

Reviewed commit 74e2599. Automated review; verify before acting.

This branch was successfully deployed

1 active deployment
manual-approval — 74e2599c Deployed Oct 13, 2026 by lucasjia-aws via wait-for-approval #662
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.

ModelBuilder.deploy(update_endpoint=True) raises AttributeError on Session.create_endpoint_config()

2 participants