Snowflake agent#

This guide provides an overview of how to set up the Snowflake agent in your Flyte deployment.

  1. Set up the key pair authentication in Snowflake. For more details, see the Snowflake key-pair authentication and key-pair rotation guide.

  2. Create a secret with the group “private-key” and the key “snowflake”. This is hardcoded in the flytekit sdk, since we can’t know the group and key name in advance. This is for permission to upload and download data with structured dataset in python task pod.

kubectl create secret generic private-key --from-file=snowflake=<YOUR PRIVATE KEY FILE> --namespace=flytesnacks-development
  1. Create a secret in the flyteagent’s pod, this is for execution snowflake query in the agent pod.

ENCODED_VALUE=$(cat <YOUR PRIVATE KEY FILE> | base64) && kubectl patch secret flyteagent -n flyte --patch "{\"data\":{\"snowflake_private_key\":\"$ENCODED_VALUE\"}}"

Specify agent configuration#

Edit the relevant YAML file to specify the agent.

kubectl edit configmap flyte-sandbox-config -n flyte
tasks:
  task-plugins:
    enabled-plugins:
      - container
      - sidecar
      - k8s-array
      - agent-service
    default-for-task-types:
      - container: container
      - container_array: k8s-array
      - snowflake: agent-service

Ensure that the propeller has the correct service account for Snowflake.

Upgrade the Flyte Helm release#

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.

For Snowflake agent on the Flyte cluster, see Snowflake agent.