Configure
In this section you will learn how to (re)configure a server
The vantage6-server requires a configuration file to run. This is a yaml file with specific contents. You can create and edit this file manually. To create an initial configuration file you can also use the configuration wizard: vserver new.
The directory where to store the configuration file depends on you operating system (OS). It is possible to store the configuration file at system or at user level. By default, server configuration files are stored at system level. The default directories per OS are as follows:
OS
System
User
Windows
C:\ProgramData\vantage6\server
C:\Users\<user>\AppData\Local\vantage6\server\
MacOS
/Library/Application Support/vantage6/server/
/Users/<user>/Library/Application Support/vantage6/server/
Ubuntu
/etc/xdg/vantage6/server/
~/.config/vantage6/server/
The command vserver looks in certain directories by default. It is possible to use any directory and specify the location with the --config flag. However, note that using a different directory requires you to specify the --config flag every time!

Configuration file structure

Each server instance (configuration) can have multiple environments. You can specify these under the key environments which allows four types: dev ,test, acc and prod . If you do not want to specify any environment, you should only specify the key application (not within environments) .
We use DTAP for key environments. In short:
  • dev Development environment. It is ok to break things here
  • test Testing environment. Here, you can verify that everything works as expected. This environment should resemble the target environment where the final solution will be deployed as much as possible.
  • acc Acceptance environment. If the tests were successful, you can try this environment, where the final user will test his/her analysis to verify if everything meets his/her expectations.
  • prod Production environment. The version of the proposed solution where the final analyses are executed.
1
application:
2
...
3
environments:
4
test:
5
6
# Human readable description of the server instance. This is to help
7
# your peers to identify the server
8
description: Test
9
10
# Should be prod, acc, test or dev. In case the type is set to test
11
# the JWT-tokens expiration is set to 1 day (default is 6 hours). The
12
# other types can be used in future releases of vantage6
13
type: test
14
15
# IP adress to which the server binds. In case you specify 0.0.0.0
16
# the server listens on all interfaces
17
ip: 0.0.0.0
18
19
# Port to which the server binds
20
port: 5000
21
22
# API path prefix. (i.e. https://yourdomain.org/api_path/<endpoint>)
23
api_path: /api
24
25
# The URI to the server database. This should be a valid SQLAlchemy URI,
26
# e.g. for an Sqlite database: sqlite:///database-name.sqlite,
27
# or Postgres: postgresql://username:[email protected]/database).
28
uri: sqlite:///test.sqlite
29
30
# This should be set to false in production as this allows to completely
31
# wipe the database in a single command. Useful to set to true when
32
# testing/developing.
33
allow_drop_all: True
34
35
# The secret key used to generate JWT authorization tokens. This should
36
# be kept secret as others are able to generate access tokens if they
37
# know this secret. This parameter is optional. In case it is not
38
# provided in the configuration it is generated each time the server
39
# starts. Thereby invalidating all previous distributed keys.
40
# OPTIONAL
41
jwt_secret_key: super-secret-key! # recommended but optional
42
43
# Settings for the logger
44
logging:
45
46
# Controls the logging output level. Could be one of the following
47
# levels: CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET
48
level: DEBUG
49
50
# Filename of the log-file, used by RotatingFileHandler
51
file: test.log
52
53
# Whether the output is shown in the console or not
54
use_console: True
55
56
# The number of log files that are kept, used by RotatingFileHandler
57
backup_count: 5
58
59
# Size in kB of a single log file, used by RotatingFileHandler
60
max_size: 1024
61
62
# format: input for logging.Formatter,
63
format: "%(asctime)s - %(name)-14s - %(levelname)-8s - %(message)s"
64
datefmt: "%Y-%m-%d %H:%M:%S"
65
66
# Configure a smtp mail server for the server to use for administrative
67
# purposes. e.g. allowing users to reset their password.
68
# OPTIONAL
69
smtp:
70
port: 587
71
server: smtp.yourmailserver.com
72
username: your-username
73
password: super-secret-password
74
75
# If algorithm containers need direct communication between each other
76
# the server also requires a VPN server. (!) This must be a EduVPN
77
# instance as vantage6 makes use of their API (!)
78
# OPTIONAL
79
vpn_server:
80
# the URL of your VPN server
81
url: https://your-vpn-server.ext
82
83
# OATH2 settings, make sure these are the same as in the
84
# configuration file of your EduVPN instance
85
redirect_url: http://localhost
86
client_id: your_VPN_client_user_name
87
client_secret: your_VPN_client_user_password
88
89
# Username and password to acccess the EduVPN portal
90
portal_username: your_eduvpn_portal_user_name
91
portal_userpass: your_eduvpn_portal_user_password
92
93
prod:
94
...
Copied!

Configuration wizard

The most straight forward way of creating a new server configuration is using the command vserver new which allows you to configure most settings. See the structure what each settings represents.
screenshot when the command vserver new is invoked.
By default, the configuration is stored at system level, which makes this configuration available for all users. In case you want to use a user directory you can add the --user flag when invoking the vserver new command.

Update configuration

To update a configuration you need to modify the created YAML file. To see where this file is located you can use the command vserver files . Do not forget to specify the flag --system in the case of a system-wide configuration or the flag --user in case of a user-level configuration.

Local test setup

If the nodes and the server run at the same machine, you have to make sure that the node can reach the server.
Windows and (intel) Mac Setting the server IP to 0.0.0.0 makes the server reachable at your localhost (this is also the case when the dockerized version is used). In order for the node to reach this server, set the server_url setting to host.docker.internal.
On the M1 mac the local server might not reachable from your nodes as host.docker.internal does not seem to refer to the host machine. Reach out to us on Discourse for a solution if you need this!
Linux You should bind the server to 0.0.0.0. In the node configuration files, you can then use 172.17.0.1, assuming you use the default docker network settings.
Last modified 29d ago