Omar Khudeira
05/02/2024, 3:59 PMjob_variables
parameter on the deploy
method?Marvin
05/02/2024, 3:59 PMflow.deploy
for a Kubernetes worker, you can populate the job_variables
parameter with a dictionary. Here is an example of how to use the .deploy()
method to deploy your flow, including the job_variables
, straight from the Prefect documentation:
python
if __name__ == "__main__":
flow.from_source(
source="<https://github.com/zzstoatzz/prefect-monorepo.git>",
entrypoint="src/demo_project/demo_flow.py:some_work"
).deploy(
name="demo-deployment",
work_pool_name="k8s-worker-pool",
job_variables={
"env": {
"EXECUTION_ENVIRONMENT": "staging",
"MY_NOT_SO_SECRET_CONFIG": "plumbus"
}
# ... other job variables ...
}
)
For more details, please see the relevant section in the Prefect documentation about overriding job variables.
There isn't a specific typed class provided for populating `job_variables`; you would simply use a Python dictionary to define them.Nate
05/02/2024, 4:10 PMNate
05/02/2024, 4:11 PM