Application Overview
In the rapidly evolving landscape of edge computing, efficient device management and orchestration are paramount. This application note explores the use of the Ansible Automation Platform to streamline the deployment of edge AI applications. By leveraging Ansible’s capabilities, we demonstrate a robust and repeatable method for deploying and managing complex edge infrastructures. This approach addresses the challenges of scalability, heterogeneity, and rapid deployment inherent in edge environments. Through detailed instructions and practical examples, this guide empowers technical professionals to effectively harness automation, optimize resource utilization, and accelerate the delivery of cutting-edge AI solutions at the edge.
The Demo Application: “OnLogos”
For this example note, we’ll be showcasing an AI demo application that can detect “OnLogic” logos. This demo application is written in Python and uses a USB camera with a YOLO object detection model that has been trained on a custom dataset to detect the OnLogic logo in its various forms. The processed image frames are then sent to an RTSP server in order to view the live camera feed. Both the server and client of our application are packaged into Podman containers, and hosted via private registry.
Hardware Selection & Setup
HX401
For the edge device deployment, the Helix 401 (HX401) industrial computer was selected for its small form factor and performance. The Intel® 12th Generation Alder Lake-P SoC makes it an excellent choice for Edge AI applications.
AC101
Additionally, in this example, the Axial AC101 edge server is used for hosting the RTSP server that our edge endpoints connect to, in order to provide a live view of what the HX401 was seeing from the attached USB camera.
Hardware Specs
AC101
- Intel Core i9-13900E
- 64GB (2x 32GB) ECC DDR5 4800 MHz Memory
- 960GB Micron NVMe SSD
- Nvidia RTX A4000
- Red Hat Enterprise Linux 9.2 with Podman installed
HX401
- Intel Core i7-1240PE
- 32GB (2x16GB) DDR5 4800 MHz Memory
- 128GB Transcend NVMe SSD
- Red Hat Enterprise Linux 8.8 with Podman installed
Network Configuration
- 1GbE Port 1: DHCP, Connected to Internet (for Ansible Automation Connectivity)
- 1GbE Port 2: Static IP (10.10.15.1, Connected to HX401)
Getting Started with Ansible Automation Platform
Install Ansible Automation Platform
Red Hat provides a deployment planning guide along with installation instructions to set up an ansible automation platform server with (you guessed it) an Ansible Playbook. Ansible Automation Platform can be deployed either in the cloud, or on premises depending on your organization’s infrastructure. In this case, Ansible Automation Platform was deployed on premises on another AC101 we had in the office.
Import an Automation Project from a Git Repository
To start off, the first thing required is to import an automation project within the Ansible Automation Platform. The procedure noted below will step through this process.
1. Login to the Ansible Automation Platform web console.
2. Navigate to the “Projects” page.
3. Create a new project, providing a name and optional description.
4. In the project configuration, select the Git repository option and input the Git repository URL, specifying the branch and path if needed.
5. In the example shown, a GitLab HTTPS deploy token is appended to the front of the URL for authentication to an internal GitLab server.
6. Save the project configuration and initiate the sync process to pull in the content from the Git repository. Verify the successful import of playbooks and roles within the Ansible Automation Platform interface.
Add Credentials
Ansible Automation Platform provides a centralized and secure way to manage credentials, such as usernames and passwords, necessary for accessing target systems. In this case, Linux PAM credentials, required for SSH and sudo access to the devices, are the relevant credentials that need to be added to the interface.
Create Inventories
1. Navigate to the “Inventories” section.
2. Click “Add” and click on the “Inventories” tab in the main navigation menu. This will take you to the inventories management page.
Define Hosts
Within the inventory, you’ll need to define hosts (individual machines or servers) and groups (collections of hosts).
1. Add hosts by specifying their IP addresses or hostnames. For this case, two inventories are being created, one for the HX401, and one for the AC101.
Assign Variables
Variables can be assigned at several different levels (host, group, inventory, etc.). In this application, variables are being assigned at the inventory level, as there are two discrete inventories for the edge device and RTSP server.
Review the created inventory to ensure all hosts and groups are accurately defined. There are built-in tools to test the connectivity and configuration of the hosts within the inventory.
Create A Job Template
Job templates serve as blueprints for job execution, encapsulating the details of playbooks, inventories, and job options.
1. Navigate to the “Templates” section, and select “Add Job Template” under the “Add” dropdown.
2. Fill in the required information, including a name and description. Specify the playbook that the template will execute, and designate the target hosts by choosing an inventory source. Customize the job template further by configuring options such as credentials, project settings, and runtime parameters, then click save. The completed job template should now encapsulate all the necessary details for executing the automation task in a repeatable manner.
Deploy the Application
After running the jobs, the application should now be exposing an RTSP stream at the location specified in the job template:
Verifying the Application was Deployed
From our AC101 platform, we can ensure that the AI vision application container was deployed to the HX401 by attempting to open the RTSP video stream. To do so, we can use the popular VLC media player application to open the video stream as follows:
1. Open VLC media player and navigate to Media, the select Open Network Stream
2. Input your RTSP URL into the open field, e.g rtsp://<hostname-or-ip-here>:8554
3. Next, press the Play button, and the RTSP stream should open.
Confirming our application is loaded on the HX401, here is a view of the stream from VLC, demonstrating that both the RTSP container and the vision application have deployed successfully!
Interested in exploring how the Ansible Automation Platform can transform your edge AI deployments? Contact the OnLogic team today or visit www.onlogic.com/ai.