Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sagemaker inference agent #2027

Merged
merged 125 commits into from
Mar 24, 2024
Merged

Sagemaker inference agent #2027

merged 125 commits into from
Mar 24, 2024

Conversation

kumare3
Copy link
Contributor

@kumare3 kumare3 commented Dec 7, 2023

Tracking issue

Fixes flyteorg/flyte#4079

Why are the changes needed?

To deploy models and generate predictions using Sagemaker on Flyte seamlessly.

What changes were proposed in this pull request?

The Sagemaker agent lets users deploy models on Sagemaker, configure and invoke endpoints.

How was this patch tested?

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

@kumare3 kumare3 marked this pull request as draft December 7, 2023 06:29
Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Attention: Patch coverage is 94.69697% with 21 lines in your changes are missing coverage. Please review.

Project coverage is 83.52%. Comparing base (3642ec6) to head (5a906a3).
Report is 1 commits behind head on master.

Files Patch % Lines
...tekitplugins/awssagemaker_inference/boto3_mixin.py 80.35% 11 Missing ⚠️
...er/flytekitplugins/awssagemaker_inference/agent.py 89.74% 4 Missing ⚠️
...ytekitplugins/awssagemaker_inference/boto3_task.py 92.59% 2 Missing ⚠️
...flytekitplugins/awssagemaker_inference/workflow.py 96.00% 2 Missing ⚠️
...tekitplugins/awssagemaker_inference/boto3_agent.py 97.29% 1 Missing ⚠️
...tions/flytekitplugins/great_expectations/schema.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2027      +/-   ##
==========================================
- Coverage   83.76%   83.52%   -0.24%     
==========================================
  Files         329      324       -5     
  Lines       25002    24578     -424     
  Branches     3708     3496     -212     
==========================================
- Hits        20943    20529     -414     
+ Misses       3432     3420      -12     
- Partials      627      629       +2     

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

Signed-off-by: Ketan Umare <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
@samhita-alla samhita-alla self-assigned this Dec 28, 2023
@Future-Outlier
Copy link
Member

If this PR needs my help, feel free to ping me, thanks a lot!

Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
pingsutw
pingsutw previously approved these changes Mar 21, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by maintainer label Mar 21, 2024
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
@samhita-alla samhita-alla merged commit 224b1c9 into master Mar 24, 2024
47 of 48 checks passed
fiedlerNr9 pushed a commit that referenced this pull request Jul 25, 2024
* [wip] Sagemaker serving agent

Signed-off-by: Ketan Umare <[email protected]>

* added sync agent example

Signed-off-by: Ketan Umare <[email protected]>

* initial version

Signed-off-by: Samhita Alla <[email protected]>

* add deployment workflow

Signed-off-by: Samhita Alla <[email protected]>

* add a workflow to delete sagemaker deployment

Signed-off-by: Samhita Alla <[email protected]>

* clean up

Signed-off-by: Samhita Alla <[email protected]>

* modify dict update logic, create sagemaker deployment tasks

Signed-off-by: Samhita Alla <[email protected]>

* nit

Signed-off-by: Samhita Alla <[email protected]>

* dockerfile and setup changes

Signed-off-by: Samhita Alla <[email protected]>

* update

Signed-off-by: Samhita Alla <[email protected]>

* update

Signed-off-by: Samhita Alla <[email protected]>

* pin aioboto3 version

Signed-off-by: Samhita Alla <[email protected]>

* remove boto3 directory

Signed-off-by: Samhita Alla <[email protected]>

* update imports

Signed-off-by: Samhita Alla <[email protected]>

* boto3 update code and add tests

Signed-off-by: Samhita Alla <[email protected]>

* remove output type

Signed-off-by: Samhita Alla <[email protected]>

* add await

Signed-off-by: Samhita Alla <[email protected]>

* remove sync

Signed-off-by: Samhita Alla <[email protected]>

* modify imports

Signed-off-by: Samhita Alla <[email protected]>

* modify container logic

Signed-off-by: Samhita Alla <[email protected]>

