DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

SBOMs are essential to circumventing software supply chain attacks, and they provide visibility into various software components.

Related

  • Machine Learning for CI/CD: Predicting Deployment Durations and Improving DevOps Agility
  • DevOps in the Cloud - How to Streamline Your CI/CD Pipeline for Multinational Teams
  • Simplified Development With Azure DevOps
  • Exploring Cloud-Based AI/ML Services for IoT Edge Devices

Trending

  • Build AI Agents With MCP Server in C# and Run in VS Code
  • Stop Building Monolithic AI Brains, Build a Specialist Team Instead
  • From Java 8 to Java 21: How the Evolution Changed My Developer Workflow
  • Easy Integration Testing With Testcontainers
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. DevOps at the Edge: Deploying Machine Learning Models on IoT Devices

DevOps at the Edge: Deploying Machine Learning Models on IoT Devices

Deploying ML models on IoT devices using DevOps practices enables scalable, low-latency intelligence at the edge without managing cloud infrastructure.

By 
Bhanu Sekhar Guttikonda user avatar
Bhanu Sekhar Guttikonda
·
Jun. 25, 25 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
2.5K Views

Join the DZone community and get the full member experience.

Join For Free

Edge computing is redefining how we deploy and manage machine learning (ML) models. Instead of sending every data point to the cloud, DevOps at the edge brings model inference directly onto IoT devices — enabling low-latency predictions, offline operation, and improved privacy. 

However, pushing AI to a fleet of heterogeneous, resource-constrained devices introduces new complexities. This article explores how DevOps practices can be applied to edge ML deployments on IoT hardware. We will discuss key tools, walk through a hands-on example of deploying a model to an IoT device with CI/CD, and address common challenges (model versioning, limited compute, intermittent connectivity) along the way.

Edge ML and DevOps: An Overview

Running ML models on IoT and edge devices means the model inference happens on-site rather than in the cloud. For use cases ranging from smart cameras to industrial sensors, this edge approach offers clear benefits: latency is minimized by processing data locally, operations can continue even with unreliable connectivity, and sensitive raw data can remain on the device. The trade-off is that each device must host and manage the ML model itself, which can be challenging to coordinate across potentially thousands of units.

This is where DevOps — the culture and toolkit of automating and streamlining software delivery — intersects with edge ML. Traditional DevOps pipelines are designed for cloud or server deployments, but the principles hold at the edge. In fact, DevOps practices make it easier to distribute and maintain software upgrades on edge IoT devices. 

Continuous Integration/Continuous Deployment (CI/CD) pipelines can automatically push updates to devices with minimal downtime, ensuring that each device stays secure and up-to-date. Applying DevOps to edge ML means treating your ML model and edge application as continuously evolving software that needs version control, testing, and automated deployment.

Tools and Platforms for Edge ML Deployment

These tools abstract much of the complexity of fleet management, remote updates, and on-device inference:

AWS IoT Greengrass

An open-source edge runtime and cloud service for building, deploying, and managing device software. Greengrass lets you run AWS Lambda functions or containerized applications on devices and manage them from the cloud. It supports ML inference capabilities out-of-the-box, so you can deploy models (e.g., TensorFlow Lite, PyTorch models) for local predictions. 

Greengrass emphasizes modular components — you can update a machine learning model or application logic on a device remotely without needing a full firmware update. For example, a manufacturer could push a retrained anomaly detection model to thousands of factory sensors via Greengrass, and each device would start using the new model immediately. Greengrass also integrates with AWS IoT services for messaging, and it can operate offline for extended periods, buffering data and decisions until connectivity is restored.

Azure IoT Edge

A Microsoft platform that allows cloud intelligence to run on IoT devices. IoT Edge uses Docker containers to package ML models or other workloads as modules that run on edge hardware. You can remotely and securely deploy and manage these containerized workloads on your devices through Azure IoT Hub. 

Notably, Azure IoT Edge is designed to handle intermittent connectivity gracefully — the edge runtime will sync the device’s state with the cloud once a connection is reestablished, so deployments or updates that were issued during downtime are applied seamlessly when the device comes back online. This platform is ideal for scenarios such as deploying a Custom Vision AI model onto a Raspberry Pi camera, where you can wrap the model in an IoT Edge module and use IoT Hub to push it to the device. Azure IoT Edge also provides monitoring of modules and can send telemetry to Azure Monitor for DevOps visibility.

NVIDIA Jetson Devices

Jetson is a line of embedded Linux computers with powerful GPU accelerators (NVIDIA Tegra SOCs) targeted at edge AI applications. Popular models, such as Jetson Nano, TX2, or Jetson Xavier/Orin series, enable high-performance inferencing for computer vision, robotics, and more. NVIDIA provides the JetPack SDK and tools like TensorRT for optimizing models on Jetson’s GPU. 

