vantage6 4.6.1__py3-none-any.whl → 4.7.0rc1__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/__build__ +1 -1
- vantage6/cli/_version.py +1 -1
- vantage6/cli/algostore/remove.py +52 -0
- vantage6/cli/algostore/start.py +0 -6
- vantage6/cli/algostore/stop.py +8 -8
- vantage6/cli/cli.py +2 -0
- vantage6/cli/dev/create.py +179 -45
- vantage6/cli/dev/data/olympic_athletes_2016.csv +2425 -0
- vantage6/cli/dev/remove.py +36 -5
- vantage6/cli/dev/start.py +76 -7
- vantage6/cli/dev/stop.py +21 -6
- vantage6/cli/dev/utils.py +24 -0
- vantage6/cli/globals.py +3 -0
- vantage6/cli/node/remove.py +4 -5
- vantage6/cli/node/start.py +5 -1
- vantage6/cli/rabbitmq/__init__.py +0 -28
- vantage6/cli/rabbitmq/queue_manager.py +1 -1
- vantage6/cli/server/import_.py +2 -2
- vantage6/cli/server/remove.py +14 -4
- vantage6/cli/server/stop.py +1 -1
- vantage6/cli/template/node_config.j2 +11 -0
- vantage6/cli/template/server_config.j2 +19 -0
- vantage6/cli/template/server_import_config.j2 +3 -4
- vantage6/cli/test/integration_test.py +1 -1
- {vantage6-4.6.1.dist-info → vantage6-4.7.0rc1.dist-info}/METADATA +18 -18
- {vantage6-4.6.1.dist-info → vantage6-4.7.0rc1.dist-info}/RECORD +29 -26
- {vantage6-4.6.1.dist-info → vantage6-4.7.0rc1.dist-info}/WHEEL +1 -1
- {vantage6-4.6.1.dist-info → vantage6-4.7.0rc1.dist-info}/entry_points.txt +0 -0
- {vantage6-4.6.1.dist-info → vantage6-4.7.0rc1.dist-info}/top_level.txt +0 -0
vantage6/cli/dev/remove.py
CHANGED
|
@@ -5,24 +5,34 @@ from pathlib import Path
|
|
|
5
5
|
|
|
6
6
|
import click
|
|
7
7
|
|
|
8
|
+
from vantage6.cli.context.algorithm_store import AlgorithmStoreContext
|
|
8
9
|
from vantage6.common import info
|
|
9
10
|
from vantage6.cli.context.server import ServerContext
|
|
10
11
|
from vantage6.cli.context.node import NodeContext
|
|
11
|
-
from vantage6.cli.common.decorator import click_insert_context
|
|
12
12
|
from vantage6.cli.server.remove import cli_server_remove
|
|
13
13
|
from vantage6.cli.utils import remove_file
|
|
14
14
|
from vantage6.common.globals import InstanceType
|
|
15
|
+
from vantage6.cli.dev.utils import get_dev_server_context
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
@click.command()
|
|
18
|
-
@
|
|
19
|
+
@click.option("-n", "--name", default=None, help="Name of the configuration.")
|
|
20
|
+
@click.option(
|
|
21
|
+
"-c",
|
|
22
|
+
"--config",
|
|
23
|
+
default=None,
|
|
24
|
+
help="Path to configuration-file; overrides --name",
|
|
25
|
+
)
|
|
19
26
|
@click.pass_context
|
|
20
|
-
def remove_demo_network(
|
|
27
|
+
def remove_demo_network(
|
|
28
|
+
click_ctx: click.Context, name: str | None, config: str | None
|
|
29
|
+
) -> None:
|
|
21
30
|
"""Remove all related demo network files and folders.
|
|
22
31
|
|
|
23
32
|
Select a server configuration to remove that server and the nodes attached
|
|
24
33
|
to it.
|
|
25
34
|
"""
|
|
35
|
+
ctx = get_dev_server_context(config, name)
|
|
26
36
|
|
|
27
37
|
# remove the server
|
|
28
38
|
for handler in itertools.chain(ctx.log.handlers, ctx.log.root.handlers):
|
|
@@ -39,16 +49,37 @@ def remove_demo_network(click_ctx: click.Context, ctx: ServerContext) -> None:
|
|
|
39
49
|
|
|
40
50
|
# also remove the server folder
|
|
41
51
|
server_configs = ServerContext.instance_folders(
|
|
42
|
-
InstanceType.SERVER, ctx.name, system_folders=
|
|
52
|
+
InstanceType.SERVER, ctx.name, system_folders=False
|
|
43
53
|
)
|
|
44
54
|
server_folder = server_configs["data"]
|
|
45
55
|
if server_folder.is_dir():
|
|
46
56
|
rmtree(server_folder)
|
|
47
57
|
|
|
58
|
+
# remove the store folder
|
|
59
|
+
store_configs = AlgorithmStoreContext.instance_folders(
|
|
60
|
+
InstanceType.ALGORITHM_STORE, f"{ctx.name}_store", system_folders=False
|
|
61
|
+
)
|
|
62
|
+
store_folder = store_configs["data"]
|
|
63
|
+
if store_folder.is_dir():
|
|
64
|
+
rmtree(store_folder)
|
|
65
|
+
|
|
66
|
+
# remove the store config file
|
|
67
|
+
subprocess.run(
|
|
68
|
+
[
|
|
69
|
+
"v6",
|
|
70
|
+
"algorithm-store",
|
|
71
|
+
"remove",
|
|
72
|
+
"-n",
|
|
73
|
+
f"{ctx.name}_store",
|
|
74
|
+
"--force",
|
|
75
|
+
"--user",
|
|
76
|
+
]
|
|
77
|
+
)
|
|
78
|
+
|
|
48
79
|
# remove the nodes
|
|
49
80
|
configs, _ = NodeContext.available_configurations(system_folders=False)
|
|
50
81
|
node_names = [
|
|
51
|
-
config.name for config in configs if f"{ctx.name}_node_"
|
|
82
|
+
config.name for config in configs if config.name.startswith(f"{ctx.name}_node_")
|
|
52
83
|
]
|
|
53
84
|
for name in node_names:
|
|
54
85
|
node_ctx = NodeContext(name, False)
|
vantage6/cli/dev/start.py
CHANGED
|
@@ -1,52 +1,121 @@
|
|
|
1
1
|
import subprocess
|
|
2
2
|
import click
|
|
3
3
|
|
|
4
|
-
from vantage6.
|
|
4
|
+
from vantage6.common import info
|
|
5
|
+
from vantage6.client import Client
|
|
6
|
+
from vantage6.cli.globals import COMMUNITY_STORE
|
|
7
|
+
from vantage6.cli.context.algorithm_store import AlgorithmStoreContext
|
|
5
8
|
from vantage6.cli.context.node import NodeContext
|
|
6
|
-
from vantage6.cli.common.decorator import click_insert_context
|
|
7
9
|
from vantage6.cli.server.start import cli_server_start
|
|
10
|
+
from vantage6.cli.dev.utils import get_dev_server_context
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
@click.command()
|
|
11
|
-
@
|
|
14
|
+
@click.option("-n", "--name", default=None, help="Name of the configuration.")
|
|
15
|
+
@click.option(
|
|
16
|
+
"-c",
|
|
17
|
+
"--config",
|
|
18
|
+
default=None,
|
|
19
|
+
help="Path to configuration-file; overrides --name",
|
|
20
|
+
)
|
|
12
21
|
@click.option(
|
|
13
22
|
"--server-image", type=str, default=None, help="Server Docker image to use"
|
|
14
23
|
)
|
|
15
24
|
@click.option("--node-image", type=str, default=None, help="Node Docker image to use")
|
|
25
|
+
@click.option(
|
|
26
|
+
"--store-image", type=str, default=None, help="Algorithm Store Docker image to use"
|
|
27
|
+
)
|
|
16
28
|
@click.pass_context
|
|
17
29
|
def start_demo_network(
|
|
18
|
-
click_ctx: click.Context,
|
|
30
|
+
click_ctx: click.Context,
|
|
31
|
+
name: str | None,
|
|
32
|
+
config: str | None,
|
|
33
|
+
server_image: str | None,
|
|
34
|
+
node_image: str | None,
|
|
35
|
+
store_image: str | None,
|
|
19
36
|
) -> None:
|
|
20
37
|
"""Starts running a demo-network.
|
|
21
38
|
|
|
22
39
|
Select a server configuration to run its demo network. You should choose a
|
|
23
40
|
server configuration that you created earlier for a demo network. If you
|
|
24
|
-
have not created a demo network, you can run `
|
|
41
|
+
have not created a demo network, you can run `v6 dev create-demo-network` to
|
|
25
42
|
create one.
|
|
26
43
|
"""
|
|
44
|
+
ctx = get_dev_server_context(config, name)
|
|
45
|
+
|
|
27
46
|
# run the server
|
|
47
|
+
info("Starting server...")
|
|
28
48
|
click_ctx.invoke(
|
|
29
49
|
cli_server_start,
|
|
30
50
|
ctx=ctx,
|
|
31
51
|
ip=None,
|
|
32
52
|
port=None,
|
|
33
53
|
image=server_image,
|
|
34
|
-
start_ui=
|
|
54
|
+
start_ui=True,
|
|
35
55
|
ui_port=None,
|
|
36
56
|
start_rabbitmq=False,
|
|
37
57
|
rabbitmq_image=None,
|
|
38
58
|
keep=True,
|
|
39
59
|
mount_src="",
|
|
40
60
|
attach=False,
|
|
61
|
+
system_folders=False,
|
|
41
62
|
)
|
|
42
63
|
|
|
64
|
+
# run the store
|
|
65
|
+
info("Starting algorithm store...")
|
|
66
|
+
cmd = ["v6", "algorithm-store", "start", "--name", f"{ctx.name}_store", "--user"]
|
|
67
|
+
if store_image:
|
|
68
|
+
cmd.extend(["--image", store_image])
|
|
69
|
+
subprocess.run(cmd)
|
|
70
|
+
|
|
43
71
|
# run all nodes that belong to this server
|
|
44
72
|
configs, _ = NodeContext.available_configurations(system_folders=False)
|
|
45
73
|
node_names = [
|
|
46
|
-
config.name for config in configs if f"{ctx.name}_node_"
|
|
74
|
+
config.name for config in configs if config.name.startswith(f"{ctx.name}_node_")
|
|
47
75
|
]
|
|
48
76
|
for name in node_names:
|
|
49
77
|
cmd = ["v6", "node", "start", "--name", name]
|
|
50
78
|
if node_image:
|
|
51
79
|
cmd.extend(["--image", node_image])
|
|
52
80
|
subprocess.run(cmd)
|
|
81
|
+
|
|
82
|
+
# now that both server and store have been started, couple them
|
|
83
|
+
info("Linking local algorithm store to server...")
|
|
84
|
+
store_ctxs, _ = AlgorithmStoreContext.available_configurations(system_folders=False)
|
|
85
|
+
store_ctx = [c for c in store_ctxs if c.name == f"{ctx.name}_store"][0]
|
|
86
|
+
client = Client(
|
|
87
|
+
"http://localhost",
|
|
88
|
+
ctx.config["port"],
|
|
89
|
+
ctx.config["api_path"],
|
|
90
|
+
log_level="warn",
|
|
91
|
+
)
|
|
92
|
+
# TODO these credentials are hardcoded and may change if changed elsewhere. Link
|
|
93
|
+
# them together so that they are guaranteed to be the same.
|
|
94
|
+
USERNAME = "dev_admin"
|
|
95
|
+
PASSWORD = "password"
|
|
96
|
+
client.authenticate(USERNAME, PASSWORD)
|
|
97
|
+
existing_stores = client.store.list().get("data", [])
|
|
98
|
+
existing_urls = [store["url"] for store in existing_stores]
|
|
99
|
+
local_store_url = f"http://localhost:{store_ctx.config['port']}"
|
|
100
|
+
if not local_store_url in existing_urls:
|
|
101
|
+
client.store.create(
|
|
102
|
+
algorithm_store_url=local_store_url,
|
|
103
|
+
name="local store",
|
|
104
|
+
all_collaborations=True,
|
|
105
|
+
force=True, # required to link localhost store
|
|
106
|
+
)
|
|
107
|
+
# note that we do not need to register the user as root of the store: this is
|
|
108
|
+
# already handled in the store config file and is executed on store startup (and
|
|
109
|
+
# successful because server is already started up at that point)
|
|
110
|
+
info("Done!")
|
|
111
|
+
|
|
112
|
+
# link the community store also to the server
|
|
113
|
+
info("Linking community algorithm store to local server...")
|
|
114
|
+
if not COMMUNITY_STORE in existing_urls:
|
|
115
|
+
client.store.create(
|
|
116
|
+
algorithm_store_url=COMMUNITY_STORE,
|
|
117
|
+
name="Community store (read-only)",
|
|
118
|
+
all_collaborations=True,
|
|
119
|
+
force=True, # required to continue when linking localhost server
|
|
120
|
+
)
|
|
121
|
+
info("Done!")
|
vantage6/cli/dev/stop.py
CHANGED
|
@@ -1,30 +1,45 @@
|
|
|
1
1
|
import click
|
|
2
2
|
|
|
3
|
-
from vantage6.cli.context.server import ServerContext
|
|
4
3
|
from vantage6.cli.context.node import NodeContext
|
|
5
|
-
from vantage6.cli.common.decorator import click_insert_context
|
|
6
4
|
from vantage6.cli.server.stop import cli_server_stop
|
|
7
5
|
from vantage6.cli.node.stop import cli_node_stop
|
|
6
|
+
from vantage6.cli.algostore.stop import cli_algo_store_stop
|
|
7
|
+
from vantage6.cli.dev.utils import get_dev_server_context
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
@click.command()
|
|
11
|
-
@
|
|
11
|
+
@click.option("-n", "--name", default=None, help="Name of the configuration.")
|
|
12
|
+
@click.option(
|
|
13
|
+
"-c",
|
|
14
|
+
"--config",
|
|
15
|
+
default=None,
|
|
16
|
+
help="Path to configuration-file; overrides --name",
|
|
17
|
+
)
|
|
12
18
|
@click.pass_context
|
|
13
|
-
def stop_demo_network(
|
|
19
|
+
def stop_demo_network(
|
|
20
|
+
click_ctx: click.Context, name: str | None, config: str | None
|
|
21
|
+
) -> None:
|
|
14
22
|
"""Stops a demo network's server and nodes.
|
|
15
23
|
|
|
16
24
|
Select a server configuration to stop that server and the nodes attached
|
|
17
25
|
to it.
|
|
18
26
|
"""
|
|
27
|
+
ctx = get_dev_server_context(config, name)
|
|
28
|
+
|
|
19
29
|
# stop the server
|
|
20
30
|
click_ctx.invoke(
|
|
21
|
-
cli_server_stop, name=ctx.name, system_folders=
|
|
31
|
+
cli_server_stop, name=ctx.name, system_folders=False, all_servers=False
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
# stop the algorithm store
|
|
35
|
+
click_ctx.invoke(
|
|
36
|
+
cli_algo_store_stop, name=f"{ctx.name}_store", system_folders=False
|
|
22
37
|
)
|
|
23
38
|
|
|
24
39
|
# stop the nodes
|
|
25
40
|
configs, _ = NodeContext.available_configurations(False)
|
|
26
41
|
node_names = [
|
|
27
|
-
config.name for config in configs if f"{ctx.name}_node_"
|
|
42
|
+
config.name for config in configs if config.name.startswith(f"{ctx.name}_node_")
|
|
28
43
|
]
|
|
29
44
|
for name in node_names:
|
|
30
45
|
click_ctx.invoke(
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from vantage6.common.globals import InstanceType
|
|
2
|
+
from vantage6.cli.configuration_wizard import select_configuration_questionaire
|
|
3
|
+
from vantage6.cli.context import get_context
|
|
4
|
+
from vantage6.cli.context.server import ServerContext
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def get_dev_server_context(config: str | None, name: str | None) -> ServerContext:
|
|
8
|
+
"""
|
|
9
|
+
Get the server context for the development server.
|
|
10
|
+
|
|
11
|
+
Parameters
|
|
12
|
+
----------
|
|
13
|
+
config : str | None
|
|
14
|
+
Path to the configuration file. If None, the name will be used.
|
|
15
|
+
name : str | None
|
|
16
|
+
Name of the configuration. If None, a questionaire will be shown.
|
|
17
|
+
"""
|
|
18
|
+
if config:
|
|
19
|
+
return ServerContext.from_external_config_file(config)
|
|
20
|
+
if not name:
|
|
21
|
+
name = select_configuration_questionaire(
|
|
22
|
+
InstanceType.SERVER, system_folders=False
|
|
23
|
+
)
|
|
24
|
+
return get_context(InstanceType.SERVER, name, system_folders=False)
|
vantage6/cli/globals.py
CHANGED
|
@@ -42,6 +42,9 @@ ALGORITHM_TEMPLATE_REPO = "gh:vantage6/v6-algorithm-template.git"
|
|
|
42
42
|
# image to use for diagnostics in `v6 test` commands
|
|
43
43
|
DIAGNOSTICS_IMAGE = "harbor2.vantage6.ai/algorithms/diagnostic"
|
|
44
44
|
|
|
45
|
+
# Address of community algorithm store
|
|
46
|
+
COMMUNITY_STORE = "https://store.cotopaxi.vantage6.ai"
|
|
47
|
+
|
|
45
48
|
|
|
46
49
|
class ServerType(str, Enum):
|
|
47
50
|
"""Enum containing server types"""
|
vantage6/cli/node/remove.py
CHANGED
|
@@ -99,13 +99,12 @@ def cli_node_remove(name: str, system_folders: bool, force: bool) -> None:
|
|
|
99
99
|
|
|
100
100
|
# remove the log file. As this process opens the log file above, the log
|
|
101
101
|
# handlers need to be closed before deleting
|
|
102
|
-
|
|
102
|
+
log_dir = Path(ctx.log_file.parent)
|
|
103
|
+
info(f"Removing log file {log_dir}")
|
|
103
104
|
for handler in itertools.chain(ctx.log.handlers, ctx.log.root.handlers):
|
|
104
105
|
handler.close()
|
|
105
|
-
#
|
|
106
|
-
|
|
107
|
-
# removes the whole folder
|
|
108
|
-
rmtree(Path(ctx.log_file.parent))
|
|
106
|
+
# remove the whole folder with all the log files
|
|
107
|
+
rmtree(log_dir)
|
|
109
108
|
|
|
110
109
|
# remove the folder: if it hasn't been started yet this won't exist...
|
|
111
110
|
if Path.exists(ctx.config_dir / name):
|
vantage6/cli/node/start.py
CHANGED
|
@@ -309,7 +309,11 @@ def cli_node_start(
|
|
|
309
309
|
extra_hosts=extra_hosts,
|
|
310
310
|
)
|
|
311
311
|
|
|
312
|
-
info("Node container was
|
|
312
|
+
info("Node container was started!")
|
|
313
|
+
info(
|
|
314
|
+
"Please check the node logs to see if the node successfully connects to the "
|
|
315
|
+
"server."
|
|
316
|
+
)
|
|
313
317
|
|
|
314
318
|
if attach:
|
|
315
319
|
logs = container.attach(stream=True, logs=True)
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"""RabbitMQ utilities."""
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def split_rabbitmq_uri(rabbit_uri: str) -> dict:
|
|
5
|
-
"""
|
|
6
|
-
Get details (user, pass, host, vhost, port) from a RabbitMQ uri.
|
|
7
|
-
|
|
8
|
-
Parameters
|
|
9
|
-
----------
|
|
10
|
-
rabbit_uri: str
|
|
11
|
-
URI of RabbitMQ service ('amqp://$user:$pass@$host:$port/$vhost')
|
|
12
|
-
|
|
13
|
-
Returns
|
|
14
|
-
-------
|
|
15
|
-
dict[str]
|
|
16
|
-
The vhost defined in the RabbitMQ URI
|
|
17
|
-
"""
|
|
18
|
-
(user_details, location_details) = rabbit_uri.split("@", 1)
|
|
19
|
-
(user, password) = user_details.split("/")[-1].split(":", 1)
|
|
20
|
-
(host, remainder) = location_details.split(":", 1)
|
|
21
|
-
port, vhost = remainder.split("/", 1)
|
|
22
|
-
return {
|
|
23
|
-
"user": user,
|
|
24
|
-
"password": password,
|
|
25
|
-
"host": host,
|
|
26
|
-
"port": port,
|
|
27
|
-
"vhost": vhost,
|
|
28
|
-
}
|
|
@@ -12,10 +12,10 @@ from vantage6.common.globals import APPNAME
|
|
|
12
12
|
from vantage6.common import debug, info, error
|
|
13
13
|
from vantage6.common.docker.addons import get_container
|
|
14
14
|
from vantage6.common.docker.network_manager import NetworkManager
|
|
15
|
+
from vantage6.common import split_rabbitmq_uri
|
|
15
16
|
from vantage6.cli.context.server import ServerContext
|
|
16
17
|
from vantage6.cli.rabbitmq.definitions import RABBITMQ_DEFINITIONS
|
|
17
18
|
from vantage6.cli.globals import RABBIT_TIMEOUT
|
|
18
|
-
from vantage6.cli.rabbitmq import split_rabbitmq_uri
|
|
19
19
|
|
|
20
20
|
DEFAULT_RABBIT_IMAGE = "harbor2.vantage6.ai/infrastructure/rabbitmq"
|
|
21
21
|
RABBIT_CONFIG = "rabbitmq.config"
|
vantage6/cli/server/import_.py
CHANGED
|
@@ -47,7 +47,7 @@ def cli_server_import(
|
|
|
47
47
|
ctx: ServerContext,
|
|
48
48
|
file: str,
|
|
49
49
|
drop_all: bool,
|
|
50
|
-
image: str,
|
|
50
|
+
image: str | None,
|
|
51
51
|
mount_src: str,
|
|
52
52
|
keep: bool,
|
|
53
53
|
wait: bool,
|
|
@@ -122,7 +122,7 @@ def cli_server_import(
|
|
|
122
122
|
info("Consider using the docker-compose method to start a server")
|
|
123
123
|
|
|
124
124
|
drop_all_ = "--drop-all" if drop_all else ""
|
|
125
|
-
cmd = f"vserver-local import -c /mnt/config.yaml {drop_all_}
|
|
125
|
+
cmd = f"vserver-local import -c /mnt/config.yaml {drop_all_} /mnt/import.yaml"
|
|
126
126
|
|
|
127
127
|
info(cmd)
|
|
128
128
|
|
vantage6/cli/server/remove.py
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import itertools
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from shutil import rmtree
|
|
4
|
+
|
|
2
5
|
import click
|
|
3
6
|
import questionary as q
|
|
4
7
|
|
|
5
8
|
from vantage6.common import info
|
|
6
9
|
from vantage6.common.docker.addons import check_docker_running
|
|
10
|
+
from vantage6.common.globals import InstanceType
|
|
7
11
|
from vantage6.cli.common.decorator import click_insert_context
|
|
8
12
|
from vantage6.cli.context import ServerContext
|
|
9
13
|
from vantage6.cli.utils import remove_file
|
|
10
14
|
|
|
11
15
|
|
|
12
16
|
@click.command()
|
|
13
|
-
@click_insert_context(type_=
|
|
17
|
+
@click_insert_context(type_=InstanceType.SERVER)
|
|
14
18
|
@click.option("-f", "--force", "force", flag_value=True)
|
|
15
19
|
def cli_server_remove(ctx: ServerContext, force: bool) -> None:
|
|
16
20
|
"""
|
|
@@ -37,6 +41,12 @@ def cli_server_remove(ctx: ServerContext, force: bool) -> None:
|
|
|
37
41
|
# now remove the folders...
|
|
38
42
|
remove_file(ctx.config_file, "configuration")
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
# ensure log files are closed before removing
|
|
45
|
+
log_dir = Path(ctx.log_file.parent)
|
|
46
|
+
if log_dir.exists():
|
|
47
|
+
info(f"Removing log directory: {log_dir}")
|
|
48
|
+
for handler in itertools.chain(ctx.log.handlers, ctx.log.root.handlers):
|
|
49
|
+
handler.close()
|
|
50
|
+
# remove the whole folder with all the log files. This may also still contain other
|
|
51
|
+
# files like RabbitMQ configuration etc
|
|
52
|
+
rmtree(log_dir)
|
vantage6/cli/server/stop.py
CHANGED
|
@@ -16,7 +16,7 @@ from vantage6.common.docker.addons import (
|
|
|
16
16
|
remove_container_if_exists,
|
|
17
17
|
)
|
|
18
18
|
from vantage6.common.globals import APPNAME, InstanceType
|
|
19
|
-
from vantage6.
|
|
19
|
+
from vantage6.common import split_rabbitmq_uri
|
|
20
20
|
from vantage6.cli.context.server import ServerContext
|
|
21
21
|
from vantage6.cli.globals import DEFAULT_SERVER_SYSTEM_FOLDERS
|
|
22
22
|
from vantage6.cli.server.common import get_server_context, stop_ui
|
|
@@ -17,6 +17,17 @@ logging:
|
|
|
17
17
|
level: DEBUG
|
|
18
18
|
max_size: 1024
|
|
19
19
|
use_console: true
|
|
20
|
+
loggers:
|
|
21
|
+
- level: warning
|
|
22
|
+
name: urllib3
|
|
23
|
+
- level: warning
|
|
24
|
+
name: requests
|
|
25
|
+
- level: warning
|
|
26
|
+
name: engineio.client
|
|
27
|
+
- level: warning
|
|
28
|
+
name: docker.utils.config
|
|
29
|
+
- level: warning
|
|
30
|
+
name: docker.auth
|
|
20
31
|
port: {{ port }}
|
|
21
32
|
server_url: {{ server_url }}
|
|
22
33
|
task_dir: {{ task_dir}}
|
|
@@ -10,7 +10,26 @@ logging:
|
|
|
10
10
|
level: DEBUG
|
|
11
11
|
max_size: 1024
|
|
12
12
|
use_console: true
|
|
13
|
+
loggers:
|
|
14
|
+
- level: warning
|
|
15
|
+
name: urllib3
|
|
16
|
+
- level: warning
|
|
17
|
+
name: socketIO-client
|
|
18
|
+
- level: warning
|
|
19
|
+
name: socketio.server
|
|
20
|
+
- level: warning
|
|
21
|
+
name: engineio.server
|
|
22
|
+
- level: warning
|
|
23
|
+
name: sqlalchemy.engine
|
|
24
|
+
- level: warning
|
|
25
|
+
name: requests_oauthlib.oauth2_session
|
|
13
26
|
port: {{ port }}
|
|
14
27
|
uri: sqlite:///default.sqlite
|
|
15
28
|
jwt_secret_key: {{ jwt_secret_key }}
|
|
29
|
+
dev:
|
|
30
|
+
host_uri: {{ host_uri }}
|
|
31
|
+
server_url: http://localhost:{{ port }}/api
|
|
32
|
+
ui:
|
|
33
|
+
enable: true
|
|
34
|
+
port: {{ ui_port }}
|
|
16
35
|
{{ user_provided_config }}
|
|
@@ -3,12 +3,12 @@ organizations:
|
|
|
3
3
|
- name: {{ org['name'] }}
|
|
4
4
|
domain: iknl.nl
|
|
5
5
|
address1: Godebaldkwartier 419
|
|
6
|
-
address2:
|
|
6
|
+
address2:
|
|
7
7
|
zipcode: 3511DT
|
|
8
8
|
country: Netherlands
|
|
9
9
|
{% if org['make_admin'] %}
|
|
10
10
|
users:
|
|
11
|
-
- username:
|
|
11
|
+
- username: dev_admin
|
|
12
12
|
firstname: admin
|
|
13
13
|
lastname: robot
|
|
14
14
|
password: password
|
|
@@ -19,7 +19,7 @@ collaborations:
|
|
|
19
19
|
- name: {{ collaboration['name'] }}
|
|
20
20
|
domain: iknl.nl
|
|
21
21
|
address1: Godebaldkwartier 419
|
|
22
|
-
address2:
|
|
22
|
+
address2:
|
|
23
23
|
zipcode: 3511DT
|
|
24
24
|
country: Netherlands
|
|
25
25
|
participants:
|
|
@@ -31,4 +31,3 @@ collaborations:
|
|
|
31
31
|
{% endif %}
|
|
32
32
|
tasks: ['hello-world']
|
|
33
33
|
encrypted: false
|
|
34
|
-
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vantage6
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.7.0rc1
|
|
4
4
|
Summary: vantage6 command line interface
|
|
5
5
|
Home-page: https://github.com/vantage6/vantage6
|
|
6
6
|
Requires-Python: >=3.10
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: click
|
|
9
|
-
Requires-Dist: colorama
|
|
10
|
-
Requires-Dist: copier
|
|
11
|
-
Requires-Dist: docker
|
|
12
|
-
Requires-Dist: ipython
|
|
13
|
-
Requires-Dist: jinja2
|
|
14
|
-
Requires-Dist: questionary
|
|
15
|
-
Requires-Dist: rich
|
|
16
|
-
Requires-Dist: schema
|
|
17
|
-
Requires-Dist: SQLAlchemy
|
|
18
|
-
Requires-Dist: vantage6-common
|
|
19
|
-
Requires-Dist: vantage6-client
|
|
8
|
+
Requires-Dist: click==8.1.3
|
|
9
|
+
Requires-Dist: colorama==0.4.6
|
|
10
|
+
Requires-Dist: copier==9.2.0
|
|
11
|
+
Requires-Dist: docker==7.1.0
|
|
12
|
+
Requires-Dist: ipython==8.10.0
|
|
13
|
+
Requires-Dist: jinja2==3.1.4
|
|
14
|
+
Requires-Dist: questionary==1.10.0
|
|
15
|
+
Requires-Dist: rich==13.5.2
|
|
16
|
+
Requires-Dist: schema==0.7.5
|
|
17
|
+
Requires-Dist: SQLAlchemy==1.4.46
|
|
18
|
+
Requires-Dist: vantage6-common==4.7.0rc1
|
|
19
|
+
Requires-Dist: vantage6-client==4.7.0rc1
|
|
20
20
|
Provides-Extra: dev
|
|
21
|
-
Requires-Dist: coverage
|
|
22
|
-
Requires-Dist: black
|
|
23
|
-
Requires-Dist: pre-commit
|
|
21
|
+
Requires-Dist: coverage==6.4.4; extra == "dev"
|
|
22
|
+
Requires-Dist: black; extra == "dev"
|
|
23
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
24
24
|
|
|
25
25
|
<h1 align="center">
|
|
26
26
|
<br>
|
|
@@ -103,7 +103,7 @@ v6 server attach
|
|
|
103
103
|
|
|
104
104
|
From here you can use the [vantage6-client](https://pypi.org/project/vantage6-client) to interact with the server. The demo network has a pre-configured organization with the following credentials:
|
|
105
105
|
|
|
106
|
-
- Username: `
|
|
106
|
+
- Username: `dev_admin`
|
|
107
107
|
- Password: `password`
|
|
108
108
|
|
|
109
109
|
For example, you can create a new organization by running:
|
|
@@ -112,7 +112,7 @@ For example, you can create a new organization by running:
|
|
|
112
112
|
from vantage6.client import Client
|
|
113
113
|
|
|
114
114
|
client = Client('http://127.0.0.1', 5000, '/api', log_level='debug')
|
|
115
|
-
client.authenticate('
|
|
115
|
+
client.authenticate('dev_admin', 'password')
|
|
116
116
|
client.setup_encryption(None)
|
|
117
117
|
|
|
118
118
|
client.organization.create(
|