https://flyte.org logo
#ask-the-community
Title
# ask-the-community
g

Gilbert Yang

03/28/2024, 6:51 PM
Hi! May I know how to inject the value of FLYTE_INTERNAL_IMAGE? 1. Are we injecting this when pyflyte --image? 2. Or we have to manually set this in the container as env vars?
y

Yee

03/28/2024, 7:34 PM
i’m not actually sure that env var is used anymore.
we definitely used to inject them.
could you elaborate a bit on the issue you’re seeing?
g

Gilbert Yang

03/28/2024, 7:44 PM
I see. We are looking for a way to get the image_uri from workflows. I know tasks can use different images, but in our case we use one image across the whole workflow.
y

Yee

03/28/2024, 8:09 PM
you want to get the image from inside a task?
that should already be possible.
g

Gilbert Yang

03/28/2024, 8:11 PM
Yeah, could you send me the doc?
We are hoping to get this from flyte remote if that is possible
y

Yee

03/28/2024, 8:12 PM
huh?
i’m confused.
you’re asking to get the image of a task, from like the command line?
or from inside the task, while the task is running?
g

Gilbert Yang

03/28/2024, 8:12 PM
This: get the image of a task, from like the command line?
y

Yee

03/28/2024, 8:13 PM
oh
that’s very different.
that should be possible by just hitting the api.
just call fetch_task.
it’s inside the object that’s returned.
c

Chris Grass

03/28/2024, 8:14 PM
if you want to get the image used for a task pod on the command line you can use
kubectl get pods {podname} -o yaml
and look for the
image
field
g

Gilbert Yang

03/28/2024, 8:14 PM
I see. I tried to run while the task is not running, is that possible?
nvm I got it!
Thanks!
y

Yee

03/28/2024, 8:18 PM
yeah you’re just hitting the control plane and reading the definition of the task from the database.
g

Gilbert Yang

03/28/2024, 8:19 PM
Thanks a lot Yee! You are very helpful
Btw @Yee, do we ever consider to support labels when pyflyte register? We have a need to store some metadata when registering the workflow and use them when workflow runs.
y

Yee

03/28/2024, 8:32 PM
could you elaborate a bit more? what’s the functionality you’re looking for?
flyte does have execution labels.
but these are set at execution time iirc.
g

Gilbert Yang

03/28/2024, 8:35 PM
Sure. Let's not say this is labels. What we hope is: we want to save some metadata (k=v pairs) while we registering the workflow, like artifacts name, repository name etc. which we will need when executing the workflow. (for example to deploy the model, we need to pass the artifact names downstream)
We previously preserve those value in the image as env vars, but due to company restriction, we cannot do it anymore.
I see there is --env, does it act as a one time parameters or I can use that when workflow runs?
y

Yee

03/28/2024, 11:20 PM
what are artifacts name?
it is certainly possible to set environment variables at execution time.
g

Gilbert Yang

03/29/2024, 1:44 AM
artifacts name
It is some custom data we want to use in the workflow.
it is certainly possible to set environment variables at execution time.
We hope to set env vars in registration, and use them in execution time
y

Yee

03/29/2024, 3:50 AM
you can always set env vars at registration time, at least you can set them in the task definition.
g

Gilbert Yang

03/29/2024, 11:35 AM
hm... we cannot do this because we are the platform-provider (ML infra at Stripe). Workflow code is implemented by our users (Stripe DS)..
That's why I would hope to add
--lables
option in
pyflyte register
, as we will register the workflow to Flyte for our users.
y

Yee

03/29/2024, 4:39 PM
this will take some digging.
what do you mean? you can’t add an env field to the task decorator?
could you cut a ticket for this please?
i think it will be helpful to get all the tags/labels in one place.
there’s a bunch scattered all around the idl, they all serve different purposes.
g

Gilbert Yang

03/31/2024, 1:15 AM
what do you mean? you can’t add an env field to the task decorator?
I cannot. We are Stripe ML infra and we set up Flyte to let Stripe Data scientist to develop workflows.
could you cut a ticket for this please?
Sure
y

Yee

04/01/2024, 1:36 AM
thanks. could you add more details as well as to the ux you'd like to see.
g

Gilbert Yang

04/01/2024, 7:20 PM
2 Views