Robert
10/09/2024, 7:57 PMMarvin
10/09/2024, 7:57 PMprefect.yaml
file. These variables can be used to pass necessary information to your deployment.
Here's an example based on the documentation:
yaml
deployments:
- name: demo-deployment
entrypoint: demo_project/demo_flow.py:some_work
work_pool:
name: local
job_variables:
env:
EXECUTION_ENVIRONMENT: "your_value"
MY_NOT_SO_SECRET_CONFIG: "your_value"
In this setup, you can specify any environment variable you need for your deployment, but there's no specific default variable that Prefect sets to indicate the job is running. You would have to define such behavior yourself if needed.
For more details, you can visit the deployment guide here.Nate
10/09/2024, 8:09 PMRobert
10/10/2024, 2:27 PMNate
10/10/2024, 2:31 PMPREFECT__FLOW_RUN_ID
but i’d be curious if you need specifically an env var or just some signal that you’re in a run?
because accessing prefect.runtime.deployment would probably be safer / more future proofRobert
10/10/2024, 3:24 PM