Power System Blocks

Micro-services

Getting started with micro-services

Micro-services are implemented using Spring Boot and Spring Cloud, packaged as Docker images using JIB Maven plugin.

Building docker images

Clone and install powsybl-core snapshots:

git clone https://github.com/powsybl/powsybl-core.git
cd powsybl-core
mvn install

Clone the git repository.

git clone https://github.com/powsybl/powsybl-spring.git

Compile and build the docker images.

mvn -Pdocker install

The Docker images should be available in your local registry.

$ docker images
powsybl/powsybl-server-discovery                 1.0.0-SNAPSHOT                   b4aa78912a87        49 years ago        163.7 MB
powsybl/powsybl-server-discovery                 latest                           b4aa78912a87        49 years ago        163.7 MB
powsybl/powsybl-server-storage                   1.0.0-SNAPSHOT                   5d5dfdc64985        49 years ago        170.9 MB
powsybl/powsybl-server-storage                   latest                           5d5dfdc64985        49 years ago        170.9 MB
powsybl/powsybl-server-config                    1.0.0-SNAPSHOT                   33056b76b8a1        49 years ago        145.8 MB
powsybl/powsybl-server-config                    latest                           33056b76b8a1        49 years ago        145.8 MB
powsybl/powsybl-server-network                   1.0.0-SNAPSHOT                   c6d5501e3af9        49 years ago        188.1 MB
powsybl/powsybl-server-network                   latest                           c6d5501e3af9        49 years ago        188.1 MB

Four services have been built:

Services configuration

AFS configuration

Create $HOME/.itools/config.yml and add the following configuration to add a MapDB storage drive named ‘test’ (for more documentation on this configuration, please visit the MapDB storage page):

mapdb-app-file-system:
        drive-name: test
        db-file: /storage/db
        remotely-accessible: true

This file will be shared with the Storage service container.

Create the $HOME/storage directory. This directory will also be shared with the Storage service container and contains the MapDB data.

Spring config service configuration

Create the $HOME/config directory and copy all the Spring Boot service configuration files.

mkdir $HOME/config
cp powsybl-spring/config/* $HOME/config/

Starting containers

To start docker containers using docker compose:

docker-compose up

Getting Swagger documentation

Storage and Network services are documented using Swagger and are available once the containers have started (replace localhost with the docker host IP if you are using a remote docker host)