vantage6 5.0.0a35__py3-none-any.whl → 5.0.0a37__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 -10
- 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/algostore/new.py +3 -2
- vantage6/cli/algostore/start.py +14 -3
- vantage6/cli/algostore/stop.py +3 -0
- 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 +81 -0
- vantage6/cli/auth/remove.py +31 -0
- vantage6/cli/auth/start.py +94 -0
- vantage6/cli/auth/stop.py +67 -0
- vantage6/cli/cli.py +56 -5
- vantage6/cli/common/decorator.py +24 -5
- vantage6/cli/common/new.py +27 -7
- vantage6/cli/common/start.py +49 -41
- vantage6/cli/common/stop.py +23 -5
- vantage6/cli/common/utils.py +25 -0
- vantage6/cli/config.py +10 -2
- vantage6/cli/{configuration_wizard.py → configuration_create.py} +28 -15
- vantage6/cli/configuration_manager.py +97 -17
- vantage6/cli/context/__init__.py +10 -5
- vantage6/cli/context/algorithm_store.py +11 -5
- vantage6/cli/context/auth.py +125 -0
- vantage6/cli/context/base_server.py +0 -4
- vantage6/cli/context/node.py +25 -8
- vantage6/cli/context/server.py +18 -6
- 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 +5 -1
- vantage6/cli/node/common/__init__.py +26 -10
- vantage6/cli/node/list.py +5 -4
- vantage6/cli/node/new.py +13 -6
- vantage6/cli/node/set_api_key.py +1 -1
- vantage6/cli/node/start.py +19 -4
- vantage6/cli/node/stop.py +153 -7
- vantage6/cli/node/task_cleanup/__init__.py +153 -0
- vantage6/cli/node/version.py +5 -4
- vantage6/cli/prometheus/monitoring_manager.py +5 -3
- vantage6/cli/sandbox/config/base.py +101 -0
- vantage6/cli/sandbox/config/core.py +300 -0
- vantage6/cli/sandbox/config/node.py +314 -0
- vantage6/cli/sandbox/data/olympic_athletes_2016.csv +2425 -0
- vantage6/cli/sandbox/new.py +207 -0
- vantage6/cli/sandbox/populate/__init__.py +173 -0
- vantage6/cli/sandbox/populate/helpers/connect_store.py +203 -0
- vantage6/cli/sandbox/populate/helpers/delete_fixtures.py +67 -0
- vantage6/cli/sandbox/populate/helpers/load_fixtures.py +476 -0
- vantage6/cli/sandbox/populate/helpers/utils.py +35 -0
- vantage6/cli/sandbox/remove.py +173 -0
- vantage6/cli/sandbox/start.py +341 -0
- vantage6/cli/sandbox/stop.py +106 -0
- vantage6/cli/server/attach.py +1 -0
- vantage6/cli/server/common/__init__.py +6 -33
- vantage6/cli/server/import_.py +137 -119
- vantage6/cli/server/new.py +22 -7
- vantage6/cli/server/start.py +10 -1
- vantage6/cli/server/stop.py +2 -0
- vantage6/cli/template/auth_config.j2 +253 -0
- vantage6/cli/template/node_config.j2 +8 -8
- vantage6/cli/template/node_config_nonk8s.j2 +33 -0
- vantage6/cli/template/server_config.j2 +10 -7
- vantage6/cli/test/common/diagnostic_runner.py +5 -3
- vantage6/cli/use/namespace.py +2 -1
- vantage6/cli/utils.py +33 -1
- {vantage6-5.0.0a35.dist-info → vantage6-5.0.0a37.dist-info}/METADATA +4 -4
- vantage6-5.0.0a37.dist-info/RECORD +97 -0
- vantage6/cli/dev/create.py +0 -693
- vantage6/cli/dev/remove.py +0 -112
- vantage6/cli/rabbitmq/__init__.py +0 -0
- vantage6/cli/rabbitmq/definitions.py +0 -26
- vantage6/cli/rabbitmq/queue_manager.py +0 -218
- vantage6/cli/rabbitmq/rabbitmq.config +0 -8
- vantage6/cli/server/shell.py +0 -54
- vantage6-5.0.0a35.dist-info/RECORD +0 -75
- /vantage6/cli/{dev → sandbox}/data/km_dataset.csv +0 -0
- {vantage6-5.0.0a35.dist-info → vantage6-5.0.0a37.dist-info}/WHEEL +0 -0
- {vantage6-5.0.0a35.dist-info → vantage6-5.0.0a37.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))
|
|
File without changes
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
RABBITMQ_DEFINITIONS = {
|
|
2
|
-
"rabbit_version": "3.6.6",
|
|
3
|
-
"users": [
|
|
4
|
-
{
|
|
5
|
-
"name": "{{username}}",
|
|
6
|
-
"password_hash": "{{password}}",
|
|
7
|
-
"hashing_algorithm": "rabbit_password_hashing_sha256",
|
|
8
|
-
"tags": "administrator",
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
|
-
"vhosts": [{"name": "{{vhost_name}}"}],
|
|
12
|
-
"permissions": [
|
|
13
|
-
{
|
|
14
|
-
"user": "{{username}}",
|
|
15
|
-
"vhost": "{{vhost_name}}",
|
|
16
|
-
"configure": ".*",
|
|
17
|
-
"write": ".*",
|
|
18
|
-
"read": ".*",
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"parameters": [],
|
|
22
|
-
"policies": [],
|
|
23
|
-
"queues": [],
|
|
24
|
-
"exchanges": [],
|
|
25
|
-
"bindings": [],
|
|
26
|
-
}
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import docker
|
|
2
|
-
import json
|
|
3
|
-
import os
|
|
4
|
-
import shutil
|
|
5
|
-
import base64
|
|
6
|
-
import hashlib
|
|
7
|
-
import time
|
|
8
|
-
|
|
9
|
-
from pathlib import Path
|
|
10
|
-
|
|
11
|
-
from vantage6.common.globals import APPNAME
|
|
12
|
-
from vantage6.common import debug, info, error
|
|
13
|
-
from vantage6.common.docker.addons import get_container
|
|
14
|
-
from vantage6.common.docker.network_manager import NetworkManager
|
|
15
|
-
from vantage6.common import split_rabbitmq_uri
|
|
16
|
-
from vantage6.cli.context.server import ServerContext
|
|
17
|
-
from vantage6.cli.rabbitmq.definitions import RABBITMQ_DEFINITIONS
|
|
18
|
-
from vantage6.cli.globals import RABBIT_TIMEOUT
|
|
19
|
-
|
|
20
|
-
DEFAULT_RABBIT_IMAGE = "harbor2.vantage6.ai/infrastructure/rabbitmq"
|
|
21
|
-
RABBIT_CONFIG = "rabbitmq.config"
|
|
22
|
-
RABBIT_DIR = "rabbitmq"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class RabbitMQManager:
|
|
26
|
-
"""
|
|
27
|
-
Manages the RabbitMQ docker container
|
|
28
|
-
|
|
29
|
-
Parameters
|
|
30
|
-
----------
|
|
31
|
-
ctx: ServerContext
|
|
32
|
-
Configuration object
|
|
33
|
-
network_mgr: NetworkManager
|
|
34
|
-
Network manager for network in which server container resides
|
|
35
|
-
image: str
|
|
36
|
-
Docker image to use for RabbitMQ container. By default, the image
|
|
37
|
-
harbor2.vantage6.ai/infrastructure/rabbitmq is used.
|
|
38
|
-
"""
|
|
39
|
-
|
|
40
|
-
def __init__(
|
|
41
|
-
self, ctx: ServerContext, network_mgr: NetworkManager, image: str = None
|
|
42
|
-
) -> None:
|
|
43
|
-
self.ctx = ctx
|
|
44
|
-
self.queue_uri = self.ctx.config["rabbitmq"].get("uri")
|
|
45
|
-
rabbit_splitted = split_rabbitmq_uri(self.queue_uri)
|
|
46
|
-
self.rabbit_user = rabbit_splitted["user"]
|
|
47
|
-
self.rabbit_pass = rabbit_splitted["password"]
|
|
48
|
-
self.vhost = rabbit_splitted["vhost"]
|
|
49
|
-
self.port = rabbit_splitted["port"]
|
|
50
|
-
self.host = rabbit_splitted["host"]
|
|
51
|
-
self.definitions_file = Path(self.ctx.data_dir / "definitions.json")
|
|
52
|
-
self.network_mgr = network_mgr
|
|
53
|
-
|
|
54
|
-
self.docker = docker.from_env()
|
|
55
|
-
self.image = image if image else DEFAULT_RABBIT_IMAGE
|
|
56
|
-
|
|
57
|
-
def start(self) -> None:
|
|
58
|
-
"""
|
|
59
|
-
Start a docker container which runs a RabbitMQ queue
|
|
60
|
-
"""
|
|
61
|
-
# get volumes which contain rabbitMQ configuration and a location to
|
|
62
|
-
# save rabbitMQ files so that they persist after container is stopped
|
|
63
|
-
volumes = self._get_volumes()
|
|
64
|
-
|
|
65
|
-
# expose port 5672 inside the container as port 5672 on the host, and
|
|
66
|
-
# same for 15672 in container to 8080 on host
|
|
67
|
-
# TODO check if these ports are not already used on the host
|
|
68
|
-
ports = {
|
|
69
|
-
f"{self.port}/tcp": self.port,
|
|
70
|
-
# TODO this is for the management tool, do we keep this? Not used
|
|
71
|
-
# at the moment..
|
|
72
|
-
"15672/tcp": 8080,
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
# check if a RabbitMQ container is already running
|
|
76
|
-
self.rabbit_container = get_container(docker_client=self.docker, name=self.host)
|
|
77
|
-
if self.rabbit_container:
|
|
78
|
-
info("RabbitMQ is already running! Linking the server to that " "queue")
|
|
79
|
-
if not self.network_mgr.contains(self.rabbit_container):
|
|
80
|
-
self.network_mgr.connect(self.rabbit_container)
|
|
81
|
-
return
|
|
82
|
-
|
|
83
|
-
# start rabbitMQ container
|
|
84
|
-
self.rabbit_container = self.docker.containers.run(
|
|
85
|
-
name=self.host,
|
|
86
|
-
image=self.image,
|
|
87
|
-
volumes=volumes,
|
|
88
|
-
ports=ports,
|
|
89
|
-
detach=True,
|
|
90
|
-
restart_policy={"Name": "unless-stopped"},
|
|
91
|
-
hostname=self.host,
|
|
92
|
-
labels={
|
|
93
|
-
f"{APPNAME}-type": "rabbitmq",
|
|
94
|
-
},
|
|
95
|
-
network=self.network_mgr.network_name,
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
# Wait until RabbitMQ is up before continuing with other stuff
|
|
99
|
-
self._wait_for_startup()
|
|
100
|
-
|
|
101
|
-
def _wait_for_startup(self) -> None:
|
|
102
|
-
"""Wait until RabbitMQ has been initialized"""
|
|
103
|
-
interval = 10
|
|
104
|
-
attempts = int((RABBIT_TIMEOUT + interval) / interval)
|
|
105
|
-
is_running = False
|
|
106
|
-
for _ in range(attempts):
|
|
107
|
-
if self.is_running():
|
|
108
|
-
is_running = True
|
|
109
|
-
break
|
|
110
|
-
debug(f"RabbitMQ is not yet running. Retrying in {interval}s...")
|
|
111
|
-
time.sleep(interval)
|
|
112
|
-
if is_running:
|
|
113
|
-
info("RabbitMQ was started successfully!")
|
|
114
|
-
else:
|
|
115
|
-
error("Could not start RabbitMQ! Exiting...")
|
|
116
|
-
exit(1)
|
|
117
|
-
|
|
118
|
-
def is_running(self) -> bool:
|
|
119
|
-
"""
|
|
120
|
-
Returns
|
|
121
|
-
-------
|
|
122
|
-
bool
|
|
123
|
-
Whether the container has fully initialized RabbitMQ or not
|
|
124
|
-
"""
|
|
125
|
-
response = self.rabbit_container.exec_run(
|
|
126
|
-
cmd="rabbitmqctl status --formatter json"
|
|
127
|
-
)
|
|
128
|
-
return response.exit_code == 0
|
|
129
|
-
|
|
130
|
-
def _get_volumes(self) -> dict:
|
|
131
|
-
"""
|
|
132
|
-
Prepare the volumes for the RabbitMQ container. The RabbitMQ should
|
|
133
|
-
set up the right vhost and users to allow the server to communicate
|
|
134
|
-
with RabbitMQ as configured.
|
|
135
|
-
|
|
136
|
-
Returns
|
|
137
|
-
-------
|
|
138
|
-
dict
|
|
139
|
-
Dictionary with the volumes to mount in the RabbitMQ container
|
|
140
|
-
"""
|
|
141
|
-
# default RabbitMQ configuration: replace the user/password with the
|
|
142
|
-
# credentials from the configuraiton
|
|
143
|
-
rabbit_definitions = self._get_rabbitmq_definitions()
|
|
144
|
-
|
|
145
|
-
# write the RabbitMQ definition to file(s)
|
|
146
|
-
with open(self.definitions_file, "w") as f:
|
|
147
|
-
json.dump(rabbit_definitions, f, indent=2)
|
|
148
|
-
|
|
149
|
-
# write RabbitMQ config to file
|
|
150
|
-
rabbit_conf = Path(__file__).parent.resolve() / RABBIT_CONFIG
|
|
151
|
-
shutil.copyfile(rabbit_conf, self.ctx.data_dir / RABBIT_CONFIG)
|
|
152
|
-
|
|
153
|
-
# check if a directory for persistent RabbitMQ storage exists,
|
|
154
|
-
# otherwise create it
|
|
155
|
-
rabbit_data_dir = self.ctx.data_dir / RABBIT_DIR
|
|
156
|
-
if not rabbit_data_dir.exists():
|
|
157
|
-
rabbit_data_dir.mkdir(parents=True, exist_ok=True)
|
|
158
|
-
|
|
159
|
-
return {
|
|
160
|
-
self.definitions_file: {
|
|
161
|
-
"bind": "/etc/rabbitmq/definitions.json",
|
|
162
|
-
"mode": "ro",
|
|
163
|
-
},
|
|
164
|
-
self.ctx.data_dir
|
|
165
|
-
/ RABBIT_CONFIG: {"bind": "/etc/rabbitmq/rabbitmq.config", "mode": "ro"},
|
|
166
|
-
rabbit_data_dir: {"bind": "/var/lib/rabbitmq", "mode": "rw"},
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
def _get_rabbitmq_definitions(self) -> dict:
|
|
170
|
-
"""
|
|
171
|
-
Get startup definitions (users/vhosts etc) for RabbitMQ container
|
|
172
|
-
|
|
173
|
-
Returns
|
|
174
|
-
-------
|
|
175
|
-
Dict:
|
|
176
|
-
dictionary with all users/vhosts etc that must be generated on
|
|
177
|
-
startup of RabbitMQ
|
|
178
|
-
"""
|
|
179
|
-
rabbit_definitions = RABBITMQ_DEFINITIONS
|
|
180
|
-
rabbit_definitions["users"][0]["name"] = self.rabbit_user
|
|
181
|
-
rabbit_definitions["permissions"][0]["user"] = self.rabbit_user
|
|
182
|
-
rabbit_definitions["users"][0]["password_hash"] = self._get_hashed_pw(
|
|
183
|
-
self.rabbit_pass
|
|
184
|
-
)
|
|
185
|
-
rabbit_definitions["vhosts"][0]["name"] = self.vhost
|
|
186
|
-
rabbit_definitions["permissions"][0]["vhost"] = self.vhost
|
|
187
|
-
return rabbit_definitions
|
|
188
|
-
|
|
189
|
-
def _get_hashed_pw(self, pw: str) -> str:
|
|
190
|
-
"""
|
|
191
|
-
Hash a user-defined password for RabbitMQ
|
|
192
|
-
|
|
193
|
-
Parameters
|
|
194
|
-
----------
|
|
195
|
-
pw: str
|
|
196
|
-
The password for RabbitMQ
|
|
197
|
-
|
|
198
|
-
Returns
|
|
199
|
-
-------
|
|
200
|
-
str
|
|
201
|
-
Hashed password for RabbitMQ
|
|
202
|
-
"""
|
|
203
|
-
|
|
204
|
-
# Generate a random 32 bit salt:
|
|
205
|
-
salt = os.urandom(4)
|
|
206
|
-
|
|
207
|
-
# Concatenate that with the UTF-8 representation of the password
|
|
208
|
-
tmp0 = salt + pw.encode("utf-8")
|
|
209
|
-
|
|
210
|
-
# Take the SHA256 hash and get the bytes back
|
|
211
|
-
tmp1 = hashlib.sha256(tmp0).digest()
|
|
212
|
-
|
|
213
|
-
# Concatenate the salt again:
|
|
214
|
-
salted_hash = salt + tmp1
|
|
215
|
-
|
|
216
|
-
# convert to base64 encoding:
|
|
217
|
-
pass_hash = base64.b64encode(salted_hash)
|
|
218
|
-
return pass_hash.decode("utf-8")
|
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)
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
vantage6/cli/__init__.py,sha256=8KIgMPbZTNdkYlUrB8irpsUA7KdkFdLbNbMKixOP2dE,277
|
|
2
|
-
vantage6/cli/cli.py,sha256=1Se1g-qEeC3NrPyTosIT4EPbl-WAnqCwL1mTZyEL5Pc,6552
|
|
3
|
-
vantage6/cli/config.py,sha256=Jqe3VcvoxPrFlvw7cuKt4-5oyL0YTZXvpNsqPybSAYk,7973
|
|
4
|
-
vantage6/cli/configuration_manager.py,sha256=TtD4PdFrKCuN_zeSAouEgi_htlhBqmiNGqI7yui6EmE,5466
|
|
5
|
-
vantage6/cli/configuration_wizard.py,sha256=JFGeBagW5D4R-sGCXzqU9WpUInq0w7h0MVlbxYC7Q8Q,6634
|
|
6
|
-
vantage6/cli/globals.py,sha256=kbxRcpCFmyIKOma3rWfrcPnV7k5H7MHG9-yY2orzauY,2627
|
|
7
|
-
vantage6/cli/utils.py,sha256=9ZNHtTnOH2RqgYgnoyMR5EJpBE-_kYXEbuHtfrG3ul0,4275
|
|
8
|
-
vantage6/cli/algorithm/create.py,sha256=kRT1BlBcb0fDaB2Q988WxtA6EyAZmOW5QoU2uhbwBIo,2075
|
|
9
|
-
vantage6/cli/algorithm/generate_algorithm_json.py,sha256=huaqoadhz-2-Sy6SON9zFe_cAatvE7dtTQazvmNOgMA,19558
|
|
10
|
-
vantage6/cli/algorithm/update.py,sha256=WwAfTnq0kTOgePUsBzGoo1AJQqGMn82E9Bjk1wf61CQ,1338
|
|
11
|
-
vantage6/cli/algostore/attach.py,sha256=0WzLnKigJAelPpL5EaWcnRuUyQzMSofrrZfEzwDIvSw,311
|
|
12
|
-
vantage6/cli/algostore/files.py,sha256=r89VRixK_K-c44qseq58Aa2Dqf1wEf8yompQRN5AVu4,580
|
|
13
|
-
vantage6/cli/algostore/list.py,sha256=xBCnwGbuWY_rrx6jrFX8JVAEFXh8GwqwicqpxMiaSa8,418
|
|
14
|
-
vantage6/cli/algostore/new.py,sha256=7eVovSdNBO_Yj-FQmlV0TTl13Vv4qKP5zA_HuHZMglk,3454
|
|
15
|
-
vantage6/cli/algostore/remove.py,sha256=JsZ1L3qH2k_G3Zei-fhb_dApah91gdJKKv2vfsWK6Os,1006
|
|
16
|
-
vantage6/cli/algostore/start.py,sha256=15ZebThxgw4H1G8CswRNNoU1bYNflhQ-dWIkzEkwUi0,2137
|
|
17
|
-
vantage6/cli/algostore/stop.py,sha256=AF6ay7y6dlCvjPa3ctFOESAfHEA74eK4dKT4o-iFTLE,1814
|
|
18
|
-
vantage6/cli/common/decorator.py,sha256=KF3uFjmn00qtTSD90BLczaX-gqvlt2Kud4PJGm7P4jU,3627
|
|
19
|
-
vantage6/cli/common/new.py,sha256=WBGGYknLUMz4iPAzFanG57ioM9bTqFf2ANQRzYg6Ibo,2612
|
|
20
|
-
vantage6/cli/common/remove.py,sha256=sJaPF5y1Gd14I4Xg5QRBq3d1x4j2KF4Ys6wVDuqE6HQ,1697
|
|
21
|
-
vantage6/cli/common/start.py,sha256=jErssa0-E4tl3RI2BMND4PFmLQm3uZzhUJ45cuZEHw8,9784
|
|
22
|
-
vantage6/cli/common/stop.py,sha256=S3IeV_myD01CdSUvl6hkf4qWlWQZ_oUgIkbJoGsQK-Q,4989
|
|
23
|
-
vantage6/cli/common/utils.py,sha256=P1Wp1mKG8Z36IqeE7nyXnrAO_jhIVwnMYBDnJ1ltFPc,11767
|
|
24
|
-
vantage6/cli/context/__init__.py,sha256=88LSA3h_v-t8PzjCrzl0vw1jkOdNUNr3nPo-L2e9onc,2684
|
|
25
|
-
vantage6/cli/context/algorithm_store.py,sha256=qTNRrCo_EWVAfSC4eg_MohSf_Ra4U3tZvB8EwZZREEw,4044
|
|
26
|
-
vantage6/cli/context/base_server.py,sha256=i0op_9mifKjJIP4I1Z-V3HRFf_WPOrBQGFvTL6pJZL8,2450
|
|
27
|
-
vantage6/cli/context/node.py,sha256=GaU52z4dMnZMDMj3MZACL0VeWZLeeM3lRNvMKlqA1J4,7304
|
|
28
|
-
vantage6/cli/context/server.py,sha256=o2HMlDEg7RbU44AfwNPln8K64FX4SQ_IgULFY_GBhEI,4837
|
|
29
|
-
vantage6/cli/dev/create.py,sha256=WBBPG9jyNvPQVb1koHX9y3VKQmlijlq-QBsYYzqqojg,21207
|
|
30
|
-
vantage6/cli/dev/remove.py,sha256=kjmOqkMO0ZU5F-3KgQ05VlfQQCS5Ta6yLY32DU0rH7k,3917
|
|
31
|
-
vantage6/cli/dev/data/km_dataset.csv,sha256=OrYF2ympb2QndiUOX_nTFGGB1HbAp2eOvZzrQ_PqJs4,31283
|
|
32
|
-
vantage6/cli/node/attach.py,sha256=5wB6vjp-m44cQx-C20QBo5WhbHqjxrfWWFzTa5YCyww,277
|
|
33
|
-
vantage6/cli/node/create_private_key.py,sha256=gmgI9Gtcx3z0esxyLw-96HcrfmAJFOjjXbVvA9ZGN3g,5129
|
|
34
|
-
vantage6/cli/node/files.py,sha256=y7WOGHCTE3DnmxgbweLcu51t0YLS9Jvl24zgCHKkQTQ,1003
|
|
35
|
-
vantage6/cli/node/list.py,sha256=_WZ8EBIEUlzFhVp3cR2MK5FUuQicMEZHhD8npMwKSpM,1664
|
|
36
|
-
vantage6/cli/node/new.py,sha256=gs0okv4jnh3jPmENNH2RzXxG8Q-bbPmbjxioQOyjUH8,12395
|
|
37
|
-
vantage6/cli/node/remove.py,sha256=alInSH_3E-yJthQ8JrGaopvAZ7GgxuRBppnpC8BRTBU,1061
|
|
38
|
-
vantage6/cli/node/restart.py,sha256=hJWzyJjetfNe8YYkOt5ZEUE_t-LpvQOwUGcQH0pXfNQ,3122
|
|
39
|
-
vantage6/cli/node/set_api_key.py,sha256=OYCCJ8zrbc7uXyv0uLTejqD43xXELVvR01czzG46imo,1998
|
|
40
|
-
vantage6/cli/node/start.py,sha256=wzSfN_H9PdorSjJr8dYJl7p0HJ0XuOz-gNDbuHAbWo4,3975
|
|
41
|
-
vantage6/cli/node/stop.py,sha256=pQ4auPeGbipBRlgFsuqqsMBlNAbgaowxeFpH-HpikkM,1950
|
|
42
|
-
vantage6/cli/node/version.py,sha256=X921xyIvIPYObPac2Si5msZ2tay5ySidnPWmGj1ilZw,1959
|
|
43
|
-
vantage6/cli/node/common/__init__.py,sha256=gYbdDajTz5Sh-buChejB8-lkMXalL85mMsMbM0OlR1Q,2868
|
|
44
|
-
vantage6/cli/prometheus/monitoring_manager.py,sha256=tNvguLonbVILqCDnHRizef5NwKnEOV0DuzTx0Bhd2HU,4906
|
|
45
|
-
vantage6/cli/prometheus/prometheus.yml,sha256=Q4i9lVknITBodHUMgarRnEsXfXTNuSdI6a-9pW4YCoI,98
|
|
46
|
-
vantage6/cli/rabbitmq/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
|
-
vantage6/cli/rabbitmq/definitions.py,sha256=CcS9jG7ZGB6LjzHQqZ2FliDurPItUvNSjHrOYptORZg,637
|
|
48
|
-
vantage6/cli/rabbitmq/queue_manager.py,sha256=KGDGHy4NBN8O9xhjzfI7mh65i9lOQIqQwrOFqvGFdHI,7545
|
|
49
|
-
vantage6/cli/rabbitmq/rabbitmq.config,sha256=LYAQAEoXaF472XeJDYXc9JfWSETIzPRIR2W-JB2i7fU,136
|
|
50
|
-
vantage6/cli/server/attach.py,sha256=q1E40nGCBEFUF1p94sZoU-Ud3OXAUy4-FJqcP7Gqa7U,322
|
|
51
|
-
vantage6/cli/server/files.py,sha256=MsnLaY91F2m49mm_FpVboFrSsZiEsu175KioN1alZfk,568
|
|
52
|
-
vantage6/cli/server/import_.py,sha256=VDzEdEBtCtyF_ofzb6sSkXTNwhzBcq1-ByaHb1jfdes,4523
|
|
53
|
-
vantage6/cli/server/list.py,sha256=ioHQeBq5_SE6zNcyg9C7lqvcPwyHOyGPZ4SisFgq5-E,314
|
|
54
|
-
vantage6/cli/server/new.py,sha256=rXq643DOqladIgGBNTDKSk3p1sUma8AwTIQDEknzCYg,3032
|
|
55
|
-
vantage6/cli/server/remove.py,sha256=dwylIP5uEUPTRP9bd6_7rWhyUoCJuYoe1Kon9WUV4tY,891
|
|
56
|
-
vantage6/cli/server/shell.py,sha256=47uGPupdG-2b8yhWvJoht-VJL29CodemcgXuo04CMBU,1601
|
|
57
|
-
vantage6/cli/server/start.py,sha256=fO4A7D0aiSVKN4zhX5I1Z6UzQj57Ih4KD8PGuDgQoic,2606
|
|
58
|
-
vantage6/cli/server/stop.py,sha256=MwJqGh_9a0RCBQ7ZCDCO3975NyzKzGVz3AKRbghsJnc,2016
|
|
59
|
-
vantage6/cli/server/version.py,sha256=lqrPNKMbFO22W-NarJ2TjLd7fZT43hV-sFRbzMlBniw,1307
|
|
60
|
-
vantage6/cli/server/common/__init__.py,sha256=htv0mFYa4GhIHdzA2xqUUgKhHcMh09UQERlIjIgrwOM,2062
|
|
61
|
-
vantage6/cli/template/algo_store_config.j2,sha256=eA79CEXGPTO3kWX5SDhuO4VY2t_shjOHIvGIC6ANrro,7377
|
|
62
|
-
vantage6/cli/template/node_config.j2,sha256=tmpTzD62WPTlth3wl_B9VHfk5j9aw1Rlf5BhrxZf65k,13742
|
|
63
|
-
vantage6/cli/template/server_config.j2,sha256=tCgceSajZ-GVG8yEufFBPWkEJKKg3BfECQmO5TzTrgw,10036
|
|
64
|
-
vantage6/cli/test/client_script.py,sha256=AHQ4fhzbtD-VcJAm0rxUDteepXNa4Bef9SKWnzobTd0,4825
|
|
65
|
-
vantage6/cli/test/feature_tester.py,sha256=AsZam91KqaAo_yIFxyZ5Hmy1ZPw83d02BDyO4TzKFQo,2631
|
|
66
|
-
vantage6/cli/test/integration_test.py,sha256=MctR_t-WEyxzFpMdc6ByTcX1BQglZiT5-CIOQXTBBWo,4034
|
|
67
|
-
vantage6/cli/test/algo_test_scripts/algo_test_arguments.py,sha256=HIKAhJ5zKkWMGXpCb_KLukbcwbyeMK5j3wcqubalbyM,791
|
|
68
|
-
vantage6/cli/test/algo_test_scripts/algo_test_script.py,sha256=jfzXPmpL0HlE_eq1jXLV3HuZgh_aV-ZOaawHcYIuwQE,2741
|
|
69
|
-
vantage6/cli/test/common/diagnostic_runner.py,sha256=5-KgspYW0PncO_t_TrQzd_GSOXVwH-7bIVv-IHOxwQM,6598
|
|
70
|
-
vantage6/cli/use/context.py,sha256=mEtOfbuLtYQlRh-ypif24WtOwgpcvXObX310mmXIkWY,1362
|
|
71
|
-
vantage6/cli/use/namespace.py,sha256=MOd9H3GJwZ0cho0mmlHTRlGPLoQEiSnZIFDsFsvYw4Q,1643
|
|
72
|
-
vantage6-5.0.0a35.dist-info/METADATA,sha256=U1-XFn_RjriLgoqwYEkwb_DTjROM-1Y0_YTIw9Rqcfo,1779
|
|
73
|
-
vantage6-5.0.0a35.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
74
|
-
vantage6-5.0.0a35.dist-info/entry_points.txt,sha256=RKVCMsD70s_Gp6If89uDlCphsZ9uLIOMt1gciv8EMDQ,53
|
|
75
|
-
vantage6-5.0.0a35.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|