vantage6-node#
Node
class#
ServerContext
class#
- class ServerContext(instance_name, environment='prod', system_folders=True)#
Server context
- Parameters:
instance_name (str) – Name of the configuration instance, corresponds to the filename of the configuration file.
environment (str, optional) – DTAP environment to load from the configuration file, by default S_ENV
system_folders (bool, optional) – System wide or user configuration, by default S_FOL
- INST_CONFIG_MANAGER#
alias of
ServerConfigurationManager
- classmethod available_configurations(system_folders=True)#
Find all available server configurations in the default folders.
- Parameters:
system_folders (bool, optional) – System wide or user configuration, by default S_FOL
- Returns:
The first list contains validated configuration files, the second list contains invalid configuration files.
- Return type:
Tuple[List, List]
- classmethod config_exists(instance_name, environment='prod', system_folders=True)#
Check if a configuration file exists.
- Parameters:
instance_name (str) – Name of the configuration instance, corresponds to the filename of the configuration file.
environment (str, optional) – DTAP environment that needs to be present, by default S_ENV
system_folders (bool, optional) – System wide or user configuration, by default S_FOL
- Returns:
Whether the configuration file exists or not
- Return type:
bool
- property docker_container_name: str#
Unique name of the docker container.
- Returns:
Unique docker container name
- Return type:
str
- classmethod from_external_config_file(path, environment='prod', system_folders=True)#
Create a server context from an external configuration file. External means that the configuration file is not located in the default folders but its location is specified by the user.
- Parameters:
path (str) – Path of the configuration file
environment (str, optional) – DTAP environment to be loaded, by default S_ENV
system_folders (bool, optional) – System wide or user configuration, by default S_FOL
- Returns:
Server context object
- Return type:
- get_database_uri()#
Obtain the database uri from the environment or the configuration. The VANTAGE6_DB_URI environment variable is used by the Docker container, but can also be set by the user.
- Returns:
string representation of the database uri
- Return type:
str
NodeContext
class#
- class NodeContext(instance_name, environment='application', system_folders=False, config_file=None)#
Node context
See DockerNodeContext for the node instance mounts when running as a dockerized service.
- Parameters:
instance_name (str) – Name of the configuration instance, corresponds to the filename of the configuration file.
environment (str, optional) – DTAP environment to be loaded, by default N_ENV
system_folders (bool, optional) – _description_, by default N_FOL
config_file (str, optional) – _description_, by default None
- INST_CONFIG_MANAGER#
alias of
NodeConfigurationManager
- classmethod available_configurations(system_folders=False)#
Find all available server configurations in the default folders.
- Parameters:
system_folders (bool, optional) – System wide or user configuration, by default N_FOL
- Returns:
The first list contains validated configuration files, the second list contains invalid configuration files.
- Return type:
Tuple[List, List]
- classmethod config_exists(instance_name, environment='application', system_folders=False)#
Check if a configuration file exists.
- Parameters:
instance_name (str) – Name of the configuration instance, corresponds to the filename of the configuration file.
environment (str, optional) – DTAP environment that needs to be present, by default N_ENV
system_folders (bool, optional) – System wide or user configuration, by default N_FOL
- Returns:
Whether the configuration file exists or not
- Return type:
bool
- property databases#
Dictionary of local databases that are available for this node.
- Returns:
dictionary with database names as keys and their corresponding paths as values.
- Return type:
dict
- property docker_container_name: str#
Unique Docker container name of the node.
- Returns:
Unique Docker container name
- Return type:
str
- property docker_network_name: str#
Private Docker network name which is unique for this node.
- Returns:
Docker network name
- Return type:
str
- property docker_ssh_volume_name: str#
Docker volume in which the SSH configuration is stored.
- Returns:
Docker voluem name
- Return type:
str
- docker_temporary_volume_name(run_id)#
Docker volume in which temporary data is stored. Temporary data is linked to a specific run. Multiple algorithm containers can have the same run id, and therefore the share same temporary volume.
- Parameters:
run_id (int) – run id provided by the server
- Returns:
Docker volume name
- Return type:
str
- property docker_volume_name: str#
Docker volume in which task data is stored. In case a file based database is used, this volume contains the database file as well.
- Returns:
Docker volume name
- Return type:
str
- property docker_vpn_volume_name: str#
Docker volume in which the VPN configuration is stored.
- Returns:
Docker volume name
- Return type:
str
- classmethod from_external_config_file(path, environment='application', system_folders=False)#
Create a node context from an external configuration file. External means that the configuration file is not located in the default folders but its location is specified by the user.
- Parameters:
path (str) – Path of the configuration file
environment (str, optional) – DTAP environment to be loaded, by default N_ENV
system_folders (bool, optional) – System wide or user configuration, by default N_FOL
- Returns:
Node context object
- Return type:
- get_database_uri(label='default')#
Obtain the database URI for a specific database.
- Parameters:
label (str, optional) – Database label, by default “default”
- Returns:
URI to the database
- Return type:
str
- static type_data_folder(system_folders=False)#
Obtain OS specific data folder where to store node specific data.
- Parameters:
system_folders (bool, optional) – System wide or user configuration, by default N_FOL
- Returns:
Path to the data folder
- Return type:
Path