* modify output key

Signed-off-by: Samhita Alla <[email protected]>

* add default container image

Signed-off-by: Samhita Alla <[email protected]>

* remove struct

Signed-off-by: Samhita Alla <[email protected]>

* add region

Signed-off-by: Samhita Alla <[email protected]>

* add output to gettaskresponse

Signed-off-by: Samhita Alla <[email protected]>

* convert to dict to str

Signed-off-by: Samhita Alla <[email protected]>

* revert

Signed-off-by: Samhita Alla <[email protected]>

* remove timeout and add creds to boto3 calls

Signed-off-by: Samhita Alla <[email protected]>

* add to_flyte_idl

Signed-off-by: Samhita Alla <[email protected]>

* subclass fix

Signed-off-by: Samhita Alla <[email protected]>

* invoke endpoint async

Signed-off-by: Samhita Alla <[email protected]>

* remove output type

Signed-off-by: Samhita Alla <[email protected]>

* modify create sagemaker deployment code

Signed-off-by: Samhita Alla <[email protected]>

* dict loop

Signed-off-by: Samhita Alla <[email protected]>

* add wf output

Signed-off-by: Samhita Alla <[email protected]>

* set lhs to an empty string for pythoninstancetask & modify param name in create deployment task

Signed-off-by: Samhita Alla <[email protected]>

* update tracker and delete deployment workflow

Signed-off-by: Samhita Alla <[email protected]>

* instance to instancetask

Signed-off-by: Samhita Alla <[email protected]>

* add tests

Signed-off-by: Samhita Alla <[email protected]>

* ruff isort

Signed-off-by: Samhita Alla <[email protected]>

* ruff isort

Signed-off-by: Samhita Alla <[email protected]>

* isort

Signed-off-by: Samhita Alla <[email protected]>

* add test

Signed-off-by: Samhita Alla <[email protected]>

* pin greatexpectations version

Signed-off-by: Samhita Alla <[email protected]>

* update secret name

Signed-off-by: Samhita Alla <[email protected]>

* add typing dict and update tracker

Signed-off-by: Samhita Alla <[email protected]>

* modify tracker test

Signed-off-by: Samhita Alla <[email protected]>

* add sync agent

Signed-off-by: Samhita Alla <[email protected]>

* add name

Signed-off-by: Samhita Alla <[email protected]>

* add syncagentexecutormixin

Signed-off-by: Samhita Alla <[email protected]>

* modify sync output

Signed-off-by: Samhita Alla <[email protected]>

* metadata to resource_meta

Signed-off-by: Samhita Alla <[email protected]>

* remote conversion to flyte idl

Signed-off-by: Samhita Alla <[email protected]>

* add output type

Signed-off-by: Samhita Alla <[email protected]>

* floats to ints

Signed-off-by: Samhita Alla <[email protected]>

* in place modification

Signed-off-by: Samhita Alla <[email protected]>

* chain tasks

Signed-off-by: Samhita Alla <[email protected]>

* great expectations revert

Signed-off-by: Samhita Alla <[email protected]>

* optimize float to int code

Signed-off-by: Samhita Alla <[email protected]>

* snake case

Signed-off-by: Samhita Alla <[email protected]>

* modify plugin name

Signed-off-by: Samhita Alla <[email protected]>

* modify plugin name

Signed-off-by: Samhita Alla <[email protected]>

* modify tracker tests

Signed-off-by: Samhita Alla <[email protected]>

* fix tests, revert tracker changes and remove pythoninstancetask

Signed-off-by: Samhita Alla <[email protected]>

* tracker changes revert

Signed-off-by: Samhita Alla <[email protected]>

* dict to Dict

Signed-off-by: Samhita Alla <[email protected]>

* make images optional

Signed-off-by: Samhita Alla <[email protected]>

* add image_name

Signed-off-by: Samhita Alla <[email protected]>

* debug

Signed-off-by: Samhita Alla <[email protected]>

* debug

Signed-off-by: Samhita Alla <[email protected]>

* debug

