Matin
07/02/2025, 10:20 PMMarvin
07/02/2025, 10:20 PMMarvin
07/02/2025, 10:21 PMprefect.yaml
file that defines your pull step
- Run prefect deploy
to deploy your flow
2. Docker-based Alternative:
- Package your code directly into a Docker image
- The pull step becomes unnecessary since your code is already in the runtime environment
3. Local Development:
- For local development and testing, you can run flows directly without deployments using flow.serve()
- This is great for development but not recommended for production
Here's a basic example of deploying from the terminal:
bash
# Standard deployment
prefect deploy
# Or specify the path to your flow
prefect deploy path/to/your/flow.py:flow_name
The prefect.yaml
file is where you define your deployment configuration, including the pull step. Here's a minimal example:
yaml
deployments:
- name: my-deployment
entrypoint: flow.py:my_flow
work_pool:
name: my-pool
For more details on deployment configuration options, check out the deployment concepts documentation and the prefect.yaml guide.
Remember: While you can't completely eliminate the need for code retrieval in production deployments, you can simplify it by packaging your code appropriately or using container-based solutions.