Skip to main content
Documentation

Profile Rollouts

A device profile sets property values on the devices it is applied to, such as the update configuration dev.nexigon.ota.config. Every save of its property values creates a new revision. A profile rollout applies a revision to a profile’s devices in stages, and releases each stage only once enough devices of the earlier stages have taken the revision successfully. Use rollouts for changes that could break devices, such as a new software version, so that a faulty revision reaches a few devices instead of the whole fleet.

A device can have several profiles. They apply in order, and a value that the device sets itself takes precedence over all of them. Configure Updates for a Device Profile shows an example.

How Devices Follow a Profile

When you apply a profile to devices, you choose how the devices follow the profile’s revisions:

ModeRevision the device uses
Latest revisionEvery revision, as soon as it is saved. This is the default.
Pinned revisionOne specific revision, until you choose another one.
RolloutThe revision of the profile’s rollout, once the rollout reaches the device.

Use Latest revision for test devices that should receive every change right away, Pinned revision for devices that must stay on a known revision, and Rollout for the rest of the fleet.

A device in rollout mode changes its revision only through the profile’s rollout. When you switch a device from another mode to rollout mode, it keeps its current revision until the rollout reaches it. A device that you apply the profile to in rollout mode has no revision of the profile until then, so the profile sets no values on it.

Applying a revision to a device gives every property that the revision sets a new property version, even if its value does not change. Device software can therefore tell that a revision was applied. Property versions identify the configuration that the device read; they do not by themselves reset update attempts. To request a new round of attempts for the same software, change the update configuration’s rollout value, for example with Roll Out Again on the profile’s System Updates page. This saves a new revision; for devices in rollout mode, start a new profile rollout targeting that revision.

Rollouts

A rollout has a target revision and a list of stages. It applies the target revision to the profile’s devices in rollout mode, one stage after the other. Devices with another mode are not part of the rollout.

Each profile has at most one rollout, which stays in place until you replace it. Starting a new rollout replaces the current one, even if the current one is halted. Devices keep their revision until the new rollout reaches them.

A rollout has converged when its last stage is released, the spread of that stage has finished, and every device in it has completed or failed. The rollout’s page shows this state. A converged rollout still applies its revision to devices that join it.

A device joins the rollout when you switch it to rollout mode or apply the profile to it in rollout mode. A device leaves the rollout when you remove the profile from it, switch it to another mode, or delete it. A device that left no longer counts toward any guard.

Stages

A stage selects devices by group conditions and a percentage. For example, a rollout of a new software version could use these stages:

StageGroupsPercentage
CanaryIn canary100%
EarlyNot in critical10%
Everything100%

The Early stage leaves out the devices in the critical group, so that they only receive the revision with the rest of the fleet in Everything.

Nexigon Hub gives each device of a rollout a position between 0% and 100%, derived from the rollout and the device. A device belongs to the first stage whose group conditions it meets and whose percentage is above its position. Percentages therefore build on each other. In the example, Early contains about 10% of the devices outside the canary and critical groups, and Everything contains all remaining devices.

Percentages and the shares of guards can have fractions, such as 0.5%. In a large fleet, a fraction keeps an early stage small, and a guard such as at least 99.5% completed tolerates a few devices that stay offline.

Each rollout assigns new positions, so a percentage stage selects different devices in each rollout. Use groups to select the same devices every time, as the Canary stage does. A device keeps its stage for the lifetime of the rollout, even if its groups change.

Devices that match no stage are not part of the rollout. The web interface always ends a rollout with a stage that contains all remaining devices.

Device Status

Each device in a rollout has one of these statuses:

StatusMeaning
PendingThe rollout has not reached the device yet.
ActiveNexigon Hub has applied the target revision. Its outcome is still open.
CompletedIts completion expression returned true, or none was configured.
FailedIts failure expression returned true.

A device becomes active when Nexigon Hub applies the revision, also while the device is offline. The rollout re-applies the target revision even if a device already uses it, then evaluates completion and failure normally. Completed and failed are final.

Completion and Failure Expressions

Whether an active device has completed or failed is decided by two expressions of the rollout, which Nexigon Hub evaluates for each active device. Besides properties and now, they can read the variable rollout:

VariableValue
rollout.writes[name].versionFor each property that the revision sets, the property version that applying it created.

For example, these expressions track system updates. The update integration reports the version of dev.nexigon.ota.config that it last read as configVersion, together with the state that results from it:

// Completion
properties["dev.nexigon.ota.status"].value.configVersion
    >= rollout.writes["dev.nexigon.ota.config"].version
  && properties["dev.nexigon.ota.status"].value.state == "completed"
