Skip to content

Commit 5037a6b

Browse files
committed
Updat update doc
1 parent fb48976 commit 5037a6b

File tree

8 files changed

+54
-35
lines changed

8 files changed

+54
-35
lines changed
43.2 KB
Loading
105 KB
Loading
24.7 KB
Loading
100 KB
Loading
49.8 KB
Loading

docs/manage/software/deploy-software.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ languages: []
1010
viamresources: []
1111
platformarea: ["registry", "fleet"]
1212
level: "Intermediate"
13-
date: "2024-08-28"
13+
date: "2025-02-05"
1414
aliases:
1515
- /how-tos/deploy-packages/
1616
- /manage/software/deploy-packages/
@@ -37,7 +37,7 @@ If at least some of your machine control logic should run on your machine, place
3737

3838
{{% alert title="OTA updates for microcontrollers" color="note" %}}
3939
The following steps do not cover how to create a module with machine control logic for microcontrollers.
40-
For microcontrollers, see [Micro-RDK modules](/operate/get-started/other-hardware/micro-module) and [Over-the-air firmware updates](/operate/get-started/other-hardware/micro-module/#over-the-air-updates) instead.
40+
For microcontrollers, see [Micro-RDK modules](/operate/get-started/other-hardware/micro-module/) and [Over-the-air firmware updates](/operate/get-started/other-hardware/micro-module/#over-the-air-updates) instead.
4141
{{% /alert %}}
4242

4343
{{< table >}}
@@ -60,7 +60,7 @@ Follow the prompts, selecting the following options:
6060
In the example snippets below, the namespace is `naomi`.
6161
- Resource to be added to the module: `Generic Component`.[^generic]
6262
- Model name: Your choice, for example `control-logic`
63-
- Enable cloud build: Choose `Yes` if you are using GitHub or want to make use of cloud build.
63+
- Enable cloud build: Choose `Yes` if you are using GitHub or want to use cloud build.
6464
- Register module: `Yes`
6565

6666
Press the Enter key and the generator will create a folder for your control logic component.
@@ -81,7 +81,7 @@ Be sure to also implement logic to handle subsequent calls to the reconfigure me
8181

8282
For example, in Python, start your logic in <FILE>src/main.py</FILE>:
8383

84-
```python {class="line-numbers linkable-line-numbers" data-line="15-23"}
84+
```python {class="line-numbers linkable-line-numbers" data-line="19-26"}
8585
# Add these imports
8686
import asyncio
8787
from threading import Event
@@ -90,6 +90,7 @@ from viam.logging import getLogger
9090

9191
LOGGER = getLogger("control-logic")
9292

93+
9394
class ControlLogic(Generic, EasyResource):
9495
MODEL: ClassVar[Model] = Model(
9596
ModelFamily("naomi", "my-control-logic"), "control-logic"
@@ -101,7 +102,8 @@ class ControlLogic(Generic, EasyResource):
101102
# Other methods omitted for brevity
102103

103104
def reconfigure(
104-
self, config: ComponentConfig, dependencies: Mapping[ResourceName, ResourceBase]
105+
self, config: ComponentConfig,
106+
dependencies: Mapping[ResourceName, ResourceBase]
105107
):
106108
# starts automatically
107109
if self.running is None:
@@ -174,7 +176,7 @@ For complete examples that implement control logic, see:
174176

175177
Once you have implemented your control logic, commit and push your changes to a GitHub repository.
176178

177-
If you are not using GitHub, see [Upload your module](/operate/get-started/other-hardware/#upload-your-module) and [Update an existing module](/other-hardware/manage-modules/#update-an-existing-module) for more information on alternatives.
179+
If you are not using GitHub, see [Upload your module](/operate/get-started/other-hardware/#upload-your-module) and [Update an existing module](/operate/get-started/other-hardware/manage-modules/#update-an-existing-module-using-a-github-action) for more information on alternatives.
178180

179181
Follow the steps in [Upload your module](/operate/get-started/other-hardware/#upload-your-module) using cloud build.
180182

docs/manage/software/update-software.md

+45-28
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@ weight: 40
55
layout: "docs"
66
type: "docs"
77
description: "As new versions of software modules or ML models become available, you can update the deployed version on all machines in one go."
8+
date: "2025-02-05"
89
aliases:
910
- /manage/software/update-packages/
1011
---
1112

1213
If you have already [deployed software](/manage/software/deploy-software/), you can inspect the fragment you have created.
13-
The JSON object for the deployed package has a `version` field.
14+
The JSON object for the deployed module or package has a `version` field.
15+
Unless the `version` field is set to a specific version, some or all updates for that module or package can happen automatically.
1416

15-
As new versions of software modules or ML models become available, you can update the deployed version in one go using the fragment.
16-
TODO - might auto update?
17+
To perform other updates or changes to the configuration of all machines using the fragment:
18+
19+
1. [Test your updates](#test-updates)
20+
2. [Update the software version and roll out the changes](#update-the-software-version)
21+
3. [Check the status of your machines](#check-machine-status)
1722

1823
We strongly recommend that you test updates on a subset of machines before deploying it to all machines.
1924

@@ -41,26 +46,32 @@ Paste the JSON object from your primary fragment.
4146
{{% tablestep %}}
4247
**2. Edit the fragment**
4348

44-
Change the version of your package in the development fragment.
49+
Change the version of your module or package in the development fragment.
4550
For example:
4651

47-
```json {class="line-numbers linkable-line-numbers" data-line="16"}
52+
```json {class="line-numbers linkable-line-numbers" data-line="22"}
4853
{
49-
"services": [
54+
"components": [
55+
{
56+
"api": "rdk:component:camera",
57+
"attributes": {},
58+
"model": "rdk:builtin:fake",
59+
"name": "camera-1"
60+
},
5061
{
51-
"name": "speech-1",
52-
"namespace": "viam-labs",
53-
"type": "speech",
54-
"model": "viam-labs:speech:speechio",
55-
"attributes": {}
62+
"api": "rdk:component:generic",
63+
"attributes": {},
64+
"model": "naomi:my-control-logic:control-logic",
65+
"name": "generic-1"
5666
}
5767
],
68+
"debug": true,
5869
"modules": [
5970
{
71+
"module_id": "naomi:my-control-logic",
72+
"name": "naomi_my-control-logic",
6073
"type": "registry",
61-
"name": "viam-labs_speech",
62-
"module_id": "viam-labs:speech",
63-
"version": "0.5.3"
74+
"version": "0.0.7"
6475
}
6576
]
6677
}
@@ -78,7 +89,7 @@ If you had configured them already with the primary fragment, remove that fragme
7889
**4. Test the new version**
7990

8091
Test the new version of your package.
81-
When you are satisfied that your package works as expected, continue to [update your primary fragment](#update-a-package-version).
92+
When you are satisfied that your package works as expected, continue to update your primary fragment.
8293

8394
{{% /tablestep %}}
8495
{{< /table >}}
@@ -103,37 +114,43 @@ Click **Save** in the upper right corner of the screen.
103114
**2. Test the new version**
104115

105116
Test the new version of your package.
106-
When you are satisfied that your package works as expected, continue to [update your primary fragment](#update-a-package-version).
117+
When you are satisfied that your package works as expected, continue to [update your primary fragment](#update-the-software-version).
107118

108119
{{% /tablestep %}}
109120
{{< /table >}}
110121

111122
{{% /tab %}}
112123
{{< /tabs >}}
113124

114-
## Update a package version
125+
## Update the software version
115126

116-
Once you have confirmed that the new version of your package works, go to your primary fragment and edit it to use the new version of your package.
127+
Once you have confirmed that the new version of your module or package works, go to your primary fragment and edit it to use the new version.
117128

118129
For example:
119130

120-
```json {class="line-numbers linkable-line-numbers" data-line="16"}
131+
```json {class="line-numbers linkable-line-numbers" data-line="22"}
121132
{
122-
"services": [
133+
"components": [
134+
{
135+
"api": "rdk:component:camera",
136+
"attributes": {},
137+
"model": "rdk:builtin:fake",
138+
"name": "camera-1"
139+
},
123140
{
124-
"name": "speech-1",
125-
"namespace": "viam-labs",
126-
"type": "speech",
127-
"model": "viam-labs:speech:speechio",
128-
"attributes": {}
141+
"api": "rdk:component:generic",
142+
"attributes": {},
143+
"model": "naomi:my-control-logic:control-logic",
144+
"name": "generic-1"
129145
}
130146
],
147+
"debug": true,
131148
"modules": [
132149
{
150+
"module_id": "naomi:my-control-logic",
151+
"name": "naomi_my-control-logic",
133152
"type": "registry",
134-
"name": "viam-labs_speech",
135-
"module_id": "viam-labs:speech",
136-
"version": "0.5.3"
153+
"version": "0.0.7"
137154
}
138155
]
139156
}

docs/operate/get-started/other-hardware/micro-module.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ There is no way to roll back to previous firmware after a bad upgrade without re
285285
{{% /alert %}}
286286
287287
{{% alert title="Tip" color="tip" %}}
288-
To update the firmware version for a group of microcontrollers at the same time, you can [create a fragment](/manage/software/deploy-packages/) with the OTA service configuration and apply it to multiple machines.
288+
To update the firmware version for a group of microcontrollers at the same time, you can [create a fragment](/manage/software/deploy-software/) with the OTA service configuration and apply it to multiple machines.
289289
Then, whenever you update the `version` field in the fragment, the version will be updated for each machine that has that fragment in its config, triggering a firmware update the next time the devices fetch their configs.
290290
{{% /alert %}}
291291

0 commit comments

Comments
 (0)