vantage6 4.9.0rc1__py3-none-any.whl → 4.10.0__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.
- tests_cli/test_node_cli.py +6 -0
- tests_cli/test_server_cli.py +2 -2
- tests_cli/test_wizard.py +5 -5
- vantage6/cli/__build__ +1 -1
- vantage6/cli/__init__.py +1 -1
- vantage6/cli/_version.py +1 -1
- vantage6/cli/algorithm/create.py +26 -8
- vantage6/cli/algorithm/update.py +5 -1
- vantage6/cli/algostore/attach.py +10 -6
- vantage6/cli/algostore/list.py +1 -1
- vantage6/cli/algostore/new.py +7 -1
- vantage6/cli/algostore/start.py +2 -2
- vantage6/cli/algostore/stop.py +1 -1
- vantage6/cli/common/utils.py +18 -7
- vantage6/cli/configuration_manager.py +1 -0
- vantage6/cli/configuration_wizard.py +60 -50
- vantage6/cli/context/algorithm_store.py +1 -1
- vantage6/cli/context/node.py +1 -1
- vantage6/cli/dev/create.py +8 -6
- vantage6/cli/dev/remove.py +18 -1
- vantage6/cli/node/attach.py +7 -3
- vantage6/cli/node/clean.py +6 -2
- vantage6/cli/node/common/__init__.py +21 -4
- vantage6/cli/node/new.py +5 -1
- vantage6/cli/node/restart.py +7 -3
- vantage6/cli/node/set_api_key.py +5 -1
- vantage6/cli/node/start.py +13 -5
- vantage6/cli/node/stop.py +7 -3
- vantage6/cli/node/version.py +7 -3
- vantage6/cli/server/attach.py +9 -5
- vantage6/cli/server/import_.py +4 -1
- vantage6/cli/server/list.py +1 -1
- vantage6/cli/server/new.py +5 -1
- vantage6/cli/server/shell.py +1 -1
- vantage6/cli/server/start.py +6 -3
- vantage6/cli/server/stop.py +9 -5
- vantage6/cli/server/version.py +2 -2
- vantage6/cli/template/algo_store_config.j2 +1 -1
- vantage6/cli/template/server_config.j2 +1 -1
- vantage6/cli/test/feature_tester.py +10 -3
- vantage6/cli/utils.py +5 -1
- {vantage6-4.9.0rc1.dist-info → vantage6-4.10.0.dist-info}/METADATA +4 -4
- vantage6-4.10.0.dist-info/RECORD +76 -0
- vantage6-4.9.0rc1.dist-info/RECORD +0 -76
- {vantage6-4.9.0rc1.dist-info → vantage6-4.10.0.dist-info}/WHEEL +0 -0
- {vantage6-4.9.0rc1.dist-info → vantage6-4.10.0.dist-info}/entry_points.txt +0 -0
- {vantage6-4.9.0rc1.dist-info → vantage6-4.10.0.dist-info}/top_level.txt +0 -0
vantage6/cli/dev/create.py
CHANGED
|
@@ -8,7 +8,7 @@ from jinja2 import Environment, FileSystemLoader
|
|
|
8
8
|
from colorama import Fore, Style
|
|
9
9
|
|
|
10
10
|
from vantage6.common.globals import APPNAME, InstanceType, Ports
|
|
11
|
-
from vantage6.common import info, error, generate_apikey
|
|
11
|
+
from vantage6.common import ensure_config_dir_writable, info, error, generate_apikey
|
|
12
12
|
|
|
13
13
|
import vantage6.cli.dev.data as data_dir
|
|
14
14
|
from vantage6.cli.context.algorithm_store import AlgorithmStoreContext
|
|
@@ -114,13 +114,15 @@ def create_node_config_file(
|
|
|
114
114
|
}
|
|
115
115
|
)
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
except Exception as e:
|
|
121
|
-
error(f"Could not write node configuration file: {e}")
|
|
117
|
+
# Check that we can write the node config
|
|
118
|
+
if not ensure_config_dir_writable():
|
|
119
|
+
error("Cannot write configuration file. Exiting...")
|
|
122
120
|
exit(1)
|
|
123
121
|
|
|
122
|
+
Path(full_path).parent.mkdir(parents=True, exist_ok=True)
|
|
123
|
+
with open(full_path, "x", encoding="utf-8") as f:
|
|
124
|
+
f.write(node_config)
|
|
125
|
+
|
|
124
126
|
info(
|
|
125
127
|
f"Spawned node for organization {Fore.GREEN}{config['org_id']}"
|
|
126
128
|
f"{Style.RESET_ALL}"
|
vantage6/cli/dev/remove.py
CHANGED
|
@@ -4,9 +4,12 @@ from shutil import rmtree
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
|
|
6
6
|
import click
|
|
7
|
+
import docker
|
|
8
|
+
from colorama import Fore, Style
|
|
7
9
|
|
|
8
10
|
from vantage6.cli.context.algorithm_store import AlgorithmStoreContext
|
|
9
|
-
from vantage6.common import info
|
|
11
|
+
from vantage6.common import info, error
|
|
12
|
+
from vantage6.common.globals import APPNAME
|
|
10
13
|
from vantage6.cli.context.server import ServerContext
|
|
11
14
|
from vantage6.cli.context.node import NodeContext
|
|
12
15
|
from vantage6.cli.server.remove import cli_server_remove
|
|
@@ -34,6 +37,20 @@ def remove_demo_network(
|
|
|
34
37
|
"""
|
|
35
38
|
ctx = get_dev_server_context(config, name)
|
|
36
39
|
|
|
40
|
+
# check that the server is not running
|
|
41
|
+
client = docker.from_env()
|
|
42
|
+
running_servers = client.containers.list(
|
|
43
|
+
filters={"label": f"{APPNAME}-type={InstanceType.SERVER.value}"}
|
|
44
|
+
)
|
|
45
|
+
running_server_names = [server.name for server in running_servers]
|
|
46
|
+
container_name = f"{APPNAME}-{name}-user-{InstanceType.SERVER.value}"
|
|
47
|
+
if container_name in running_server_names:
|
|
48
|
+
error(
|
|
49
|
+
f"Server {Fore.RED}{name}{Style.RESET_ALL} is still running! First stop "
|
|
50
|
+
"the network with 'v6 dev stop-demo-network'."
|
|
51
|
+
)
|
|
52
|
+
return
|
|
53
|
+
|
|
37
54
|
# remove the server
|
|
38
55
|
for handler in itertools.chain(ctx.log.handlers, ctx.log.root.handlers):
|
|
39
56
|
handler.close()
|
vantage6/cli/node/attach.py
CHANGED
|
@@ -45,9 +45,13 @@ def cli_node_attach(name: str, system_folders: bool) -> None:
|
|
|
45
45
|
return
|
|
46
46
|
|
|
47
47
|
if not name:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
try:
|
|
49
|
+
name = q.select(
|
|
50
|
+
"Select the node you wish to attach:", choices=running_node_names
|
|
51
|
+
).unsafe_ask()
|
|
52
|
+
except KeyboardInterrupt:
|
|
53
|
+
error("Aborted by user!")
|
|
54
|
+
return
|
|
51
55
|
else:
|
|
52
56
|
post_fix = "system" if system_folders else "user"
|
|
53
57
|
name = f"{APPNAME}-{name}-{post_fix}"
|
vantage6/cli/node/clean.py
CHANGED
|
@@ -26,8 +26,12 @@ def cli_node_clean() -> None:
|
|
|
26
26
|
msg += volume.name + ","
|
|
27
27
|
info(msg)
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
try:
|
|
30
|
+
confirm = q.confirm("Are you sure?").unsafe_ask()
|
|
31
|
+
except KeyboardInterrupt:
|
|
32
|
+
confirm = False
|
|
33
|
+
|
|
34
|
+
if confirm:
|
|
31
35
|
for volume in candidates:
|
|
32
36
|
try:
|
|
33
37
|
volume.remove()
|
|
@@ -58,9 +58,11 @@ def create_client_and_authenticate(
|
|
|
58
58
|
"""
|
|
59
59
|
client = create_client(ctx)
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
try:
|
|
62
|
+
username, password, mfa_code = _get_auth_data()
|
|
63
|
+
except KeyboardInterrupt:
|
|
64
|
+
error("Authentication aborted.")
|
|
65
|
+
exit(1)
|
|
64
66
|
|
|
65
67
|
try:
|
|
66
68
|
client.authenticate(username, password, mfa_code=mfa_code)
|
|
@@ -73,6 +75,21 @@ def create_client_and_authenticate(
|
|
|
73
75
|
return client
|
|
74
76
|
|
|
75
77
|
|
|
78
|
+
def _get_auth_data() -> tuple[str, str, str]:
|
|
79
|
+
"""
|
|
80
|
+
Get authentication data from the user.
|
|
81
|
+
|
|
82
|
+
Returns
|
|
83
|
+
-------
|
|
84
|
+
tuple[str, str, str]
|
|
85
|
+
Tuple containing username, password and MFA code
|
|
86
|
+
"""
|
|
87
|
+
username = q.text("Username:").unsafe_ask()
|
|
88
|
+
password = q.password("Password:").unsafe_ask()
|
|
89
|
+
mfa_code = q.text("MFA code:").unsafe_ask()
|
|
90
|
+
return username, password, mfa_code
|
|
91
|
+
|
|
92
|
+
|
|
76
93
|
def select_node(name: str, system_folders: bool) -> tuple[str, str]:
|
|
77
94
|
"""
|
|
78
95
|
Let user select node through questionnaire if name is not given.
|
|
@@ -113,6 +130,6 @@ def find_running_node_names(client: docker.DockerClient) -> list[str]:
|
|
|
113
130
|
List of names of running nodes
|
|
114
131
|
"""
|
|
115
132
|
running_nodes = client.containers.list(
|
|
116
|
-
filters={"label": f"{APPNAME}-type={InstanceType.NODE}"}
|
|
133
|
+
filters={"label": f"{APPNAME}-type={InstanceType.NODE.value}"}
|
|
117
134
|
)
|
|
118
135
|
return [node.name for node in running_nodes]
|
vantage6/cli/node/new.py
CHANGED
|
@@ -47,7 +47,11 @@ def cli_node_new_configuration(name: str, system_folders: bool) -> None:
|
|
|
47
47
|
|
|
48
48
|
# create config in ctx location
|
|
49
49
|
flag = "--system" if system_folders else ""
|
|
50
|
-
|
|
50
|
+
try:
|
|
51
|
+
cfg_file = configuration_wizard(InstanceType.NODE, name, system_folders)
|
|
52
|
+
except KeyboardInterrupt:
|
|
53
|
+
error("Configuration creation aborted.")
|
|
54
|
+
exit(1)
|
|
51
55
|
info(f"New configuration created: {Fore.GREEN}{cfg_file}{Style.RESET_ALL}")
|
|
52
56
|
info(
|
|
53
57
|
f"You can start the node by running "
|
vantage6/cli/node/restart.py
CHANGED
|
@@ -92,9 +92,13 @@ def cli_node_restart(
|
|
|
92
92
|
]
|
|
93
93
|
else:
|
|
94
94
|
if not name:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
try:
|
|
96
|
+
container_name = q.select(
|
|
97
|
+
"Select the node you wish to restart:", choices=running_node_names
|
|
98
|
+
).unsafe_ask()
|
|
99
|
+
except KeyboardInterrupt:
|
|
100
|
+
error("Aborted by user!")
|
|
101
|
+
return
|
|
98
102
|
names = [get_name_from_container_name(container_name)]
|
|
99
103
|
else:
|
|
100
104
|
names = [name]
|
vantage6/cli/node/set_api_key.py
CHANGED
|
@@ -38,7 +38,11 @@ def cli_node_set_api_key(name: str, api_key: str, system_folders: bool) -> None:
|
|
|
38
38
|
exit(1)
|
|
39
39
|
|
|
40
40
|
if not api_key:
|
|
41
|
-
|
|
41
|
+
try:
|
|
42
|
+
api_key = q.text("Please enter your new API key:").unsafe_ask()
|
|
43
|
+
except KeyboardInterrupt:
|
|
44
|
+
error("API key input aborted.")
|
|
45
|
+
exit(1)
|
|
42
46
|
|
|
43
47
|
# get configuration manager
|
|
44
48
|
ctx = NodeContext(name, system_folders=system_folders)
|
vantage6/cli/node/start.py
CHANGED
|
@@ -78,7 +78,7 @@ def cli_node_start(
|
|
|
78
78
|
|
|
79
79
|
# check that this node is not already running
|
|
80
80
|
running_nodes = docker_client.containers.list(
|
|
81
|
-
filters={"label": f"{APPNAME}-type={InstanceType.NODE}"}
|
|
81
|
+
filters={"label": f"{APPNAME}-type={InstanceType.NODE.value}"}
|
|
82
82
|
)
|
|
83
83
|
|
|
84
84
|
suffix = "system" if system_folders else "user"
|
|
@@ -235,15 +235,23 @@ def cli_node_start(
|
|
|
235
235
|
label_capitals = label.upper()
|
|
236
236
|
|
|
237
237
|
try:
|
|
238
|
-
|
|
238
|
+
db_file_exists = Path(uri).exists()
|
|
239
239
|
except Exception:
|
|
240
240
|
# If the database uri cannot be parsed, it is definitely not a
|
|
241
241
|
# file. In case of http servers or sql servers, checking the path
|
|
242
242
|
# of the the uri will lead to an OS-dependent error, which is why
|
|
243
243
|
# we catch all exceptions here.
|
|
244
|
-
|
|
244
|
+
db_file_exists = False
|
|
245
245
|
|
|
246
|
-
if
|
|
246
|
+
if db_type in ["folder", "csv", "parquet", "excel"] and not db_file_exists:
|
|
247
|
+
error(
|
|
248
|
+
f"Database {Fore.RED}{uri}{Style.RESET_ALL} not found. Databases of "
|
|
249
|
+
f"type '{db_type}' must be present on the harddrive. Please update "
|
|
250
|
+
"your node configuration file."
|
|
251
|
+
)
|
|
252
|
+
exit(1)
|
|
253
|
+
|
|
254
|
+
if not db_file_exists and not force_db_mount:
|
|
247
255
|
debug(" - non file-based database added")
|
|
248
256
|
env[f"{label_capitals}_DATABASE_URI"] = uri
|
|
249
257
|
else:
|
|
@@ -298,7 +306,7 @@ def cli_node_start(
|
|
|
298
306
|
volumes=volumes,
|
|
299
307
|
detach=True,
|
|
300
308
|
labels={
|
|
301
|
-
f"{APPNAME}-type": InstanceType.NODE,
|
|
309
|
+
f"{APPNAME}-type": InstanceType.NODE.value,
|
|
302
310
|
"system": str(system_folders),
|
|
303
311
|
"name": ctx.config_file_name,
|
|
304
312
|
},
|
vantage6/cli/node/stop.py
CHANGED
|
@@ -69,9 +69,13 @@ def cli_node_stop(
|
|
|
69
69
|
_stop_node(client, container_name, force, system_folders)
|
|
70
70
|
else:
|
|
71
71
|
if not name:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
try:
|
|
73
|
+
container_name = q.select(
|
|
74
|
+
"Select the node you wish to stop:", choices=running_node_names
|
|
75
|
+
).unsafe_ask()
|
|
76
|
+
except KeyboardInterrupt:
|
|
77
|
+
error("Aborted by user!")
|
|
78
|
+
return
|
|
75
79
|
else:
|
|
76
80
|
post_fix = "system" if system_folders else "user"
|
|
77
81
|
container_name = f"{APPNAME}-{name}-{post_fix}"
|
vantage6/cli/node/version.py
CHANGED
|
@@ -42,9 +42,13 @@ def cli_node_version(name: str, system_folders: bool) -> None:
|
|
|
42
42
|
"nodes that are running"
|
|
43
43
|
)
|
|
44
44
|
exit(1)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
try:
|
|
46
|
+
name = q.select(
|
|
47
|
+
"Select the node you wish to inspect:", choices=running_node_names
|
|
48
|
+
).unsafe_ask()
|
|
49
|
+
except KeyboardInterrupt:
|
|
50
|
+
error("Aborted by user!")
|
|
51
|
+
return
|
|
48
52
|
else:
|
|
49
53
|
post_fix = "system" if system_folders else "user"
|
|
50
54
|
name = f"{APPNAME}-{name}-{post_fix}"
|
vantage6/cli/server/attach.py
CHANGED
|
@@ -29,17 +29,21 @@ def cli_server_attach(name: str, system_folders: bool) -> None:
|
|
|
29
29
|
client = docker.from_env()
|
|
30
30
|
|
|
31
31
|
running_servers = client.containers.list(
|
|
32
|
-
filters={"label": f"{APPNAME}-type={InstanceType.SERVER}"}
|
|
32
|
+
filters={"label": f"{APPNAME}-type={InstanceType.SERVER.value}"}
|
|
33
33
|
)
|
|
34
34
|
running_server_names = [node.name for node in running_servers]
|
|
35
35
|
|
|
36
36
|
if not name:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
try:
|
|
38
|
+
name = q.select(
|
|
39
|
+
"Select the server you wish to attach:", choices=running_server_names
|
|
40
|
+
).unsafe_ask()
|
|
41
|
+
except KeyboardInterrupt:
|
|
42
|
+
error("Aborted by user!")
|
|
43
|
+
return
|
|
40
44
|
else:
|
|
41
45
|
post_fix = "system" if system_folders else "user"
|
|
42
|
-
name = f"{APPNAME}-{name}-{post_fix}-{InstanceType.SERVER}"
|
|
46
|
+
name = f"{APPNAME}-{name}-{post_fix}-{InstanceType.SERVER.value}"
|
|
43
47
|
|
|
44
48
|
if name in running_server_names:
|
|
45
49
|
container = client.containers.get(name)
|
vantage6/cli/server/import_.py
CHANGED
|
@@ -132,7 +132,10 @@ def cli_server_import(
|
|
|
132
132
|
command=cmd,
|
|
133
133
|
mounts=mounts,
|
|
134
134
|
detach=True,
|
|
135
|
-
labels={
|
|
135
|
+
labels={
|
|
136
|
+
f"{APPNAME}-type": InstanceType.SERVER.value,
|
|
137
|
+
"name": ctx.config_file_name,
|
|
138
|
+
},
|
|
136
139
|
environment=environment_vars,
|
|
137
140
|
auto_remove=not keep,
|
|
138
141
|
tty=True,
|
vantage6/cli/server/list.py
CHANGED
vantage6/cli/server/new.py
CHANGED
|
@@ -45,7 +45,11 @@ def cli_server_new(name: str, system_folders: bool) -> None:
|
|
|
45
45
|
exit(1)
|
|
46
46
|
|
|
47
47
|
# create config in ctx location
|
|
48
|
-
|
|
48
|
+
try:
|
|
49
|
+
cfg_file = configuration_wizard(InstanceType.SERVER, name, system_folders)
|
|
50
|
+
except KeyboardInterrupt:
|
|
51
|
+
error("Configuration creation aborted.")
|
|
52
|
+
exit(1)
|
|
49
53
|
info(f"New configuration created: {Fore.GREEN}{cfg_file}{Style.RESET_ALL}")
|
|
50
54
|
|
|
51
55
|
# info(f"root user created.")
|
vantage6/cli/server/shell.py
CHANGED
|
@@ -28,7 +28,7 @@ def cli_server_shell(ctx: ServerContext) -> None:
|
|
|
28
28
|
docker_client = docker.from_env()
|
|
29
29
|
|
|
30
30
|
running_servers = docker_client.containers.list(
|
|
31
|
-
filters={"label": f"{APPNAME}-type={InstanceType.SERVER}"}
|
|
31
|
+
filters={"label": f"{APPNAME}-type={InstanceType.SERVER.value}"}
|
|
32
32
|
)
|
|
33
33
|
|
|
34
34
|
if ctx.docker_container_name not in [s.name for s in running_servers]:
|
vantage6/cli/server/start.py
CHANGED
|
@@ -83,7 +83,7 @@ def cli_server_start(
|
|
|
83
83
|
Start the server.
|
|
84
84
|
"""
|
|
85
85
|
info("Starting server...")
|
|
86
|
-
docker_client = check_for_start(ctx, InstanceType.SERVER)
|
|
86
|
+
docker_client = check_for_start(ctx, InstanceType.SERVER.value)
|
|
87
87
|
|
|
88
88
|
image = get_image(image, ctx, "server", DEFAULT_SERVER_IMAGE)
|
|
89
89
|
|
|
@@ -131,7 +131,7 @@ def cli_server_start(
|
|
|
131
131
|
)
|
|
132
132
|
else:
|
|
133
133
|
warning(
|
|
134
|
-
"Message queue
|
|
134
|
+
"Message queue is not set up! This means that the vantage6 server "
|
|
135
135
|
"cannot be scaled horizontally!"
|
|
136
136
|
)
|
|
137
137
|
|
|
@@ -157,7 +157,10 @@ def cli_server_start(
|
|
|
157
157
|
command=cmd,
|
|
158
158
|
mounts=mounts,
|
|
159
159
|
detach=True,
|
|
160
|
-
labels={
|
|
160
|
+
labels={
|
|
161
|
+
f"{APPNAME}-type": InstanceType.SERVER.value,
|
|
162
|
+
"name": ctx.config_file_name,
|
|
163
|
+
},
|
|
161
164
|
environment=environment_vars,
|
|
162
165
|
ports={f"{internal_port}/tcp": (ip, port_)},
|
|
163
166
|
name=ctx.docker_container_name,
|
vantage6/cli/server/stop.py
CHANGED
|
@@ -37,7 +37,7 @@ def cli_server_stop(name: str, system_folders: bool, all_servers: bool):
|
|
|
37
37
|
client = docker.from_env()
|
|
38
38
|
|
|
39
39
|
running_servers = client.containers.list(
|
|
40
|
-
filters={"label": f"{APPNAME}-type={InstanceType.SERVER}"}
|
|
40
|
+
filters={"label": f"{APPNAME}-type={InstanceType.SERVER.value}"}
|
|
41
41
|
)
|
|
42
42
|
|
|
43
43
|
if not running_servers:
|
|
@@ -53,12 +53,16 @@ def cli_server_stop(name: str, system_folders: bool, all_servers: bool):
|
|
|
53
53
|
|
|
54
54
|
# make sure we have a configuration name to work with
|
|
55
55
|
if not name:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
try:
|
|
57
|
+
container_name = q.select(
|
|
58
|
+
"Select the server you wish to stop:", choices=running_server_names
|
|
59
|
+
).unsafe_ask()
|
|
60
|
+
except KeyboardInterrupt:
|
|
61
|
+
error("Aborted by user!")
|
|
62
|
+
return
|
|
59
63
|
else:
|
|
60
64
|
post_fix = "system" if system_folders else "user"
|
|
61
|
-
container_name = f"{APPNAME}-{name}-{post_fix}-{InstanceType.SERVER}"
|
|
65
|
+
container_name = f"{APPNAME}-{name}-{post_fix}-{InstanceType.SERVER.value}"
|
|
62
66
|
|
|
63
67
|
if container_name not in running_server_names:
|
|
64
68
|
error(f"{Fore.RED}{name}{Style.RESET_ALL} is not running!")
|
vantage6/cli/server/version.py
CHANGED
|
@@ -22,10 +22,10 @@ def cli_server_version(name: str, system_folders: bool) -> None:
|
|
|
22
22
|
check_docker_running()
|
|
23
23
|
client = docker.from_env()
|
|
24
24
|
|
|
25
|
-
running_server_names = get_running_servers(client, InstanceType.SERVER)
|
|
25
|
+
running_server_names = get_running_servers(client, InstanceType.SERVER.value)
|
|
26
26
|
|
|
27
27
|
name = get_server_name(
|
|
28
|
-
name, system_folders, running_server_names, InstanceType.SERVER
|
|
28
|
+
name, system_folders, running_server_names, InstanceType.SERVER.value
|
|
29
29
|
)
|
|
30
30
|
|
|
31
31
|
if name in running_server_names:
|
|
@@ -16,13 +16,13 @@ from vantage6.cli.test.common.diagnostic_runner import DiagnosticRunner
|
|
|
16
16
|
@click.option(
|
|
17
17
|
"--username",
|
|
18
18
|
type=str,
|
|
19
|
-
default="
|
|
19
|
+
default="dev_admin",
|
|
20
20
|
help="Username of vantage6 user account to create the task with",
|
|
21
21
|
)
|
|
22
22
|
@click.option(
|
|
23
23
|
"--password",
|
|
24
24
|
type=str,
|
|
25
|
-
default="
|
|
25
|
+
default="password",
|
|
26
26
|
help="Password of vantage6 user account to create the task with",
|
|
27
27
|
)
|
|
28
28
|
@click.option(
|
|
@@ -56,6 +56,12 @@ from vantage6.cli.test.common.diagnostic_runner import DiagnosticRunner
|
|
|
56
56
|
default=None,
|
|
57
57
|
help="Path to the private key for end-to-end encryption",
|
|
58
58
|
)
|
|
59
|
+
@click.option(
|
|
60
|
+
"--mfa-code",
|
|
61
|
+
type=str,
|
|
62
|
+
help="Multi-factor authentication code. Use this if MFA is enabled on the "
|
|
63
|
+
"server.",
|
|
64
|
+
)
|
|
59
65
|
def cli_test_features(
|
|
60
66
|
host: str,
|
|
61
67
|
port: int,
|
|
@@ -68,6 +74,7 @@ def cli_test_features(
|
|
|
68
74
|
online_only: bool,
|
|
69
75
|
no_vpn: bool,
|
|
70
76
|
private_key: str | None,
|
|
77
|
+
mfa_code: str | None,
|
|
71
78
|
) -> list[dict]:
|
|
72
79
|
"""
|
|
73
80
|
Run diagnostic checks on an existing vantage6 network.
|
|
@@ -83,7 +90,7 @@ def cli_test_features(
|
|
|
83
90
|
organizations = None
|
|
84
91
|
|
|
85
92
|
client = UserClient(host=host, port=port, path=api_path, log_level="critical")
|
|
86
|
-
client.authenticate(username=username, password=password)
|
|
93
|
+
client.authenticate(username=username, password=password, mfa_code=mfa_code)
|
|
87
94
|
client.setup_encryption(private_key)
|
|
88
95
|
diagnose = DiagnosticRunner(client, collaboration, organizations, online_only)
|
|
89
96
|
res = diagnose(base=True, vpn=not no_vpn)
|
vantage6/cli/utils.py
CHANGED
|
@@ -90,7 +90,11 @@ def prompt_config_name(name: str | None) -> None:
|
|
|
90
90
|
The name of the configuration
|
|
91
91
|
"""
|
|
92
92
|
if not name:
|
|
93
|
-
|
|
93
|
+
try:
|
|
94
|
+
name = q.text("Please enter a configuration-name:").unsafe_ask()
|
|
95
|
+
except KeyboardInterrupt:
|
|
96
|
+
error("Aborted by user!")
|
|
97
|
+
exit(1)
|
|
94
98
|
if name.count(" ") > 0:
|
|
95
99
|
name = name.replace(" ", "-")
|
|
96
100
|
info(f"Replaced spaces from configuration name: {name}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vantage6
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.10.0
|
|
4
4
|
Summary: vantage6 command line interface
|
|
5
5
|
Home-page: https://github.com/vantage6/vantage6
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -10,14 +10,14 @@ Requires-Dist: colorama==0.4.6
|
|
|
10
10
|
Requires-Dist: copier==9.2.0
|
|
11
11
|
Requires-Dist: docker==7.1.0
|
|
12
12
|
Requires-Dist: ipython==8.10.0
|
|
13
|
-
Requires-Dist: jinja2==3.1.
|
|
13
|
+
Requires-Dist: jinja2==3.1.6
|
|
14
14
|
Requires-Dist: pandas>=1.5.3
|
|
15
15
|
Requires-Dist: questionary==1.10.0
|
|
16
16
|
Requires-Dist: rich==13.5.2
|
|
17
17
|
Requires-Dist: schema==0.7.5
|
|
18
18
|
Requires-Dist: SQLAlchemy==1.4.46
|
|
19
|
-
Requires-Dist: vantage6-common==4.
|
|
20
|
-
Requires-Dist: vantage6-client==4.
|
|
19
|
+
Requires-Dist: vantage6-common==4.10.0
|
|
20
|
+
Requires-Dist: vantage6-client==4.10.0
|
|
21
21
|
Provides-Extra: dev
|
|
22
22
|
Requires-Dist: coverage==6.4.4; extra == "dev"
|
|
23
23
|
Requires-Dist: black; extra == "dev"
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
tests_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
tests_cli/test_example.py,sha256=0fw_v-lgZEacshWSDwLNyLMA1_xc48bKUGM3ll-n1L0,146
|
|
3
|
+
tests_cli/test_node_cli.py,sha256=XAKRS1-SXdeBRz3ob25q467soCIB178pKVz8MJVZbCQ,17534
|
|
4
|
+
tests_cli/test_server_cli.py,sha256=DLcOWM0ZCRTs-XMNsNKCOEELUMh22Ayow1FvAFLI0aA,5879
|
|
5
|
+
tests_cli/test_wizard.py,sha256=NIj59eiCBuVNJXwhofrWLmLIKAsD45gSOzqOFWLmWhY,4916
|
|
6
|
+
vantage6/cli/__build__,sha256=X-zrZv_IbzjZUnhsbWlsecLbwjndTpG0ZynXOif7V-k,1
|
|
7
|
+
vantage6/cli/__init__.py,sha256=ZXbeQ_-g2-M4XYteWZkoO5lMFYhqjm5doQgGy1fq8i0,125
|
|
8
|
+
vantage6/cli/_version.py,sha256=_EG_e0qRmCXkO8GQO74QenaB8Ycf83o3UU0JKF4Yu1k,697
|
|
9
|
+
vantage6/cli/cli.py,sha256=NHpiPcljADaVzwGYrG4FWVMfbmDRguSZWBeGxcdQxDo,6184
|
|
10
|
+
vantage6/cli/configuration_manager.py,sha256=QuR8Lvgjfp36aLnMV3PdbjddVJHOCvOv2Vci1bYHDHY,3642
|
|
11
|
+
vantage6/cli/configuration_wizard.py,sha256=ifqvrVqHkxoM0ZVUVIwlYXFByzAbuVlahNjmwFGLVRU,20874
|
|
12
|
+
vantage6/cli/globals.py,sha256=8AWI55FBbumVQTuI1bJzKp5hiRWtiwsVgTTKqWgRBes,1616
|
|
13
|
+
vantage6/cli/utils.py,sha256=Jfr6IeHMQDk_wU5X7rJ1dRY118dhVVX8PwzwMYMv9Vw,2481
|
|
14
|
+
vantage6/cli/algorithm/create.py,sha256=kRT1BlBcb0fDaB2Q988WxtA6EyAZmOW5QoU2uhbwBIo,2075
|
|
15
|
+
vantage6/cli/algorithm/update.py,sha256=WwAfTnq0kTOgePUsBzGoo1AJQqGMn82E9Bjk1wf61CQ,1338
|
|
16
|
+
vantage6/cli/algostore/attach.py,sha256=WcwamJXIt1wemvkNgQQHkcaaFHVj4lGrbUB4YtdAADE,1679
|
|
17
|
+
vantage6/cli/algostore/files.py,sha256=r89VRixK_K-c44qseq58Aa2Dqf1wEf8yompQRN5AVu4,580
|
|
18
|
+
vantage6/cli/algostore/list.py,sha256=WH-WkPbo-WtXe2I7XI_JCBB1rxZQuVo0jBqkFv63czo,423
|
|
19
|
+
vantage6/cli/algostore/new.py,sha256=ekqZ7_qCUtWs0QU6coo34thfkksHbCAYAD8nr0SKgO4,2147
|
|
20
|
+
vantage6/cli/algostore/remove.py,sha256=ieQLpo2ZpblpPxaeRXdB7IO0DzTtURnveYQltW7TTSw,1643
|
|
21
|
+
vantage6/cli/algostore/start.py,sha256=MI1wSvRdORyOdgZZKkyxFZSHwxUj060HXAlm-elYh0M,3181
|
|
22
|
+
vantage6/cli/algostore/stop.py,sha256=79C-q27x_BdkrwZGLVDnKOsyMiHXeG9k_UsfcLrGEgw,1841
|
|
23
|
+
vantage6/cli/common/decorator.py,sha256=7Iwlcc_ekgXJco4tNjEV79ul43Q28OrieiGkvDBeGeE,3625
|
|
24
|
+
vantage6/cli/common/start.py,sha256=tjz61lQ9yYf-ZAow_Zm3J17oJVDLSLBdxhfR8Wb9eoo,9255
|
|
25
|
+
vantage6/cli/common/utils.py,sha256=fr94GoVxKTJnkdR5ncxSBtg5T9rzi2o8OoMW4PMaEIY,4772
|
|
26
|
+
vantage6/cli/context/__init__.py,sha256=e8rfY2tCyu6_SLQ-rbVzEHkDtmbnGCZRHFN_HH-2bnA,2683
|
|
27
|
+
vantage6/cli/context/algorithm_store.py,sha256=RimxNcoqfWeu2WQede6wsOu1rx-azzXIPVkCDqVJLWs,3944
|
|
28
|
+
vantage6/cli/context/base_server.py,sha256=paKSzNrKWD-J6eakHAtGELk2cD05A8NqoCAuQfF7c2s,2972
|
|
29
|
+
vantage6/cli/context/node.py,sha256=4R7X__u_pyZVvRSNO3ojTnVQFTWhuIemoHcGP6hsD5I,7444
|
|
30
|
+
vantage6/cli/context/server.py,sha256=vBGJWNsJoVcIryX5OLiWnFklNRcjOVkhqm2U5tqW5b0,3946
|
|
31
|
+
vantage6/cli/dev/create.py,sha256=6LiK0MUZjZK_W932WnlMMVeCqX1L11F87Rk1UkU6O-4,19347
|
|
32
|
+
vantage6/cli/dev/remove.py,sha256=R_OU_LXLDCnoD-2xnegg4lh0B3t8EgpqzDqueLx16io,3730
|
|
33
|
+
vantage6/cli/dev/start.py,sha256=fUMoPAEpmXoDAJidAmjIziaHZX1yqEErcrTKEXqPik8,4471
|
|
34
|
+
vantage6/cli/dev/stop.py,sha256=gPy87r8T3nqe7RFJjlYE9Bns8N3RiPPcdzNIFCoqGRY,1430
|
|
35
|
+
vantage6/cli/dev/utils.py,sha256=DOTwPVXKZWhJfto9FG7EFgMhMaFJHXuhLDSlBCUCR1o,888
|
|
36
|
+
vantage6/cli/dev/data/olympic_athletes_2016.csv,sha256=WGycwcwMKEyOyJc3aEo4EhrnBJiTSE0kZAr50j2qzGk,77699
|
|
37
|
+
vantage6/cli/node/attach.py,sha256=6VADWJb4NTXu-TK_XR8It8J7OJ8f_xE2P8cpSd3vAzQ,2326
|
|
38
|
+
vantage6/cli/node/clean.py,sha256=uCty2GNuwoTybs1nIOygQLxtbleQ-rnnS6_4ieWVmCw,1199
|
|
39
|
+
vantage6/cli/node/create_private_key.py,sha256=yciL1DtACxrBeEGxeaDi0NefDTvegG6s4rr5jA9J5TY,5207
|
|
40
|
+
vantage6/cli/node/files.py,sha256=V7bJeR8weX0Llpp6y9wQoNrRsvlotEE6e70aTJp9j6M,1331
|
|
41
|
+
vantage6/cli/node/list.py,sha256=_WZ8EBIEUlzFhVp3cR2MK5FUuQicMEZHhD8npMwKSpM,1664
|
|
42
|
+
vantage6/cli/node/new.py,sha256=wuv8mdL4sLV91TJMIksU8dx2LlcUFrA1oORyiICruMw,2039
|
|
43
|
+
vantage6/cli/node/remove.py,sha256=Al1XALUwciOU6zIRQB2D9EggUdvtU23laOZTWyYKKvc,3552
|
|
44
|
+
vantage6/cli/node/restart.py,sha256=bWx0n4tN8TWOy_o8lJkA7AR-H1UIbfAiPp93I5wXg1Y,3709
|
|
45
|
+
vantage6/cli/node/set_api_key.py,sha256=2kB8wveTy9_N8kX4huVhJhY86Ppd2BI8v-d7MRXQAdA,1877
|
|
46
|
+
vantage6/cli/node/start.py,sha256=mV4vDBBtFcxva4MJdg5ymsstefDM4bV4pmhSsVX1o4k,12407
|
|
47
|
+
vantage6/cli/node/stop.py,sha256=-jw0DChIoUScVVwY4SBi_AvmdXT0XlMsGVuO9_vrpJI,4085
|
|
48
|
+
vantage6/cli/node/version.py,sha256=X921xyIvIPYObPac2Si5msZ2tay5ySidnPWmGj1ilZw,1959
|
|
49
|
+
vantage6/cli/node/common/__init__.py,sha256=ziGS3skkX6Kf4uvFqe22kdFbSck7mubNK5a-KgDAxX8,3467
|
|
50
|
+
vantage6/cli/rabbitmq/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
|
+
vantage6/cli/rabbitmq/definitions.py,sha256=CcS9jG7ZGB6LjzHQqZ2FliDurPItUvNSjHrOYptORZg,637
|
|
52
|
+
vantage6/cli/rabbitmq/queue_manager.py,sha256=KGDGHy4NBN8O9xhjzfI7mh65i9lOQIqQwrOFqvGFdHI,7545
|
|
53
|
+
vantage6/cli/rabbitmq/rabbitmq.config,sha256=LYAQAEoXaF472XeJDYXc9JfWSETIzPRIR2W-JB2i7fU,136
|
|
54
|
+
vantage6/cli/server/attach.py,sha256=yTjD8-PnSY8N8_NTlbHmBGGEH5MOJspfFiXHqjVzIKY,2137
|
|
55
|
+
vantage6/cli/server/files.py,sha256=LJhFyYHcEnCgFhVAM-lX6_EnfhMJ7YPdN21kVIpmwkc,507
|
|
56
|
+
vantage6/cli/server/import_.py,sha256=pW1WlVc7eKoLhprxkREz9g8RfXxkEylB2467PsRV8eI,4557
|
|
57
|
+
vantage6/cli/server/list.py,sha256=_kVBe7TrtUfT2ZLWPkVvKj4xx5AvS17e99Bwp0ajc_E,410
|
|
58
|
+
vantage6/cli/server/new.py,sha256=JnUMMD0UUSCOdO0K7v19l5HOV7vnMd9D38WUoEJ2F00,2094
|
|
59
|
+
vantage6/cli/server/remove.py,sha256=6tfKfVa5dYnZAKQYo_VlGZTuiugi7sh2F3U2cZ7mCmQ,1627
|
|
60
|
+
vantage6/cli/server/shell.py,sha256=7cSdBOwvloWyCz3RXHaFZUnxgNRV4gZUDmIFecV8Hks,1589
|
|
61
|
+
vantage6/cli/server/start.py,sha256=mPfsfkihJWf8bObNoln4YuBwOCVx3EstXtcNft8Pigo,7787
|
|
62
|
+
vantage6/cli/server/stop.py,sha256=DY3r9VsUk_r3cqIm1iL-U-kstLVb9pZsiGDSZyAMrKA,4147
|
|
63
|
+
vantage6/cli/server/version.py,sha256=aXAztHEky_F2jPbfPdHPfsAY7rdTurl0_3S6bL94_QQ,1318
|
|
64
|
+
vantage6/cli/server/common/__init__.py,sha256=htv0mFYa4GhIHdzA2xqUUgKhHcMh09UQERlIjIgrwOM,2062
|
|
65
|
+
vantage6/cli/template/algo_store_config.j2,sha256=XR-ly-47p6egH8lVh4lZZDh3YSV4kFnkZprdsfSkS2Y,552
|
|
66
|
+
vantage6/cli/template/node_config.j2,sha256=XHJm5x5KEwuBAZERzWzzVKJxcw7Px5k-LYSMET_8dqU,743
|
|
67
|
+
vantage6/cli/template/server_config.j2,sha256=3gEPY8YlqUMAQEgfR7a1HTU8WaCRhVzTS-IwPhsU1Gg,802
|
|
68
|
+
vantage6/cli/template/server_import_config.j2,sha256=9WT2XeG9-ADoYLb4ahXhof3i9Fcvg0oqwNPyFwLJpvc,1827
|
|
69
|
+
vantage6/cli/test/feature_tester.py,sha256=M8hvebupPwYjcBZoUB8GB3qb8G1-d3ipNzRMc_3-Z8E,2761
|
|
70
|
+
vantage6/cli/test/integration_test.py,sha256=yQVG72XKDNH_eOPTsf3pb65FCBwJzMxn5VNfUGemJBM,3808
|
|
71
|
+
vantage6/cli/test/common/diagnostic_runner.py,sha256=x_4ikihgoSTKI914pqlgVziBSg5LpV6MheO6O_GBCeA,6657
|
|
72
|
+
vantage6-4.10.0.dist-info/METADATA,sha256=kQJiMcDfAhaaJG3sKvd016zSDM9Ltgfg0D5ao4n7rpk,10881
|
|
73
|
+
vantage6-4.10.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
74
|
+
vantage6-4.10.0.dist-info/entry_points.txt,sha256=YFBvwjxoeAGxYyPC-YevEgOBBYRGaXkS6jiOGGCLNy0,157
|
|
75
|
+
vantage6-4.10.0.dist-info/top_level.txt,sha256=CYDIBS8jEfFq5YCs_Fuit54K9-3wdosZppTrsymIoUk,19
|
|
76
|
+
vantage6-4.10.0.dist-info/RECORD,,
|