vantage6 5.0.0a33__py3-none-any.whl → 5.0.0a35__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of vantage6 might be problematic. Click here for more details.

Files changed (45) hide show
  1. vantage6/cli/algostore/new.py +106 -47
  2. vantage6/cli/algostore/remove.py +18 -34
  3. vantage6/cli/algostore/start.py +36 -67
  4. vantage6/cli/algostore/stop.py +43 -46
  5. vantage6/cli/cli.py +31 -33
  6. vantage6/cli/common/new.py +85 -0
  7. vantage6/cli/common/remove.py +54 -0
  8. vantage6/cli/common/start.py +36 -213
  9. vantage6/cli/common/stop.py +78 -0
  10. vantage6/cli/common/utils.py +253 -16
  11. vantage6/cli/configuration_manager.py +90 -12
  12. vantage6/cli/configuration_wizard.py +49 -414
  13. vantage6/cli/context/algorithm_store.py +7 -6
  14. vantage6/cli/context/base_server.py +22 -30
  15. vantage6/cli/context/node.py +14 -17
  16. vantage6/cli/context/server.py +16 -7
  17. vantage6/cli/globals.py +29 -8
  18. vantage6/cli/node/attach.py +1 -0
  19. vantage6/cli/node/common/__init__.py +1 -1
  20. vantage6/cli/node/create_private_key.py +9 -6
  21. vantage6/cli/node/files.py +12 -25
  22. vantage6/cli/node/new.py +348 -28
  23. vantage6/cli/node/remove.py +14 -90
  24. vantage6/cli/node/restart.py +30 -51
  25. vantage6/cli/node/set_api_key.py +7 -4
  26. vantage6/cli/node/start.py +81 -304
  27. vantage6/cli/node/stop.py +36 -96
  28. vantage6/cli/server/import_.py +1 -2
  29. vantage6/cli/server/list.py +0 -3
  30. vantage6/cli/server/new.py +72 -42
  31. vantage6/cli/server/remove.py +12 -33
  32. vantage6/cli/server/shell.py +1 -1
  33. vantage6/cli/server/start.py +22 -20
  34. vantage6/cli/server/stop.py +37 -17
  35. vantage6/cli/template/algo_store_config.j2 +195 -22
  36. vantage6/cli/template/node_config.j2 +336 -33
  37. vantage6/cli/template/server_config.j2 +255 -33
  38. vantage6/cli/utils.py +0 -2
  39. {vantage6-5.0.0a33.dist-info → vantage6-5.0.0a35.dist-info}/METADATA +4 -4
  40. vantage6-5.0.0a35.dist-info/RECORD +75 -0
  41. vantage6/cli/node/clean.py +0 -46
  42. vantage6/cli/template/server_import_config.j2 +0 -31
  43. vantage6-5.0.0a33.dist-info/RECORD +0 -75
  44. {vantage6-5.0.0a33.dist-info → vantage6-5.0.0a35.dist-info}/WHEEL +0 -0
  45. {vantage6-5.0.0a33.dist-info → vantage6-5.0.0a35.dist-info}/entry_points.txt +0 -0
@@ -1,23 +1,34 @@
1
+ from typing import Any
2
+
1
3
  import click
2
- from colorama import Fore, Style
4
+ import questionary as q
3
5
 
4
- from vantage6.common import ensure_config_dir_writable, error, info
5
- from vantage6.common.globals import InstanceType
6
+ from vantage6.common.globals import (
7
+ InstanceType,
8
+ )
6
9
 
10
+ from vantage6.cli.common.new import new
7
11
  from vantage6.cli.config import CliConfig
8
- from vantage6.cli.configuration_wizard import configuration_wizard
9
- from vantage6.cli.context.server import ServerContext
12
+ from vantage6.cli.configuration_wizard import add_common_server_config
10
13
  from vantage6.cli.globals import DEFAULT_SERVER_SYSTEM_FOLDERS
11
- from vantage6.cli.utils import check_config_name_allowed, prompt_config_name
12
14
 
13
15
 
14
16
  @click.command()
