vantage6 4.10.1rc1__tar.gz → 5.0.0a7__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.
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/PKG-INFO +1 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/setup.py +2 -2
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/tests_cli/test_server_cli.py +2 -2
- vantage6-5.0.0a7/vantage6/cli/__build__ +1 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/_version.py +1 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/algostore/attach.py +2 -2
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/algostore/list.py +1 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/algostore/start.py +2 -2
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/algostore/stop.py +1 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/common/start.py +1 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/common/utils.py +3 -10
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/configuration_manager.py +0 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/context/algorithm_store.py +1 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/context/node.py +18 -19
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/dev/create.py +7 -9
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/dev/remove.py +1 -18
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/node/common/__init__.py +1 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/node/start.py +2 -2
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/node/stop.py +3 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/server/attach.py +2 -2
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/server/import_.py +1 -4
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/server/list.py +1 -2
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/server/shell.py +1 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/server/start.py +2 -5
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/server/stop.py +2 -2
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/server/version.py +2 -2
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/template/algo_store_config.j2 +1 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/template/node_config.j2 +3 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/template/server_config.j2 +1 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6.egg-info/PKG-INFO +1 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6.egg-info/SOURCES.txt +0 -1
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6.egg-info/requires.txt +4 -4
- vantage6-4.10.1rc1/vantage6/cli/__build__ +0 -1
- vantage6-4.10.1rc1/vantage6/cli/dev/data/olympic_athletes_2016.csv +0 -2425
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/setup.cfg +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/tests_cli/__init__.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/tests_cli/test_example.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/tests_cli/test_node_cli.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/tests_cli/test_wizard.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/__init__.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/algorithm/create.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/algorithm/update.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/algostore/files.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/algostore/new.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/algostore/remove.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/cli.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/common/decorator.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/configuration_wizard.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/context/__init__.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/context/base_server.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/context/server.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/dev/start.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/dev/stop.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/dev/utils.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/globals.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/node/attach.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/node/clean.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/node/create_private_key.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/node/files.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/node/list.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/node/new.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/node/remove.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/node/restart.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/node/set_api_key.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/node/version.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/rabbitmq/__init__.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/rabbitmq/definitions.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/rabbitmq/queue_manager.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/rabbitmq/rabbitmq.config +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/server/common/__init__.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/server/files.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/server/new.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/server/remove.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/template/server_import_config.j2 +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/test/common/diagnostic_runner.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/test/feature_tester.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/test/integration_test.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6/cli/utils.py +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6.egg-info/dependency_links.txt +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6.egg-info/entry_points.txt +0 -0
- {vantage6-4.10.1rc1 → vantage6-5.0.0a7}/vantage6.egg-info/top_level.txt +0 -0
|
@@ -38,12 +38,12 @@ setup(
|
|
|
38
38
|
"copier==9.2.0",
|
|
39
39
|
"docker==7.1.0",
|
|
40
40
|
"ipython==8.10.0",
|
|
41
|
-
"jinja2==3.1.
|
|
41
|
+
"jinja2==3.1.5",
|
|
42
42
|
"pandas>=1.5.3",
|
|
43
43
|
"questionary==1.10.0",
|
|
44
44
|
"rich==13.5.2",
|
|
45
45
|
"schema==0.7.5",
|
|
46
|
-
"
|
|
46
|
+
"sqlalchemy==2.0.37",
|
|
47
47
|
f'vantage6-common == {version_ns["__version__"]}',
|
|
48
48
|
f'vantage6-client == {version_ns["__version__"]}',
|
|
49
49
|
],
|
|
@@ -132,7 +132,7 @@ class ServerCLITest(unittest.TestCase):
|
|
|
132
132
|
"""Stop server without errors."""
|
|
133
133
|
|
|
134
134
|
container1 = MagicMock()
|
|
135
|
-
container1.name = f"{APPNAME}-iknl-system-{InstanceType.SERVER
|
|
135
|
+
container1.name = f"{APPNAME}-iknl-system-{InstanceType.SERVER}"
|
|
136
136
|
containers.containers.list.return_value = [container1]
|
|
137
137
|
|
|
138
138
|
runner = CliRunner()
|
|
@@ -146,7 +146,7 @@ class ServerCLITest(unittest.TestCase):
|
|
|
146
146
|
def test_attach(self, containers, sleep):
|
|
147
147
|
"""Attach log to the console without errors."""
|
|
148
148
|
container1 = MagicMock()
|
|
149
|
-
container1.name = f"{APPNAME}-iknl-system-{InstanceType.SERVER
|
|
149
|
+
container1.name = f"{APPNAME}-iknl-system-{InstanceType.SERVER}"
|
|
150
150
|
containers.list.return_value = [container1]
|
|
151
151
|
|
|
152
152
|
sleep.side_effect = KeyboardInterrupt("Boom!")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7
|
|
@@ -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 = (
|
|
10
|
+
version_info = (5, 0, 0, "alpha", __build__, 0)
|
|
11
11
|
|
|
12
12
|
# Module version stage suffix map
|
|
13
13
|
_specifier_ = {"alpha": "a", "beta": "b", "candidate": "rc", "final": ""}
|
|
@@ -25,7 +25,7 @@ def cli_algo_store_attach(name: str, system_folders: bool) -> None:
|
|
|
25
25
|
client = docker.from_env()
|
|
26
26
|
|
|
27
27
|
running_servers = client.containers.list(
|
|
28
|
-
filters={"label": f"{APPNAME}-type={InstanceType.ALGORITHM_STORE
|
|
28
|
+
filters={"label": f"{APPNAME}-type={InstanceType.ALGORITHM_STORE}"}
|
|
29
29
|
)
|
|
30
30
|
running_server_names = [container.name for container in running_servers]
|
|
31
31
|
|
|
@@ -40,7 +40,7 @@ def cli_algo_store_attach(name: str, system_folders: bool) -> None:
|
|
|
40
40
|
return
|
|
41
41
|
else:
|
|
42
42
|
post_fix = "system" if system_folders else "user"
|
|
43
|
-
name = f"{APPNAME}-{name}-{post_fix}-{InstanceType.ALGORITHM_STORE
|
|
43
|
+
name = f"{APPNAME}-{name}-{post_fix}-{InstanceType.ALGORITHM_STORE}"
|
|
44
44
|
|
|
45
45
|
if name in running_server_names:
|
|
46
46
|
container = client.containers.get(name)
|
|
@@ -54,7 +54,7 @@ def cli_algo_store_start(
|
|
|
54
54
|
Start the algorithm store server.
|
|
55
55
|
"""
|
|
56
56
|
info("Starting algorithm store...")
|
|
57
|
-
docker_client = check_for_start(ctx, InstanceType.ALGORITHM_STORE
|
|
57
|
+
docker_client = check_for_start(ctx, InstanceType.ALGORITHM_STORE)
|
|
58
58
|
|
|
59
59
|
image = get_image(image, ctx, "algorithm-store", DEFAULT_ALGO_STORE_IMAGE)
|
|
60
60
|
|
|
@@ -91,7 +91,7 @@ def cli_algo_store_start(
|
|
|
91
91
|
mounts=mounts,
|
|
92
92
|
detach=True,
|
|
93
93
|
labels={
|
|
94
|
-
f"{APPNAME}-type": InstanceType.ALGORITHM_STORE
|
|
94
|
+
f"{APPNAME}-type": InstanceType.ALGORITHM_STORE,
|
|
95
95
|
"name": ctx.config_file_name,
|
|
96
96
|
},
|
|
97
97
|
environment=environment_vars,
|
|
@@ -23,7 +23,7 @@ def cli_algo_store_stop(ctx: AlgorithmStoreContext, all_stores: bool):
|
|
|
23
23
|
client = docker.from_env()
|
|
24
24
|
|
|
25
25
|
running_stores = client.containers.list(
|
|
26
|
-
filters={"label": f"{APPNAME}-type={InstanceType.ALGORITHM_STORE
|
|
26
|
+
filters={"label": f"{APPNAME}-type={InstanceType.ALGORITHM_STORE}"}
|
|
27
27
|
)
|
|
28
28
|
|
|
29
29
|
if not running_stores:
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import enum
|
|
2
1
|
import questionary as q
|
|
3
2
|
from colorama import Fore, Style
|
|
4
3
|
import click
|
|
@@ -88,11 +87,7 @@ def get_server_configuration_list(instance_type: InstanceType.SERVER) -> None:
|
|
|
88
87
|
client = docker.from_env()
|
|
89
88
|
ctx_class = select_context_class(instance_type)
|
|
90
89
|
|
|
91
|
-
|
|
92
|
-
instance_type.value if isinstance(instance_type, enum.Enum) else instance_type
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
running_server_names = get_running_servers(client, instance_type_value)
|
|
90
|
+
running_server_names = get_running_servers(client, instance_type)
|
|
96
91
|
header = "\nName" + (21 * " ") + "Status" + (10 * " ") + "System/User"
|
|
97
92
|
|
|
98
93
|
click.echo(header)
|
|
@@ -106,8 +101,7 @@ def get_server_configuration_list(instance_type: InstanceType.SERVER) -> None:
|
|
|
106
101
|
for config in configs:
|
|
107
102
|
status = (
|
|
108
103
|
running
|
|
109
|
-
if f"{APPNAME}-{config.name}-system-{
|
|
110
|
-
in running_server_names
|
|
104
|
+
if f"{APPNAME}-{config.name}-system-{instance_type}" in running_server_names
|
|
111
105
|
else stopped
|
|
112
106
|
)
|
|
113
107
|
click.echo(f"{config.name:25}" f"{status:25} System ")
|
|
@@ -117,8 +111,7 @@ def get_server_configuration_list(instance_type: InstanceType.SERVER) -> None:
|
|
|
117
111
|
for config in configs:
|
|
118
112
|
status = (
|
|
119
113
|
running
|
|
120
|
-
if f"{APPNAME}-{config.name}-user-{
|
|
121
|
-
in running_server_names
|
|
114
|
+
if f"{APPNAME}-{config.name}-user-{instance_type}" in running_server_names
|
|
122
115
|
else stopped
|
|
123
116
|
)
|
|
124
117
|
click.echo(f"{config.name:25}" f"{status:25} User ")
|
|
@@ -53,7 +53,7 @@ class AlgorithmStoreContext(BaseServerContext):
|
|
|
53
53
|
str
|
|
54
54
|
Server's docker container name
|
|
55
55
|
"""
|
|
56
|
-
return f"{APPNAME}-{self.name}-{self.scope}-{ServerType.ALGORITHM_STORE
|
|
56
|
+
return f"{APPNAME}-{self.name}-{self.scope}-{ServerType.ALGORITHM_STORE}"
|
|
57
57
|
|
|
58
58
|
@classmethod
|
|
59
59
|
def from_external_config_file(
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import hashlib
|
|
3
4
|
import os.path
|
|
4
5
|
|
|
5
6
|
from pathlib import Path
|
|
6
7
|
|
|
7
8
|
from vantage6.common.context import AppContext
|
|
8
|
-
from vantage6.common.globals import APPNAME, InstanceType
|
|
9
|
+
from vantage6.common.globals import APPNAME, STRING_ENCODING, InstanceType
|
|
9
10
|
from vantage6.cli.configuration_manager import NodeConfigurationManager
|
|
10
11
|
from vantage6.cli.globals import DEFAULT_NODE_SYSTEM_FOLDERS as N_FOL
|
|
11
12
|
from vantage6.cli._version import __version__
|
|
@@ -39,6 +40,7 @@ class NodeContext(AppContext):
|
|
|
39
40
|
system_folders: bool = N_FOL,
|
|
40
41
|
config_file: str = None,
|
|
41
42
|
print_log_header: bool = True,
|
|
43
|
+
logger_prefix: str = "",
|
|
42
44
|
):
|
|
43
45
|
super().__init__(
|
|
44
46
|
InstanceType.NODE,
|
|
@@ -46,9 +48,11 @@ class NodeContext(AppContext):
|
|
|
46
48
|
system_folders,
|
|
47
49
|
config_file,
|
|
48
50
|
print_log_header,
|
|
51
|
+
logger_prefix,
|
|
49
52
|
)
|
|
50
53
|
if print_log_header:
|
|
51
54
|
self.log.info("vantage6 version '%s'", __version__)
|
|
55
|
+
self.identifier = self.__create_node_identifier()
|
|
52
56
|
|
|
53
57
|
@classmethod
|
|
54
58
|
def from_external_config_file(
|
|
@@ -132,7 +136,7 @@ class NodeContext(AppContext):
|
|
|
132
136
|
Path
|
|
133
137
|
Path to the data folder
|
|
134
138
|
"""
|
|
135
|
-
return AppContext.type_data_folder(InstanceType.NODE
|
|
139
|
+
return AppContext.type_data_folder(InstanceType.NODE, system_folders)
|
|
136
140
|
|
|
137
141
|
@property
|
|
138
142
|
def databases(self) -> dict:
|
|
@@ -230,36 +234,31 @@ class NodeContext(AppContext):
|
|
|
230
234
|
def proxy_log_file(self):
|
|
231
235
|
return self.log_file_name(type_="proxy_server")
|
|
232
236
|
|
|
233
|
-
def
|
|
237
|
+
def get_database_uri(self, label: str = "default") -> str:
|
|
234
238
|
"""
|
|
235
|
-
|
|
236
|
-
linked to a specific run. Multiple algorithm containers can have the
|
|
237
|
-
same run id, and therefore the share same temporary volume.
|
|
239
|
+
Obtain the database URI for a specific database.
|
|
238
240
|
|
|
239
241
|
Parameters
|
|
240
242
|
----------
|
|
241
|
-
|
|
242
|
-
|
|
243
|
+
label : str, optional
|
|
244
|
+
Database label, by default "default"
|
|
243
245
|
|
|
244
246
|
Returns
|
|
245
247
|
-------
|
|
246
248
|
str
|
|
247
|
-
|
|
249
|
+
URI to the database
|
|
248
250
|
"""
|
|
249
|
-
return
|
|
251
|
+
return self.config["databases"][label]
|
|
250
252
|
|
|
251
|
-
def
|
|
253
|
+
def __create_node_identifier(self) -> str:
|
|
252
254
|
"""
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
Parameters
|
|
256
|
-
----------
|
|
257
|
-
label : str, optional
|
|
258
|
-
Database label, by default "default"
|
|
255
|
+
Create a unique identifier for the node.
|
|
259
256
|
|
|
260
257
|
Returns
|
|
261
258
|
-------
|
|
262
259
|
str
|
|
263
|
-
|
|
260
|
+
Unique identifier for the node
|
|
264
261
|
"""
|
|
265
|
-
return
|
|
262
|
+
return hashlib.sha256(
|
|
263
|
+
self.config.get("api_key").encode(STRING_ENCODING)
|
|
264
|
+
).hexdigest()[:16]
|
|
@@ -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
|
|
11
|
+
from vantage6.common import 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
|
|
@@ -49,7 +49,7 @@ def create_node_data_files(num_nodes: int, server_name: str) -> list[Path]:
|
|
|
49
49
|
start = i * length_df // num_nodes
|
|
50
50
|
end = (i + 1) * length_df // num_nodes
|
|
51
51
|
data = full_df[start:end]
|
|
52
|
-
data_file = data_folder / f"
|
|
52
|
+
data_file = data_folder / f"{node_name}.csv"
|
|
53
53
|
|
|
54
54
|
# write data to file
|
|
55
55
|
data.to_csv(data_file, index=False)
|
|
@@ -114,15 +114,13 @@ def create_node_config_file(
|
|
|
114
114
|
}
|
|
115
115
|
)
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
try:
|
|
118
|
+
with open(full_path, "x") as f:
|
|
119
|
+
f.write(node_config)
|
|
120
|
+
except Exception as e:
|
|
121
|
+
error(f"Could not write node configuration file: {e}")
|
|
120
122
|
exit(1)
|
|
121
123
|
|
|
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
|
-
|
|
126
124
|
info(
|
|
127
125
|
f"Spawned node for organization {Fore.GREEN}{config['org_id']}"
|
|
128
126
|
f"{Style.RESET_ALL}"
|
|
@@ -4,12 +4,9 @@ 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
|
|
9
7
|
|
|
10
8
|
from vantage6.cli.context.algorithm_store import AlgorithmStoreContext
|
|
11
|
-
from vantage6.common import info
|
|
12
|
-
from vantage6.common.globals import APPNAME
|
|
9
|
+
from vantage6.common import info
|
|
13
10
|
from vantage6.cli.context.server import ServerContext
|
|
14
11
|
from vantage6.cli.context.node import NodeContext
|
|
15
12
|
from vantage6.cli.server.remove import cli_server_remove
|
|
@@ -37,20 +34,6 @@ def remove_demo_network(
|
|
|
37
34
|
"""
|
|
38
35
|
ctx = get_dev_server_context(config, name)
|
|
39
36
|
|
|
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
|
-
|
|
54
37
|
# remove the server
|
|
55
38
|
for handler in itertools.chain(ctx.log.handlers, ctx.log.root.handlers):
|
|
56
39
|
handler.close()
|
|
@@ -130,6 +130,6 @@ def find_running_node_names(client: docker.DockerClient) -> list[str]:
|
|
|
130
130
|
List of names of running nodes
|
|
131
131
|
"""
|
|
132
132
|
running_nodes = client.containers.list(
|
|
133
|
-
filters={"label": f"{APPNAME}-type={InstanceType.NODE
|
|
133
|
+
filters={"label": f"{APPNAME}-type={InstanceType.NODE}"}
|
|
134
134
|
)
|
|
135
135
|
return [node.name for node in running_nodes]
|
|
@@ -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}"}
|
|
82
82
|
)
|
|
83
83
|
|
|
84
84
|
suffix = "system" if system_folders else "user"
|
|
@@ -306,7 +306,7 @@ def cli_node_start(
|
|
|
306
306
|
volumes=volumes,
|
|
307
307
|
detach=True,
|
|
308
308
|
labels={
|
|
309
|
-
f"{APPNAME}-type": InstanceType.NODE
|
|
309
|
+
f"{APPNAME}-type": InstanceType.NODE,
|
|
310
310
|
"system": str(system_folders),
|
|
311
311
|
"name": ctx.config_file_name,
|
|
312
312
|
},
|
|
@@ -120,8 +120,10 @@ def _stop_node(
|
|
|
120
120
|
scope = "system" if system_folders else "user"
|
|
121
121
|
config_name = get_server_config_name(container_name, scope)
|
|
122
122
|
ctx = NodeContext(config_name, system_folders, print_log_header=False)
|
|
123
|
+
|
|
124
|
+
# Do not delete the data volume as this would remove all sessions.
|
|
123
125
|
for volume in [
|
|
124
|
-
ctx.docker_volume_name,
|
|
126
|
+
# ctx.docker_volume_name,
|
|
125
127
|
ctx.docker_squid_volume_name,
|
|
126
128
|
ctx.docker_ssh_volume_name,
|
|
127
129
|
ctx.docker_vpn_volume_name,
|
|
@@ -29,7 +29,7 @@ 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}"}
|
|
33
33
|
)
|
|
34
34
|
running_server_names = [node.name for node in running_servers]
|
|
35
35
|
|
|
@@ -43,7 +43,7 @@ def cli_server_attach(name: str, system_folders: bool) -> None:
|
|
|
43
43
|
return
|
|
44
44
|
else:
|
|
45
45
|
post_fix = "system" if system_folders else "user"
|
|
46
|
-
name = f"{APPNAME}-{name}-{post_fix}-{InstanceType.SERVER
|
|
46
|
+
name = f"{APPNAME}-{name}-{post_fix}-{InstanceType.SERVER}"
|
|
47
47
|
|
|
48
48
|
if name in running_server_names:
|
|
49
49
|
container = client.containers.get(name)
|
|
@@ -132,10 +132,7 @@ def cli_server_import(
|
|
|
132
132
|
command=cmd,
|
|
133
133
|
mounts=mounts,
|
|
134
134
|
detach=True,
|
|
135
|
-
labels={
|
|
136
|
-
f"{APPNAME}-type": InstanceType.SERVER.value,
|
|
137
|
-
"name": ctx.config_file_name,
|
|
138
|
-
},
|
|
135
|
+
labels={f"{APPNAME}-type": InstanceType.SERVER, "name": ctx.config_file_name},
|
|
139
136
|
environment=environment_vars,
|
|
140
137
|
auto_remove=not keep,
|
|
141
138
|
tty=True,
|
|
@@ -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}"}
|
|
32
32
|
)
|
|
33
33
|
|
|
34
34
|
if ctx.docker_container_name not in [s.name for s in running_servers]:
|
|
@@ -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)
|
|
87
87
|
|
|
88
88
|
image = get_image(image, ctx, "server", DEFAULT_SERVER_IMAGE)
|
|
89
89
|
|
|
@@ -157,10 +157,7 @@ def cli_server_start(
|
|
|
157
157
|
command=cmd,
|
|
158
158
|
mounts=mounts,
|
|
159
159
|
detach=True,
|
|
160
|
-
labels={
|
|
161
|
-
f"{APPNAME}-type": InstanceType.SERVER.value,
|
|
162
|
-
"name": ctx.config_file_name,
|
|
163
|
-
},
|
|
160
|
+
labels={f"{APPNAME}-type": InstanceType.SERVER, "name": ctx.config_file_name},
|
|
164
161
|
environment=environment_vars,
|
|
165
162
|
ports={f"{internal_port}/tcp": (ip, port_)},
|
|
166
163
|
name=ctx.docker_container_name,
|
|
@@ -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}"}
|
|
41
41
|
)
|
|
42
42
|
|
|
43
43
|
if not running_servers:
|
|
@@ -62,7 +62,7 @@ def cli_server_stop(name: str, system_folders: bool, all_servers: bool):
|
|
|
62
62
|
return
|
|
63
63
|
else:
|
|
64
64
|
post_fix = "system" if system_folders else "user"
|
|
65
|
-
container_name = f"{APPNAME}-{name}-{post_fix}-{InstanceType.SERVER
|
|
65
|
+
container_name = f"{APPNAME}-{name}-{post_fix}-{InstanceType.SERVER}"
|
|
66
66
|
|
|
67
67
|
if container_name not in running_server_names:
|
|
68
68
|
error(f"{Fore.RED}{name}{Style.RESET_ALL} is not running!")
|
|
@@ -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)
|
|
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
|
|
29
29
|
)
|
|
30
30
|
|
|
31
31
|
if name in running_server_names:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
api_key: {{ api_key }}
|
|
2
|
-
api_path:
|
|
2
|
+
api_path: {{ api_path }}
|
|
3
3
|
databases:
|
|
4
4
|
{% for label, path in databases.items() %}
|
|
5
5
|
- label: {{ label }}
|
|
@@ -28,6 +28,8 @@ logging:
|
|
|
28
28
|
name: docker.utils.config
|
|
29
29
|
- level: warning
|
|
30
30
|
name: docker.auth
|
|
31
|
+
- level: warning
|
|
32
|
+
name: kubernetes.client.rest
|
|
31
33
|
port: {{ port }}
|
|
32
34
|
server_url: {{ server_url }}
|
|
33
35
|
task_dir: {{ task_dir}}
|
|
@@ -40,7 +40,6 @@ vantage6/cli/dev/remove.py
|
|
|
40
40
|
vantage6/cli/dev/start.py
|
|
41
41
|
vantage6/cli/dev/stop.py
|
|
42
42
|
vantage6/cli/dev/utils.py
|
|
43
|
-
vantage6/cli/dev/data/olympic_athletes_2016.csv
|
|
44
43
|
vantage6/cli/node/attach.py
|
|
45
44
|
vantage6/cli/node/clean.py
|
|
46
45
|
vantage6/cli/node/create_private_key.py
|
|
@@ -3,14 +3,14 @@ colorama==0.4.6
|
|
|
3
3
|
copier==9.2.0
|
|
4
4
|
docker==7.1.0
|
|
5
5
|
ipython==8.10.0
|
|
6
|
-
jinja2==3.1.
|
|
6
|
+
jinja2==3.1.5
|
|
7
7
|
pandas>=1.5.3
|
|
8
8
|
questionary==1.10.0
|
|
9
9
|
rich==13.5.2
|
|
10
10
|
schema==0.7.5
|
|
11
|
-
|
|
12
|
-
vantage6-common==
|
|
13
|
-
vantage6-client==
|
|
11
|
+
sqlalchemy==2.0.37
|
|
12
|
+
vantage6-common==5.0.0a7
|
|
13
|
+
vantage6-client==5.0.0a7
|
|
14
14
|
|
|
15
15
|
[dev]
|
|
16
16
|
coverage==6.4.4
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1
|