Skip to content

Commit

Permalink
[Docs][flyteagent] Improve Agent Secret Setup (#5765)
Browse files Browse the repository at this point in the history
Signed-off-by: Future-Outlier <[email protected]>
  • Loading branch information
Future-Outlier authored Sep 23, 2024
1 parent cff510d commit 5ad4195
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 110 deletions.
38 changes: 9 additions & 29 deletions docs/deployment/agents/chatgpt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,45 +78,25 @@ Specify agent configuration
Add the OpenAI API token
-------------------------------

1. Install flyteagent pod using helm:
1. Install the flyteagent pod using helm:

.. code-block::
.. code-block:: bash
helm repo add flyteorg https://flyteorg.github.io/flyte
helm install flyteagent flyteorg/flyteagent --namespace flyte
2. Get the base64 value of your OpenAI API token:
2. Set Your OpenAI API Token as a Secret (Base64 Encoded):

.. code-block::
.. code-block:: bash
echo -n "<OPENAI_API_TOKEN>" | base64
SECRET_VALUE=$(echo -n "<OPENAI_API_TOKEN>" | base64) && \
kubectl patch secret flyteagent -n flyte --patch "{\"data\":{\"flyte_openai_api_key\":\"$SECRET_VALUE\"}}"
3. Edit the flyteagent secret:
3. Restart development:

.. code-block:: bash
kubectl edit secret flyteagent -n flyte
.. code-block:: yaml
:emphasize-lines: 3
apiVersion: v1
data:
flyte_openai_api_key: <BASE64_ENCODED_OPENAI_API_TOKEN>
kind: Secret
metadata:
annotations:
meta.helm.sh/release-name: flyteagent
meta.helm.sh/release-namespace: flyte
creationTimestamp: "2023-10-04T04:09:03Z"
labels:
app.kubernetes.io/managed-by: Helm
name: flyteagent
namespace: flyte
resourceVersion: "753"
uid: 5ac1e1b6-2a4c-4e26-9001-d4ba72c39e54
type: Opaque
.. code-block:: bash
kubectl rollout restart deployment flyteagent -n flyte
Upgrade the Flyte Helm release
------------------------------
Expand Down
38 changes: 9 additions & 29 deletions docs/deployment/agents/databricks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,45 +199,25 @@ Add the Databricks access token

You have to set the Databricks token to the Flyte configuration.

1. Install flyteagent pod using helm
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 Databricks token.
2. Set Your Databricks Token as a Secret (Base64 Encoded):

.. code-block::
.. code-block:: bash
echo -n "<DATABRICKS_TOKEN>" | base64
SECRET_VALUE=$(echo -n "<DATABRICKS_TOKEN>" | base64) && \
kubectl patch secret flyteagent -n flyte --patch "{\"data\":{\"flyte_databricks_access_token\":\"$SECRET_VALUE\"}}"
3. Edit the flyteagent secret

.. code-block:: bash
kubectl edit secret flyteagent -n flyte
.. code-block:: yaml
:emphasize-lines: 3
apiVersion: v1
data:
flyte_databricks_access_token: <BASE64_ENCODED_DATABRICKS_TOKEN>
kind: Secret
metadata:
annotations:
meta.helm.sh/release-name: flyteagent
meta.helm.sh/release-namespace: flyte
creationTimestamp: "2023-10-04T04:09:03Z"
labels:
app.kubernetes.io/managed-by: Helm
name: flyteagent
namespace: flyte
resourceVersion: "753"
uid: 5ac1e1b6-2a4c-4e26-9001-d4ba72c39e54
type: Opaque
3. Restart development:

.. code-block:: bash
kubectl rollout restart deployment flyteagent -n flyte
Upgrade the deployment
----------------------
Expand Down
34 changes: 7 additions & 27 deletions docs/deployment/agents/openai_batch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,38 +65,18 @@ Add the OpenAI API token
helm repo add flyteorg https://flyteorg.github.io/flyte
helm install flyteagent flyteorg/flyteagent --namespace flyte
2. Get the base64 value of your OpenAI API token:
2. Set Your OpenAI API Token as a Secret (Base64 Encoded):

.. code-block::
echo -n "<OPENAI_API_TOKEN>" | base64
.. code-block:: bash
3. Edit the flyteagent secret:
SECRET_VALUE=$(echo -n "<OPENAI_API_TOKEN>" | base64) && \
kubectl patch secret flyteagent -n flyte --patch "{\"data\":{\"flyte_openai_api_key\":\"$SECRET_VALUE\"}}"
.. code-block:: bash
3. Restart development:

kubectl edit secret flyteagent -n flyte
.. code-block:: yaml
:emphasize-lines: 3
apiVersion: v1
data:
FLYTE_OPENAI_API_KEY: <BASE64_ENCODED_OPENAI_API_TOKEN>
kind: Secret
metadata:
annotations:
meta.helm.sh/release-name: flyteagent
meta.helm.sh/release-namespace: flyte
creationTimestamp: "2023-10-04T04:09:03Z"
labels:
app.kubernetes.io/managed-by: Helm
name: flyteagent
namespace: flyte
resourceVersion: "753"
uid: 5ac1e1b6-2a4c-4e26-9001-d4ba72c39e54
type: Opaque
.. code-block:: bash
kubectl rollout restart deployment flyteagent -n flyte
Upgrade the Flyte Helm release
------------------------------
Expand Down
28 changes: 3 additions & 25 deletions docs/flyte_agents/deploying_agents_to_the_flyte_sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,8 @@ image: localhost:30000/flyteagent:example
3. Set up your secrets:
Let's take Databricks agent as an example:
```bash
kubectl edit secret flyteagent -n flyte
```
Get your `BASE64_ENCODED_DATABRICKS_TOKEN`:
```bash
echo -n "<DATABRICKS_TOKEN>" | base64
```
Add your token to the `data` field:
```yaml
apiVersion: v1
data:
flyte_databricks_access_token: <BASE64_ENCODED_DATABRICKS_TOKEN>
kind: Secret
metadata:
annotations:
meta.helm.sh/release-name: flyteagent
meta.helm.sh/release-namespace: flyte
creationTimestamp: "2023-10-04T04:09:03Z"
labels:
app.kubernetes.io/managed-by: Helm
name: flyteagent
namespace: flyte
resourceVersion: "753"
uid: 5ac1e1b6-2a4c-4e26-9001-d4ba72c39e54
type: Opaque
SECRET_VALUE=$(echo -n "<DATABRICKS_TOKEN>" | base64) && \
kubectl patch secret flyteagent -n flyte --patch "{\"data\":{\"flyte_databricks_access_token\":\"$SECRET_VALUE\"}}"
```
:::{note}
Please ensure two things:
Expand All @@ -85,7 +63,7 @@ Please ensure two things:

4. Restart development:
```bash
kubectl rollout restart deployment flyte-sandbox -n flyte
kubectl rollout restart deployment flyteagent -n flyte
```

5. Test your agent remotely in the Flyte sandbox:
Expand Down

0 comments on commit 5ad4195

Please sign in to comment.