0

I am trying to understand how IoT Edge devices deploy modules given a particular device deployment policy. Here is my test case:

  • On my development machine, I created a custom IoT Edge module (essentially the default CModule example from VS Code). I manually pushed the module to my Azure Container Registry and manually tagged it with 1.0.1 and with 1.0
  • I created a deployment policy which include my custom module like so
"modules": {
  "MyModule": {
    "version": "1.0",
    "type": "docker",
    "status": "running",
    "restartPolicy": "always",
    "settings": {
      "image": "<my_acr.azurecr.io>/mymodule:1.0",
      "createOptions": "{}"
    }
  }
}
  • I created an IoT Edge device which is deployed with the above custom deployment policy (I'm using tags to do that). I can see on my test machine that the /mymodule:1.0 docker image becomes available. The docker ImageID on the test machine matches the ImageID
  • On my development machine, I then modify the module very slightly and rebuild it. I tag the new module docker image with 1.0.2 and 1.0 and push the new tags to ACR. I can see in the portal that the new tags show up.
  • However, my test machine never gets the new version of the module. Docker still shows the old ImageID.

So what is the correct way to have my existing deployment policy force an update of the module version on my device? I thought that based on https://learn.microsoft.com/en-us/azure/iot-edge/how-to-update-iot-edge#understand-iot-edge-tags my module is using a rolling tagging scheme.

Paul Grinberg
  • 1,184
  • 14
  • 37

1 Answers1

2

Yes, as the stated in the like that you posted:

If you use rolling tags in your deployment then you need to force the container runtime on your device to pull the latest version of the image.

So by using rolling tags, nothing will happen on the device automatically. Because: Why should it? The devices are not monitoring your container registry for changes.

What you can actually do: If you manually pull the same image on the device again (docker pull <my_acr.azurecr.io>/mymodule:1.0), iotedge will see on the device that the image has changed. Then it will redeploy the module locally with the new image version.

silent
  • 14,494
  • 4
  • 46
  • 86
  • thank you for pointing that out. I have to ask then (tongue and check) what value does the edgeAgent provide if it doesn't something as basic as monitor versions? – Paul Grinberg Dec 12 '19 at 20:24
  • first of all, usually no docker client does that. Second: In most scenarios you do not want devices to pull a new image version without explicitly instructing them to do so via an updated deployment manifest. Also on the link above it states: "This approach [specific tags] is suggested for production purposes." – silent Dec 12 '19 at 20:26