Valohai triggers enable you to schedule the execution of an existing pipeline at specific time intervals, such as running a pipeline every Monday at 09:00. Here’s how to set up a trigger:
- Go to project settings.
- Navigate to the Triggers tab.
- Provide a title for your trigger (e.g., “Daily retraining” or “Every 4 hours”).
-
Select “Scheduled (Cron)” as the condition and click “Add” to configure the schedule.
- You can choose from preset options or select “Custom.”
- For instance, a custom value like “0 0/4 * * 1-7” will run the pipeline every 4 hours on every day of the week.
-
In the “Actions” column, select the appropriate action and click “Add.”
- “Copy Pipeline” reruns the same pipeline version.
- “Run Pipeline” executes the pipeline with the latest version fetched to Valohai.
- “Source Commit Reference” can be set to “main” to always run with the latest pipeline from your main branch.
- “Pipeline Name” is the name of the pipeline specified in your valohai.yaml.
- “Pipeline Title” is the title used in the UI and API results.
-
Finally, click “Create trigger” to set up your scheduled pipeline execution.
Cron maker
You can define custom schedules using cron expressions. To generate the correct expression, you can utilize tools like cronmaker.