|
| 1 | +AutoSD MCO LoLa Demo |
| 2 | +==================== |
| 3 | + |
| 4 | +## Background and Basic Info |
| 5 | + |
| 6 | +This demo build an AutoSD image using [Automotive-Image-Builder](https://gitlab.com/CentOS/automotive/src/automotive-image-builder). |
| 7 | +This image comes pre-populated with the S-core's [communication](https://github.com/eclipse-score/communication) project packaged as RPM in a [COPR](https://copr.fedorainfracloud.org/coprs/pingou/score-playground/) repository as well as the [QM](https://github.com/containers/qm) project. |
| 8 | + |
| 9 | +The image is pre-configured to allow the communication project to send and receive messages within the root partition but also between the root partition and the QM partition. |
| 10 | + |
| 11 | + |
| 12 | +Some things to know about this demo: |
| 13 | +- The RPM packaging, currently, doesn't rely on Bazel. This is something that is being fixed, but in the current stage it is not there yet. |
| 14 | +- Baselibs and communication have had to get some patches, some of which have already been sent upstream: |
| 15 | + - Missing headers: https://github.com/eclipse-score/communication/pull/64 |
| 16 | + - Missing headers: https://github.com/eclipse-score/baselibs/pull/19 |
| 17 | + - Compilation issues on newer GCC + support for Linux ARM64: https://github.com/eclipse-score/baselibs/pull/22 |
| 18 | + - Fix dangling references and compiler warnings for newer GCC: https://github.com/eclipse-score/communication/pull/68 |
| 19 | + - Fix Google benchmark main function scope: https://github.com/eclipse-score/communication/pull/67 |
| 20 | +- Other changes have not yet been sent upstream: |
| 21 | + - Add the ability to configure the path where communication opens the shared memory segments: https://github.com/eclipse-score/communication/commit/127a64f07f48e1d69783dc20f217da813115dbe6 (not the final version of this change) |
| 22 | + |
| 23 | +The goal of this last commit is to avoid having to mount the entire `/dev/shm` into the QM partition and instead mount just a subfolder: `/dev/shm/lola_qm`. |
| 24 | + |
| 25 | + |
| 26 | +## Building It |
| 27 | + |
| 28 | +A linux system is required to build this image but Ubuntu |
| 29 | +and an OCI compliant container manager (docker, podman) should be enough. |
| 30 | + |
| 31 | +Download the builder script: |
| 32 | + |
| 33 | +``` |
| 34 | +$ curl -o auto-image-builder.sh \ |
| 35 | + "https://gitlab.com/CentOS/automotive/src/automotive-image-builder/-/raw/main/auto-image-builder.sh" |
| 36 | +$ chmod +x automotive-image-builder |
| 37 | +``` |
| 38 | + |
| 39 | +Build a qemu image by running: |
| 40 | + |
| 41 | +``` |
| 42 | +sudo ./auto-image-builder.sh build \ |
| 43 | +--define-file vars-devel.yml \ |
| 44 | +--target qemu \ |
| 45 | +--export qcow2 \ |
| 46 | +--distro autosd10 lola-demo.aib.yml \ |
| 47 | +autosd10-lola-x86_64.qcow2 |
| 48 | +``` |
| 49 | + |
| 50 | +Change the image perms (if needed) since `sudo` was used: |
| 51 | + |
| 52 | +``` |
| 53 | +sudo chown $(logname) autosd10-lola-x86_64.qcow2 |
| 54 | +``` |
| 55 | + |
| 56 | +## Running/Testing the Demo |
| 57 | + |
| 58 | +You can run the qcow2 image with your qemu tool of choice and login into the image (either directly or over ssh) |
| 59 | +with `root / password` (developer access defined by `vars-devel`). |
| 60 | + |
| 61 | +The image contains Systemd service defintions for LoLa, in both host and QM environemnts: |
| 62 | + |
| 63 | +- lola-ipc-sub.service |
| 64 | +- lola-ipc-pub.service |
| 65 | + |
| 66 | +They can be used in the same environment or between them, to exemplify its mixed critical orchestration integration. |
| 67 | + |
| 68 | +For example, to run the publisher in the host environment while receiving messages in the QM one: |
| 69 | + |
| 70 | + |
| 71 | +Start the subscriber in the QM partition: |
| 72 | + |
| 73 | +``` |
| 74 | +# start the service |
| 75 | +podman exec -it qm systemctl start lola-ipc-sub |
| 76 | +
|
| 77 | +# check status |
| 78 | +podman exec -it qm systemctl status lola-ipc-sub |
| 79 | +
|
| 80 | +# get logs |
| 81 | +podman exec -it qm journalctl -u lola-ipc-sub.service |
| 82 | +``` |
| 83 | + |
| 84 | + |
| 85 | +Start a publisher in the host environment: |
| 86 | + |
| 87 | +``` |
| 88 | +systemctl start lola-ipc-pub |
| 89 | +``` |
| 90 | + |
| 91 | +Check the QM process logs again with: |
| 92 | + |
| 93 | +``` |
| 94 | +podman exec -it qm journalctl -u lola-ipc-sub.service |
| 95 | +``` |
0 commit comments