Hello, In the task , I am trying to dynamically se...
# ask-the-community
f
Hello, In the task , I am trying to dynamically set the env variable like this: if domain is ‘development’, then env=‘dev’ if domain is ‘stage’, then env=‘stage’ if domain is ‘production’, then env=‘prod’ The question is how to determine the domain in code? I tried flytekit.current_context() with no avail. Could someone shed some light? Thanks
k
We set environment variables in our CI/CD process using the same parameter that sets the target domain to deploy workflows to (which is tied to our branch name). Would be interested in following this thread in case there's a better way to do it
f
@Katrina P that’s a great way to do that.
e
@Frank Shen, the field called
execution_id
found in
flytekit.current_context()
contains the project, domain, and execution name (as defined in https://github.com/flyteorg/flytekit/blob/master/flytekit/models/core/identifier.py#L100-L109 )
f
@Eduardo Apolinario (eapolinario) Thank you!
155 Views