Scheduling

By default, a newly-created application won't run on any devices. To run the application on your devices, you need to schedule it.

By navigating to the Scheduling tab on your application (Applications > [application] > Scheduling), you can see what devices an application has been scheduled to.

You can deploy applications in three ways:

  1. No devices
  2. All devices
  3. Conditional scheduling

The first two options are intuitive. It's possible you may not need anything else. However, if you need more flexibility, conditional scheduling gives you much more control over which devices an application can be scheduled to.

Conditional Scheduling

We can use conditional scheduling to schedule to a subset of devices, based on the labels on those devices.

To use conditional scheduling, a scheduling rule needs to be set. A scheduling rule is a collection of "filters" that restrict which devices an application should run on. Filters consist of multiple label conditions such as canary=true or customer=stark-industries.

You may have an idea of how to use this. If you're not sure what use cases it might be useful for, you probably don't need it, but read on to see an example of where it might be useful.

During this example, we'll talk about filters, in the context of scheduling rules. If you'd like to find more detailed documentation on them, you can look here.

In addition, we offer the option of pinning releases, which allows you to schedule more stable versions of your application to high-priority devices, or select a group of devices for canary deployments.

An Example

Imagine that you have a project that has 2 different device types: x86 servers, and Raspberry Pis. Different applications should run on the x86 servers versus the Raspberry Pis.

Labeling your devices

After adding your devices into the project, you'll need to label each one to group the types of devices.

Labeling your server devices

  1. From the list of devices, select the device that is one of the servers.
  2. Select the device to get the details of the device.
  3. Add a device label, i.e. type=server.
  4. Repeat this for all devices that are servers.

Labeling your Raspberry Pi devices

  1. From the list of devices, select the device that is one of the Raspberry Pis.
  2. Select the device to get the details of the device.
  3. Add a device label, i.e. type=rpi.
  4. Repeat this for all devices that are Raspberry Pis.

Deploying applications

Next we'll add two applications: one designed to run on the servers and one designed to run on the Raspberry Pis. It makes sense to set a scheduling rule before creating the first release of the application so that the containers will be scheduled to the correct devices as soon as they're first deployed.

Creating your application for your servers

  1. Create a new application.
  2. Add a scheduling rule with a single filter containing the condition type=server. This scheduling rule will only deploy the application to any device that has the type=server label on it.
  3. Create the first release of the application.
  4. The release will only be deployed to any devices that have the type=server.

Creating your application for your Raspberry Pis

  1. Create a new application.
  2. Add a scheduling rule with a single filter containing the condition type=rpi. This scheduling rule will only deploy the application to any device that has the type=rpi label on it.
  3. Create the first release of the application.
  4. The release will only be deployed to any devices that have the type=rpi.

Deploying new releases

Now that the devices are split by device type, you can add releases to your application, which will always be released only to the device with the matching labels.

Adding more devices

As you add more devices into the project, the application will only be deployed onto devices that have the corresponding label. These labels could either be manually added after the device is registered or automatically added during registration by using registration tokens.