Signed-off-by: Samhita Alla <[email protected]>

* debug

Signed-off-by: Samhita Alla <[email protected]>

* debug

Signed-off-by: Samhita Alla <[email protected]>

* debug

Signed-off-by: Samhita Alla <[email protected]>

* debug

Signed-off-by: Samhita Alla <[email protected]>

* debug

Signed-off-by: Samhita Alla <[email protected]>

* debug

Signed-off-by: Samhita Alla <[email protected]>

* debug

Signed-off-by: Samhita Alla <[email protected]>

* debug

Signed-off-by: Samhita Alla <[email protected]>

* debug

Signed-off-by: Samhita Alla <[email protected]>

* debug

Signed-off-by: Samhita Alla <[email protected]>

* dict to Dict

Signed-off-by: Samhita Alla <[email protected]>

* state to phase

Signed-off-by: Samhita Alla <[email protected]>

* add encode mode to secrets.get

Signed-off-by: Samhita Alla <[email protected]>

* revert: add encode mode to secrets.get

Signed-off-by: Samhita Alla <[email protected]>

* add decode

Signed-off-by: Samhita Alla <[email protected]>

* revert decode

Signed-off-by: Samhita Alla <[email protected]>

* ergonomic improvements; change plugin name

Signed-off-by: Samhita Alla <[email protected]>

* change plugin name

Signed-off-by: Samhita Alla <[email protected]>

* nit

Signed-off-by: Samhita Alla <[email protected]>

* image check

Signed-off-by: Samhita Alla <[email protected]>

* add api docs

Signed-off-by: Samhita Alla <[email protected]>

* add api docs

Signed-off-by: Samhita Alla <[email protected]>

* incorporate Kevin's suggestions

Signed-off-by: Samhita Alla <[email protected]>

* handle scenario when the same input is present in the wf already

Signed-off-by: Samhita Alla <[email protected]>

* add support for region to be a user-provided input at run-time

Signed-off-by: Samhita Alla <[email protected]>

* modify workflow code to accommodate providing regions at runtime

Signed-off-by: Samhita Alla <[email protected]>

* code optimization and add region support to workflows

Signed-off-by: Samhita Alla <[email protected]>

* nit

Signed-off-by: Samhita Alla <[email protected]>

* fixed an input_types bug

Signed-off-by: Samhita Alla <[email protected]>

* fix images bug

Signed-off-by: Samhita Alla <[email protected]>

* replace endpoint_name with config

Signed-off-by: Samhita Alla <[email protected]>

* input_region default

Signed-off-by: Samhita Alla <[email protected]>

* add inputs

Signed-off-by: Samhita Alla <[email protected]>

* replace bug

Signed-off-by: Samhita Alla <[email protected]>

* add return type

Signed-off-by: Samhita Alla <[email protected]>

* kwtypes fix bug

Signed-off-by: Samhita Alla <[email protected]>

* add cache_ignore_input_vars to task template in tests

Signed-off-by: Samhita Alla <[email protected]>

* fix test

Signed-off-by: Samhita Alla <[email protected]>

* fix test

Signed-off-by: Samhita Alla <[email protected]>

* add test case for boto3 call method

Signed-off-by: Samhita Alla <[email protected]>

* lint

Signed-off-by: Samhita Alla <[email protected]>

* lint

Signed-off-by: Samhita Alla <[email protected]>

* lint

Signed-off-by: Samhita Alla <[email protected]>

* lint

Signed-off-by: Samhita Alla <[email protected]>

* lint

Signed-off-by: Samhita Alla <[email protected]>

* ruff version

Signed-off-by: Samhita Alla <[email protected]>

* ruff version

Signed-off-by: Samhita Alla <[email protected]>

* nit

Signed-off-by: Samhita Alla <[email protected]>

* docstring update

Signed-off-by: Samhita Alla <[email protected]>

---------

Signed-off-by: Ketan Umare <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Co-authored-by: Samhita Alla <[email protected]>
Signed-off-by: Jan Fiedler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Core feature] Sagemaker Agent
5 participants