Hello, In the task , I am trying to dynamically se...
# flyte-support
s
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
l
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
s
@limited-dog-47035 that’s a great way to do that.
h
@salmon-refrigerator-32115, 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 )
s
@high-accountant-32689 Thank you!
👍 1
167 Views