vantage6 4.5.4__tar.gz → 4.6.0rc3__tar.gz

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 (76) hide show
  1. {vantage6-4.5.4 → vantage6-4.6.0rc3}/PKG-INFO +1 -1
  2. {vantage6-4.5.4 → vantage6-4.6.0rc3}/tests_cli/test_node_cli.py +1 -1
  3. {vantage6-4.5.4 → vantage6-4.6.0rc3}/tests_cli/test_server_cli.py +1 -1
  4. {vantage6-4.5.4 → vantage6-4.6.0rc3}/tests_cli/test_wizard.py +11 -2
  5. vantage6-4.6.0rc3/vantage6/cli/__build__ +1 -0
  6. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/_version.py +1 -1
  7. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/algostore/start.py +2 -2
  8. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/common/start.py +92 -2
  9. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/configuration_wizard.py +108 -35
  10. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/node/start.py +2 -2
  11. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/server/start.py +3 -3
  12. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6.egg-info/PKG-INFO +1 -1
  13. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6.egg-info/requires.txt +2 -2
  14. vantage6-4.5.4/vantage6/cli/__build__ +0 -1
  15. {vantage6-4.5.4 → vantage6-4.6.0rc3}/setup.cfg +0 -0
  16. {vantage6-4.5.4 → vantage6-4.6.0rc3}/setup.py +0 -0
  17. {vantage6-4.5.4 → vantage6-4.6.0rc3}/tests_cli/__init__.py +0 -0
  18. {vantage6-4.5.4 → vantage6-4.6.0rc3}/tests_cli/test_example.py +0 -0
  19. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/__init__.py +0 -0
  20. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/algorithm/create.py +0 -0
  21. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/algorithm/update.py +0 -0
  22. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/algostore/attach.py +0 -0
  23. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/algostore/files.py +0 -0
  24. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/algostore/list.py +0 -0
  25. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/algostore/new.py +0 -0
  26. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/algostore/stop.py +0 -0
  27. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/cli.py +0 -0
  28. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/common/decorator.py +0 -0
  29. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/common/utils.py +0 -0
  30. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/configuration_manager.py +0 -0
  31. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/context/__init__.py +0 -0
  32. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/context/algorithm_store.py +0 -0
  33. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/context/base_server.py +0 -0
  34. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/context/node.py +0 -0
  35. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/context/server.py +0 -0
  36. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/dev/create.py +0 -0
  37. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/dev/remove.py +0 -0
  38. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/dev/start.py +0 -0
  39. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/dev/stop.py +0 -0
  40. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/globals.py +0 -0
  41. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/node/attach.py +0 -0
  42. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/node/clean.py +0 -0
  43. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/node/common/__init__.py +0 -0
  44. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/node/create_private_key.py +0 -0
  45. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/node/files.py +0 -0
  46. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/node/list.py +0 -0
  47. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/node/new.py +0 -0
  48. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/node/remove.py +0 -0
  49. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/node/set_api_key.py +0 -0
  50. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/node/stop.py +0 -0
  51. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/node/version.py +0 -0
  52. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/rabbitmq/__init__.py +0 -0
  53. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/rabbitmq/definitions.py +0 -0
  54. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/rabbitmq/queue_manager.py +0 -0
  55. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/rabbitmq/rabbitmq.config +0 -0
  56. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/server/attach.py +0 -0
  57. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/server/common/__init__.py +0 -0
  58. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/server/files.py +0 -0
  59. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/server/import_.py +0 -0
  60. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/server/list.py +0 -0
  61. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/server/new.py +0 -0
  62. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/server/remove.py +0 -0
  63. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/server/shell.py +0 -0
  64. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/server/stop.py +0 -0
  65. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/server/version.py +0 -0
  66. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/template/node_config.j2 +0 -0
  67. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/template/server_config.j2 +0 -0
  68. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/template/server_import_config.j2 +0 -0
  69. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/test/common/diagnostic_runner.py +0 -0
  70. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/test/feature_tester.py +0 -0
  71. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/test/integration_test.py +0 -0
  72. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6/cli/utils.py +0 -0
  73. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6.egg-info/SOURCES.txt +0 -0
  74. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6.egg-info/dependency_links.txt +0 -0
  75. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6.egg-info/entry_points.txt +0 -0
  76. {vantage6-4.5.4 → vantage6-4.6.0rc3}/vantage6.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vantage6
