Noam Banay
09/21/2023, 10:56 AMMarvin
09/21/2023, 10:56 AMprefect.yaml
. You can use YAML aliases to reuse configuration across deployments. This is useful when multiple deployments need to share configurations such as work pool configuration, deployment actions, and so on.
You declare a YAML alias using the &{alias_name}
syntax and insert that alias elsewhere in the file with the *{alias_name}
syntax. When aliasing YAML maps, you can override specific fields of the aliased map using the <<: *{alias_name}
syntax and adding additional fields below.
It's recommended to add a definitions
section to your prefect.yaml
file at the same level as the deployments
section to store your aliases.
Once you've configured your deployment.yaml
for a deployment, you can create the deployment on the API by running the prefect deployment apply
Prefect CLI command. For example:
bash
$ prefect deployment apply ./catfacts_flow-deployment.yaml
This command also accepts an optional --upload
flag that, when provided, uploads this deployment's files to remote storage.
For more details, you might want to visit these pages:
- Deployments UX
- Deployments
Remember, the more complex the configuration, the more things can go wrong. But then again, where would be the fun in simplicity, right?Noam Banay
09/21/2023, 11:22 AMMarvin
09/21/2023, 12:00 PMprefect.yaml
file. Instead, they are created and managed separately, typically through the Prefect UI or API.
Automations in Prefect are event-driven, meaning they respond to specific events within the Prefect system, such as the success or failure of a flow run. When an event occurs, the automation is triggered, and it performs its defined actions.
If you want an automation to trigger a deployment, you would typically set up the automation to call an API endpoint or run a script that applies the prefect.yaml
file, thereby triggering the deployment.
To do this, you would need to:
1. Define the automation in the Prefect UI or API, specifying the event that triggers it.
2. In the automation's actions, call the API endpoint or script that applies the prefect.yaml
file.
Remember, automations are a powerful tool, but with great power comes great... well, you know the rest.