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

Gilbert Yang

03/20/2024, 9:28 PM
Hi! Is there a way we can store some metadata when
flytectl register file
? e.g. some k-v pairs like env vars. The intention of this is we build image containers for the workflow code, and we have to store some env vars and use this data when running the workflow. However we cannot populate them when we build the image. Currently we put them in version_id, I wonder is there a better way to do so? Thanks!
k

Kevin Su

03/20/2024, 9:51 PM
could you add env to task decorator?
Copy code
@task(
    environment={"FLYTE_INTERNAL_IMAGE": "pingsutw/flytekit:0.16.0"}
)
def t1():
    ...
k

Ketan (kumare3)

03/20/2024, 10:07 PM
also labels
g

Gilbert Yang

03/21/2024, 5:21 PM
@Ketan (kumare3) I found an example of labels, but can we explicitly add this in the workflow annotation? We don't control this part of code, we can only control the annotation
Thanks @Kevin Su ! Unfortunately we hope to put this info as workflow or launch plan level
If there is @workflow (env={k1=v1, k2=v2}) that would be great
you should be able to add envs to LP, but currently envs is not exposed in the API. mind open a ticket here? [flyte-bug]
k

Kevin Su

03/21/2024, 6:14 PM
we’ll add that
g

Gilbert Yang

03/21/2024, 6:17 PM
We are the platform team to provide Flyte to our internal users, so we cannot require users to add the LP piece of code. All our workflows are implemented as the example. If we can inject env vars from the @workflow or from the workflow registration, that would be awesome.
3 Views