For instance, a Jetson board in an autonomous drone runs object detection models locally. DevOps principles apply here in ensuring your build pipeline produces the correct binaries/containers for the Jetson’s ARM64 architecture and that updates are delivered reliably to devices in the field.

Raspberry Pi and Other IoT Devices

Raspberry Pi is a widely used single-board computer in IoT projects. It runs Linux and can execute lightweight ML models. While a Raspberry Pi lacks a built-in GPU for heavy acceleration, it is accessible and has a large community. DevOps at the edge with Raspberry Pis might involve containerizing applications and using a tool like Azure IoT Edge or a custom update mechanism to deploy new code/models. 

Other platforms in a similar vein include Google Coral (with an Edge TPU for ML acceleration), Intel Neural Compute Stick, or microcontroller-based solutions (for tinyML scenarios). The principles remain the same — we need a way to automate the packaging of the model and code and remotely deploy it to these devices.

CI/CD and Automation for Edge ML Deployment

With Continuous Integration (CI), the process begins when a data scientist or ML engineer updates a model (or commits new code). Models might be retrained in the cloud or updated to improve accuracy. Using CI, we can automate tasks like converting a trained model into a device-friendly format and packaging that model into an application. 

This often involves writing a Docker container or build script that encapsulates the model along with the inference logic and any dependencies. For example, if our edge app is a Python script using tflite_runtime, the CI pipeline can include a step to build a Docker image for it.

Dockerfile
 
# Dockerfile – containerize the edge ML application (e.g., for Raspberry Pi)
FROM python:3.9-slim  
RUN pip install --no-cache-dir tflite-runtime==2.7.0  # Install lightweight TFLite interpreter  
COPY model.tflite /app/model.tflite  
COPY inference_app.py /app/  
CMD ["python", "/app/inference_app.py"]  

The above Dockerfile packages a TensorFlow Lite model (model.tflite) and a Python inference script into a container image. In a real scenario, you would build this image as part of CI. If targeting a Raspberry Pi (ARM processor), the CI build process can use multi-architecture Docker images or cross-compilation to produce an ARM-compatible image. Tools like Docker Buildx or services like Azure IoT Edge Build can help create images for the correct architecture. Once built, it is pushed to a container registry.

Continuous Deployment (CD)

After a successful build, the new model or application version needs to be deployed to the edge devices. Platforms such as AWS Greengrass and Azure IoT Edge excel in this area by providing a mechanism to roll out updates remotely. 

For instance, with Azure IoT Edge, you would update a deployment manifest in IoT Hub to point your module to the new container image tag. The IoT Edge agent on each device sees the updated deployment configuration and pulls the new container image from the registry, swapping out the old model for the new one. 

This entire process can be triggered via automation (e.g., using Azure DevOps or GitHub Actions to run a deployment script once an image is published). In AWS Greengrass, you can create a new component version for your ML model or function and use the Greengrass deployment API to push it to devices. Modern CI/CD workflows and infrastructure-as-code practices allow these updates to be rolled out seamlessly and efficiently, minimizing downtime. The best practice is to do phased deployments: update a small percentage of devices first (canary release) and monitor them before a broad rollout.

AI model pipeline: trained on server, containerized, deployed via SSH to edge devices with GPUs, outputs sent to API.

AI model pipeline: trained on server, containerized, deployed via SSH to edge devices with GPUs, outputs sent to API.

Monitoring, Logging, and Maintenance at the Edge

Below are the tools to use for insights into our edge devices and models:

Device and Model Monitoring

It’s crucial to collect metrics from edge devices — both system metrics and application-specific metrics. Many IoT platforms support sending telemetry to the cloud. For example, AWS Greengrass and IoT Core can stream custom metrics or logs from devices to AWS CloudWatch or Amazon Timestream for analysis. Azure IoT Edge modules can use Azure Monitor or Application Insights to report metrics. Additionally, you might deploy monitoring agents on larger edge devices for granular data. Real-time monitoring allows operators to detect issues and to roll back or update models proactively.

Logging and Feedback

Logs from edge ML applications should be aggregated if possible. This can help in troubleshooting problems on devices that are not physically accessible. Furthermore, capturing a feedback loop — such as cases where the model’s prediction was wrong — is valuable for improvement. Some advanced setups employ a form of A/B testing at the edge, deploying a new model to a subset of devices and comparing its performance to that of the old model. DevOps pipelines can incorporate this feedback by automatically flagging when a model falls below a certain accuracy threshold in the field, triggering a retraining process.