// Failure
properties["dev.nexigon.ota.status"].value.configVersion
    >= rollout.writes["dev.nexigon.ota.config"].version
  && properties["dev.nexigon.ota.status"].value.failureCount >= 3

The failure expression waits for three failed attempts, because the update integration retries failed updates and a device marked as failed stays failed.

The rules are:

  • If an expression evaluates to true, the device completes or fails. If both do, the device fails.
  • An expression error, for example because the device has not reported a status yet, counts as false for that expression. A true failure expression fails the device; otherwise, a true completion expression completes it. If neither is true, the device stays active.
  • Once a device has completed or failed, Nexigon Hub stops evaluating its expressions.
  • Without a completion expression, a device completes as soon as it becomes active. Without a failure expression, a device never fails. A failure expression therefore requires a completion expression.

Without expressions, devices complete right away, so only spreads and soak times separate the stages.

A write is recorded even if another profile or the device’s own value takes precedence for the property. The device then keeps acting on the same value, and the expressions see the device’s state for that value.

Releasing Stages

Starting a rollout releases its first stage. The devices of a released stage become active, unless the rollout is halted.

A stage can spread its devices over a period of time. With a spread of 10 hours, Nexigon Hub activates the stage’s devices evenly over 10 hours, in an order derived from the rollout and the device, so about 10% of them become active per hour. Without a spread, all devices of the stage become active right away. A device that joins a released stage becomes active at its time in the spread, or right away if that time has passed.

Each stage after the first has a guard with three conditions. Nexigon Hub releases the stage once all of them pass:

ConditionDefaultPasses when
Completed100%At least this share of the devices in earlier stages has completed.
Failed0%At most this share of the devices in earlier stages has failed.
Soak timeNoneAt least this time has passed since the previous stage’s spread finished or, without a spread, since its release.

The shares refer to all devices in earlier stages, whatever their status. An offline device therefore holds back the next stage until it completes, so that an outage of the canary devices cannot pass for a successful canary. Devices that join an earlier stage later also count. A stage is never released before the spread of the previous stage has finished.

If the earlier stages contain no devices, the shares cannot hold anything back, and the guard passes once its soak time has passed. This happens when a rollout starts before any device is in rollout mode, or when a percentage stage selects no device of a small fleet. Devices that join later then receive the revision without waiting for a canary.

The guard rounds in the cautious direction. With 7 devices in earlier stages and a completed share of 90%, all 7 devices must complete. With a failed share of 10%, no device may fail. With the default failed share of 0%, a single failed device holds back all further stages.

Failures never stop a stage that is already released. Halt the rollout to stop the spread of a stage.

You can release the next stage manually at any time while the rollout is not halted, for example when a few devices of an earlier stage are offline for good. A manual release skips the guard and the wait for the previous stage’s spread.

Halting a Rollout

Halting a rollout stops it from applying the target revision to further devices. Pending devices keep their revision, including devices whose time in a spread comes up, and no stage is released. Devices that are already active keep the target revision, and Nexigon Hub keeps evaluating their expressions. Nexigon Hub never halts a rollout by itself.

Resuming the rollout continues where it stopped. The clocks of spreads and soak times do not advance while the rollout is halted.

Roll Out a Revision

  1. Open the profile under Profiles in the project’s sidebar and open its Rollout page.
  2. Choose Start Rollout, or Start New Rollout if the profile already has a rollout. The dialog then notes that the new rollout replaces the current one, and starts with the current rollout’s stages and expressions.
  3. Choose the target revision.
  4. Define the stages. For each stage, set its group conditions, percentage, and spread, and for each stage after the first, its guard.
  5. Enter the completion and failure expressions. For system updates, choose Use System Update Expressions to fill in the expressions shown above. Without expressions, only spreads and soak times separate the stages.
  6. Choose Start Rollout.

Before you start the first rollout, apply the profile to the devices in rollout mode: choose Apply to Devices on the profile’s Devices page and choose the Rollout mode. To change the mode of a single device, choose Edit profiles on the device. Devices that you apply the profile to in rollout mode receive no values from it until a rollout reaches them.

The Rollout page shows the stages, the status of each device, and whether the rollout has converged. Use Halt, Resume, and Release Next Stage to control the rollout.

To roll back, start a new rollout with an earlier revision as its target. The dialog keeps the stages and expressions of the current rollout, so you only need to choose the revision. A rollback with a single stage reaches all devices at once, while more stages protect against a faulty earlier revision but take longer to reach the devices that need the rollback.