-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #435 from golioth/cohorts
Document Cohorts and Packages
- Loading branch information
Showing
31 changed files
with
468 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
id: managing-packages | ||
title: Managing packages | ||
--- | ||
|
||
A package represents a single upgradeable component on your embedded device. | ||
Each package has a list of versions, each with a version number and an artifact, | ||
as well as a description and user defined metadata fields for categorizing the | ||
package. | ||
|
||
Generally, it's recommended to make one package for each unique component in | ||
your project. For example, if two different devices in your project use the same | ||
AI model, you only need to create a single package to represent it. You can | ||
deploy the AI model package to both types of devices individually. | ||
|
||
To upgrade a package on one of your devices, you'll first need to upload the new | ||
version to Golioth as an artifact. | ||
|
||
We provide a [firmware update sample | ||
application](https://github.com/golioth/golioth-firmware-sdk/tree/main/examples/zephyr/fw_update) | ||
that can be used to test our OTA service. The sample listens for new deployment | ||
events from our backend and automatically downloads and installs them with | ||
MCUboot. | ||
|
||
Follow [the Firmware OTA Upgrade | ||
guide](/firmware/golioth-firmware-sdk/firmware-upgrade/firmware-upgrade) to | ||
build the sample application for your target board. | ||
|
||
## Creating a new package in the Golioth Web Console | ||
|
||
1. Navigate to [the packages section](https://console.golioth.io/packages) of | ||
the Golioth Web Console | ||
2. Click the `Create` button | ||
3. Fill in the relevant information: | ||
- Give the package a name (Use `main` if you're working with the firmware | ||
update sample) | ||
- Optional: Give the package a short description | ||
- Optional: Set properties to help categorize your package (e.g. `type`: | ||
`firmware`) | ||
|
||
![Creating a package](./assets/web-console-create-package.png) | ||
|
||
## Uploading a new package version in the Golioth Web Console | ||
|
||
1. Navigate to [the packages section](https://console.golioth.io/packages) of | ||
the Golioth Web Console | ||
2. Open your package in the list | ||
3. Click the `New Version` button | ||
4. Fill in the relevant information | ||
- Set the version number of your artifact (eg: `1.2.3` or `2024-Q4`) | ||
- Choose the binary you want to upload | ||
|
||
![Creating an Artifact](./assets/web-console-create-artifact.png) | ||
|
||
5. Click the `Upload Artifact` button and the new version will appear in the | ||
version list: | ||
|
||
![Version list](./assets/web-console-artifact-list.png) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
id: managing-cohorts | ||
title: Managing cohorts | ||
--- | ||
|
||
In order to deploy OTA updates to your devices, you'll need to assign them to a | ||
cohort. A cohort is a group of devices that should have the same set of | ||
packages, and receive the same firmware updates. | ||
|
||
Typically, you'll need to create a cohort for each type of device in your | ||
project. For example, if your project contains both light switches and light | ||
bulbs, you should form one "Light Switch" cohort and one "Light Bulb" cohort, so | ||
that you can manage the firmware of the two types of devices separately. You may | ||
also want to create dedicated cohorts for devices that should receive the | ||
updates early, such as internal test devices or external beta testers. | ||
|
||
## Assigning devices to a cohort | ||
|
||
There are three ways to assign a device to a cohort in the Golioth Web Console: | ||
|
||
- In the cohort's page: | ||
1. Click the `Add Devices` button in the top right corner | ||
2. Find the device you want to add to the cohort in the table | ||
3. Click the `Add` button next to your device in the table | ||
- In the Device Index: | ||
1. Select the devices you want to add using the checkboxes in the device | ||
list | ||
2. Click `Bulk Actions` in the top right corner | ||
3. Select `Assign to cohort` | ||
4. Select the right cohort and press `Assign` | ||
- In the Edit Device page: | ||
1. Click the `Edit` button in the top right corner | ||
2. Select a cohort in the `cohort` dropdown in the form | ||
3. Click `Save` | ||
|
||
If your device is online and observing the OTA manifest, it will immediately | ||
receive a manifest update and start updating its packages to match the cohort's | ||
active deployment. | ||
|
||
|
||
## Removing devices from a cohort | ||
|
||
You can remove a device from a cohort through the Device Index and the Edit | ||
Device page using the same workflow as when you added them. You can also remove | ||
the device from a cohort in the Devices tab of the cohort page by selecting the | ||
device in the table and clicking `Remove Device` in the top right corner. | ||
|
||
When you remove a device from a cohort, it stops receiving updates about its deployments. Contrary to when you added a device to a cohort, removing it will **not** prompt an immediate manifest change event on the device. | ||
|
||
:::warning Fallback to legacy releases | ||
|
||
If you have previously used the old releases concept to distribute OTA updates, | ||
devices that are removed from their cohorts will fall back to using releases as | ||
a basis for their manifest. You can avoid this by disabling rollout for all your | ||
old releases. See [the migration | ||
documentation](./5-migrating-from-releases/README.md) for more information. | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
id: deploying-updates | ||
title: Deploying Updates | ||
--- | ||
|
||
You can push OTA updates to all devices in a cohort by creating deployments. | ||
Each deployment contains a set of packages, which decide the composition of the | ||
firmware and assets on all devices in the cohort. Each cohort can only have one | ||
active deployment at a time, and deployments are always pushed to all devices in | ||
the cohort with as soon as they connect to Golioth's servers. | ||
|
||
:::info Deployments are immutable | ||
|
||
Once a deployment has been pushed to your cohort, it cannot be reverted or | ||
deleted. To roll back to a previous version of a package, you have to create a | ||
new deployment. | ||
|
||
::: | ||
|
||
The deployment history for your cohort is available in cohort's page the Golioth | ||
Web Console. Here, you can see the changes in packages and their versions from | ||
deployment to deployment. New deployments are added to the top of the list, and | ||
all packages that have been used in any of the last 10 deployments are displayed | ||
in their own column. | ||
|
||
![Deployment History](./assets/web-console-deployment-history.png) | ||
|
||
You can add and remove packages from one deployment to the next. It's up to you | ||
how you want your firmware to handle changes to the set of included packages. | ||
While it may make sense to delete the on-device copy of an asset like an image | ||
when it is removed from the OTA manifest of the active deployment, the same is | ||
usually not true for the main application firmware. | ||
|
||
Packages that don't change from one deployment to the next do not need to be | ||
downloaded again, but the device firmware should be able to handle both upgrades | ||
and downgrades of all package types. | ||
|
||
Each deployment has a sequence number that is included in the manifest of the | ||
OTA update pushed to your devices. The sequence number is strictly increasing, | ||
and can be stored by the device to determine whether an update has been handled | ||
or not. | ||
|
||
## Creating Deployments | ||
|
||
Before you create a deployment, make sure you have [uploaded the required | ||
artifacts to the Golioth Cloud](./2-managing-packages.md). | ||
|
||
1. Navigate to [the cohorts section](https://console.golioth.io/cohorts) of | ||
the Golioth Web Console | ||
2. Select the cohort you want to deploy to | ||
3. Click `Deploy` in the top right corner | ||
3. Select a name and the included packages for your deployment | ||
|
||
![Creating a Deployment](./assets/web-console-deploy.png) | ||
|
||
4. Click the `Next` button and review the changes in your deployment. | ||
|
||
![releases list](./assets/web-console-deployment-changes.png) | ||
|
||
5. Click `Start Deployment` to start distributing the update to the devices in | ||
your cohort. |
10 changes: 8 additions & 2 deletions
10
...gement/5-ota/3-release-firmware-update.md → ...rating-from-releases/2-legacy-releases.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.