Retraining and Model Lifecycle

Edge-deployed models will eventually become stale as data drifts. A robust MLOps process includes periodically retraining models on fresh data. DevOps automation can assist here by scheduling retraining jobs, then packaging and deploying the updated model to devices as described earlier. This continuous training-deployment cycle is sometimes called continuous model improvement. The model’s lifecycle is decoupled from the application’s lifecycle, meaning you can update the model independently of the rest of the device firmware. This separation is important for agility: you deploy the device software once, and then you can iterate on the ML model many times over its life.

Security and Configuration Management

Managing a fleet of edge devices also involves keeping software secure. DevSecOps principles should be applied – for example, signing model packages so devices verify integrity before loading them, or using secure enclaves for sensitive ML models. Configuration management tools or IoT Hub device twins can keep track of which model version each device is running. AWS IoT Core provides mechanisms for safe versioning and deployment of IoT components, allowing controlled rollouts and the ability to roll back if something goes wrong.

Hands-On Example: Deploying a Model to a Raspberry Pi (Step-by-Step)

Below is a conceptual walkthrough of how this can be achieved:

1. Develop and Train the Model

A data scientist trains the object detection model in the cloud using a large dataset. Once satisfied with the accuracy, they export the model to a format suitable for the Pi – for instance, a .tflite file. They might also quantize the model to reduce its size, knowing the Raspberry Pi has a limited CPU and no GPU.

2. Containerize the Inference Application

The development team writes a small Python application (inference_app.py) that uses the model to perform inference on camera frames. This app might use OpenCV to grab images and the TensorFlow Lite interpreter to get predictions. To simplify deployment, the team creates a Docker container using a Dockerfile. They ensure the container includes all dependencies and is built for the correct architecture. They test the container locally on a Raspberry Pi to verify it works and achieves the needed speed.

3. Set Up CI Pipeline

They use a CI tool (Jenkins, GitHub Actions, GitLab CI, etc.) to automate building the container. Whenever there’s a code change or a new model file, the pipeline triggers. It builds the Docker image, runs some automated tests (for example, a quick inference test to ensure the model file isn’t corrupt), and then pushes the image to a registry. Let’s say our registry is Azure Container Registry or Docker Hub, and the image is tagged as mycompany/edge-detector:1.0.0.

4. Deploy to IoT Devices via Platform

Now the CD part kicks in. Suppose we are using Azure IoT Edge to manage the Raspberry Pis. In Azure IoT Hub, we create a deployment manifest JSON that specifies the desired module for the devices in our fleet. We set the image URI to the new 1.0.0 tag. We can target specific devices or all devices with tags. 

Using Azure’s tooling (Azure CLI or the portal), we apply this deployment configuration. The IoT Edge agent on each Pi notices the change, pulls the new container image, and starts the updated module. The old module is stopped gracefully. 

Thanks to IoT Edge’s approach of only updating the model inside the module, we could even design it such that only the model file is swapped out to minimize download size — but in this simple case, we replaced the whole container. The devices are often configured to run on startup, so even if a Pi reboots, it will launch the IoT Edge runtime and retrieve the latest deployment info to run the correct model.

5. Monitor and Improve

Once the new model is live on all the Raspberry Pis, we monitor its performance. We may have cloud logs showing inference counts or any errors that occurred on devices. Suppose we find that one particular scenario is not performing well; the team can gather sample images from the edge and use them to retrain or fine-tune the model. This updated model would then go through the same pipeline — built, tested, and deployed. The CI/CD pipeline ensures that such updates can be rolled out regularly with minimal manual effort.

Conclusion

DevOps at the edge is a powerful approach to tame the complexity of deploying machine learning models on IoT devices. It brings discipline and automation to what could otherwise be a fragile, manual process of updating devices one by one. By leveraging platforms like AWS IoT Greengrass and Azure IoT Edge, and following best practices of CI/CD, teams can continuously deliver ML improvements to the field, whether it’s a smart camera in a city or a sensor on a remote wind turbine. We discussed how to set up pipelines that build and package models for edge hardware, how to push those updates remotely in a safe manner, and how to monitor the whole system.


Contextual design DevOps IoT Machine learning Cloud

Opinions expressed by DZone contributors are their own.

Related

  • Machine Learning for CI/CD: Predicting Deployment Durations and Improving DevOps Agility
  • DevOps in the Cloud - How to Streamline Your CI/CD Pipeline for Multinational Teams
  • Simplified Development With Azure DevOps
  • Exploring Cloud-Based AI/ML Services for IoT Edge Devices

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: