qruise flow schedule
Submit a flow for scheduled execution.
Syntax¶
Description¶
The qruise flow schedule
command schedules a flow for automated, periodic execution without any human intervention. The flows can be executed either by the QruiseOS infrastructure or locally.
Options¶
Option |
Description |
---|---|
|
Path of the flow definition file for scheduling the flow. Default: |
|
If specified, the flow is scheduled for execution on the user's machine. |
|
The knowledge base branch to be used by the flow. Can also be set using the
|
|
If specified, the flow results will not be merged to the integration branch. |
|
Limit the flow run to only specified qubits. If no qubits are specified, all qubits defined in the flow file will be used. Must have the list format. |
|
Execute only notebooks with ordinal numbers greater than or equal to the number specified. |
|
Execute only notebooks with ordinal numbers less than or equal to the number specified. |
|
Interval at which the flow should be run. Cannot be specified at the same time as The value must be a string consisting of a numeral and a unit without whitespaces, e.g. |
|
Schedule on which the flow should be run, in a
cron-like format. Cannot be specified at the
same time as |
|
Specify time zone for the cron schedule in a
tz database format. If
specified, Default: |
|
Docker base image tag to be used. |
|
Version of the Docker image to be used. If specified, |
|
If specified, the provided image will be used as-is and pulled at runtime. |
|
If specified, scheduling is prepared but no further action is taken. Overwrites the content already present. |
|
If specified, the flow is prepared for execution in the same directory and not copied. Cannot be
specified at the same time as |
|
Specifies path of the build directory for the flow, where Default: |
|
Show a help message and exit. |
Environment variables¶
Variable |
Description |
---|---|
|
Default knowledge base to be used by the flow. See the |
|
If set to |
|
Default schedule to be used by the flow. See the |
|
Default interval to be use by the flow. See the |
|
Default Docker base image tag to be used. See the |
Examples¶
Scheduling a nightly calibration run¶
Regular calibration of the QPU is crucial for smooth and high-fidelity operation. When you finish the development of your calibration flow (and test it using the qruise flow run
command), you can schedule it using a single Qruise CLI command.
Suppose your flow file is located in $HOME/flows/my-flow.yaml
and you want it to run every day at 1:00 UTC during a daily downtime window. To achieve that, simply run (using the same cron-like format to define the time):
In this case, you don't need to specify the time zone as UTC is the default. However, if your device is located in a different time zone, you can specify it using the --time-zone
option. For instance, if you operate from Berlin, Germany, you can run:
qruise flow schedule --flow-file $HOME/flows/my-flow.yaml --schedule "0 1 * * *" --time-zone Europe/Berlin
Modifying flow parameters¶
When you schedule a flow, it will use parameter values as defined in the flow definition file. To change them, you can simply modify the flow file, but sometimes it's desirable to change them during scheduling without actually touching the flow file. For this reason, qruise flow schedule
allows you to override certain parameters, as described by the following table:
Parameter | Command line option |
---|---|
qubits | -q, --qubits |
start position | -s, --start |
end position | -e, --end |
KB intergration branch | -b, --branch |
skip merging results | -m, --no-merge |
See the Options section for a detailed description of each parameter.
As an example, assume you have a flow file my-flow.yaml
located in your current working directory, which has the following features:
- four different qubits:
Q1
,Q2
,Q3
, andQ4
- experiments with ordinal numbers 10 to 80
Now let's assume you want to schedule this flow but want it to:
- run for
Q1
andQ4
qubits only - run only experiments numbered 15 to 75
You can achieve this by running
Range specification
The range specified by --start
and --end
is inclusive on both ends. Thus, passing --start 15
and --end 75
will result in both notebooks 15 and 75 being executed (as well as everything in between).
Customising Docker image¶
Similarly to changing flow parameter default values, you might want to change the Docker image used as a base for building the flow container or its version.
For instance, assume that your base image is simply ubuntu
, version 22.04
. However, you'd like to see if your flow would work with another version of this container, say 24.04
. You can do this by simply running
where we assumed that the flow file is located in ./my-flow.yaml
. Similarly, if you wanted to switch the base from ubuntu
to, say, jupyterhub/jupyterhub
, you can achieve it with the following:
Scheduling flows on a local machine¶
You can use a local machine for scheduling flows. You can achieve this by using the --local
flag:
This will schedule the flow defined in $HOME/flows/my-flow.yaml
to run locally every day at 1:00 UTC, until the process is exited either by closing the shell window or pressing Ctrl+C
.