Skip to content

Add managed SageMaker job connectors - #3456

Open
rohitrsh wants to merge 1 commit into
flyteorg:masterfrom
rohitrsh:feat/sagemaker-managed-jobs
Open

Add managed SageMaker job connectors#3456
rohitrsh wants to merge 1 commit into
flyteorg:masterfrom
rohitrsh:feat/sagemaker-managed-jobs

Conversation

@rohitrsh

@rohitrsh rohitrsh commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Expand flytekitplugins-awssagemaker beyond deployment and endpoint management with first-class async connectors for SageMaker managed jobs:

  • Training
  • Processing
  • Batch Transform
  • Hyperparameter Tuning
  • Inference Recommender

Tracks flyteorg/flyte#7767.

Design

Each task follows Flyte's standard async connector lifecycle:

  • create() submits the corresponding SageMaker job
  • get() polls the describe API and maps service states to Flyte phases
  • delete() stops the job and tolerates already-terminal or missing resources

The tasks reuse the plugin's existing boto3 templating for {inputs.X}, {images.X}, and {idempotence_token}. Successful describe responses are projected into stable result dictionaries so workflows can pass model artifacts, processing destinations, tuning results, recommendations, and transform output locations downstream without re-querying SageMaker.

The shared boto3 mixin now normalizes whole-number floats before request hashing/calls and preserves semantically significant list order. Duplicate-job recovery is only enabled when Flyte generated an idempotence token; quota and authorization failures remain visible to users.

No FlytePropeller changes are required. Each connector self-registers through the existing flytekit.plugins entry-point mechanism.

Package layout

The existing plugin gains five public subpackages:

  • flytekitplugins.awssagemaker_training
  • flytekitplugins.awssagemaker_processing
  • flytekitplugins.awssagemaker_batch_transform
  • flytekitplugins.awssagemaker_hyperparameter_tuning
  • flytekitplugins.awssagemaker_inference_recommender

Each package contains its task surface, async connector, lifecycle metadata, and synchronous stop/describe helpers. The README documents configuration and composition patterns.

Test plan

  • 93 SageMaker plugin unit tests pass locally
  • Connector create/get/delete paths, terminal-state mapping, projected outputs, idempotent retry, quota propagation, and cleanup error handling are covered
  • Package imports and connector registration verified
  • Repository pre-commit hooks pass: Ruff, Ruff format, codespell, pydoclint, whitespace and debug-statement checks
  • Managed job lifecycle exercised against AWS SageMaker for training, processing, tuning, recommendation, and batch-transform workflows
  • Upstream CI

Follow-up

Flyte-native Pythonic execution for Training and Processing is intentionally excluded. That follow-up will run a regular @task function body inside the SageMaker container via ContainerEntrypoint and handle Flyte inputs.pb / outputs.pb / error.pb. Keeping it separate allows the conventional boto3/config connector surface to be reviewed independently.

/cc @samhita-alla @machichima @kumare3 @pingsutw

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.58%. Comparing base (ca59398) to head (ce5cbe9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3456      +/-   ##
==========================================
+ Coverage   81.95%   83.58%   +1.63%     
==========================================
  Files         217        3     -214     
  Lines       22943      195   -22748     
  Branches     3036        0    -3036     
==========================================
- Hits        18804      163   -18641     
+ Misses       3248       32    -3216     
+ Partials      891        0     -891     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rohitrsh

rohitrsh commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

CI is green for the SageMaker plugin and all other jobs. The only failure is the unrelated flytekit-greatexpectations matrix job because its external fixture now returns 404: https://raw.githubusercontent.com/superconductive/ge_tutorials/main/data/yellow_tripdata_sample_2019-01.csv. I do not have repository permission to rerun the failed job; please rerun that job when convenient.

Expand the existing SageMaker plugin with async lifecycle support for training, processing, batch transform, hyperparameter tuning, and Inference Recommender jobs. Include typed task wrappers, stable projected outputs, idempotent retries, public documentation, and comprehensive unit tests without requiring Propeller changes.

Signed-off-by: Rohit Sharma <rohitrsh@gmail.com>
@rohitrsh
rohitrsh force-pushed the feat/sagemaker-managed-jobs branch from ce5cbe9 to 7f9c534 Compare August 4, 2026 12:09
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