Deploying sample applications in containers
Deploying sample applications in containers¶
The Automotive SIG repo contains containerized sample applications that you can use to learn how to deploy applications in containers in your AutoSD image.
Use the quadlet_radio_engine.aib.yml manifest to build a virtual machine OS image that includes containerized sample applications.
The sample applications include two SOME/IP services:
radio-service
, which simulates a radioengine-service
that simulates other parts of the car.
There is also a command line application radio-client
, which talks to the services displaying the current status and allowing you to control the
radio. For more information, see the sample-apps README.
The image uses the COVESA vsomeip implementation of SOME/IP as
packaged in Fedora, and
rebuilt in COPR. In particular, the image starts the vsomeip
routing manager
(non-contained), using systemd socket activation with a custom
SELinux policy that controls access.
After you boot the OS image, two container-based systemd sample services are running: radio.service
and engine.service
.
Prerequisites
- You have installed the Automotive image builder utility by following the instructions in
-
You have installed QEMU by following the instructions in the QEMU documentation.
Procedure
-
Create and go to a new directory called
sample-auto-apps
:console $ mkdir sample-auto-apps && cd sample-auto-apps
-
Create and save a file called
radio.container
that contains the following code:console --8<-- "demos/radio.container"
-
Create and save a file called
engine.container
that contains the following code:console --8<-- "demos/engine.container"
-
Create and go to a new subdirectory called
quadlet_radio_engine
:console $ mkdir quadlet_radio_engine && cd quadlet_radio_engine
-
Create and save a build manifest file named
quadlet_radio_engine.aib.yml
, that contains the following YAML code:console --8<-- "demos/quadlet_radio_engine/quadlet_radio_engine.aib.yml:4:46"
-
Export the current system's CPU architecture as a variable:
console $ arch=$(arch)
-
Run the following command to build the OS image:
console --8<-- "demos/quadlet_radio_engine/build.sh:20:29"
-
Boot the OS image as a virtual machine (VM) in QEMU:
console $ sudo automotive-image-runner --nographics quadlet_radio_engine.x86_64.img
-
Log in to the VM as the
root
user with the passwordpassword
. -
Verify that the auto-apps container exists:
```console
podman image list¶
```
-
Verify that the radio service is running:
```console
systemctl status radio.service¶
```
-
Verify that the engine service is running:
```console
systemctl status engine.service¶
```
-
When you are done, run the following command to shut down the VM and return to your local terminal:
```console
poweroff¶
```