From b6da651aaec584f7acc65ec91f374475627043c0 Mon Sep 17 00:00:00 2001 From: Yuvraj Date: Wed, 20 Oct 2021 11:03:42 +0530 Subject: [PATCH 1/4] Added pytorch plugin documentation Signed-off-by: Yuvraj --- rsts/deployment/index.rst | 10 ++- rsts/deployment/plugin_setup/index.rst | 24 ++++++ .../plugin_setup/pytorch_operator.rst | 73 +++++++++++++++++++ 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 rsts/deployment/plugin_setup/index.rst create mode 100644 rsts/deployment/plugin_setup/pytorch_operator.rst diff --git a/rsts/deployment/index.rst b/rsts/deployment/index.rst index e4bc234844..8e93b1865e 100644 --- a/rsts/deployment/index.rst +++ b/rsts/deployment/index.rst @@ -45,9 +45,16 @@ solution). The following pages will help you effectively deploy and manage an en GCP ^^^^^^^^^^^^ Deployment guides with detailed instructions specific to GCP. *(Coming soon)* - --- + .. link-button:: deployment-plugin-setup + :type: ref + :text: Plugin Setup + :classes: btn-block stretched-link + ^^^^^^^^^^^^ + Plugin Setup guides with detailed instructions. + + --- .. link-button:: deployment-cluster-config :type: ref :text: Cluster Configuration @@ -66,3 +73,4 @@ solution). The following pages will help you effectively deploy and manage an en gcp/index cluster_config/index sandbox + plugin_setup/index diff --git a/rsts/deployment/plugin_setup/index.rst b/rsts/deployment/plugin_setup/index.rst new file mode 100644 index 0000000000..4f4ef90660 --- /dev/null +++ b/rsts/deployment/plugin_setup/index.rst @@ -0,0 +1,24 @@ +.. _deployment-plugin-setup: + +############## +Plugin Setup +############## + + +.. panels:: + :header: text-center + + .. link-button:: deployment-plugin-setup-pytorch-operator + :type: ref + :text: PyTorch Plugin + :classes: btn-block stretched-link + ^^^^^^^^^^^^ + PyTorch Plugin + + +.. toctree:: + :maxdepth: 1 + :name: Plugin Setup + :hidden: + + pytorch_operator diff --git a/rsts/deployment/plugin_setup/pytorch_operator.rst b/rsts/deployment/plugin_setup/pytorch_operator.rst new file mode 100644 index 0000000000..c2da108eaa --- /dev/null +++ b/rsts/deployment/plugin_setup/pytorch_operator.rst @@ -0,0 +1,73 @@ +.. _deployment-plugin-setup-pytorch-operator: + +PyTorch Operator Setup +------------------------ + +.. _pytorch-operator: + +#################################### +Install PyTorch Operator +#################################### + +Clone Flytesnacks + +.. code-block:: bash + + git clone https://github.com/flyteorg/flytesnacks.git + +Start the sandbox for testing + +.. code-block:: bash + + flytectl sandbox start --source=./flytesnacks + +Install Pytorch Operator + +.. code-block:: bash + + helm repo add bitnami https://charts.bitnami.com/bitnami --kubeconfig=~/.flyte/k3s/k3s.yaml + helm install my-release bitnami/pytorch + + +Create a file values-pytorch.yaml and add the below values + +.. code-block:: + + configmap: + enabled_plugins: + # -- Tasks specific configuration [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#GetConfig) + tasks: + # -- Plugins configuration, [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#TaskPluginConfig) + task-plugins: + # -- [Enabled Plugins](https://pkg.go.dev/github.com/flyteorg/flyteplugins/go/tasks/config#Config). Enable sagemaker*, athena if you install the backend + # plugins + enabled-plugins: + - container + - sidecar + - k8s-array + - mpi + - pytorch + default-for-task-types: + container: container + sidecar: sidecar + container_array: k8s-array + pytorch: pytorch + +Upgrade flyte helm release + +.. code-block:: bash + + helm upgrade -n flyte -f values-pytorch.yaml flyteorg/flyte --kubeconfig=~/.flyte/k3s/k3s.yaml + +Build & Serialize Pytorch plugin example + +.. code-block:: bash + + cd flytesnacks + flytectl sandbox exec -- make -C cookbook/integrations/kubernetes/kfpytorch serialize + +Register Pytorch plugin example + +.. code-block:: bash + + make -C cookbook/integrations/kubernetes/kfpytorch register From a337112242a52bf19e11d2902530fa263c6ba96c Mon Sep 17 00:00:00 2001 From: Yuvraj Date: Wed, 20 Oct 2021 11:31:55 +0530 Subject: [PATCH 2/4] Added create execution in guide Signed-off-by: Yuvraj --- rsts/deployment/index.rst | 2 +- rsts/deployment/plugin_setup/index.rst | 4 ++-- rsts/deployment/plugin_setup/pytorch_operator.rst | 12 ++++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/rsts/deployment/index.rst b/rsts/deployment/index.rst index 8e93b1865e..bea638c571 100644 --- a/rsts/deployment/index.rst +++ b/rsts/deployment/index.rst @@ -52,7 +52,7 @@ solution). The following pages will help you effectively deploy and manage an en :text: Plugin Setup :classes: btn-block stretched-link ^^^^^^^^^^^^ - Plugin Setup guides with detailed instructions. + Plugin Setup Guides --- .. link-button:: deployment-cluster-config diff --git a/rsts/deployment/plugin_setup/index.rst b/rsts/deployment/plugin_setup/index.rst index 4f4ef90660..795bdbfee2 100644 --- a/rsts/deployment/plugin_setup/index.rst +++ b/rsts/deployment/plugin_setup/index.rst @@ -10,10 +10,10 @@ Plugin Setup .. link-button:: deployment-plugin-setup-pytorch-operator :type: ref - :text: PyTorch Plugin + :text: Pytorch Plugin :classes: btn-block stretched-link ^^^^^^^^^^^^ - PyTorch Plugin + Pytorch Plugin .. toctree:: diff --git a/rsts/deployment/plugin_setup/pytorch_operator.rst b/rsts/deployment/plugin_setup/pytorch_operator.rst index c2da108eaa..08e75cad26 100644 --- a/rsts/deployment/plugin_setup/pytorch_operator.rst +++ b/rsts/deployment/plugin_setup/pytorch_operator.rst @@ -1,6 +1,6 @@ .. _deployment-plugin-setup-pytorch-operator: -PyTorch Operator Setup +PyTorch plugin Setup ------------------------ .. _pytorch-operator: @@ -70,4 +70,12 @@ Register Pytorch plugin example .. code-block:: bash - make -C cookbook/integrations/kubernetes/kfpytorch register + flytectl register files cookbook/integrations/kubernetes/kfpytorch/_pb_output/* -p flytesnacks -d development + + +Create executions + +.. code-block:: bash + + flytectl get launchplan --project flytesnacks --domain development kfpytorch.pytorch_mnist.pytorch_training_wf --latest --execFile exec_spec.yaml + flytectl create execution --project flytesnacks --domain development --execFile exec_spec.yaml From ce9cdf632651a84ed976ac4d0094fc3796b492d7 Mon Sep 17 00:00:00 2001 From: Samhita Alla Date: Wed, 20 Oct 2021 12:00:09 +0530 Subject: [PATCH 3/4] update plugin doc Signed-off-by: Samhita Alla --- rsts/deployment/index.rst | 2 +- rsts/deployment/plugin_setup/index.rst | 8 +- .../plugin_setup/pytorch_operator.rst | 102 +++++++++--------- 3 files changed, 54 insertions(+), 58 deletions(-) diff --git a/rsts/deployment/index.rst b/rsts/deployment/index.rst index bea638c571..e6cde38acb 100644 --- a/rsts/deployment/index.rst +++ b/rsts/deployment/index.rst @@ -52,7 +52,7 @@ solution). The following pages will help you effectively deploy and manage an en :text: Plugin Setup :classes: btn-block stretched-link ^^^^^^^^^^^^ - Plugin Setup Guides + How to set up a plugin for your deployment. --- .. link-button:: deployment-cluster-config diff --git a/rsts/deployment/plugin_setup/index.rst b/rsts/deployment/plugin_setup/index.rst index 795bdbfee2..7b67ecf9c6 100644 --- a/rsts/deployment/plugin_setup/index.rst +++ b/rsts/deployment/plugin_setup/index.rst @@ -1,8 +1,8 @@ .. _deployment-plugin-setup: -############## +############ Plugin Setup -############## +############ .. panels:: @@ -10,10 +10,10 @@ Plugin Setup .. link-button:: deployment-plugin-setup-pytorch-operator :type: ref - :text: Pytorch Plugin + :text: PyTorch Operator :classes: btn-block stretched-link ^^^^^^^^^^^^ - Pytorch Plugin + Guide to setting up the PyTorch Operator. .. toctree:: diff --git a/rsts/deployment/plugin_setup/pytorch_operator.rst b/rsts/deployment/plugin_setup/pytorch_operator.rst index 08e75cad26..b282781562 100644 --- a/rsts/deployment/plugin_setup/pytorch_operator.rst +++ b/rsts/deployment/plugin_setup/pytorch_operator.rst @@ -1,81 +1,77 @@ .. _deployment-plugin-setup-pytorch-operator: -PyTorch plugin Setup ------------------------- +PyTorch Operator Setup +---------------------- -.. _pytorch-operator: +This guide gives an overview of how to set up the PyTorch operator in your Flyte deployment. -#################################### -Install PyTorch Operator -#################################### +1. First, clone the Flytesnacks repo. This is where we have the example. -Clone Flytesnacks + .. code-block:: bash -.. code-block:: bash + git clone https://github.com/flyteorg/flytesnacks.git - git clone https://github.com/flyteorg/flytesnacks.git +2. Start the Flyte sandbox for testing. -Start the sandbox for testing + .. code-block:: bash -.. code-block:: bash + flytectl sandbox start --source=./flytesnacks - flytectl sandbox start --source=./flytesnacks +3. Install the PyTorch Operator. -Install Pytorch Operator + .. code-block:: bash -.. code-block:: bash + helm repo add bitnami https://charts.bitnami.com/bitnami --kubeconfig=~/.flyte/k3s/k3s.yaml + helm install my-release bitnami/pytorch - helm repo add bitnami https://charts.bitnami.com/bitnami --kubeconfig=~/.flyte/k3s/k3s.yaml - helm install my-release bitnami/pytorch +4. Create a file named ``values-pytorch.yaml`` and add the following config to it: + .. code-block:: -Create a file values-pytorch.yaml and add the below values + configmap: + enabled_plugins: + # -- Tasks specific configuration [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#GetConfig) + tasks: + # -- Plugins configuration, [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#TaskPluginConfig) + task-plugins: + # -- [Enabled Plugins](https://pkg.go.dev/github.com/flyteorg/flyteplugins/go/tasks/config#Config). Enable sagemaker*, athena if you install the backend + # plugins + enabled-plugins: + - container + - sidecar + - k8s-array + - mpi + - pytorch + default-for-task-types: + container: container + sidecar: sidecar + container_array: k8s-array + pytorch: pytorch -.. code-block:: +5. Upgrade the Flyte Helm release. - configmap: - enabled_plugins: - # -- Tasks specific configuration [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#GetConfig) - tasks: - # -- Plugins configuration, [structure](https://pkg.go.dev/github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config#TaskPluginConfig) - task-plugins: - # -- [Enabled Plugins](https://pkg.go.dev/github.com/flyteorg/flyteplugins/go/tasks/config#Config). Enable sagemaker*, athena if you install the backend - # plugins - enabled-plugins: - - container - - sidecar - - k8s-array - - mpi - - pytorch - default-for-task-types: - container: container - sidecar: sidecar - container_array: k8s-array - pytorch: pytorch + .. code-block:: bash -Upgrade flyte helm release + helm upgrade -n flyte -f values-pytorch.yaml flyteorg/flyte --kubeconfig=~/.flyte/k3s/k3s.yaml -.. code-block:: bash +6. Build & Serialize the PyTorch plugin example. - helm upgrade -n flyte -f values-pytorch.yaml flyteorg/flyte --kubeconfig=~/.flyte/k3s/k3s.yaml + .. code-block:: bash -Build & Serialize Pytorch plugin example + cd flytesnacks + flytectl sandbox exec -- make -C cookbook/integrations/kubernetes/kfpytorch serialize -.. code-block:: bash +7. Register the PyTorch plugin example. - cd flytesnacks - flytectl sandbox exec -- make -C cookbook/integrations/kubernetes/kfpytorch serialize + .. code-block:: bash -Register Pytorch plugin example + flytectl register files cookbook/integrations/kubernetes/kfpytorch/_pb_output/* -p flytesnacks -d development -.. code-block:: bash - flytectl register files cookbook/integrations/kubernetes/kfpytorch/_pb_output/* -p flytesnacks -d development +8. Lastly, fetch the launch plan, create and monitor the execution. + .. code-block:: bash -Create executions - -.. code-block:: bash - - flytectl get launchplan --project flytesnacks --domain development kfpytorch.pytorch_mnist.pytorch_training_wf --latest --execFile exec_spec.yaml - flytectl create execution --project flytesnacks --domain development --execFile exec_spec.yaml + flytectl get launchplan --project flytesnacks --domain development kfpytorch.pytorch_mnist.pytorch_training_wf --latest --execFile exec_spec.yaml + flytectl create execution --project flytesnacks --domain development --execFile exec_spec.yaml + flytectl get execution --project flytesnacks --domain development From cd89cb0a2ceab7a5de1ea32388412b6f7f96985d Mon Sep 17 00:00:00 2001 From: Samhita Alla Date: Wed, 20 Oct 2021 12:01:26 +0530 Subject: [PATCH 4/4] revert newline removal Signed-off-by: Samhita Alla --- rsts/deployment/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/rsts/deployment/index.rst b/rsts/deployment/index.rst index e6cde38acb..d7229682e2 100644 --- a/rsts/deployment/index.rst +++ b/rsts/deployment/index.rst @@ -45,6 +45,7 @@ solution). The following pages will help you effectively deploy and manage an en GCP ^^^^^^^^^^^^ Deployment guides with detailed instructions specific to GCP. *(Coming soon)* + --- .. link-button:: deployment-plugin-setup