You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-edge/iot-edge-modules.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,8 +19,8 @@ Azure IoT Edge lets you deploy and manage business logic on the edge in the form
19
19
20
20
* A **module image** is a package containing the software that defines a module.
21
21
* A **module instance** is the specific unit of computation running the module image on an IoT Edge device. The module instance is started by the IoT Edge runtime.
22
-
* A **module identity** is a piece of information (including security credentials) stored in IoT Hub, that is associated to each module instance.
23
-
* A **module twin** is a JSON document stored in IoT Hub, that contains state information for a module instance, including metadata, configurations, and conditions.
22
+
* A **module identity** is a piece of information (including security credentials) stored in IoT Hub that is associated to each module instance.
23
+
* A **module twin** is a JSON document stored in IoT Hub that contains state information for a module instance, including metadata, configurations, and conditions.
24
24
25
25
## Module images and instances
26
26
@@ -63,7 +63,6 @@ await client.OpenAsync();
63
63
// Get the module twin
64
64
Twintwin=awaitclient.GetTwinAsync();
65
65
```
66
-
67
66
## Offline capabilities
68
67
69
68
Azure IoT Edge modules can operate offline indefinitely after syncing with IoT Hub at least once. IoT Edge devices can also extend this offline capability to other IoT devices. For more information, see [Understand extended offline capabilities for IoT Edge devices, modules, and child devices](offline-capabilities.md).
Copy file name to clipboardExpand all lines: articles/iot-edge/production-checklist.md
+52-1Lines changed: 52 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,7 @@ Once your IoT Edge device connects, be sure to continue configuring the Upstream
88
88
* Reduce memory space used by the IoT Edge hub
89
89
* Use correct module images in deployment manifests
90
90
* Be mindful of twin size limits when using custom modules
91
+
* Configure how updates to modules are applied
91
92
92
93
### Be consistent with upstream protocol
93
94
@@ -148,13 +149,38 @@ If you deploy a large number of modules, you might exhaust this twin size limit.
148
149
- Store any configuration in the custom module twin, which has its own limit.
149
150
- Store some configuration that points to a non-space-limited location (that is, to a blob store).
150
151
151
-
## Container management
152
+
::: moniker range=">=iotedge-1.4"
153
+
### Configure how updates to modules are applied
154
+
When a deployment is updated, Edge Agent receives the new configuration as a twin update. If the new configuration has new or updated module images, by default, Edge Agent sequentially processes each module:
155
+
1. The updated image is downloaded
156
+
1. The running module is stopped
157
+
1. A new module instance is started
158
+
1. The next module update is processed
159
+
160
+
In some cases, for example when dependencies exist between modules, it may be desirable to first download all updated module images before restarting any running modules. This module update behavior can be configured by setting an IoT Edge Agent environment variable `ModuleUpdateMode` to string value `WaitForAllPulls`. For more information, see [IoT Edge Environment Variables](https://github.com/Azure/iotedge/blob/main/doc/EnvironmentVariables.md).
161
+
162
+
```JSON
163
+
"modulesContent": {
164
+
"$edgeAgent": {
165
+
"properties.desired": {
166
+
...
167
+
"systemModules": {
168
+
"edgeAgent": {
169
+
"env": {
170
+
"ModuleUpdateMode": {
171
+
"value": "WaitForAllPulls"
172
+
}
173
+
...
174
+
```
175
+
::: moniker-end
176
+
### Container management
152
177
153
178
* **Important**
154
179
* Use tags to manage versions
155
180
* Manage volumes
156
181
* **Helpful**
157
182
* Store runtime containers in your private registry
183
+
* Configure image garbage collection
158
184
159
185
### Use tags to manage versions
160
186
@@ -194,6 +220,31 @@ Next, be sure to update the image references in the deployment.template.json fil
194
220
195
221
`"image": "<registry name and server>/azureiotedge-hub:1.1",`
196
222
223
+
::: moniker range=">=iotedge-1.4"
224
+
### Configure image garbage collection
225
+
Image garbage collection is a feature in IoT Edge v1.4 and later to automatically clean up Docker images that are no longer used by IoT Edge modules. It only deletes Docker images that were pulled by the IoT Edge runtime as part of a deployment. Deleting unused Docker images helps conserve disk space.
226
+
227
+
The feature is implemented in IoT Edge's host component, the `aziot-edged` service and enabled by default. Cleanup is done every day at midnight (device local time) and removes unused Docker images that were last used seven days ago. The parameters to control cleanup behavior are set in the `config.toml` and explained later in this section. If parameters aren't specified in the configuration file, the default values are applied.
228
+
229
+
For example, the following is the `config.toml` image garbage collection section using default values:
230
+
231
+
```toml
232
+
[image_garbage_collection]
233
+
enabled = true
234
+
cleanup_recurrence = "1d"
235
+
image_age_cleanup_threshold = "7d"
236
+
cleanup_time = "00:00"
237
+
```
238
+
The following table describes image garbage collection parameters. All parameters are **optional** and can be set individually to change the default settings.
239
+
240
+
| Parameter | Description | Required | Default value |
| `enabled` | Enables the image garbage collection. You may choose to disable the feature by changing this setting to `false`. | Optional | true |
243
+
| `cleanup_recurrence` | Controls the recurrence frequency of the cleanup task. Must be specified as a multiple of days and can't be less than one day. <br><br> For example: 1d, 2d, 6d, etc. | Optional | 1d |
244
+
| `image_age_cleanup_threshold` | Defines the minimum age threshold of unused images before considering for cleanup and must be specified in days. You can specify as *0d* to clean up the images as soon as they're removed from the deployment. <br><br> Images are considered unused *after* they've been removed from the deployment. | Optional | 7d |
245
+
| `cleanup_time` | Time of day, *in device local time*, when the cleanup task runs. Must be in 24-hour HH:MM format. | Optional | 00:00 |
0 commit comments