How to start and stop containers based on vehicle motion

Paul Lee 106 Reputation points
2023-02-21T11:03:07.2833333+00:00

I am trying to start and stop containers using an custom orchestrator container. The orchestrator container starts different ML containers based on vehicle motion. The reason for starting and stopping due to the model size and hardware limitation of the edge platform. If I setup one of the ml container to stop by default using azure iot but start the ml container using my custom orchestrator, would azure iot stop the ml container from running? I guess I will have the similar issue with k3s. My other solution for deployment is to use azure devops and each device runs as an agent, and part of an agent pool. Using the release pipeline to create a staged deployment. The issue if the device is offline (no 4g), I will need to figure out which device did not receive the updates.

Azure IoT Edge
Azure IoT Edge

An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.

Azure IoT Hub
Azure IoT Hub

An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.

0 comments No comments

2 answers

Sort by: Newest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

  2. Sander van de Velde | MVP 37,006 Reputation points MVP
    2023-02-21T11:45:55.5933333+00:00

    Hello @Paul Lee ,

    you want to be able to stop and start modules/containers and you want to deploy different modules for different devices.

    regarding starting and stopping devices, Azure IoT Edge works with a Deployment manifest in which is stated which modules are started or stopped.

    You could try to start modules locally (with some logic running next to the Azure IoT Edge runtime) but this will probably be overruled by Azure IoT Edge.

    One solution is to send the motion information to the cloud, to an IoT Hub, and have an Azure Function control the device deployment manifest. (see the status property)

    On the other hand, is it possible to keep the modules running but keep them in idle/sleep mode (not executing logic except for waiting to start doing stuff again)? Then you only need to turn the motion information into commands/routes messages into controlling the idle/sleep mode of the logic within the modules.

    Also notice the answer from @Satish , the deployment manifest also offers manipulating the restart policy for individual modules.

    Regarding the deployment of logic at scale, check out layered deployments offered for Azure IoT Edge devices. based on context text (what are the abilities of devices), different (partial) deployments are sent. You can even see the impact (how many devices are targeted, how many have picked it up).

    I'm not sure if there is a pipeline job for requesting this data but it's available using the API.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.