ancient-wolf-19325
06/28/2024, 6:58 PMFLYTE_INTERNAL_EXECUTION_WORKFLOW, FLYTE_INTERNAL_EXECUTION_ID, FLYTE_INTERNAL_EXECUTION_PROJECT, and FLYTE_INTERNAL_EXECUTION_DOMAIN, among others. You can access these variables to get workflow-related information.
2. Flyte Context: You can use flytekit.current_context() to get the execution parameters, which include the execution ID and other metadata.
Example:
import os
from flytekit import current_context
# Access environment variables
execution_workflow = os.getenv("FLYTE_INTERNAL_EXECUTION_WORKFLOW")
execution_id = os.getenv("FLYTE_INTERNAL_EXECUTION_ID")
execution_project = os.getenv("FLYTE_INTERNAL_EXECUTION_PROJECT")
execution_domain = os.getenv("FLYTE_INTERNAL_EXECUTION_DOMAIN")
# Access current context
context = current_context()
execution_params = context.execution_id
print(f"Workflow: {execution_workflow}, Execution ID: {execution_id}")
print(f"Project: {execution_project}, Domain: {execution_domain}")
print(f"Execution Params: {execution_params}")
According to Flyte community discussion, these environment variables are available in the user pod and can be used to detect runtime workflow metadata.
Would you like more detail on any specific part of this process?
Sources:
- Flyte community discussion
- Flyte community discussion
Slack Link
https://flyte-org.slack.com/archives/CP2HDHKE1/p1719601066.959839 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.