IPSM Docker deployment – installation

Structure of the repository

The ipsm-deployment repository contains the following files and folders

  • certs – sample (self-signed) SSL certificates used by the Apache Kafka container
  • certs-client – sample SSL client crtificate, used by the IPSM container
  • kafka-scripts – initialization script for the Apache Kafka container
  • environment – files with definitions of various environment variables providing configuration for the Docker containers.
  • docker-compose.yml – definition of the IPSM deployment (to be used with Docker Compose).
  • readme.md – this file

Installation process

The IPSM deployment requires a working Docker installation. The process has been tested on both Linux and Windows, using Docker (version 17.09.0-ce) and Docker Compose (version 1.17.0). It is advisable to install both tools manually, as described on the main Docker site, and not rely on versions found in third-party repositories, as they tend to be outdated.

First clone the repository.

git clone https://git.inter-iot.eu/Inter-IoT/ipsm-deployment
cd ipsm-deployment

Important! Edit the environment/kafka_vars.env file and change the 10.0.2.15 IP address to the IP address of your deployment machine (don't use localhost nor 127.0.0.1).

The other configuration options contained in the environment/*.env files can be left unchanged if the deployment does not explicitly require changing them.

Before invoking docker-compose one additional step is required. You need to create named volumes for holding IPSM and Apache Kafka data, security certificates, and container initialization scripts.

Under Linux (OS-X)

bash initialize-volumes.sh

Under Windows using the Powershell window:

.\initialize-volumes.ps1

If the deployment takes place under Windows make sure that the drive containing the cloned repository files has been "shared" via Docker->Settings->Shared Drives.

Before the final step, make sure that you are [logged into the Inter-IoT private Docker registry] (https://git.inter-iot.eu/Inter-IoT/commons/wiki/How+to+push+and+pull+Inter-IoT+private+docker+registry). Finally, to build the images, create and start containers execute the following command.

docker-compose up -d

Upon the first startup IPSM will produce log messages (see Accessing logs below) similar to:

ipsm_1  | hh:mm:ss – ERROR eu.interiot.ipsm.core.Main$ – DB initialization failed: null
ipsm_1  | hh:mm:ss – ERROR eu.interiot.ipsm.core.Main$ – Shutting down IPSM

There is nothing to worry about, though. IPSM uses SQLite for persisting its internal data (alignments and channel configurations) and upon the first startup the necessary file is not present. It gest created and IPSM accesses it just fine upon its automatic restart. The only downside is a small delay caused by the restart. Fortunately, it should only happen at the first startup.

To make sure that everything went as expected use your browser to access the IPSM REST API swagger interface. Both swagger interface and the IPSM REST API are by default available on port 8888.

SSL configuration

By default, the Apache Kafka and IPSM utilize SSL certificates contained in the certs and certs-client folders, respectively. Also the INTER-MW deployment configuration uses the same client certificate by default, so you don't need to make any changes here. A detailed description of the SSL configuration for Apache Kafka can be found in the official documentation.

Accessing logs

Logs of any of the IPSM deployment components can be accessed via docker-compose. You need to be in the main directory of the cloned repository (i.e., the one containing the docker-compose.yml file). To see the logs for a specific container issue the command

docker-compose logs container-name

where "container-name" is one of: zookeeper, kafka, and ipsm. If you want to inspect, for example, just 100 most recent lines of the ipsm logfile, use the --tail option as follows:

docker-compose logs --tail="100" ipsm