<@ULVA73B9P> if I am deploying a flow through the ...
# ask-marvin
g
@Marvin if I am deploying a flow through the cli, will it automatically update my prefect.yaml file with the deployment configuration?
m
thought for 17.0 seconds
No, the
prefect deploy
command does not automatically update your prefect.yaml file. The relationship actually works in the opposite direction - the prefect.yaml file serves as the source of configuration that the CLI command reads from, not writes to. When you want to modify your deployment configuration, you'll need to: 1. Manually edit the prefect.yaml file with your desired changes 2. Run
prefect deploy
to apply those changes The prefect.yaml file acts as a declarative configuration file that defines how your flows should be deployed. You can find detailed information about configuring your prefect.yaml file in the deployment configuration documentation. This design ensures that your deployment configuration remains explicit and version-controlled, rather than being modified automatically by CLI commands. It's rather like having a recipe book - you modify the recipe first, then cook from it, rather than having the cooking process modify your recipe.
g
@Marvin I am specifying a schedule on my prefect.yaml, but I am not seeing it show up on the deployment in the UI. Only when I go through the cli prompt for scheduling does it show in the UI. the issue doing it this way is that the schedule won't be on the yaml file, but it will be on the deployment
m
thought for 52.1 seconds
I see what's happening. There are a couple of important points to address here: 1. The correct way to specify schedules in your prefect.yaml file should look something like this:
Copy code
yaml
deployments:
  - name: your-deployment-name
    schedules:
      - interval: 3600  # for interval schedules (in seconds)
        # OR
      - cron: "0 * * * *"  # for cron schedules
        # OR
      - rrule: "FREQ=DAILY;INTERVAL=1"  # for rrule schedules
2. There's a known behavior where deployment updates can sometimes override UI-configured values. This is currently being addressed by the Prefect team (as evidenced by recent GitHub discussions). To ensure your schedule appears correctly: 1. Make sure your schedule is properly indented under the correct deployment in the yaml file 2. Use
prefect deploy
without going through the interactive CLI prompts (which can override your yaml configurations) 3. Verify the schedule appears in the UI after deployment If you're still not seeing the schedule appear, could you share your prefect.yaml configuration (with any sensitive information removed)? That would help me identify if there might be a syntax issue. As a temporary workaround, if you need to maintain both the UI-configured schedule and the yaml configuration, you can: 1. First deploy using your yaml file 2. Then add additional schedules through the UI 3. When you need to update other aspects of the deployment, be careful not to override the schedules The Prefect team is working on improvements to make this behavior more intuitive, including potential options to preserve UI-configured values during deployment updates.