15
17
  @click.option(
16
18
  "-n", "--name", default=None, help="name of the configuration you want to use."
17
19
  )
18
- @click.option("--system", "system_folders", flag_value=True)
19
20
  @click.option(
20
- "--user", "system_folders", flag_value=False, default=DEFAULT_SERVER_SYSTEM_FOLDERS
21
+ "--system",
22
+ "system_folders",
23
+ flag_value=True,
24
+ help="Use system folders instead of user folders. This is the default",
25
+ )
26
+ @click.option(
27
+ "--user",
28
+ "system_folders",
29
+ flag_value=False,
30
+ default=DEFAULT_SERVER_SYSTEM_FOLDERS,
31
+ help="Use user folders instead of system folders",
21
32
  )
22
33
  @click.option("--context", default=None, help="Kubernetes context to use")
23
34
  @click.option(
@@ -34,46 +45,65 @@ def cli_server_new(
34
45
  """
35
46
  Create a new server configuration.
36
47
  """
37
- cli_config = CliConfig()
38
- context, namespace = cli_config.compare_changes_config(
39
- context=context,
48
+ new(
49
+ questionnaire_function=server_configuration_questionaire,
50
+ name=name,
51
+ system_folders=system_folders,
40
52
  namespace=namespace,
53
+ context=context,
54
+ type_=InstanceType.SERVER,
41
55
  )
42
56
 
43
- name = prompt_config_name(name)
44
57
 
45
- # check if name is valid
46
- check_config_name_allowed(name)
58
+ def server_configuration_questionaire(instance_name: str) -> dict[str, Any]:
59
+ """
60
+ Kubernetes-specific questionnaire to generate Helm values for server.
47
61
 
48
- # check that this config does not exist
49
- try:
50
- if ServerContext.config_exists(name, system_folders):
51
- error(f"Configuration {Fore.RED}{name}{Style.RESET_ALL} already " "exists!")
52
- exit(1)
53
- except Exception as e:
54
- error(e)
55
- exit(1)
62
+ Parameters
63
+ ----------
64
+ instance_name : str
65
+ Name of the server instance.
56
66
 
57
- # Check that we can write in this folder
58
- if not ensure_config_dir_writable(system_folders):
59
- error("Your user does not have write access to all folders. Exiting")
60
- info(
61
- f"Create a new server using '{Fore.GREEN}v6 server new "
62
- f"--user{Style.RESET_ALL}' instead!"
63
- )
64
- exit(1)
67
+ Returns
68
+ -------
69
+ dict[str, Any]
70
+ dictionary with Helm values for the server configuration
71
+ """
72
+ # Get active kube namespace
73
+ cli_config = CliConfig()
74
+ kube_namespace = cli_config.get_last_namespace()
65
75
 
66
- # create config in ctx location
67
- try:
68
- cfg_file = configuration_wizard(InstanceType.SERVER, name, system_folders)
69
- except KeyboardInterrupt:
70
- error("Configuration creation aborted.")
71
- exit(1)
72
- info(f"New configuration created: {Fore.GREEN}{cfg_file}{Style.RESET_ALL}")
76
+ # Initialize config with basic structure
77
+ config = {"server": {}, "database": {}, "ui": {}, "rabbitmq": {}}
73
78
 
74
- # info(f"root user created.")
75
- flag = "" if system_folders else "--user"
76
- info(
77
- f"You can start the server by running {Fore.GREEN}v6 server start "
78
- f"{flag}{Style.RESET_ALL}"
79
+ config, is_production = add_common_server_config(
80
+ config, InstanceType.SERVER, instance_name
79
81
  )
82
+ if not is_production:
83
+ config["server"]["jwt"] = {
84
+ "secret": "constant_development_secret`",
85
+ }
86
+ config["server"]["dev"] = {
87
+ "host_uri": "host.docker.internal",
88
+ "store_in_local_cluster": True,
89
+ }
90
+
91
+ # TODO v5+ these should be removed, latest should usually be used so question is
92
+ # not needed. However, for now we want to specify alpha/beta images.
93
+ # === Server settings ===
94
+ config["server"]["image"] = q.text(
95
+ "Server Docker image:",
96
+ default="harbor2.vantage6.ai/infrastructure/server:latest",
97
+ ).unsafe_ask()
98
+
99
+ # === UI settings ===
100
+ config["ui"]["image"] = q.text(
101
+ "UI Docker image:",
102
+ default="harbor2.vantage6.ai/infrastructure/ui:latest",
103
+ ).unsafe_ask()
104
+
105
+ # === Keycloak settings ===
106
+ keycloak_url = f"http://vantage6-auth-keycloak.{kube_namespace}.svc.cluster.local"
107
+ config["server"]["keycloakUrl"] = keycloak_url
108
+
109
+ return config
@@ -1,22 +1,21 @@
1
- import itertools
2
- from pathlib import Path
3
- from shutil import rmtree
4
-
5
1
  import click
6
- import questionary as q
7
2
 
8
- from vantage6.common import info
9
- from vantage6.common.docker.addons import check_docker_running
10
3
  from vantage6.common.globals import InstanceType
4
+
11
5
  from vantage6.cli.common.decorator import click_insert_context
6
+ from vantage6.cli.common.remove import execute_remove
12
7
  from vantage6.cli.context import ServerContext
13
- from vantage6.cli.utils import remove_file
8
+ from vantage6.cli.globals import InfraComponentName
14
9
 
15
10
 
16
11
  @click.command()
17
- @click_insert_context(type_=InstanceType.SERVER)
12
+ @click_insert_context(
13
+ type_=InstanceType.SERVER, include_name=True, include_system_folders=True
14
+ )
18
15
  @click.option("-f", "--force", "force", flag_value=True)
19
- def cli_server_remove(ctx: ServerContext, force: bool) -> None:
16
+ def cli_server_remove(
17
+ ctx: ServerContext, name: str, system_folders: bool, force: bool
18
+ ) -> None:
20
19
  """
21
20
  Function to remove a server.
22
21
 
@@ -27,26 +26,6 @@ def cli_server_remove(ctx: ServerContext, force: bool) -> None:
27
26
  force : bool
28
27
  Whether to ask for confirmation before removing or not
29
28
  """
30
- check_docker_running()
31
-
32
- if not force:
33
- if not q.confirm(
34
- "This server will be deleted permanently including its "
35
- "configuration. Are you sure?",
36
- default=False,
37
- ).ask():
38
- info("Server will not be deleted")
39
- exit(0)
40
-
41
- # now remove the folders...
42
- remove_file(ctx.config_file, "configuration")
43
-
44
- # ensure log files are closed before removing
45
- log_dir = Path(ctx.log_file.parent)
46
- if log_dir.exists():
47
- info(f"Removing log directory: {log_dir}")
48
- for handler in itertools.chain(ctx.log.handlers, ctx.log.root.handlers):
49
- handler.close()
50
- # remove the whole folder with all the log files. This may also still contain other
51
- # files like RabbitMQ configuration etc
52
- rmtree(log_dir)
29
+ execute_remove(
30
+ ctx, InstanceType.SERVER, InfraComponentName.SERVER, name, system_folders, force
31
+ )
@@ -29,7 +29,7 @@ def cli_server_shell(ctx: ServerContext) -> None:
29
29
  docker_client = docker.from_env()
30
30
 
31
31
  running_servers = docker_client.containers.list(
32
- filters={"label": f"{APPNAME}-type={InstanceType.SERVER}"}
32
+ filters={"label": f"{APPNAME}-type={InstanceType.SERVER.value}"}
33
33
  )
34
34
 
35
35
  if ctx.docker_container_name not in [s.name for s in running_servers]:
@@ -1,16 +1,20 @@
1
1
  import click
2
2
 
3
3
  from vantage6.common import info
4
- from vantage6.common.globals import InstanceType
4
+ from vantage6.common.globals import InstanceType, Ports
5
5
 
6
6
  from vantage6.cli.common.decorator import click_insert_context
7
7
  from vantage6.cli.common.start import (
8
8
  helm_install,
9
+ prestart_checks,
9
10
  start_port_forward,
10
11
  )
11
- from vantage6.cli.common.utils import attach_logs
12
- from vantage6.cli.config import CliConfig
12
+ from vantage6.cli.common.utils import (
13
+ attach_logs,
14
+ create_directory_if_not_exists,
15
+ )
13
16
  from vantage6.cli.context.server import ServerContext
17
+ from vantage6.cli.globals import ChartName
14
18
 
15
19
 
16
20
  @click.command()
@@ -28,9 +32,13 @@ from vantage6.cli.context.server import ServerContext
28
32
  default=False,
29
33
  help="Print server logs to the console after start",
30
34
  )
31
- @click_insert_context(type_=InstanceType.SERVER)
35
+ @click_insert_context(
36
+ type_=InstanceType.SERVER, include_name=True, include_system_folders=True
37
+ )
32
38
  def cli_server_start(
33
39
  ctx: ServerContext,
40
+ name: str,
41
+ system_folders: bool,
34
42
  context: str,
35
43
  namespace: str,
36
44
  ip: str,
@@ -42,20 +50,14 @@ def cli_server_start(
42
50
  Start the server.
43
51
  """
44
52
  info("Starting server...")
45
- cli_config = CliConfig()
46
53
 
47
- context, namespace = cli_config.compare_changes_config(
48
- context=context,
49
- namespace=namespace,
50
- )
54
+ prestart_checks(ctx, InstanceType.SERVER, name, system_folders, context, namespace)
51
55
 
52
- # check that log directory exists - or create it
53
- ctx.log_dir.mkdir(parents=True, exist_ok=True)
56
+ create_directory_if_not_exists(ctx.log_dir)
54
57
 
55
- release_name = f"{ctx.name}-{ctx.instance_type}"
56
58
  helm_install(
57
- release_name=release_name,
58
- chart_name="server",
59
+ release_name=ctx.helm_release_name,
60
+ chart_name=ChartName.SERVER,
59
61
  values_file=ctx.config_file,
60
62
  context=context,
61
63
  namespace=namespace,
@@ -64,9 +66,9 @@ def cli_server_start(
64
66
  # port forward for server
65
67
  info("Port forwarding for server")
66
68
  start_port_forward(
67
- service_name=f"{release_name}-vantage6-server-service",
68
- service_port=ctx.config["server"].get("port", 7601),
69
- port=port or ctx.config["server"].get("port", 7601),
69
+ service_name=f"{ctx.helm_release_name}-vantage6-server-service",
70
+ service_port=ctx.config["server"].get("port", Ports.DEV_SERVER.value),
71
+ port=port or ctx.config["server"].get("port", Ports.DEV_SERVER.value),
70
72
  ip=ip,
71
73
  context=context,
72
74
  namespace=namespace,
@@ -75,9 +77,9 @@ def cli_server_start(
75
77
  # port forward for UI
76
78
  info("Port forwarding for UI")
77
79
  start_port_forward(
78
- service_name=f"{release_name}-vantage6-frontend-service",
79
- service_port=ctx.config["ui"].get("port", 7600),
80
- port=ui_port or ctx.config["ui"].get("port", 7600),
80
+ service_name=f"{ctx.helm_release_name}-vantage6-frontend-service",
81
+ service_port=ctx.config["ui"].get("port", Ports.DEV_UI.value),
82
+ port=ui_port or ctx.config["ui"].get("port", Ports.DEV_UI.value),
81
83
  ip=ip,
82
84
  context=context,
83
85
  namespace=namespace,
@@ -3,48 +3,68 @@ import click
3
3
  from vantage6.common import info
4
4
  from vantage6.common.globals import InstanceType
5
5
 
6
- from vantage6.cli.common.decorator import click_insert_context
7
- from vantage6.cli.common.stop import helm_uninstall, stop_port_forward
8
- from vantage6.cli.config import CliConfig
9
- from vantage6.cli.context.server import ServerContext
6
+ from vantage6.cli.common.stop import execute_stop, helm_uninstall, stop_port_forward
7
+ from vantage6.cli.globals import DEFAULT_SERVER_SYSTEM_FOLDERS, InfraComponentName
10
8
 
11
9
 
12
10
  @click.command()
13
- # add context and namespace options
11
+ @click.option("-n", "--name", default=None, help="Configuration name")
14
12
  @click.option("--context", default=None, help="Kubernetes context to use")
15
13
  @click.option("--namespace", default=None, help="Kubernetes namespace to use")
16
- @click_insert_context(type_=InstanceType.SERVER)
14
+ @click.option(
15
+ "--system",
16
+ "system_folders",
17
+ flag_value=True,
18
+ default=DEFAULT_SERVER_SYSTEM_FOLDERS,
19
+ help="Search for configuration in system folders instead of user folders. "
20
+ "This is the default.",
21
+ )
22
+ @click.option(
23
+ "--user",
24
+ "system_folders",
25
+ flag_value=False,
26
+ help="Search for configuration in the user folders instead of system folders.",
27
+ )
28
+ @click.option("--all", "all_servers", flag_value=True, help="Stop all running servers")
17
29
  def cli_server_stop(
18
- ctx: ServerContext,
30
+ name: str,
19
31
  context: str,
20
32
  namespace: str,
33
+ system_folders: bool,
34
+ all_servers: bool,
21
35
  ):
22
36
  """
23
37
  Stop an running server.
24
38
  """
25
- cli_config = CliConfig()
26
-
27
- context, namespace = cli_config.compare_changes_config(
28
- context=context,
39
+ execute_stop(
40
+ stop_function=_stop_server,
41
+ instance_type=InstanceType.SERVER,
42
+ infra_component=InfraComponentName.SERVER,
43
+ stop_all=all_servers,
44
+ to_stop=name,
29
45
  namespace=namespace,
46
+ context=context,
47
+ system_folders=system_folders,
30
48
  )
31
49
 
50
+
51
+ def _stop_server(server_name: str, namespace: str, context: str) -> None:
52
+ info(f"Stopping server {server_name}...")
53
+
32
54
  # uninstall the helm release
33
- info("Stopping server...")
34
- release_name = f"{ctx.name}-{ctx.instance_type}"
35
55
  helm_uninstall(
36
- release_name=release_name,
56
+ release_name=server_name,
37
57
  context=context,
38
58
  namespace=namespace,
39
59
  )
40
60
 
41
61
  # stop the port forwarding for server and UI
42
62
  stop_port_forward(
43
- service_name=f"{release_name}-vantage6-server-service",
63
+ service_name=f"{server_name}-vantage6-server-service",
44
64
  )
45
65
 
46
66
  stop_port_forward(
47
- service_name=f"{release_name}-vantage6-frontend-service",
67
+ service_name=f"{server_name}-vantage6-frontend-service",
48
68
  )
49
69
 
50
- info("Server stopped successfully.")
70
+ info(f"Server {server_name} stopped successfully.")
@@ -1,22 +1,195 @@
1
- allow_drop_all: true
2
- description: 'default_algorithm_store'
3
- ip: 0.0.0.0
4
- logging:
5
- backup_count: 5
6
- datefmt: '%Y-%m-%d %H:%M:%S'
7
- file: test-server.log
8
- format: '%(asctime)s - %(name)-14s - %(levelname)-8s - %(message)s'
9
- level: DEBUG
10
- max_size: 1024
11
- use_console: true
12
- port: {{ port }}
13
- uri: sqlite:///default.sqlite
14
- root_user:
15
- v6_server_uri: http://localhost:{{ server_port }}/api
16
- username: dev_admin
17
- dev:
18
- host_uri: {{ host_uri }}
19
- disable_review: true
20
- policies:
21
- algorithm_view: public
22
- {{ user_provided_config }}
1
+ # Override the chart name
2
+ nameOverride: {{ nameOverride | default('vantage6-store') }}
3
+ # Optional, by default the Release.Namespace is used
4
+ # namespace: vantage6-store
5
+ store:
6
+
7
+ # The description of the store
8
+ description: {{ store.description | default('Vantage algorithm store version 5') }}
9
+
10
+ api_path: {{ store.api_path | default('/store') }}
11
+
12
+ # Keycloak configuration
13
+ keycloakUrl: {{ store.keycloakUrl }}
14
+ keycloakRealm: {{ store.keycloakRealm | default('vantage6') }}
15
+ keycloakAdminUsername: {{ store.keycloakAdminUsername | default('admin') }}
16
+ keycloakAdminPassword: {{ store.keycloakAdminPassword | default('admin') }}
17
+ keycloakAdminClient: {{ store.keycloakAdminClient | default('backend-admin-client') }}
18
+ keycloakAdminClientSecret: {{ store.keycloakAdminClientSecret | default('myadminclientsecret') }}
19
+
20
+ vantage6ServerUri: {{ store.vantage6ServerUri | default('http://localhost:7601/server') }}
21
+
22
+ image: {{ store.image | default('harbor2.vantage6.ai/infrastructure/algorithm-store:latest') }}
23
+
24
+ replications: {{ store.replications | default(1) }}
25
+
26
+ policies:
27
+ # Set who is allowed to view the algorithms in the store. Possible values are:
28
+ # - "public": everyone can view the algorithms
29
+ # - "authenticated": users with a token valid for this store can view the algorithms
30
+ # - "private": only users with explicit permission in the algorithm store can view the
31
+ # algorithms
32
+ {% if store.policies is defined %}
33
+ algorithmView: {{ store.policies.algorithmView | default('public') }}
34
+ {% else %}
35
+ algorithmView: public
36
+ {% endif %}
37
+
38
+ # Set the minimum number of reviewers that need to approve an algorithm before it
39
+ # is available in the store. In case this number is lower than min_reviewing_organizations,
40
+ # the min_reviewing_organizations still has to be met to proceed with the review process.
41
+ {% if store.policies is defined %}
42
+ minReviewers: {{ store.policies.minReviewers | default(2) }}
43
+ {% else %}
44
+ minReviewers: 2
45
+ {% endif %}
46
+
47
+ # Define whether or not developers are able to assign reviewers to their own algorithms.
48
+ {% if store.policies is defined %}
49
+ assignReviewOwnAlgorithm: {{ store.policies.assignReviewOwnAlgorithm | default(false) }}
50
+ {% else %}
51
+ assignReviewOwnAlgorithm: false
52
+ {% endif %}
53
+
54
+ # Define the minimum amount of organizations that must be involved in the review process.
55
+ {% if store.policies is defined %}
56
+ minReviewingOrganizations: {{ store.policies.minReviewingOrganizations | default(2) }}
57
+ {% else %}
58
+ minReviewingOrganizations: 2
59
+ {% endif %}
60
+
61
+ # Specify the users that are allowed to review algorithms. This is a list of usernames
62
+ # that identify unique users. This policy works in combination with the permission
63
+ # system. If this policy is not set, all users with the right permissions are allowed
64
+ # to review algorithms.
65
+ {% if store.policies is defined and store.policies.allowedReviewers is defined %}
66
+ allowedReviewers:
67
+ {% for reviewer in store.policies.allowedReviewers %}
68
+ - {{ reviewer }}
69
+ {% endfor %}
70
+ {% else %}
71
+ # allowedReviewers:
72
+ # - some_username
73
+ {% endif %}
74
+
75
+ # Specify the users that are allowed to assign reviews. This is a list of usernames
76
+ # that identify unique users. This policy works in combination with the permission
77
+ # system. If this policy is not set, all users with the right permissions are allowed
78
+ # to assign reviews.
79
+ {% if store.policies is defined and store.policies.allowedReviewAssigners is defined %}
80
+ allowedReviewAssigners:
81
+ {% for assigner in store.policies.allowedReviewAssigners %}
82
+ - {{ assigner }}
83
+ {% endfor %}
84
+ {% else %}
85
+ # allowedReviewAssigners:
86
+ # - some_username
87
+ {% endif %}
88
+
89
+ {% if store.dev is defined %}
90
+ dev:
91
+ host_uri: {{ store.dev.host_uri | default('host.docker.internal') }}
92
+ disable_review: {{ store.dev.disable_review | default(false) }}
93
+ review_own_algorithm: {{ store.dev.review_own_algorithm | default(false) }}
94
+ {% endif %}
95
+
96
+ {% if store.internal is defined %}
97
+ internal:
98
+ port: {{ store.internal.port | default(7602) }}
99
+ {% endif %}
100
+ {% if store.internal is not defined %}
101
+ internal:
102
+ port: 7602
103
+ {% endif %}
104
+
105
+ logging:
106
+ # Controls the logging output level. Could be one of the following
107
+ # levels: CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET
108
+ level: {{ store.logging.level | default('INFO') }}
109
+
110
+ # Location to the log file
111
+ file: {{ store.logging.file | default('store.log') }}
112
+
113
+ # Size in kb of a single log file
114
+ max_size: {{ store.logging.max_size | default(1024) }}
115
+ use_console: {{ store.logging.use_console | default(true) }}
116
+
117
+ # Date format for the log file
118
+ datefmt: "{{ store.logging.datefmt | default('%Y-%m-%d %H:%M:%S') }}"
119
+
120
+ # Format for the log file
121
+ format: "{{ store.logging.format | default('%(asctime)s - %(name)-14s - %(levelname)-8s - %(message)s') }}"
122
+
123
+ # Maximum number of log files to keep. Log files are rotated when the size of the
124
+ # current log file exceeds `max_size`.
125
+ backup_count: {{ store.logging.backup_count | default(5) }}
126
+
127
+ # Loggers to include in the log file
128
+ loggers:
129
+ {% if store.logging.loggers is defined %}
130
+ {% for logger in store.logging.loggers %}
131
+ - level: {{ logger.level }}
132
+ name: {{ logger.name }}
133
+ {% endfor %}
134
+ {% endif %}
135
+ {% if store.logging.loggers is not defined %}
136
+ - level: warning
137
+ name: urllib3
138
+ - level: warning
139
+ name: socketIO-client
140
+ - level: warning
141
+ name: socketio.server
142
+ - level: warning
143
+ name: engineio.server
144
+ - level: warning
145
+ name: sqlalchemy.engine
146
+ {% endif %}
147
+
148
+ # set up with which origins the store should allow CORS requests. The default
149
+ # is to allow all origins. If you want to restrict this, you can specify a list
150
+ # of origins here. Below are examples to allow requests from the Cotopaxi UI, and
151
+ # port 7600 on localhost. Usually, only the UI and the server need to access the
152
+ # store.
153
+ {% if store.cors_allowed_origins is defined %}
154
+ cors_allowed_origins:
155
+ {% for origin in store.cors_allowed_origins %}
156
+ - {{ origin }}
157
+ {% endfor %}
158
+ {% else %}
159
+ # cors_allowed_origins:
160
+ # - https://portal.cotopaxi.vantage6.ai
161
+ # - http://localhost:7600
162
+ {% endif %}
163
+
164
+ database:
165
+ # whether or not to use an external database
166
+ external: {{ database.external | default(false) }}
167
+ {% if database.external is defined and database.external %}
168
+ # the URI of the external database
169
+ uri: {{ database.uri | default('postgresql://vantage6:vantage6@localhost:5432/vantage6') }}
170
+ {% else %}
171
+ # The image of the database
172
+ image:
173
+ {% if database.image is defined %}
174
+ repository: {{ database.image.repository | default('postgres') }}
175
+ tag: {{ database.image.tag | default('13') }}
176
+ {% else %}
177
+ repository: postgres
178
+ tag: 13
179
+ {% endif %}
180
+
181
+ # The username of the database
182
+ username: {{ database.username | default('vantage6') }}
183
+
184
+ # The password of the database
185
+ password: {{ database.password | default('vantage6') }}
186
+
187
+ # The name of the database
188
+ name: {{ database.name | default('vantage6') }}
189
+
190
+ #hostpath of the database mount
191
+ volumePath: {{ database.volumePath }}
192
+
193
+ # The name of the k8s node where the database is running
194
+ k8sNodeName: {{ database.k8sNodeName }}
195
+ {% endif %}