robosapiensIO backend with Docker Tutorial
Goal: This tutorial will walk you through the steps to set up the robosapiensIO backend using Docker and Docker Compose. This can be used when manually running (e.g. using main.py) self-adaptive applications instead of the generated docker containers or for experimenting purpose.
Tutorial level: Beginner
Time: 5-10 minutes
Background
The robosapiensIO backend, used to develop and commission trustworthy self-adaptive systems using the RoboSAPIENS Adaptive Platform architecture, is provided as a multi-container Docker application. It includes the following services bundled in a Docker Compose configuration:
EMQX Enterprise MQTT Broker
Redis
A standalone robosapiensIO backend is provided for experimenting purposes or to run the self-adaptive applications in a manual way (e.g. using main.py).
Prerequisites
Git: Make sure Git is installed on your machine. You can install it from Git’s official website.
Docker: Make sure Docker is installed and running on your machine. You can install it from Docker’s official website.
Docker Compose: Make sure Docker Compose is installed and running on your machine. You can install it from Docker Compose installation page.
Tasks
Clone the repository
Open a terminal and run the following commands:
git clone https://github.com/BertVanAcker/rpio-backend-docker.git cd rsio-backend-docker
Start the services using Docker Compose
After pulling the git repository, you can run the robosapiensIO backend using
docker composecommand:docker compose up --detach
Here’s what each flag does:
--detach: Runs the container in detached mode.
Verify that the services are running
You can check that Redis Stack is running by connecting to it with the
redis-cli:docker exec -it redis redis-cli
Run a basic command to confirm connectivity, such as:
PING
If the response is
PONG, Redis Stack is up and running.You can check that the EMQX MQTT broker is running by running the following command:
docker exec -it emqx emqx ping
If the response is
pong, EMQX MQTT broker is up and running.
Summary
You have successfully set up robosapiensIO on Docker and is now ready to be used.