Kevin
01/22/2025, 12:35 AMMarvin
01/22/2025, 12:35 AMPREFECT_API_KEY
and PREFECT_API_URL
to authenticate and configure your deployment.
- A typical setup involves creating a .github/workflows/deploy-prefect-flow.yaml
file in your repository that specifies the steps to build, push, and deploy your flow.
- Refer to Prefect's CI/CD documentation for more details.
2. Defining Flow Parameters:
- When defining your flow, you can specify parameters as you would with any Python function, using both positional and keyword arguments. These parameters are stored in the flow run object and can be passed through the API.
- Prefect supports type conversion using type hints and Pydantic models, allowing for robust parameter management.
- You can provide parameter values to a flow through the API when creating a deployment. For more information, see Prefect's flow writing guide.
If you're using Prefect 3.x, these resources should be directly applicable. If you have specific configurations or need more detailed steps, feel free to ask!Kevin
01/22/2025, 12:36 AMMarvin
01/22/2025, 12:36 AMprefect deploy
. You'll be prompted to create a new deployment, select the flow code entrypoint, and confirm the URL and branch name of your Git repository.
- This setup ensures that your Prefect workers have access to the flow's code when running the deployment. For detailed steps, refer to the Prefect 2.x storage guide.
2. Defining Flow Parameters:
- Default parameter values can be configured in the deployment.yaml
file using the parameters: {}
line. Parameters should be specified as JSON key-value pairs matching the flow function's expected parameters.
- You can also pass **kwargs
as a deployment parameter using a "kwargs":{}
JSON object.
- Parameters can be edited in the Prefect UI, allowing you to override default values for ad-hoc flow runs. To do this, navigate to the deployment's details page, select "Run", and then "Custom" to provide new parameter values.
- For more information, see the Prefect 2.x deployment guide.
These steps should help you deploy your flow and manage parameters effectively in Prefect 2.x. If you have further questions or specific configurations, feel free to ask!Nate
01/22/2025, 1:37 AMprefect.yaml