vantage6 5.0.0a35__py3-none-any.whl → 5.0.0a36__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.
- vantage6/cli/algorithm/generate_algorithm_json.py +9 -9
- vantage6/cli/algorithm/update.py +1 -1
- vantage6/cli/algostore/attach.py +1 -0
- vantage6/cli/algostore/files.py +3 -2
- vantage6/cli/algostore/list.py +0 -3
- vantage6/cli/auth/attach.py +60 -0
- vantage6/cli/auth/files.py +16 -0
- vantage6/cli/auth/list.py +13 -0
- vantage6/cli/auth/new.py +80 -0
- vantage6/cli/auth/remove.py +31 -0
- vantage6/cli/auth/start.py +80 -0
- vantage6/cli/auth/stop.py +64 -0
- vantage6/cli/cli.py +37 -5
- vantage6/cli/common/start.py +1 -1
- vantage6/cli/common/utils.py +2 -0
- vantage6/cli/configuration_manager.py +31 -0
- vantage6/cli/configuration_wizard.py +6 -1
- vantage6/cli/context/__init__.py +3 -0
- vantage6/cli/context/auth.py +107 -0
- vantage6/cli/context/base_server.py +0 -4
- vantage6/cli/dev/clean.py +28 -0
- vantage6/cli/dev/common.py +34 -0
- vantage6/cli/dev/rebuild.py +39 -0
- vantage6/cli/dev/start.py +36 -0
- vantage6/cli/dev/stop.py +23 -0
- vantage6/cli/globals.py +4 -1
- vantage6/cli/node/list.py +5 -4
- vantage6/cli/node/version.py +5 -4
- vantage6/cli/prometheus/monitoring_manager.py +5 -3
- vantage6/cli/rabbitmq/queue_manager.py +13 -11
- vantage6/cli/server/attach.py +1 -0
- vantage6/cli/server/common/__init__.py +1 -27
- vantage6/cli/server/import_.py +1 -1
- vantage6/cli/server/new.py +17 -4
- vantage6/cli/template/auth_config.j2 +230 -0
- vantage6/cli/template/node_config.j2 +8 -8
- vantage6/cli/template/node_config_nonk8s.j2 +33 -0
- vantage6/cli/test/common/diagnostic_runner.py +5 -3
- vantage6/cli/use/namespace.py +2 -1
- {vantage6-5.0.0a35.dist-info → vantage6-5.0.0a36.dist-info}/METADATA +3 -3
- {vantage6-5.0.0a35.dist-info → vantage6-5.0.0a36.dist-info}/RECORD +43 -32
- vantage6/cli/dev/create.py +0 -693
- vantage6/cli/dev/data/km_dataset.csv +0 -2401
- vantage6/cli/dev/remove.py +0 -112
- vantage6/cli/server/shell.py +0 -54
- {vantage6-5.0.0a35.dist-info → vantage6-5.0.0a36.dist-info}/WHEEL +0 -0
- {vantage6-5.0.0a35.dist-info → vantage6-5.0.0a36.dist-info}/entry_points.txt +0 -0
vantage6/cli/dev/remove.py
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
# import subprocess
|
|
2
|
-
# import itertools
|
|
3
|
-
# from shutil import rmtree
|
|
4
|
-
# from pathlib import Path
|
|
5
|
-
|
|
6
|
-
# import click
|
|
7
|
-
# import docker
|
|
8
|
-
# from colorama import Fore, Style
|
|
9
|
-
|
|
10
|
-
# from vantage6.cli.context.algorithm_store import AlgorithmStoreContext
|
|
11
|
-
# from vantage6.common import info, error
|
|
12
|
-
# from vantage6.common.globals import APPNAME
|
|
13
|
-
# from vantage6.cli.context.server import ServerContext
|
|
14
|
-
# from vantage6.cli.context.node import NodeContext
|
|
15
|
-
# from vantage6.cli.server.remove import cli_server_remove
|
|
16
|
-
# from vantage6.cli.utils import remove_file
|
|
17
|
-
# from vantage6.common.globals import InstanceType
|
|
18
|
-
|
|
19
|
-
# # from vantage6.cli.dev.utils import get_dev_server_context
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# @click.command()
|
|
23
|
-
# @click.option("-n", "--name", default=None, help="Name of the configuration.")
|
|
24
|
-
# @click.option(
|
|
25
|
-
# "-c",
|
|
26
|
-
# "--config",
|
|
27
|
-
# default=None,
|
|
28
|
-
# help="Path to configuration-file; overrides --name",
|
|
29
|
-
# )
|
|
30
|
-
# @click.pass_context
|
|
31
|
-
# def remove_demo_network(
|
|
32
|
-
# click_ctx: click.Context, name: str | None, config: str | None
|
|
33
|
-
# ) -> None:
|
|
34
|
-
# """Remove all related demo network files and folders.
|
|
35
|
-
|
|
36
|
-
# Select a server configuration to remove that server and the nodes attached
|
|
37
|
-
# to it.
|
|
38
|
-
# """
|
|
39
|
-
# ctx = get_dev_server_context(config, name)
|
|
40
|
-
|
|
41
|
-
# # check that the server is not running
|
|
42
|
-
# client = docker.from_env()
|
|
43
|
-
# running_servers = client.containers.list(
|
|
44
|
-
# filters={"label": f"{APPNAME}-type={InstanceType.SERVER}"}
|
|
45
|
-
# )
|
|
46
|
-
# running_server_names = [server.name for server in running_servers]
|
|
47
|
-
# container_name = f"{APPNAME}-{name}-user-{InstanceType.SERVER}"
|
|
48
|
-
# if container_name in running_server_names:
|
|
49
|
-
# error(
|
|
50
|
-
# f"Server {Fore.RED}{name}{Style.RESET_ALL} is still running! First stop "
|
|
51
|
-
# "the network with 'v6 dev stop-demo-network'."
|
|
52
|
-
# )
|
|
53
|
-
# return
|
|
54
|
-
|
|
55
|
-
# # remove the server
|
|
56
|
-
# for handler in itertools.chain(ctx.log.handlers, ctx.log.root.handlers):
|
|
57
|
-
# handler.close()
|
|
58
|
-
# click_ctx.invoke(cli_server_remove, ctx=ctx, force=True)
|
|
59
|
-
|
|
60
|
-
# # removing the server import config
|
|
61
|
-
# info("Deleting demo import config file")
|
|
62
|
-
# server_configs = ServerContext.instance_folders(
|
|
63
|
-
# InstanceType.SERVER, ctx.name, system_folders=False
|
|
64
|
-
# )
|
|
65
|
-
# import_config_to_del = Path(server_configs["dev"]) / f"{ctx.name}.yaml"
|
|
66
|
-
# remove_file(import_config_to_del, "import_configuration")
|
|
67
|
-
|
|
68
|
-
# # also remove the server folder
|
|
69
|
-
# server_configs = ServerContext.instance_folders(
|
|
70
|
-
# InstanceType.SERVER, ctx.name, system_folders=False
|
|
71
|
-
# )
|
|
72
|
-
# server_folder = server_configs["data"]
|
|
73
|
-
# if server_folder.is_dir():
|
|
74
|
-
# rmtree(server_folder)
|
|
75
|
-
|
|
76
|
-
# # remove the store folder
|
|
77
|
-
# store_configs = AlgorithmStoreContext.instance_folders(
|
|
78
|
-
# InstanceType.ALGORITHM_STORE, f"{ctx.name}_store", system_folders=False
|
|
79
|
-
# )
|
|
80
|
-
# store_folder = store_configs["data"]
|
|
81
|
-
# if store_folder.is_dir():
|
|
82
|
-
# rmtree(store_folder)
|
|
83
|
-
|
|
84
|
-
# # remove the store config file
|
|
85
|
-
# subprocess.run(
|
|
86
|
-
# [
|
|
87
|
-
# "v6",
|
|
88
|
-
# "algorithm-store",
|
|
89
|
-
# "remove",
|
|
90
|
-
# "-n",
|
|
91
|
-
# f"{ctx.name}_store",
|
|
92
|
-
# "--force",
|
|
93
|
-
# "--user",
|
|
94
|
-
# ]
|
|
95
|
-
# )
|
|
96
|
-
|
|
97
|
-
# # remove the nodes
|
|
98
|
-
# configs, _ = NodeContext.available_configurations(system_folders=False)
|
|
99
|
-
# node_names = [
|
|
100
|
-
# config.name for config in configs if config.name.startswith(f"{ctx.name}_node_")
|
|
101
|
-
# ]
|
|
102
|
-
# for name in node_names:
|
|
103
|
-
# node_ctx = NodeContext(name, False)
|
|
104
|
-
# for handler in itertools.chain(
|
|
105
|
-
# node_ctx.log.handlers, node_ctx.log.root.handlers
|
|
106
|
-
# ):
|
|
107
|
-
# handler.close()
|
|
108
|
-
# subprocess.run(["v6", "node", "remove", "-n", name, "--user", "--force"])
|
|
109
|
-
|
|
110
|
-
# # remove data files attached to the network
|
|
111
|
-
# data_dirs_nodes = NodeContext.instance_folders("node", "", False)["dev"]
|
|
112
|
-
# rmtree(Path(data_dirs_nodes / ctx.name))
|
vantage6/cli/server/shell.py
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import subprocess
|
|
2
|
-
|
|
3
|
-
import click
|
|
4
|
-
import docker
|
|
5
|
-
from colorama import Fore, Style
|
|
6
|
-
|
|
7
|
-
from vantage6.common import debug as debug_msg, error, info
|
|
8
|
-
from vantage6.common.docker.addons import check_docker_running
|
|
9
|
-
from vantage6.common.globals import APPNAME, InstanceType
|
|
10
|
-
|
|
11
|
-
from vantage6.cli.common.decorator import click_insert_context
|
|
12
|
-
from vantage6.cli.context.server import ServerContext
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@click.command()
|
|
16
|
-
@click_insert_context(type_=InstanceType.SERVER)
|
|
17
|
-
def cli_server_shell(ctx: ServerContext) -> None:
|
|
18
|
-
"""
|
|
19
|
-
Run an iPython shell within a running server. This can be used to modify
|
|
20
|
-
the database.
|
|
21
|
-
|
|
22
|
-
NOTE: using the shell is no longer recommended as there is no validation on
|
|
23
|
-
the changes that you make. It is better to use the Python client or a
|
|
24
|
-
graphical user interface instead.
|
|
25
|
-
"""
|
|
26
|
-
# will print an error if not
|
|
27
|
-
check_docker_running()
|
|
28
|
-
|
|
29
|
-
docker_client = docker.from_env()
|
|
30
|
-
|
|
31
|
-
running_servers = docker_client.containers.list(
|
|
32
|
-
filters={"label": f"{APPNAME}-type={InstanceType.SERVER.value}"}
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
if ctx.docker_container_name not in [s.name for s in running_servers]:
|
|
36
|
-
error(f"Server {Fore.RED}{ctx.name}{Style.RESET_ALL} is not running?")
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
try:
|
|
40
|
-
subprocess.run(
|
|
41
|
-
[
|
|
42
|
-
"docker",
|
|
43
|
-
"exec",
|
|
44
|
-
"-it",
|
|
45
|
-
ctx.docker_container_name,
|
|
46
|
-
"vserver-local",
|
|
47
|
-
"shell",
|
|
48
|
-
"-c",
|
|
49
|
-
"/mnt/config.yaml",
|
|
50
|
-
]
|
|
51
|
-
)
|
|
52
|
-
except Exception as e:
|
|
53
|
-
info("Failed to start subprocess...")
|
|
54
|
-
debug_msg(e)
|
|
File without changes
|
|
File without changes
|