Is it possible to get the project and domain in py...
# flyte-support
a
Is it possible to get the project and domain in python specified e.g. during the pyflyte call in the workflow definition? We want to set task specification depending on project/domain when defining workflows, here a simplified example:
flyte_project = flytekit.???
flyte_domain = flytekit.???
project_container_image = IMAGEMAP[flyte_project][flyte_domain]
@task(container_image=project_container_image)
def do_it():
do()
f
It is possible- using context
Cc @tall-lock-23197 we are thinking of updating the production docs
We will try and let you know
❤️ 1
t
you should be able to retrieve project and domain within a task:
Copy code
@task
def t1(project: str):
    print(flytekit.current_context().execution_id.project)
a
Thanks for the hint, but we would need it outside the task.
t
@glamorous-carpet-83516 do you know if this is possible?