Skip to main content

Configuration

configure.py

The root of the repository contains a configure.py script, which is used to:

  • generate a docker-compose file
  • generate deployment files for kubernetes
  • build images
  • pushing image to dockerhub.

Before you can use the configure.py script you need to run pip install -r requirements.txt in the project root, to install all necessary dependencies.

Following commands are available:

commanddescription
gen-docker-composegenerate a docker-compose.yaml to run the application locally
buildbuild images for the plugins (metrics, summarizers)
pushpush an image to dockerhub for later deployment
gen-kubernetesgenerates kubernetes files for the deployment
gen-schemagenerate json schema files for sw-config.yaml and sw-plugin-config.yaml which can be used to provide completion in your editor/IDE (see configuration#completion)

sw-config.yaml

The application is configured with the sw-config.yaml file. It has the following top level options:

optionrequired fordescription
docker_usernamepush, gen-kubernetesusername of your dockerhub
extern_environmentoptionalkey value pairs that will be environment variables inside of all the plugins (not during build time, but also in kubernetes files)
deploygen-kubernetesconfigure the deployment
metricsalllist of metrics (path or git url to the metric folder or repository)
summarizersalllist of summarizers (path or git url to the summarizer folder or repository)

To configure a metric or a summarizer specify the path or git url to the metric or to the summarizer as an list entry under the metrics or summarizers option. Alternatively you can specify the following options as dictionary:

optiondescription
sourcepath or git url to the plugin folder or repository
disabledif true, the plugin will not be loaded but information about the plugin will still be shown in the application
environmentkey-value pairs that will be add to the plugin as environment variables during build time and are present in the running plugin container. It is useful e.g. when a plugin provides different models and one wants to choose a model.
extern_environmentkey value pairs that will be environment variables inside the plugin (not during build time, but also in kubernetes files)
info

The default application configuration file is sw-config.yaml which can be found in the project root. To use a different file specify the path to the file via the --config option to the configure.py script.

Completion

You are advised to run ./configure.py gen-schema to generate the json schemas which can provide completion for IDE when you edit the configuration files. The generated files are located under schema/ in the repository.

To enable completion in VSCode, you need to install the yaml extension and add the following lines to your settings.json file:

{
"yaml.schemas": {
"<path to repository>/schema/sw-config.schema.json": "*sw-config.yaml",
"<path to repository>/schema/sw-plugin-config.schema.json": "sw-plugin-config.yaml"
}
}

Don't forget to replace <path to repository> with the path to the repository on your system. If the repository is located under /home/me/summary-workbench than <path to repository>/schema/sw-config.schema.json becomes /home/me/summary-workbench/schema/sw-config.schema.json