3
- Version: 4.5.4
3
+ Version: 4.6.0rc3
4
4
  Summary: vantage6 command line interface
5
5
  Home-page: https://github.com/vantage6/vantage6
6
6
  Requires-Python: >=3.10
@@ -207,7 +207,7 @@ class NodeCLITest(unittest.TestCase):
207
207
  self.assertNotEqual(result.exit_code, 0)
208
208
 
209
209
  @patch("docker.DockerClient.volumes")
210
- @patch("vantage6.cli.node.start.pull_image")
210
+ @patch("vantage6.cli.node.start.pull_infra_image")
211
211
  @patch("vantage6.cli.common.decorator.get_context")
212
212
  @patch("docker.DockerClient.containers")
213
213
  @patch("vantage6.cli.node.start.check_docker_running", return_value=True)
@@ -18,7 +18,7 @@ class ServerCLITest(unittest.TestCase):
18
18
  @patch("vantage6.cli.server.start.NetworkManager")
19
19
  @patch("vantage6.cli.server.start.docker.types.Mount")
20
20
  @patch("os.makedirs")
21
- @patch("vantage6.cli.server.start.pull_image")
21
+ @patch("vantage6.cli.server.start.pull_infra_image")
22
22
  @patch("vantage6.cli.common.decorator.get_context")
23
23
  @patch("vantage6.cli.server.start.docker.from_env")
24
24
  @patch("vantage6.cli.common.start.check_docker_running", return_value=True)
@@ -9,7 +9,7 @@ from vantage6.cli.configuration_wizard import (
9
9
  configuration_wizard,
10
10
  select_configuration_questionaire,
11
11
  )
12
- from vantage6.common.globals import InstanceType
12
+ from vantage6.common.globals import InstanceType, NodePolicy
13
13
 
14
14
  module_path = "vantage6.cli.configuration_wizard"
15
15
 
@@ -39,8 +39,14 @@ class WizardTest(unittest.TestCase):
39
39
  False, # don't enable two-factor authentication
40
40
  True, # add VPN server
41
41
  True, # add algorithm policies
42
+ True, # add single algorithms to allowed_algorithms
42
43
  "some-image", # algorithm image to whitelist
43
44
  False, # don't add another algorithm image
45
+ True, # add algorithm stores to allowed_algorithm_stores
46
+ "some-store", # algorithm store to whitelist
47
+ False, # don't add another algorithm store
48
+ False, # answer question on combining policies on store level and
49
+ # single algorithm level
44
50
  False, # don't abort if no server connection is made to pull
45
51
  # collaboration settings
46
52
  True, # Enable encryption
@@ -61,7 +67,10 @@ class WizardTest(unittest.TestCase):
61
67
  ]
62
68
  for key in keys:
63
69
  self.assertIn(key, config)
64
- nested_keys = [["policies", "allowed_algorithms"]]
70
+ nested_keys = [
71
+ ["policies", NodePolicy.ALLOWED_ALGORITHMS],
72
+ ["policies", NodePolicy.ALLOWED_ALGORITHM_STORES],
73
+ ]
65
74
  for nesting in nested_keys:
66
75
  current_config = config
67
76
  for key in nesting:
@@ -0,0 +1 @@
1
+ 3
@@ -7,7 +7,7 @@ with open(os.path.join(here, "__build__")) as fp:
7
7
  __build__ = json.load(fp)
8
8
 
9
9
  # Module version
10
- version_info = (4, 5, 4, "final", __build__, 0)
10
+ version_info = (4, 6, 0, "candidate", __build__, 0)
11
11
 
12
12
  # Module version stage suffix map
13
13
  _specifier_ = {"alpha": "a", "beta": "b", "candidate": "rc", "final": ""}
@@ -2,7 +2,6 @@ import click
2
2
 
3
3
  from vantage6.common import info
4
4
  from vantage6.common.globals import APPNAME, DEFAULT_ALGO_STORE_IMAGE, InstanceType
