vantage6 5.0.0a26__py3-none-any.whl → 5.0.0a29__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_server_cli.py +7 -6
- tests_cli/test_wizard.py +7 -7
- vantage6/cli/__build__ +1 -1
- vantage6/cli/algorithm/generate_algorithm_json.py +31 -29
- vantage6/cli/algostore/list.py +2 -1
- vantage6/cli/algostore/start.py +6 -6
- vantage6/cli/algostore/stop.py +3 -2
- vantage6/cli/common/decorator.py +3 -1
- vantage6/cli/common/start.py +2 -4
- vantage6/cli/common/utils.py +7 -13
- vantage6/cli/configuration_manager.py +5 -3
- vantage6/cli/configuration_wizard.py +6 -10
- vantage6/cli/context/__init__.py +2 -1
- vantage6/cli/context/algorithm_store.py +10 -7
- vantage6/cli/context/node.py +4 -9
- vantage6/cli/context/server.py +10 -5
- vantage6/cli/dev/create.py +11 -13
- vantage6/cli/dev/remove.py +2 -2
- vantage6/cli/globals.py +5 -5
- vantage6/cli/node/common/__init__.py +6 -5
- vantage6/cli/node/start.py +18 -24
- vantage6/cli/server/files.py +4 -2
- vantage6/cli/server/import_.py +7 -7
- vantage6/cli/server/list.py +2 -1
- vantage6/cli/server/shell.py +5 -4
- vantage6/cli/server/start.py +2 -1
- vantage6/cli/server/stop.py +3 -2
- vantage6/cli/server/version.py +5 -4
- vantage6/cli/template/node_config.j2 +2 -0
- vantage6/cli/test/algo_test_scripts/algo_test_script.py +6 -5
- vantage6/cli/test/feature_tester.py +5 -2
- {vantage6-5.0.0a26.dist-info → vantage6-5.0.0a29.dist-info}/METADATA +13 -6
- {vantage6-5.0.0a26.dist-info → vantage6-5.0.0a29.dist-info}/RECORD +36 -36
- {vantage6-5.0.0a26.dist-info → vantage6-5.0.0a29.dist-info}/WHEEL +1 -1
- {vantage6-5.0.0a26.dist-info → vantage6-5.0.0a29.dist-info}/entry_points.txt +0 -0
- {vantage6-5.0.0a26.dist-info → vantage6-5.0.0a29.dist-info}/top_level.txt +0 -0
vantage6/cli/dev/create.py
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
1
|
from importlib import resources as impresources
|
|
3
|
-
import
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
4
|
import click
|
|
5
5
|
import pandas as pd
|
|
6
|
-
|
|
7
|
-
from jinja2 import Environment, FileSystemLoader
|
|
6
|
+
import yaml
|
|
8
7
|
from colorama import Fore, Style
|
|
8
|
+
from jinja2 import Environment, FileSystemLoader
|
|
9
9
|
|
|
10
|
+
from vantage6.common import ensure_config_dir_writable, error, generate_apikey, info
|
|
10
11
|
from vantage6.common.globals import APPNAME, InstanceType, Ports
|
|
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
|
|
15
|
-
from vantage6.cli.globals import PACKAGE_FOLDER, DefaultDatasets
|
|
16
|
-
from vantage6.cli.context.server import ServerContext
|
|
17
15
|
from vantage6.cli.context.node import NodeContext
|
|
16
|
+
from vantage6.cli.context.server import ServerContext
|
|
17
|
+
from vantage6.cli.globals import PACKAGE_FOLDER, DefaultDatasets
|
|
18
18
|
from vantage6.cli.server.common import get_server_context
|
|
19
19
|
from vantage6.cli.server.import_ import cli_server_import
|
|
20
20
|
from vantage6.cli.utils import prompt_config_name
|
|
@@ -428,7 +428,7 @@ def create_algo_store_config(
|
|
|
428
428
|
)
|
|
429
429
|
folders = AlgorithmStoreContext.instance_folders(
|
|
430
430
|
instance_type=InstanceType.ALGORITHM_STORE,
|
|
431
|
-
instance_name="{server_name}_store",
|
|
431
|
+
instance_name=f"{server_name}_store",
|
|
432
432
|
system_folders=False,
|
|
433
433
|
)
|
|
434
434
|
|
|
@@ -546,21 +546,19 @@ def demo_network(
|
|
|
546
546
|
"--server-port",
|
|
547
547
|
type=int,
|
|
548
548
|
default=Ports.DEV_SERVER.value,
|
|
549
|
-
help=f"Port to run the server on. Default is {Ports.DEV_SERVER
|
|
549
|
+
help=f"Port to run the server on. Default is {Ports.DEV_SERVER}.",
|
|
550
550
|
)
|
|
551
551
|
@click.option(
|
|
552
552
|
"--ui-port",
|
|
553
553
|
type=int,
|
|
554
554
|
default=Ports.DEV_UI.value,
|
|
555
|
-
help=f"Port to run the UI on. Default is {Ports.DEV_UI
|
|
555
|
+
help=f"Port to run the UI on. Default is {Ports.DEV_UI}.",
|
|
556
556
|
)
|
|
557
557
|
@click.option(
|
|
558
558
|
"--algorithm-store-port",
|
|
559
559
|
type=int,
|
|
560
560
|
default=Ports.DEV_ALGO_STORE.value,
|
|
561
|
-
help=(
|
|
562
|
-
f"Port to run the algorithm store on. Default is {Ports.DEV_ALGO_STORE.value}."
|
|
563
|
-
),
|
|
561
|
+
help=(f"Port to run the algorithm store on. Default is {Ports.DEV_ALGO_STORE}."),
|
|
564
562
|
)
|
|
565
563
|
@click.option(
|
|
566
564
|
"-i",
|
vantage6/cli/dev/remove.py
CHANGED
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
# # check that the server is not running
|
|
42
42
|
# client = docker.from_env()
|
|
43
43
|
# running_servers = client.containers.list(
|
|
44
|
-
# filters={"label": f"{APPNAME}-type={InstanceType.SERVER
|
|
44
|
+
# filters={"label": f"{APPNAME}-type={InstanceType.SERVER}"}
|
|
45
45
|
# )
|
|
46
46
|
# running_server_names = [server.name for server in running_servers]
|
|
47
|
-
# container_name = f"{APPNAME}-{name}-user-{InstanceType.SERVER
|
|
47
|
+
# container_name = f"{APPNAME}-{name}-user-{InstanceType.SERVER}"
|
|
48
48
|
# if container_name in running_server_names:
|
|
49
49
|
# error(
|
|
50
50
|
# f"Server {Fore.RED}{name}{Style.RESET_ALL} is still running! First stop "
|
vantage6/cli/globals.py
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
This module contains global variables that are used throughout the CLI.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from enum import Enum
|
|
6
5
|
from pathlib import Path
|
|
7
6
|
|
|
7
|
+
from vantage6.common.enum import StrEnumBase
|
|
8
8
|
from vantage6.common.globals import APPNAME
|
|
9
9
|
|
|
10
10
|
#
|
|
@@ -58,28 +58,28 @@ PROMETHEUS_DIR = "prometheus"
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
# datasets included in the nodes of the dev network
|
|
61
|
-
class DefaultDatasets(
|
|
61
|
+
class DefaultDatasets(StrEnumBase):
|
|
62
62
|
"""Enum containing default datasets"""
|
|
63
63
|
|
|
64
64
|
OLYMPIC_ATHLETES = "olympic_athletes_2016.csv"
|
|
65
65
|
KAPLAN_MEIER_TEST = "km_dataset.csv"
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
class ServerType(
|
|
68
|
+
class ServerType(StrEnumBase):
|
|
69
69
|
"""Enum containing server types"""
|
|
70
70
|
|
|
71
71
|
V6SERVER = "server"
|
|
72
72
|
ALGORITHM_STORE = "algorithm-store"
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
class ServerGlobals(
|
|
75
|
+
class ServerGlobals(StrEnumBase):
|
|
76
76
|
"""Enum containing server environment variables"""
|
|
77
77
|
|
|
78
78
|
DB_URI_ENV_VAR = "VANTAGE6_DB_URI"
|
|
79
79
|
CONFIG_NAME_ENV_VAR = "VANTAGE6_CONFIG_NAME"
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
class AlgoStoreGlobals(
|
|
82
|
+
class AlgoStoreGlobals(StrEnumBase):
|
|
83
83
|
"""Enum containing algorithm store environment variables"""
|
|
84
84
|
|
|
85
85
|
DB_URI_ENV_VAR = "VANTAGE6_ALGO_STORE_DB_URI"
|
|
@@ -3,15 +3,17 @@ Common functions that are used in node CLI commands
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
+
|
|
6
7
|
import docker
|
|
7
8
|
from colorama import Fore, Style
|
|
8
9
|
|
|
9
|
-
from vantage6.common import error, info
|
|
10
|
+
from vantage6.common import debug, error, info
|
|
10
11
|
from vantage6.common.globals import APPNAME, InstanceType, RequiredNodeEnvVars
|
|
12
|
+
|
|
11
13
|
from vantage6.client import UserClient
|
|
12
14
|
|
|
13
|
-
from vantage6.cli.context.node import NodeContext
|
|
14
15
|
from vantage6.cli.configuration_wizard import select_configuration_questionaire
|
|
16
|
+
from vantage6.cli.context.node import NodeContext
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
def create_client(ctx: NodeContext) -> UserClient:
|
|
@@ -86,8 +88,7 @@ def select_node(name: str, system_folders: bool) -> tuple[str, str]:
|
|
|
86
88
|
# raise error if config could not be found
|
|
87
89
|
if not NodeContext.config_exists(name, system_folders):
|
|
88
90
|
error(
|
|
89
|
-
f"The configuration {Fore.RED}{name}{Style.RESET_ALL} could "
|
|
90
|
-
f"not be found."
|
|
91
|
+
f"The configuration {Fore.RED}{name}{Style.RESET_ALL} could not be found."
|
|
91
92
|
)
|
|
92
93
|
exit(1)
|
|
93
94
|
return name
|
|
@@ -108,6 +109,6 @@ def find_running_node_names(client: docker.DockerClient) -> list[str]:
|
|
|
108
109
|
List of names of running nodes
|
|
109
110
|
"""
|
|
110
111
|
running_nodes = client.containers.list(
|
|
111
|
-
filters={"label": f"{APPNAME}-type={InstanceType.NODE
|
|
112
|
+
filters={"label": f"{APPNAME}-type={InstanceType.NODE}"}
|
|
112
113
|
)
|
|
113
114
|
return [node.name for node in running_nodes]
|
vantage6/cli/node/start.py
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import os.path
|
|
2
|
+
import time
|
|
1
3
|
from pathlib import Path
|
|
2
4
|
from threading import Thread
|
|
3
|
-
import time
|
|
4
|
-
import os.path
|
|
5
5
|
|
|
6
6
|
import click
|
|
7
7
|
import docker
|
|
8
|
-
|
|
9
8
|
from colorama import Fore, Style
|
|
10
9
|
|
|
11
|
-
from vantage6.
|
|
12
|
-
from vantage6.common import warning, error, info, debug
|
|
10
|
+
from vantage6.common import debug, error, info, warning
|
|
13
11
|
from vantage6.common.dataclass import TaskDB
|
|
12
|
+
from vantage6.common.docker.addons import (
|
|
13
|
+
check_docker_running,
|
|
14
|
+
remove_container_if_exists,
|
|
15
|
+
)
|
|
14
16
|
from vantage6.common.globals import (
|
|
15
17
|
APPNAME,
|
|
16
18
|
DEFAULT_DOCKER_REGISTRY,
|
|
@@ -18,17 +20,14 @@ from vantage6.common.globals import (
|
|
|
18
20
|
DEFAULT_NODE_IMAGE_WO_TAG,
|
|
19
21
|
InstanceType,
|
|
20
22
|
)
|
|
21
|
-
from vantage6.common.docker.addons import (
|
|
22
|
-
remove_container_if_exists,
|
|
23
|
-
check_docker_running,
|
|
24
|
-
)
|
|
25
23
|
|
|
24
|
+
from vantage6.cli import __version__
|
|
26
25
|
from vantage6.cli.common.decorator import click_insert_context
|
|
27
|
-
from vantage6.cli.
|
|
26
|
+
from vantage6.cli.common.start import pull_infra_image
|
|
28
27
|
from vantage6.cli.common.utils import print_log_worker
|
|
28
|
+
from vantage6.cli.context.node import NodeContext
|
|
29
29
|
from vantage6.cli.node.common import create_client
|
|
30
30
|
from vantage6.cli.utils import check_config_name_allowed
|
|
31
|
-
from vantage6.cli import __version__
|
|
32
31
|
|
|
33
32
|
|
|
34
33
|
@click.command()
|
|
@@ -41,18 +40,17 @@ from vantage6.cli import __version__
|
|
|
41
40
|
@click.option(
|
|
42
41
|
"--force-db-mount",
|
|
43
42
|
is_flag=True,
|
|
44
|
-
help="Always mount node databases; skip the check if they are
|
|
43
|
+
help="Always mount node databases; skip the check if they are existing files.",
|
|
45
44
|
)
|
|
46
45
|
@click.option(
|
|
47
46
|
"--attach/--detach",
|
|
48
47
|
default=False,
|
|
49
|
-
help="Show node logs on the current console after starting the
|
|
48
|
+
help="Show node logs on the current console after starting the node",
|
|
50
49
|
)
|
|
51
50
|
@click.option(
|
|
52
51
|
"--mount-src",
|
|
53
52
|
default="",
|
|
54
|
-
help="Override vantage6 source code in container with the source"
|
|
55
|
-
" code in this path",
|
|
53
|
+
help="Override vantage6 source code in container with the source code in this path",
|
|
56
54
|
)
|
|
57
55
|
@click_insert_context(InstanceType.NODE, include_name=True, include_system_folders=True)
|
|
58
56
|
def cli_node_start(
|
|
@@ -79,7 +77,7 @@ def cli_node_start(
|
|
|
79
77
|
|
|
80
78
|
# check that this node is not already running
|
|
81
79
|
running_nodes = docker_client.containers.list(
|
|
82
|
-
filters={"label": f"{APPNAME}-type={InstanceType.NODE
|
|
80
|
+
filters={"label": f"{APPNAME}-type={InstanceType.NODE}"}
|
|
83
81
|
)
|
|
84
82
|
|
|
85
83
|
suffix = "system" if system_folders else "user"
|
|
@@ -117,9 +115,7 @@ def cli_node_start(
|
|
|
117
115
|
f":{major_minor}"
|
|
118
116
|
)
|
|
119
117
|
except Exception:
|
|
120
|
-
warning(
|
|
121
|
-
"Could not determine server version. Using default " "node image"
|
|
122
|
-
)
|
|
118
|
+
warning("Could not determine server version. Using default node image")
|
|
123
119
|
|
|
124
120
|
if major_minor and not __version__.startswith(major_minor):
|
|
125
121
|
warning(
|
|
@@ -243,8 +239,8 @@ def cli_node_start(
|
|
|
243
239
|
if db.type.is_file_based() and not db_file_exists:
|
|
244
240
|
error(
|
|
245
241
|
f"Database {Fore.RED}{db.uri}{Style.RESET_ALL} not found. Databases of "
|
|
246
|
-
f"type '{db.type}' must be present on the harddrive. Please
|
|
247
|
-
"your node configuration file."
|
|
242
|
+
f"type '{db.type}' must be present on the harddrive. Please "
|
|
243
|
+
"update your node configuration file."
|
|
248
244
|
)
|
|
249
245
|
exit(1)
|
|
250
246
|
|
|
@@ -283,9 +279,7 @@ def cli_node_start(
|
|
|
283
279
|
# we won't accept overwrites of existing env vars
|
|
284
280
|
env_overwrites = extra_env.keys() & env.keys()
|
|
285
281
|
if env_overwrites:
|
|
286
|
-
error(
|
|
287
|
-
"Cannot overwrite existing node environment variables: " f"{env_overwrites}"
|
|
288
|
-
)
|
|
282
|
+
error(f"Cannot overwrite existing node environment variables: {env_overwrites}")
|
|
289
283
|
exit(1)
|
|
290
284
|
env.update(extra_env)
|
|
291
285
|
|
vantage6/cli/server/files.py
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import click
|
|
2
2
|
|
|
3
3
|
from vantage6.common import info
|
|
4
|
-
from vantage6.
|
|
4
|
+
from vantage6.common.globals import InstanceType
|
|
5
|
+
|
|
5
6
|
from vantage6.cli.common.decorator import click_insert_context
|
|
7
|
+
from vantage6.cli.context.server import ServerContext
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
@click.command()
|
|
9
|
-
@click_insert_context(type_=
|
|
11
|
+
@click_insert_context(type_=InstanceType.SERVER)
|
|
10
12
|
def cli_server_files(ctx: ServerContext) -> None:
|
|
11
13
|
"""
|
|
12
14
|
List files that belong to a particular server instance.
|
vantage6/cli/server/import_.py
CHANGED
|
@@ -4,7 +4,6 @@ from threading import Thread
|
|
|
4
4
|
import click
|
|
5
5
|
import docker
|
|
6
6
|
from sqlalchemy.engine.url import make_url
|
|
7
|
-
from vantage6.cli.globals import ServerGlobals
|
|
8
7
|
|
|
9
8
|
from vantage6.common import info, warning
|
|
10
9
|
from vantage6.common.docker.addons import check_docker_running, pull_image
|
|
@@ -14,10 +13,12 @@ from vantage6.common.globals import (
|
|
|
14
13
|
DEFAULT_SERVER_IMAGE,
|
|
15
14
|
InstanceType,
|
|
16
15
|
)
|
|
17
|
-
|
|
18
|
-
from vantage6.cli.utils import check_config_name_allowed
|
|
16
|
+
|
|
19
17
|
from vantage6.cli.common.decorator import click_insert_context
|
|
20
18
|
from vantage6.cli.common.utils import print_log_worker
|
|
19
|
+
from vantage6.cli.context.server import ServerContext
|
|
20
|
+
from vantage6.cli.globals import ServerGlobals
|
|
21
|
+
from vantage6.cli.utils import check_config_name_allowed
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
# TODO this method has a lot of duplicated code from `start`
|
|
@@ -33,8 +34,7 @@ from vantage6.cli.common.utils import print_log_worker
|
|
|
33
34
|
@click.option(
|
|
34
35
|
"--mount-src",
|
|
35
36
|
default="",
|
|
36
|
-
help="Override vantage6 source code in container with the source"
|
|
37
|
-
" code in this path",
|
|
37
|
+
help="Override vantage6 source code in container with the source code in this path",
|
|
38
38
|
)
|
|
39
39
|
@click.option(
|
|
40
40
|
"--keep/--auto-remove",
|
|
@@ -42,7 +42,7 @@ from vantage6.cli.common.utils import print_log_worker
|
|
|
42
42
|
help="Keep image after finishing. Useful for debugging",
|
|
43
43
|
)
|
|
44
44
|
@click.option("--wait", default=False, help="Wait for the import to finish")
|
|
45
|
-
@click_insert_context(type_=
|
|
45
|
+
@click_insert_context(type_=InstanceType.SERVER)
|
|
46
46
|
def cli_server_import(
|
|
47
47
|
ctx: ServerContext,
|
|
48
48
|
file: str,
|
|
@@ -111,7 +111,7 @@ def cli_server_import(
|
|
|
111
111
|
mounts.append(docker.types.Mount("/mnt/database/", dirname, type="bind"))
|
|
112
112
|
|
|
113
113
|
environment_vars = {
|
|
114
|
-
ServerGlobals.DB_URI_ENV_VAR: f"sqlite:////mnt/database/{basename}"
|
|
114
|
+
ServerGlobals.DB_URI_ENV_VAR.value: f"sqlite:////mnt/database/{basename}"
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
else:
|
vantage6/cli/server/list.py
CHANGED
|
@@ -2,6 +2,7 @@ import click
|
|
|
2
2
|
|
|
3
3
|
from vantage6.common.docker.addons import check_docker_running
|
|
4
4
|
from vantage6.common.globals import InstanceType
|
|
5
|
+
|
|
5
6
|
from vantage6.cli.common.utils import get_server_configuration_list
|
|
6
7
|
|
|
7
8
|
|
|
@@ -12,4 +13,4 @@ def cli_server_configuration_list() -> None:
|
|
|
12
13
|
"""
|
|
13
14
|
check_docker_running()
|
|
14
15
|
|
|
15
|
-
get_server_configuration_list(InstanceType.SERVER
|
|
16
|
+
get_server_configuration_list(InstanceType.SERVER)
|
vantage6/cli/server/shell.py
CHANGED
|
@@ -4,15 +4,16 @@ import click
|
|
|
4
4
|
import docker
|
|
5
5
|
from colorama import Fore, Style
|
|
6
6
|
|
|
7
|
-
from vantage6.common import
|
|
7
|
+
from vantage6.common import debug as debug_msg, error, info
|
|
8
8
|
from vantage6.common.docker.addons import check_docker_running
|
|
9
9
|
from vantage6.common.globals import APPNAME, InstanceType
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
from vantage6.cli.common.decorator import click_insert_context
|
|
12
|
+
from vantage6.cli.context.server import ServerContext
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
@click.command()
|
|
15
|
-
@click_insert_context(type_=
|
|
16
|
+
@click_insert_context(type_=InstanceType.SERVER)
|
|
16
17
|
def cli_server_shell(ctx: ServerContext) -> None:
|
|
17
18
|
"""
|
|
18
19
|
Run an iPython shell within a running server. This can be used to modify
|
|
@@ -28,7 +29,7 @@ def cli_server_shell(ctx: ServerContext) -> None:
|
|
|
28
29
|
docker_client = docker.from_env()
|
|
29
30
|
|
|
30
31
|
running_servers = docker_client.containers.list(
|
|
31
|
-
filters={"label": f"{APPNAME}-type={InstanceType.SERVER
|
|
32
|
+
filters={"label": f"{APPNAME}-type={InstanceType.SERVER}"}
|
|
32
33
|
)
|
|
33
34
|
|
|
34
35
|
if ctx.docker_container_name not in [s.name for s in running_servers]:
|
vantage6/cli/server/start.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import click
|
|
2
2
|
|
|
3
3
|
from vantage6.common import info
|
|
4
|
+
from vantage6.common.globals import InstanceType
|
|
4
5
|
|
|
5
6
|
from vantage6.cli.common.decorator import click_insert_context
|
|
6
7
|
from vantage6.cli.common.start import (
|
|
@@ -27,7 +28,7 @@ from vantage6.cli.context.server import ServerContext
|
|
|
27
28
|
default=False,
|
|
28
29
|
help="Print server logs to the console after start",
|
|
29
30
|
)
|
|
30
|
-
@click_insert_context(type_=
|
|
31
|
+
@click_insert_context(type_=InstanceType.SERVER)
|
|
31
32
|
def cli_server_start(
|
|
32
33
|
ctx: ServerContext,
|
|
33
34
|
context: str,
|
vantage6/cli/server/stop.py
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import click
|
|
2
2
|
|
|
3
3
|
from vantage6.common import info
|
|
4
|
+
from vantage6.common.globals import InstanceType
|
|
4
5
|
|
|
5
6
|
from vantage6.cli.common.decorator import click_insert_context
|
|
7
|
+
from vantage6.cli.common.stop import helm_uninstall, stop_port_forward
|
|
6
8
|
from vantage6.cli.config import CliConfig
|
|
7
9
|
from vantage6.cli.context.server import ServerContext
|
|
8
|
-
from vantage6.cli.common.stop import helm_uninstall, stop_port_forward
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
@click.command()
|
|
12
13
|
# add context and namespace options
|
|
13
14
|
@click.option("--context", default=None, help="Kubernetes context to use")
|
|
14
15
|
@click.option("--namespace", default=None, help="Kubernetes namespace to use")
|
|
15
|
-
@click_insert_context(type_=
|
|
16
|
+
@click_insert_context(type_=InstanceType.SERVER)
|
|
16
17
|
def cli_server_stop(
|
|
17
18
|
ctx: ServerContext,
|
|
18
19
|
context: str,
|
vantage6/cli/server/version.py
CHANGED
|
@@ -4,9 +4,10 @@ import docker
|
|
|
4
4
|
from vantage6.common import error
|
|
5
5
|
from vantage6.common.docker.addons import check_docker_running
|
|
6
6
|
from vantage6.common.globals import InstanceType
|
|
7
|
-
|
|
8
|
-
from vantage6.cli.globals import DEFAULT_SERVER_SYSTEM_FOLDERS
|
|
7
|
+
|
|
9
8
|
from vantage6.cli import __version__
|
|
9
|
+
from vantage6.cli.common.utils import get_running_servers, get_server_name
|
|
10
|
+
from vantage6.cli.globals import DEFAULT_SERVER_SYSTEM_FOLDERS
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
@click.command()
|
|
@@ -22,10 +23,10 @@ def cli_server_version(name: str, system_folders: bool) -> None:
|
|
|
22
23
|
check_docker_running()
|
|
23
24
|
client = docker.from_env()
|
|
24
25
|
|
|
25
|
-
running_server_names = get_running_servers(client, InstanceType.SERVER
|
|
26
|
+
running_server_names = get_running_servers(client, InstanceType.SERVER)
|
|
26
27
|
|
|
27
28
|
name = get_server_name(
|
|
28
|
-
name, system_folders, running_server_names, InstanceType.SERVER
|
|
29
|
+
name, system_folders, running_server_names, InstanceType.SERVER
|
|
29
30
|
)
|
|
30
31
|
|
|
31
32
|
if name in running_server_names:
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
import json
|
|
2
|
+
import logging
|
|
3
3
|
import sys
|
|
4
4
|
|
|
5
|
+
from vantage6.common import error
|
|
5
6
|
from vantage6.common.enum import TaskStatus
|
|
7
|
+
from vantage6.common.globals import Ports
|
|
6
8
|
|
|
7
9
|
from vantage6.client import Client
|
|
8
|
-
|
|
9
|
-
from vantage6.common.globals import Ports
|
|
10
|
+
|
|
10
11
|
import vantage6.cli.test.algo_test_scripts.algo_test_arguments as arguments
|
|
11
12
|
|
|
12
13
|
|
|
@@ -33,7 +34,7 @@ def create_and_run_task(client: Client, task_args: dict, algo_name: str = "algor
|
|
|
33
34
|
|
|
34
35
|
try:
|
|
35
36
|
# check if the task has failed
|
|
36
|
-
assert client.task.get(task_id)["status"] != TaskStatus.FAILED
|
|
37
|
+
assert client.task.get(task_id)["status"] != TaskStatus.FAILED
|
|
37
38
|
|
|
38
39
|
logging.info("Task for %s completed successfully.", algo_name)
|
|
39
40
|
|
|
@@ -57,7 +58,7 @@ def run_test(custom_args: dict | None = None):
|
|
|
57
58
|
"""
|
|
58
59
|
# Create a client and authenticate
|
|
59
60
|
client = Client(
|
|
60
|
-
server_url=f"http://localhost:{Ports.DEV_SERVER
|
|
61
|
+
server_url=f"http://localhost:{Ports.DEV_SERVER}/api",
|
|
61
62
|
auth_url="http://localhost:8080",
|
|
62
63
|
)
|
|
63
64
|
try:
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import sys
|
|
2
|
+
|
|
2
3
|
import click
|
|
3
4
|
|
|
4
5
|
from vantage6.common.globals import Ports
|
|
6
|
+
|
|
5
7
|
from vantage6.client import UserClient
|
|
6
|
-
|
|
8
|
+
|
|
7
9
|
from vantage6.cli.test.common.diagnostic_runner import DiagnosticRunner
|
|
10
|
+
from vantage6.cli.utils import error
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
@click.command()
|
|
11
14
|
@click.option(
|
|
12
15
|
"--server-url",
|
|
13
16
|
type=str,
|
|
14
|
-
default=f"http://localhost:{Ports.DEV_SERVER
|
|
17
|
+
default=f"http://localhost:{Ports.DEV_SERVER}/api",
|
|
15
18
|
help="URL of the server",
|
|
16
19
|
)
|
|
17
20
|
@click.option(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: vantage6
|
|
3
|
-
Version: 5.0.
|
|
3
|
+
Version: 5.0.0a29
|
|
4
4
|
Summary: vantage6 command line interface
|
|
5
5
|
Home-page: https://github.com/vantage6/vantage6
|
|
6
|
-
Requires-Python: >=3.
|
|
6
|
+
Requires-Python: >=3.13
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
Requires-Dist: click==8.1.3
|
|
9
9
|
Requires-Dist: colorama==0.4.6
|
|
@@ -12,17 +12,24 @@ Requires-Dist: docker==7.1.0
|
|
|
12
12
|
Requires-Dist: ipython==8.10.0
|
|
13
13
|
Requires-Dist: jinja2==3.1.6
|
|
14
14
|
Requires-Dist: kubernetes==28.1.0
|
|
15
|
-
Requires-Dist: pandas>=
|
|
15
|
+
Requires-Dist: pandas>=2.2.3
|
|
16
16
|
Requires-Dist: questionary==1.10.0
|
|
17
17
|
Requires-Dist: rich==13.5.2
|
|
18
18
|
Requires-Dist: schema==0.7.5
|
|
19
19
|
Requires-Dist: sqlalchemy==2.0.37
|
|
20
|
-
Requires-Dist: vantage6-common==5.0.
|
|
21
|
-
Requires-Dist: vantage6-client==5.0.
|
|
20
|
+
Requires-Dist: vantage6-common==5.0.0a29
|
|
21
|
+
Requires-Dist: vantage6-client==5.0.0a29
|
|
22
22
|
Provides-Extra: dev
|
|
23
23
|
Requires-Dist: coverage==6.4.4; extra == "dev"
|
|
24
24
|
Requires-Dist: black; extra == "dev"
|
|
25
25
|
Requires-Dist: pre-commit; extra == "dev"
|
|
26
|
+
Dynamic: description
|
|
27
|
+
Dynamic: description-content-type
|
|
28
|
+
Dynamic: home-page
|
|
29
|
+
Dynamic: provides-extra
|
|
30
|
+
Dynamic: requires-dist
|
|
31
|
+
Dynamic: requires-python
|
|
32
|
+
Dynamic: summary
|
|
26
33
|
|
|
27
34
|
<h1 align="center">
|
|
28
35
|
<br>
|