-
Notifications
You must be signed in to change notification settings - Fork 1
SymbIoteCloud from docker
This document explains how to run the symbIoTe cloud for L1/L2 integration depending on your needs. There are two ways to run docker:
- directly (on linux)
- docker-machine (previously boot2docker) - in virtual machine
This influences how to expose port in virtual machine to local machine. So, there are 2 ways to run ngrok and 2 ways to expose port in production environment.
When getting the platform configuration you have to enter the following options:
- Compliance Level: L1 or L2 (depending on the compliance level desired)
- Deployment Type: Docker
- docker (18.03.x),
- docker-compose (1.21.x),
- docker-machine (0.14.x),
- bash,
- curl
mkdir symbiote-cloud
- change to that directory (e.g.
cd symbiote-cloud
) - unzip the configuration files to the directory from the .zip downloaded earlier
- copy the docker-compose files for the desired compliance level:
- docker-compose-swarm-L1.yml and docker-compose-prod-swarm-L1.yml for L1 integration. Also, docker-compose-ngrok-swarm-L1.yml to run ngrok.
- docker-compose-swarm-L2.yml and docker-compose-prod-swarm-L2.yml for L2 integration. Also, docker-compose-ngrok-swarm-L2.yml to run ngrok.
- Uncomment and configure the proxy settings in the docker compose files for L1/L2 (docker-compose-swarm-L1.yml, docker-compose-swarm-L2.yml) if you are behind a proxy.
- example of implementation of ResourceAccessProxyPlugin:
-
Obtain certificate as described in https://github.com/symbiote-h2020/SymbioteCloud/wiki/2.1-Configuration-of-NGINX#2111-obtaining-the-ssl-certificate
-
Create dir nginx-certificates
$ mkdir nginx-certificates
-
Copy certificates to nginx-certificates
$ sudo cp /etc/letsencrypt/live/{your domain}/fullchain.pem nginx-certificates
$ sudo cp /etc/letsencrypt/live/{your domain}/privkey.pem nginx-certificates
-
-
Run
docker swarm init
if the node is not a swarm manager. We use the swarm mode so that secrets are encrypted during transit and at rest. Docker secrets are only available to swarm services and not to standalone containers. -
Run:
-
docker stack deploy -c docker-compose-swarm-L1.yml -c docker-compose-prod-swarm-L1.yml -c docker-compose-swarm-custom.yml symbiote-app
to deploy the application in L1 compliance or -
docker stack deploy -c docker-compose-swarm-L2.yml -c docker-compose-prod-swarm-L2.yml -c docker-compose-swarm-custom.yml symbiote-app
for L2 compliance. You can change the name of the service stack (symbiote-app) to be used.
-
-
You can run:
-
docker stack ls
to list the stack and check the number of services used. -
docker image ls
to check that all images have been created. It may take a while to pull all the images from DockerHub for the first time. -
docker service ls
to list the services and check their status. Wait until the actual number of tasks (replicas) for each service is not 0. -
docker logs <container_name> -f
to get access to and follow the logs of a service. A component is ready when a message similar to 'Started <component_name> in 105.045 seconds (JVM running for 112.933)' appears in the logs of the container. -
sudo service docker restart
to restart the docker service if needed and repeat the steps.
-
-
Run
docker stack rm symbiote-app
to stop the application and remove the service stack. Services, networks, and secrets associated with the stack will be removed. -
You can run
docker swarm leave --force
to leave the swarm.
- Obtain certificate as described previously
- The following command maps
- port 443 in default docker-machine (localhost:443) to
- local computer at port 443 on all interfaces (0.0.0.0:443)
docker-machine ssh default -L 0.0.0.0:443:localhost:443
- Run steps 2-6 as described previously in Section 2.1.
Before starting with hackathon environment you need to install ngrok (https://github.com/symbiote-h2020/SymbioteCloud/wiki/2.1-Configuration-of-NGINX#2121-ngrok).
- Run
-
docker stack deploy -c docker-compose-swarm-L1.yml -c docker-compose-ngrok-swarm-L1.yml -c docker-compose-swarm-custom.yml symbiote-app
to deploy the application in L1 compliance or -
docker stack deploy -c docker-compose-swarm-L2.yml -c docker-compose-ngrok-swarm-L2.yml -c docker-compose-swarm-custom.yml symbiote-app
for L2 compliance.
-
- You can run:
-
docker stack ls
to list the stack and check the number of services used. -
docker image ls
to check that all images have been created. It may take a while to pull all the images from DockerHub for the first time. -
docker service ls
to list the services and check their status. Wait until the actual number of tasks (replicas) for each service is not 0. -
docker logs <container_name> -f
to get access to and follow the logs of a service. A component is ready when a message similar to 'Started <component_name> in 105.045 seconds (JVM running for 112.933)' appears in the logs of the container. -
sudo service docker restart
to restart the docker service if needed and repeat the steps.
-
- Run
docker stack rm symbiote-app
to stop the application and remove the service stack. Services, networks, and secrets associated with the stack will be removed.
Before starting with hackathon environment you need to install ngrok (https://github.com/symbiote-h2020/SymbioteCloud/wiki/2.1-Configuration-of-NGINX#2121-ngrok).
- Run
docker swarm init
if the node is not a swarm manager. - Run
docker-machine ssh default -L 0.0.0.0:8102:localhost:8102
. - Run
-
docker stack deploy -c docker-compose-swarm-L1.yml -c docker-compose-ngrok-swarm-L1.yml -c docker-compose-swarm-custom.yml symbiote-app
to deploy the application in L1 compliance or -
docker stack deploy -c docker-compose-swarm-L2.yml -c docker-compose-ngrok-swarm-L2.yml -c docker-compose-swarm-custom.yml symbiote-app
for L2 compliance.
-
- You can run:
-
docker stack ls
to list the stack and check the number of services used. -
docker image ls
to check that all images have been created. It may take a while to pull all the images from DockerHub for the first time. -
docker service ls
to list the services and check their status. Wait until the actual number of tasks (replicas) for each service is not 0. -
docker logs <container_name> -f
to get access to and follow the logs of a service. A component is ready when a message similar to 'Started <component_name> in 105.045 seconds (JVM running for 112.933)' appears in the logs of the container. -
sudo service docker restart
to restart the docker service if needed and repeat the steps.
-
- Run
docker stack rm symbiote-app
to stop the application and remove the service stack. Services, networks, and secrets associated with the stack will be removed.
2.5. Manage resources
3.1. Security
3.2. Search for resources
During development and testing of RAP plugin it is convenient to run it in IDE on local machine. In that case follow steps in this document.
Getting Started
Migration to 3.0.0
Migration to Docker
-
Preparation steps
1.1. Register user and configure platform in symbIoTe Core
1.2. Installation of required tools for symbIoTe platform components
1.3. Downloading jars
1.4. Downloading sources -
Configuring and starting components
2.1. Configuration of NGINX
2.2. Starting third party tools that are prerequisite for symbIoTe
2.3. Starting (generic) symbIoTe Cloud components
2.4. Configuration of cloud components
2.4.1. Starting symbIoTe Cloud components
2.5. Setting up the Platform Authentication and Authorization Manager (PAAM)
2.6. Starting Registration Handler and resource management
2.7. Set up of Resource Access Proxy
2.8. Manage resources
2.9. Set up of the Monitoring component
2.10. Other configuration topics -
Test integrated resource
3.1. Security
3.2. Search for resources
3.3. Obtaining resource access URL
3.4. Accessing the resource and actuating and invoking service for default (dummy) resources -
Creating RAP plugin
4.1. Customizing internal RAP plugin
4.2. Using RAP plugin starter
4.3. Creating RAP plugin in other languages -
Resource Description Examples
5.1. JSON Description Examples
5.2. RDF Description Examples - Preparation for L2 compliance
-
Configuring and starting components for L2
7.1. Starting Federation Manager
7.2. Starting Subscription Manager
7.3. Starting Platform Registry
7.4. Starting Trust Manager
7.5. Starting Bartering And Trading
7.6. Starting SLA Manager
7.7. Create a federation
7.8. Manage resources in L2
7.9. Register Subscription - Test Integrated L2 Resources
- Developing symbIoTe enabled apps