5
- from vantage6.common.docker.addons import pull_image
6
5
  from vantage6.cli.common.start import (
7
6
  attach_logs,
8
7
  check_for_start,
@@ -10,6 +9,7 @@ from vantage6.cli.common.start import (
10
9
  mount_config_file,
11
10
  mount_database,
12
11
  mount_source,
12
+ pull_infra_image,
13
13
  )
14
14
  from vantage6.cli.globals import AlgoStoreGlobals
15
15
  from vantage6.cli.context.algorithm_store import AlgorithmStoreContext
@@ -55,7 +55,7 @@ def cli_algo_store_start(
55
55
  image = get_image(image, ctx, "algorithm-store", DEFAULT_ALGO_STORE_IMAGE)
56
56
 
57
57
  info("Pulling algorithm store image...")
58
- pull_image(docker_client, image)
58
+ pull_infra_image(docker_client, image, InstanceType.ALGORITHM_STORE)
59
59
 
60
60
  config_file = "/mnt/config.yaml"
61
61
  mounts = mount_config_file(ctx, config_file)
@@ -10,8 +10,16 @@ from sqlalchemy.engine.url import make_url
10
10
 
11
11
  from vantage6.common import error, info, warning
12
12
  from vantage6.common.context import AppContext
13
- from vantage6.common.globals import InstanceType, APPNAME, DEFAULT_DOCKER_REGISTRY
14
- from vantage6.common.docker.addons import check_docker_running
13
+ from vantage6.common.globals import (
14
+ DEFAULT_ALGO_STORE_IMAGE,
15
+ DEFAULT_NODE_IMAGE,
16
+ DEFAULT_SERVER_IMAGE,
17
+ DEFAULT_UI_IMAGE,
18
+ InstanceType,
19
+ APPNAME,
20
+ DEFAULT_DOCKER_REGISTRY,
21
+ )
22
+ from vantage6.common.docker.addons import check_docker_running, pull_image
15
23
  from vantage6.cli.context import AlgorithmStoreContext, ServerContext
16
24
  from vantage6.cli.common.utils import print_log_worker
17
25
  from vantage6.cli.utils import check_config_name_allowed
@@ -88,6 +96,88 @@ def get_image(
88
96
  return image
89
97
 
90
98
 
99
+ def pull_infra_image(
100
+ client: DockerClient, image: str, instance_type: InstanceType
101
+ ) -> None:
102
+ """
103
+ Try to pull an infrastructure image. If the image is a default infrastructure image,
104
+ exit if in cannot be pulled. If it is not a default image, exit if it cannot be
105
+ pulled and it is also not available locally. If a local image is available, a
106
+ warning is printed.
107
+
108
+ Parameters
109
+ ----------
110
+ client : DockerClient
111
+ The Docker client
112
+ image : str
113
+ The image name to pull
114
+ instance_type : InstanceType
115
+ The type of instance to pull the image for
116
+ """
117
+ try:
118
+ pull_image(client, image, suppress_error=True)
119
+ except docker.errors.APIError:
120
+ if not is_default_infra_image(image, instance_type):
121
+ if image_exists_locally(client, image):
122
+ warning("Failed to pull infrastructure image! Will use local image...")
123
+ else:
124
+ error("Failed to pull infrastructure image!")
125
+ error("Image also not found locally. Exiting...")
126
+ exit(1)
127
+ else:
128
+ error("Failed to pull infrastructure image! Exiting...")
129
+ exit(1)
130
+
131
+
132
+ def is_default_infra_image(image: str, instance_type: InstanceType) -> bool:
133
+ """
134
+ Check if an infrastructure image is the default image.
135
+
136
+ Parameters
137
+ ----------
138
+ image : str
139
+ The image name to check
140
+ instance_type : InstanceType
141
+ The type of instance to check the image for
142
+
143
+ Returns
144
+ -------
145
+ bool
146
+ True if the image is the default image, False otherwise
147
+ """
148
+ if instance_type == InstanceType.SERVER:
149
+ return image == f"{DEFAULT_DOCKER_REGISTRY}/{DEFAULT_SERVER_IMAGE}"
150
+ elif instance_type == InstanceType.ALGORITHM_STORE:
151
+ return image == f"{DEFAULT_DOCKER_REGISTRY}/{DEFAULT_ALGO_STORE_IMAGE}"
152
+ elif instance_type == InstanceType.UI:
153
+ return image == f"{DEFAULT_DOCKER_REGISTRY}/{DEFAULT_UI_IMAGE}"
154
+ elif instance_type == InstanceType.NODE:
155
+ return image == f"{DEFAULT_DOCKER_REGISTRY}/{DEFAULT_NODE_IMAGE}"
156
+
157
+
158
+ def image_exists_locally(client: DockerClient, image: str) -> bool:
159
+ """
160
+ Check if the image exists locally.
161
+
162
+ Parameters
163
+ ----------
164
+ client : DockerClient
165
+ The Docker client
166
+ image : str
167
+ The image name to check
168
+
169
+ Returns
170
+ -------
171
+ bool
172
+ True if the image exists locally, False otherwise
173
+ """
174
+ try:
175
+ client.images.get(image)
176
+ except docker.errors.ImageNotFound:
177
+ return False
178
+ return True
179
+
180
+
91
181
  def mount_config_file(ctx: AppContext, config_file: str) -> list[docker.types.Mount]:
92
182
  """
93
183
  Mount the config file in the container.
@@ -3,7 +3,7 @@ import questionary as q
3
3
  from pathlib import Path
4
4
 
5
5
  from vantage6.common import generate_apikey
6
- from vantage6.common.globals import DATABASE_TYPES, InstanceType
6
+ from vantage6.common.globals import DATABASE_TYPES, InstanceType, NodePolicy
7
7
  from vantage6.common.client.node_client import NodeClient
8
8
  from vantage6.common.context import AppContext
9
9
  from vantage6.common import error, warning, info
@@ -82,11 +82,6 @@ def node_configuration_questionaire(dirs: dict, instance_name: str) -> dict:
82
82
  {"label": db_label.get("label"), "uri": db_path.get("uri"), "type": db_type}
83
83
  )
84
84
 
85
- res = q.select(
86
- "Which level of logging would you like?",
87
- choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL", "NOTSET"],
88
- ).ask()
89
-
90
85
  is_add_vpn = q.confirm(
91
86
  "Do you want to connect to a VPN server?", default=False
92
87
  ).ask()
@@ -101,33 +96,41 @@ def node_configuration_questionaire(dirs: dict, instance_name: str) -> dict:
101
96
  "should always be done for production scenarios.",
102
97
  default=True,
103
98
  ).ask()
99
+ policies = {}
104
100
  if is_policies:
105
- allowed_algorithms = []
106
- info("Below you can add algorithms that are allowed to run on your node.")
107
- info(
108
- "You can use regular expressions to match multiple algorithms, or you can "
109
- "use strings to provide one algorithm at a time."
110
- )
111
- info("Examples:")
112
- # pylint: disable=W1401
113
- # flake8: noqa: W605
114
- info("^harbor2\.vantage6\.ai/demo/average$ Allow the demo average algorithm")
115
- info(
116
- "^harbor2\.vantage6\.ai/algorithms/.* Allow all algorithms from "
117
- "harbor2.vantage6.ai/algorithms"
118
- )
119
101
  info(
120
- "^harbor2\.vantage6\.ai/demo/average:@sha256:82becede...$ Allow a "
121
- "specific hash of average algorithm"
102
+ "You can limit the algorithms that can run on your node in two ways: by "
103
+ "allowing specific algorithms or by allowing all algorithms in a given "
104
+ "algorithm store."
122
105
  )
123
- while True:
124
- algo = q.text(message="Enter your algorithm expression:").ask()
125
- allowed_algorithms.append(algo)
126
- if not q.confirm(
127
- "Do you want to add another algorithm expression?", default=True
128
- ).ask():
129
- break
130
- config["policies"] = {"allowed_algorithms": allowed_algorithms}
106
+ ask_single_algorithms = q.confirm(
107
+ "Do you want to enter a list of allowed algorithms?"
108
+ ).ask()
109
+ if ask_single_algorithms:
110
+ policies[NodePolicy.ALLOWED_ALGORITHMS] = _get_allowed_algorithms()
111
+ ask_algorithm_stores = q.confirm(
112
+ "Do you want to allow algorithms from specific algorithm stores?"
113
+ ).ask()
114
+ if ask_algorithm_stores:
115
+ policies[NodePolicy.ALLOWED_ALGORITHM_STORES] = (
116
+ _get_allowed_algorithm_stores()
117
+ )
118
+ if ask_single_algorithms and ask_algorithm_stores:
119
+ require_both_whitelists = q.confirm(
120
+ "Do you want to allow only algorithms that are both in the list of "
121
+ "allowed algorithms *AND* are part of one of the allowed algorithm "
122
+ "stores? If not, algorithms will be allowed if they are in either the "
123
+ "list of allowed algorithms or one of the allowed algorithm stores.",
124
+ default=True,
125
+ ).ask()
126
+ policies["allow_either_whitelist_or_store"] = not require_both_whitelists
127
+ if policies:
128
+ config["policies"] = policies
129
+
130
+ res = q.select(
131
+ "Which level of logging would you like?",
132
+ choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL", "NOTSET"],
133
+ ).ask()
131
134
 
132
135
  config["logging"] = {
133
136
  "level": res,
@@ -182,6 +185,77 @@ def node_configuration_questionaire(dirs: dict, instance_name: str) -> dict:
182
185
  return config
183
186
 
184
187
 
188
+ def _get_allowed_algorithms() -> list[str]:
189
+ """
190
+ Prompt the user for the allowed algorithms on their node
191
+
192
+ Returns
193
+ -------
194
+ list[str]
195
+ List of allowed algorithms or regular expressions to match them
196
+ """
197
+ info("Below you can add algorithms that are allowed to run on your node.")
198
+ info(
199
+ "You can use regular expressions to match multiple algorithms, or you can "
200
+ "use strings to provide one algorithm at a time."
201
+ )
202
+ info("Examples:")
203
+ # pylint: disable=W1401
204
+ # flake8: noqa: W605
205
+ info("^harbor2\.vantage6\.ai/demo/average$ Allow the demo average algorithm")
206
+ info(
207
+ "^harbor2\.vantage6\.ai/algorithms/.* Allow all algorithms from "
208
+ "harbor2.vantage6.ai/algorithms"
209
+ )
210
+ info(
211
+ "^harbor2\.vantage6\.ai/demo/average@sha256:82becede...$ Allow a "
212
+ "specific hash of average algorithm"
213
+ )
214
+ allowed_algorithms = []
215
+ while True:
216
+ algo = q.text(message="Enter your algorithm expression:").ask()
217
+ allowed_algorithms.append(algo)
218
+ if not q.confirm(
219
+ "Do you want to add another algorithm expression?", default=True
220
+ ).ask():
221
+ break
222
+ return allowed_algorithms
223
+
224
+
225
+ def _get_allowed_algorithm_stores() -> list[str]:
226
+ """
227
+ Prompt the user for the allowed algorithm stores on their node
228
+
229
+ Returns
230
+ -------
231
+ list[str]
232
+ List of allowed algorithm stores
233
+ """
234
+ info("Below you can add algorithm stores that are allowed to run on your node.")
235
+ info(
236
+ "You can use regular expressions to match multiple algorithm stores, or you can"
237
+ " use strings to provide one algorithm store at a time."
238
+ )
239
+ info("Examples:")
240
+ info(
241
+ "https://store.cotopaxi.vantage6.ai Allow all algorithms from the "
242
+ "community store"
243
+ )
244
+ info(
245
+ "^https://*\.vantage6\.ai$ Allow all algorithms from any "
246
+ "store hosted on vantage6.ai"
247
+ )
248
+ allowed_algorithm_stores = []
249
+ while True:
250
+ store = q.text(message="Enter the URL of the algorithm store:").ask()
251
+ allowed_algorithm_stores.append(store)
252
+ if not q.confirm(
253
+ "Do you want to add another algorithm store?", default=True
254
+ ).ask():
255
+ break
256
+ return allowed_algorithm_stores
257
+
258
+
185
259
  def _get_common_server_config(
186
260
  instance_type: InstanceType, instance_name: str, include_api_path: bool = True
187
261
  ) -> dict:
@@ -435,13 +509,14 @@ def algo_store_configuration_questionaire(instance_name: str) -> dict:
435
509
  }
436
510
 
437
511
  # ask about openness of the algorithm store
512
+ config["policies"] = {"allow_localhost": False}
438
513
  is_open = q.confirm(
439
514
  "Do you want to open the algorithm store to the public? This will allow anyone "
440
515
  "to view the algorithms, but they cannot modify them.",
441
516
  default=False,
442
517
  ).ask()
443
518
  if is_open:
444
- config["policies"] = {"algorithms_open": True}
519
+ open_algos_policy = "public"
445
520
  else:
446
521
  is_open_to_whitelist = q.confirm(
447
522
  "Do you want to allow all users of whitelisted vantage6 servers to access "
@@ -449,10 +524,8 @@ def algo_store_configuration_questionaire(instance_name: str) -> dict:
449
524
  " the appropriate permissions to each user individually.",
450
525
  default=True,
451
526
  ).ask()
452
- config["policies"] = {
453
- "algorithms_open": False,
454
- "algorithms_open_to_whitelisted": is_open_to_whitelist,
455
- }
527
+ open_algos_policy = "whitelisted" if is_open_to_whitelist else "private"
528
+ config["policies"]["algorithm_view"] = open_algos_policy
456
529
 
457
530
  return config
458
531
 
@@ -8,8 +8,8 @@ import docker
8
8
 
9
9
  from colorama import Fore, Style
10
10
 
11
+ from vantage6.cli.common.start import pull_infra_image
11
12
  from vantage6.common import warning, error, info, debug, get_database_config
12
- from vantage6.common.docker.addons import pull_image
13
13
  from vantage6.common.globals import (
14
14
  APPNAME,
15
15
  DEFAULT_DOCKER_REGISTRY,
@@ -135,7 +135,7 @@ def cli_node_start(
135
135
  image = f"{DEFAULT_DOCKER_REGISTRY}/{DEFAULT_NODE_IMAGE}"
136
136
 
137
137
  info(f"Pulling latest node image '{image}'")
138
- pull_image(docker_client, image)
138
+ pull_infra_image(docker_client, image, InstanceType.NODE)
139
139
 
140
140
  data_volume = docker_client.volumes.create(ctx.docker_volume_name)
141
141
  vpn_volume = docker_client.volumes.create(ctx.docker_vpn_volume_name)
@@ -4,7 +4,6 @@ from docker.client import DockerClient
4
4
 
5
5
  from vantage6.common import info, warning, error
6
6
  from vantage6.common.docker.network_manager import NetworkManager
7
- from vantage6.common.docker.addons import pull_image
8
7
  from vantage6.common.globals import (
9
8
  APPNAME,
10
9
  DEFAULT_SERVER_IMAGE,
@@ -23,6 +22,7 @@ from vantage6.cli.common.start import (
23
22
  get_image,
24
23
  mount_database,
25
24
  mount_source,
25
+ pull_infra_image,
26
26
  )
27
27
 
28
28
 
@@ -91,7 +91,7 @@ def cli_server_start(
91
91
  ctx.log_dir.mkdir(parents=True, exist_ok=True)
92
92
 
93
93
  info("Pulling server image...")
94
- pull_image(docker_client, image)
94
+ pull_infra_image(docker_client, image, InstanceType.SERVER)
95
95
 
96
96
  info("Creating mounts")
97
97
  config_file = "/mnt/config.yaml"
@@ -229,7 +229,7 @@ def _start_ui(client: DockerClient, ctx: ServerContext, ui_port: int) -> None:
229
229
  # find image to use
230
230
  image = get_image(None, ctx, "ui", DEFAULT_UI_IMAGE)
231
231
 
232
- pull_image(client, image)
232
+ pull_infra_image(client, image, InstanceType.UI)
233
233
 
234
234
  # set environment variables
235
235
  env_vars = {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vantage6
3
- Version: 4.5.4
3
+ Version: 4.6.0rc3
4
4
  Summary: vantage6 command line interface
5
5
  Home-page: https://github.com/vantage6/vantage6
6
6
  Requires-Python: >=3.10
@@ -8,8 +8,8 @@ questionary==1.10.0
8
8
  rich==13.5.2
9
9
  schema==0.7.5
10
10
  SQLAlchemy==1.4.46
11
- vantage6-common==4.5.4
12
- vantage6-client==4.5.4
11
+ vantage6-common==4.6.0rc3
12
+ vantage6-client==4.6.0rc3
13
13
 
14
14
  [dev]
15
15
  coverage==6.4.4
@@ -1 +0,0 @@
1
- 0
File without changes
File without changes