I am trying to play with the Sensor agent. I wonde...
# flyte-connectors
h
I am trying to play with the Sensor agent. I wonder what's the best way to pass credentials (secrets) from a workflow to the sensor's
poke
method?
f
cc @glamorous-carpet-83516 / @damp-lion-88352
d
But you can customize your own sensor
Let me give you some reference
For secret usage in the agent server (e.g., ChatGPT Agent), refer to this documentation: https://docs.flyte.org/en/latest/deployment/agents/chatgpt.html#deployment-agent-setup-chatgpt To create your customized sensor, you can check out this guide: https://www.union.ai/blog-post/flyte-agents-a-developer-perspective#sensor-task
If you have setup problems, feel free to ping me, thank you
g
we usually mount the secret to the agent pod. why do you want to pass a secret from a workflow to the sensor?
h
My use-case is to check whether a copy operation has completed on Azure Blob Storage. I can control the level of access that each "normal" task has (by choosing, which secrets it will use), but with the sensor agent it appears I would then need to give it access to practically everything, which isn't great. Right now I am probably going to stick to generating a delegation token for a specific blob that I want to check and pass it as a parameter to the sensor, but it sounds not particularly secure either because those keys will exposed to everyone in the Flyte UI.
d
I don't have much experience with credentials and Blob Storage, but let me try to give you some information about how Flyte add minio credential to the agent pod.
In flyte sandbox, which use minio s3 as storage, we will get these variables
FLYTE_AWS_ENDPOINT,FLYTE_AWS_ACCESS_KEY_ID and FLYTE_AWS_SECRET_ACCESS_KEY
to access data
h
^ I think this is equivalent to giving the agent access to basically everything that any workflow may conceivably use.
d
I don't think we've supported this. But after this PR merged, use a config to store the secret will be a good alternative. https://github.com/flyteorg/flyte/pull/5126
How do you think?
h
Unless config is per-project, this doesn't change much.
Slightly unrelated question: when trying to instantiate a sensor I am getting the following error:
Copy code
failed to get grpc connection with error: failed to exit idle mode: passthrough: received empty target in Build()
What is this and how can I troubleshoot it?
g
looking, seems like it happens in 1.12
f
Unless config is per-project, this doesn't change much.
@hallowed-branch-43666 since Flyte does not really own the secrets this is manual. In the Union managed platform this is how it works. It binds at any arbitrary level