2.7 KiB
Production Setup
Setting up VILLASweb for production
For development setup instructions see @ref web-development. The production setup is based on docker. Clone the frontend and backend repositories on your computer and build the Docker images for both:
Frontend
cd VILLASweb
docker build -t villasweb-frontend .
Backend
cd ..\VILLASweb-backend-go
docker build -t villasweb-backend .
WIP Docker compose and/or Kubernetes
Run the production docker-compose file:
docker-compose -f docker-compose-production.yml up -d
Configure VILLASnode to get data into VILLASweb
Install VILLASnode
See: @ref node-installation
Create a VILLASnode demo data source
- Create a new empty configuration file with the following contents and save it as
webdemo.conf
:
WIP this example configuration requires revision!
nodes = {
sine = {
type = "signal"
signal = "mixed"
values = 5
rate = 25
frequency = 5
}
web = {
type = "websocket"
destinations = [
"TODO"
]
}
}
paths = (
{
in = "sine"
out = "web"
}
)
The node sine
is a software signal generator for 5 signals.
The node web
is the websocket interface to stream the data generated by the sine
node to the browser.
Note: If you do not want to use your local system as the destination for the websocket node, change the option
destinations
of theweb
node to the destination of your production environment, for examplehttps://my.production.environment/ws/webdemo
.
Start the VILLASnode gateway
Run the following command on your system:
villas node webdemo.conf
Note: Change the path to the configuration file accordingly. The
villas
command will only work if VILLASnode is installed on your system.
Visualize real-time data in VILLASweb Dashboards
- Use the VILLASweb frontend to create a new infrastructure component for the VILLASnode gateway from above (Admin user required).
- Set the
websocketurl
parameter of the component to the target you used as theweb.destinations
parameter in the configuration from above. - Create a new scenario in VILLASweb and within that scenario create a new component configuration that uses the infrastructure component you created under 2.
- WIP: Use the signal auto-configure function to retrieve the signal configuration of the VILLASnode automatically.
- Create a new dashboard with widgets of your choice and link these widgets to the signals received from the infrastructure component.
- Enjoy what you see.