Skip to content
Snippets Groups Projects
Commit c5a81663 authored by Steffen Vogel's avatar Steffen Vogel :santa_tone2:
Browse files

migrated demo setup configuration from VILLASweb repo

parents
No related branches found
No related merge requests found
[submodule "node"]
path = node
url = ../VILLASnode
[submodule "backend"]
path = backend
url = ../VILLASweb-backend
[submodule "frontend"]
path = frontend
url = ../VILLASweb
FROM nginx:stable-alpine
COPY etc/nginx/villas.conf /etc/nginx/conf.d/default.conf
FROM villas/node:latest
COPY etc/node/*.conf /etc/villas/node/
Subproject commit 13d2641b2df01052ed742ec436c9bed3df36c9f0
version: "2"
volumes:
database:
driver: local
website:
services:
# Build the frontend with node into a Docker volume
# This container does nothing useful beside providing an
# assets container to the nginx service
frontend:
build:
context: frontend
volumes:
- website:/usr/src/app/build
# The VILLASweb backend
backend:
build:
context: backend
environment:
- NODE_ENV=production
restart: always
nginx:
build:
context: .
dockerfile: Dockerfile.nginx
ports:
- "80:80"
- "443:443"
volumes:
- website:/www
# The MongoDB database for the VILLASweb backend
database:
image: mongo:latest
user: mongodb
volumes:
- database:/data/db
restart: always
user: mongodb
# VILLASnode, the gateway between UDP and WebSocket traffic
node:
build:
context: .
dockerfile: Dockerfile.node
privileged: true
restart: always
command: node /etc/villas/node/websocket-demo.conf
volumes:
- /villas:/villas
- ./etc/node:/etc/villas/node
# Web Interface for MongoDB
mongo-express:
image: mongo-express
environment:
ME_CONFIG_MONGODB_SERVER: database
ME_CONFIG_BASICAUTH_USERNAME: admin
ME_CONFIG_BASICAUTH_PASSWORD: mongo-admin
ports:
- "8081:8081"
# AMQP broker for VILLAScontroller
# broker:
# image: rabbitmq:management
# environment:
# RABBITMQ_DEFAULT_USER: "villas"
# RABBITMQ_DEFAULT_PASS: "s3c0sim4!"
# ports:
# - "8080:15672"
# - "5672:5672"
server {
listen 80 default_server;
server_name VILLASweb;
# backend location
location /api/ {
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# rewrite url to exclude /api on context broker side
rewrite ^/api/?(.*) /api/$1 break;
proxy_pass http://backend:4000/;
}
location /public {
proxy_pass http://backend:4000/public;
}
location /ws/api/ {
proxy_pass http://node/api/;
}
location /ws {
proxy_pass http://node/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# frontend location
location / {
root /www;
index index.html;
try_files $uri $uri/ /index.html;
}
# error pages
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
error_page 500 502 503 504 50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
/** Example configuration file for VILLASnode.
*
* The syntax of this file is similar to JSON.
* A detailed description of the format can be found here:
* http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files
*
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* VILLASnode
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
stats = 2;
nodes = {
file_ssA = {
type = "file",
in = {
# uri = "https://OOKc0UfswqvgRp0@rwth-aachen.sciebo.de/public.php/webdav/inl-csu/ssA_cosim_inl-csu_20170726_03-28-21.csv",
uri = "/villas/data/GenericCoSimExmp/inl-csu/ssA_cosim_inl-csu_20170726_03-28-21.csv"
eof = "rewind"
}
},
file_ssB = {
type = "file",
in = {
# uri = "https://OOKc0UfswqvgRp0@rwth-aachen.sciebo.de/public.php/webdav/inl-csu/ssB_cosim_inl-csu_20170726_03-27-19.csv",
uri = "/villas/data/GenericCoSimExmp/inl-csu/ssB_cosim_inl-csu_20170726_03-27-19.csv"
eof = "rewind"
}
}
sig_1 = {
type = "signal",
signal = "mixed",
values = 4,
rate = 50,
frequency = 0.5
stddev = 0.2
},
ws_sig = {
type = "websocket",
vectorize = 10,
},
ws_ssA = {
type = "websocket",
vectorize = 1,
},
ws_ssB = {
type = "websocket",
vectorize = 1,
}
};
############ List of paths ############
paths = (
{ in = "sig_1", out = "ws_sig", hooks = ( { type = "stats" } ) },
{ in = "file_ssA", out = "ws_ssA", hooks = ( { type = "decimate", ratio = 200 } ) },
{ in = "file_ssB", out = "ws_ssB", hooks = ( { type = "decimate", ratio = 200 } ) }
);
/** Example configuration file for VILLASnode.
*
* The syntax of this file is similar to JSON.
* A detailed description of the format can be found here:
* http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files
*
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* VILLASnode
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
nodes = {
sig_1 = {
type = "signal",
signal = "mixed",
values = 4,
rate = 25
},
ws_1 = {
type = "websocket",
description = "Demo Channel",
vectorize = 50,
source = {
simulator = "OP5600",
location = "ACS lab"
},
series = (
{ label = "Random walk", unit = "V" },
{ label = "Sine", unit = "A" },
{ label = "Rect", unit = "Var"},
{ label = "Ramp", unit = "°C" }
)
}
};
############ List of paths ############
paths = (
{
in = "sig_1",
out = "ws_1",
reverse = false
}
);
/** Example configuration file for VILLASnode.
*
* The syntax of this file is similar to JSON.
* A detailed description of the format can be found here:
* http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files
*
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* VILLASnode
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
nodes = {
ws_1 = {
type = "websocket",
description = "Demo Channel",
#vectorize = 10,
source = {
simulator = "OP5600",
location = "ACS lab"
},
series = (
{ label = "Random walk", unit = "V" },
{ label = "Sine", unit = "A" },
{ label = "Rect", unit = "Var"},
{ label = "Ramp", unit = "°C" }
)
},
udp_1 = {
type = "socket",
layer = "udp",
remote = "signal:12001"
local = "node:12000"
},
};
############ List of paths ############
paths = (
{ in = "udp_1", out = "ws_1", reverse = true }
);
Subproject commit 8abd8feb9226e8b5eb1106aae9310d48ee4221b1
Subproject commit 8c881a878a468d007fdb44fcc0ff6d9a6bbf5554
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment