-
Notifications
You must be signed in to change notification settings - Fork 670
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sagemaker agent backend setup documentation (#5064)
* sagemaker agent backend setup doc Signed-off-by: Samhita Alla <[email protected]> * update requirement and remove debugging code Signed-off-by: Samhita Alla <[email protected]> * add python-kubernetes Signed-off-by: Samhita Alla <[email protected]> * incorporate suggestions by Nikki Signed-off-by: Samhita Alla <[email protected]> --------- Signed-off-by: Samhita Alla <[email protected]>
- Loading branch information
1 parent
5fc57fa
commit c13d601
Showing
11 changed files
with
2,955 additions
and
2,114 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
.. _deployment-agent-setup-sagemaker-inference: | ||
|
||
SageMaker Inference Agent | ||
========================= | ||
|
||
This guide provides an overview of how to set up the SageMaker inference agent in your Flyte deployment. | ||
|
||
Specify agent configuration | ||
--------------------------- | ||
|
||
.. tabs:: | ||
|
||
.. group-tab:: Flyte binary | ||
|
||
Edit the relevant YAML file to specify the agent. | ||
|
||
.. code-block:: bash | ||
kubectl edit configmap flyte-sandbox-config -n flyte | ||
.. code-block:: yaml | ||
:emphasize-lines: 7,11-12,16-17 | ||
tasks: | ||
task-plugins: | ||
enabled-plugins: | ||
- container | ||
- sidecar | ||
- k8s-array | ||
- agent-service | ||
default-for-task-types: | ||
- container: container | ||
- container_array: k8s-array | ||
- boto: agent-service | ||
- sagemaker-endpoint: agent-service | ||
plugins: | ||
agent-service: | ||
supportedTaskTypes: | ||
- boto | ||
- sagemaker-endpoint | ||
.. group-tab:: Flyte core | ||
|
||
Create a file named ``values-override.yaml`` and add the following configuration to it: | ||
|
||
.. code-block:: yaml | ||
:emphasize-lines: 9,14-15,19-20 | ||
configmap: | ||
enabled_plugins: | ||
tasks: | ||
task-plugins: | ||
enabled-plugins: | ||
- container | ||
- sidecar | ||
- k8s-array | ||
- agent-service | ||
default-for-task-types: | ||
container: container | ||
sidecar: sidecar | ||
container_array: k8s-array | ||
boto: agent-service | ||
sagemaker-endpoint: agent-service | ||
plugins: | ||
agent-service: | ||
supportedTaskTypes: | ||
- boto | ||
- sagemaker-endpoint | ||
Add the AWS credentials | ||
----------------------- | ||
|
||
1. Install the flyteagent pod using helm: | ||
|
||
.. code-block:: | ||
helm repo add flyteorg https://flyteorg.github.io/flyte | ||
helm install flyteagent flyteorg/flyteagent --namespace flyte | ||
2. Get the base64 value of your AWS credentials: | ||
|
||
.. code-block:: | ||
echo -n "<AWS_CREDENTIAL>" | base64 | ||
3. Edit the flyteagent secret: | ||
|
||
.. code-block:: bash | ||
kubectl edit secret flyteagent -n flyte | ||
.. code-block:: yaml | ||
:emphasize-lines: 3-5 | ||
apiVersion: v1 | ||
data: | ||
aws-access-key: <BASE64_ENCODED_AWS_ACCESS_KEY> | ||
aws-secret-access-key: <BASE64_ENCODED_AWS_SECRET_ACCESS_KEY> | ||
aws-session-token: <BASE64_ENCODED_AWS_SESSION_TOKEN> | ||
kind: Secret | ||
Upgrade the Flyte Helm release | ||
------------------------------ | ||
|
||
.. tabs:: | ||
|
||
.. group-tab:: Flyte binary | ||
|
||
.. code-block:: bash | ||
helm upgrade <RELEASE_NAME> flyteorg/flyte-binary -n <YOUR_NAMESPACE> --values <YOUR_YAML_FILE> | ||
Replace ``<RELEASE_NAME>`` with the name of your release (e.g., ``flyte-backend``), | ||
``<YOUR_NAMESPACE>`` with the name of your namespace (e.g., ``flyte``), | ||
and ``<YOUR_YAML_FILE>`` with the name of your YAML file. | ||
|
||
.. group-tab:: Flyte core | ||
|
||
.. code-block:: bash | ||
helm upgrade <RELEASE_NAME> flyte/flyte-core -n <YOUR_NAMESPACE> --values values-override.yaml | ||
Replace ``<RELEASE_NAME>`` with the name of your release (e.g., ``flyte``) | ||
and ``<YOUR_NAMESPACE>`` with the name of your namespace (e.g., ``flyte``). | ||
|
||
You can refer to the documentation `here <https://docs.flyte.org/en/latest/flytesnacks/examples/sagemaker_inference_agent/index.html>`__. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,15 +30,15 @@ Flyte. | |
To recap, here are a few examples of why you would want to implement a backend plugin: | ||
|
||
1. We want to add a new capability to the Flyte Platform, for example we might want to: | ||
- Talk to a new service like AWS Sagemaker, Snowflake, Redshift, Athena, BigQuery, etc. | ||
- Talk to a new service like AWS SageMaker, Snowflake, Redshift, Athena, BigQuery, etc. | ||
- Orchestrate a set of containers in a new way like Spark, Flink, Distributed | ||
training on Kubernetes (usually using a Kubernetes operator). | ||
- Use a new container orchestration engine like AWS Batch/ECS, Hashicorp' Nomad | ||
- Use a completely new runtime like AWS Lambda, KNative, etc. | ||
3. You want to retain the capability to update the plugin implementation and roll | ||
2. You want to retain the capability to update the plugin implementation and roll | ||
out new changes and fixes without affecting the users code or requiring them to update | ||
versions of their plugins. | ||
4. You want the same plugin to be accessible across multiple language SDK's. | ||
3. You want the same plugin to be accessible across multiple language SDK's. | ||
|
||
```{note} | ||
Talking to a new service can be done using flytekit extensions and usually is the better way to get started. But, once matured, most of these extensions are better to be migrated to the backend. For the rest of the cases, it is possible to extend flytekit to achieve these scenarios, but this is less desirable, because of the associated overhead of first launching a container that launches these jobs downstream. | ||
|
@@ -85,6 +85,7 @@ The backend plugin is where the actual logic of the execution is implemented. Th | |
1. [Kubernetes operator Plugin](https://pkg.go.dev/github.com/lyft/[email protected]/go/tasks/pluginmachinery/k8s#Plugin): The demo in the video below shows two examples of K8s backend plugins: flytekit `Athena` & `Spark`, and Flyte K8s `Pod` & `Spark`. | ||
|
||
```{youtube} oK2RGQuP94k | ||
``` | ||
|
||
2. **A Web API plugin:** [Async](https://pkg.go.dev/github.com/lyft/[email protected]/go/tasks/pluginmachinery/webapi#AsyncPlugin) or [Sync](https://pkg.go.dev/github.com/lyft/[email protected]/go/tasks/pluginmachinery/webapi#SyncPlugin). | ||
|
This file contains 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
Oops, something went wrong.