4.8. Configure#

The algorithm store requires a configuration file to run. This is a yaml file with a specific format.

The next sections describes how to configure the algorithm store. It first provides a few quick answers on setting up your store, then shows an example of all configuration file options, and finally explains where your configuration files are stored.

4.8.1. How to create a configuration file#

The easiest way to create an initial configuration file is via: v6 algorithm-store new. This allows you to configure the basic settings. For more advanced configuration options, which are listed below, you can view the example configuration file.

4.8.2. Where is my configuration file?#

To see where your configuration file is located, you can use the following command

v6 algorithm-store files

Warning

This command will only work for if the algorithm store has been deployed using the v6 commands.

Also, note that on local deployments you may need to specify the --user flag if you put your configuration file in the user folder.

You can also create and edit this file manually.

4.8.3. All configuration options#

The following configuration file is an example that intends to list all possible configuration options.

You can download this file here: algorithm_store_config.yaml

# Human readable description of the algorithm store instance. This is to help
# your peers to identify the store
description: Test

# IP adress to which the algorithm store server binds. In case you specify 0.0.0.0
# the server listens on all interfaces
ip: 0.0.0.0

# Port to which the algorithm store binds
port: 5000

# The URI to the algorithm store database. This should be a valid SQLAlchemy URI,
# e.g. for an Sqlite database: sqlite:///database-name.sqlite,
# or Postgres: postgresql://username:password@172.17.0.1/database).
uri: sqlite:///test.sqlite

# This should be set to false in production as this allows to completely
# wipe the database in a single command. Useful to set to true when
# testing/developing.
allow_drop_all: True

# Settings for the logger
logging:
  # Controls the logging output level. Could be one of the following
  # levels: CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET
  level: DEBUG

  # Filename of the log-file, used by RotatingFileHandler
  file: test.log

  # Whether the output is shown in the console or not
  use_console: True

  # The number of log files that are kept, used by RotatingFileHandler
  backup_count: 5

  # Size in kB of a single log file, used by RotatingFileHandler
  max_size: 1024

  # format: input for logging.Formatter,
  format: "%(asctime)s - %(name)-14s - %(levelname)-8s - %(message)s"
  datefmt: "%Y-%m-%d %H:%M:%S"

  # (optional) set the individual log levels per logger name, for example
  # mute some loggers that are too verbose.
  loggers:
    - name: urllib3
      level: warning
    - name: sqlalchemy.engine
      level: warning

# Additional debug flags
debug:
  # Set to `true` to enable debug mode in the Flask app
  flask: false

# Settings for the algorithm store's policies
policies:
  # Set who is allowed to view the algorithms in the store. Possible values are:
  # - "public": everyone can view the algorithms
  # - "whitelisted": only users from whitelisted servers can view the algorithms
  # - "private": only users with explicit permission in the algorithm store can view the
  #   algorithms
  algorithm_view: "public"

  # List of servers for which users are allowed to modify algorithms or other resources
  # in the algorithm store. If used together with "whitelisted" algorithm_view policy,
  # any user from these servers will be able use the algorithms from the store.
  allowed_servers:
    - "https://cotopaxi.vantage6.ai"
    - "http://localhost:5000/api"

  # Localhost servers are by default never allowed to connect to the algorithm store,
  # even if no allowed servers lists are given. This setting can be used to allow
  # localhost servers to connect.
  allow_localhost: false

# Credentials used to login to private Docker registries. These credentials are used
# to e.g. find the digests of the algorithm.
docker_registries:
  - registry: docker-registry.org
    username: docker-registry-user
    password: docker-registry-password

# development mode settings. Only use when running both the algorithm store and
# the server that it communicates with locally
dev:
  # Specify the URI to the host. This is used to generate the correct URIs to
  # communicate with the server. On Windows and Mac, you can use the special
  # hostname `host.docker.internal` to refer to the host machine. On Linux, you
  # should normally use http://172.17.0.1.
  host_uri: http://host.docker.internal

  # disable review process - all submitted algorithms are automatically accepted, which
  # can be useful while developing algorithms locally. By default, the review process
  # is enabled.
  disable_review: false

  # Define whether or not developers are able to review their own algorithms. For
  # production, this is not recommended, but it can facilitate development. By default,
  # this is disabled.
  review_own_algorithm: false

# Provide an initial root user for the algorithm store. This user will be created
# when the store is started for the first time. The root user has full access to
# the store and can create other users. The root user should be a reference to an
# existing user in a vantage6 server.
root_user:
  # URI to the vantage6 server
  v6_server_uri: http://localhost:5000/api
  # username of the vantage6 server's user you want to make root in the algorithm store
  username: root

4.8.4. Configuration file location#

The directory where to store the configuration file depends on your operating system (OS). It is possible to store the configuration file at system or at user level. At the user level, configuration files are only available for your user. By default, algorithm store configuration files are stored at system level.

The default directories per OS are as follows:

OS

System

User

Windows

C:\ProgramData\vantage\algorithm-store

C:\Users\<user>\AppData\Local\vantage\algorithm-store

MacOS

/Library/Application/Support/vantage6/algorithm-store

/Users/<user>/Library/Application Support/vantage6/algorithm-store

Linux

/etc/xdg/vantage6/algorithm-store/

/home/<user>/.config/vantage6/algorithm-store/

Warning

The command v6 algorithm-store 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!

Similarly, you can put your algorithm store configuration file in the user folder by using the --user flag. Note that in that case, you have to specify the --user flag for all v6 algorithm-store commands.

4.8.5. Logging#

Logging is enabled by default. To configure the logger, look at the logging section in the example configuration in All configuration options.

Useful commands:

  1. v6 algorithm-store files: shows you where the log file is stored

  2. v6 algorithm-store attach: show live logs of a running store in your current console. This can also be achieved when starting the store with v6 algorithm-store start --attach