<@U06RKAMK0UC> can I get the targeted `domain` fro...
# ask-ai
a
@ancient-wolf-19325 can I get the targeted
domain
from the flyte context?
j
Yes, you can retrieve the targeted
domain
from the Flyte context using
flytekit.current_context().execution_id.domain
. This method allows you to access the domain information at runtime within a task. Would you like more detail on how to implement this in your code? Sources: - Flyte Discussion on Retrieving Domain - Flyte Discussion on Workflow Metadata 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
a
@ancient-wolf-19325 That returns
local
and not the value passed in from CLI
--domain
j
The behavior you're experiencing might be due to running the task locally. When running tasks locally, Flyte defaults to using "local" as the domain. To ensure the correct domain is used, you should run the task in a remote environment where the domain is set correctly. Would you like more detail on how to configure your environment to reflect the correct domain? Sources: - Flyte Discussion on Local vs Remote Execution 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.