Is it possible to get the project and domain in py...
# ask-the-community
v
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()
k
It is possible- using context
Cc @Samhita Alla we are thinking of updating the production docs
We will try and let you know
s
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)
v
Thanks for the hint, but we would need it outside the task.
s
@Kevin Su do you know if this is possible?