vantage6 5.0.0a7__py3-none-any.whl → 5.0.0a9__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_node_cli.py +4 -21
- tests_cli/test_server_cli.py +32 -11
- vantage6/cli/__build__ +1 -1
- vantage6/cli/algostore/attach.py +6 -42
- vantage6/cli/cli.py +4 -11
- vantage6/cli/common/utils.py +15 -0
- vantage6/cli/node/attach.py +5 -66
- vantage6/cli/server/attach.py +5 -55
- vantage6/cli/test/common/diagnostic_runner.py +2 -4
- vantage6/cli/test/integration_test.py +113 -113
- {vantage6-5.0.0a7.dist-info → vantage6-5.0.0a9.dist-info}/METADATA +3 -3
- {vantage6-5.0.0a7.dist-info → vantage6-5.0.0a9.dist-info}/RECORD +15 -20
- vantage6/cli/dev/create.py +0 -633
- vantage6/cli/dev/remove.py +0 -94
- vantage6/cli/dev/start.py +0 -123
- vantage6/cli/dev/stop.py +0 -47
- vantage6/cli/dev/utils.py +0 -24
- {vantage6-5.0.0a7.dist-info → vantage6-5.0.0a9.dist-info}/WHEEL +0 -0
- {vantage6-5.0.0a7.dist-info → vantage6-5.0.0a9.dist-info}/entry_points.txt +0 -0
- {vantage6-5.0.0a7.dist-info → vantage6-5.0.0a9.dist-info}/top_level.txt +0 -0
tests_cli/test_node_cli.py
CHANGED
|
@@ -295,29 +295,12 @@ class NodeCLITest(unittest.TestCase):
|
|
|
295
295
|
result = runner.invoke(cli_node_restart, ["--name", "iknl"])
|
|
296
296
|
self.assertEqual(result.exit_code, 0)
|
|
297
297
|
|
|
298
|
-
@patch("vantage6.cli.node.attach.
|
|
299
|
-
|
|
300
|
-
@patch("docker.DockerClient.containers")
|
|
301
|
-
@patch("vantage6.cli.node.attach.check_docker_running", return_value=True)
|
|
302
|
-
def test_attach(self, check_docker, containers, log_worker, time_):
|
|
298
|
+
@patch("vantage6.cli.node.attach.attach_logs")
|
|
299
|
+
def test_attach(self, attach_logs):
|
|
303
300
|
"""Attach docker logs without errors."""
|
|
304
|
-
container1 = MagicMock()
|
|
305
|
-
container1.name = f"{APPNAME}-iknl-user"
|
|
306
|
-
containers.list.return_value = [container1]
|
|
307
|
-
|
|
308
|
-
log_worker.return_value = ""
|
|
309
|
-
time_.sleep.side_effect = KeyboardInterrupt()
|
|
310
|
-
|
|
311
301
|
runner = CliRunner()
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
self.assertEqual(
|
|
315
|
-
result.output,
|
|
316
|
-
"[info ] - Closing log file. Keyboard Interrupt.\n"
|
|
317
|
-
"[info ] - Note that your node is still running! Shut it down "
|
|
318
|
-
"with 'v6 node stop'\n",
|
|
319
|
-
)
|
|
320
|
-
self.assertEqual(result.exit_code, 0)
|
|
302
|
+
runner.invoke(cli_node_attach)
|
|
303
|
+
attach_logs.assert_called_once_with("app=node")
|
|
321
304
|
|
|
322
305
|
@patch("vantage6.cli.node.clean.q")
|
|
323
306
|
@patch("docker.DockerClient.volumes")
|
tests_cli/test_server_cli.py
CHANGED
|
@@ -5,6 +5,7 @@ from pathlib import Path
|
|
|
5
5
|
from click.testing import CliRunner
|
|
6
6
|
|
|
7
7
|
from vantage6.common.globals import APPNAME, InstanceType
|
|
8
|
+
from vantage6.cli.common.utils import attach_logs
|
|
8
9
|
from vantage6.cli.server.start import cli_server_start
|
|
9
10
|
from vantage6.cli.server.list import cli_server_configuration_list
|
|
10
11
|
from vantage6.cli.server.files import cli_server_files
|
|
@@ -141,18 +142,38 @@ class ServerCLITest(unittest.TestCase):
|
|
|
141
142
|
self.assertIsNone(result.exception)
|
|
142
143
|
self.assertEqual(result.exit_code, 0)
|
|
143
144
|
|
|
144
|
-
@patch("vantage6.cli.server.attach.
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
"""Attach log to the console without errors."""
|
|
148
|
-
container1 = MagicMock()
|
|
149
|
-
container1.name = f"{APPNAME}-iknl-system-{InstanceType.SERVER}"
|
|
150
|
-
containers.list.return_value = [container1]
|
|
151
|
-
|
|
152
|
-
sleep.side_effect = KeyboardInterrupt("Boom!")
|
|
153
|
-
|
|
145
|
+
@patch("vantage6.cli.server.attach.attach_logs")
|
|
146
|
+
def test_attach(self, attach_logs):
|
|
147
|
+
"""Attach logs to the console without errors."""
|
|
154
148
|
runner = CliRunner()
|
|
155
|
-
result = runner.invoke(cli_server_attach
|
|
149
|
+
result = runner.invoke(cli_server_attach)
|
|
156
150
|
|
|
157
151
|
self.assertIsNone(result.exception)
|
|
158
152
|
self.assertEqual(result.exit_code, 0)
|
|
153
|
+
attach_logs.assert_called_once_with(
|
|
154
|
+
"app=vantage6-server", "component=vantage6-server"
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
@patch("vantage6.cli.common.utils.Popen")
|
|
158
|
+
def test_attach_logs(self, mock_popen):
|
|
159
|
+
# Mock the Popen instance and its methods
|
|
160
|
+
mock_process = mock_popen.return_value
|
|
161
|
+
mock_process.wait.return_value = None
|
|
162
|
+
|
|
163
|
+
# Call the function with a sample label
|
|
164
|
+
attach_logs("app=node", "env=dev")
|
|
165
|
+
|
|
166
|
+
# Construct the expected command
|
|
167
|
+
expected_command = [
|
|
168
|
+
"devspace",
|
|
169
|
+
"logs",
|
|
170
|
+
"--follow",
|
|
171
|
+
"--label-selector",
|
|
172
|
+
"app=node,env=dev",
|
|
173
|
+
]
|
|
174
|
+
|
|
175
|
+
# Verify that Popen was called with the expected command
|
|
176
|
+
mock_popen.assert_called_once_with(expected_command, stdout=None, stderr=None)
|
|
177
|
+
|
|
178
|
+
# Verify that wait was called on the process
|
|
179
|
+
mock_process.wait.assert_called_once()
|
vantage6/cli/__build__
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
9
|
vantage6/cli/algostore/attach.py
CHANGED
|
@@ -1,49 +1,13 @@
|
|
|
1
1
|
import click
|
|
2
|
-
import docker
|
|
3
|
-
import questionary as q
|
|
4
2
|
|
|
5
|
-
from
|
|
6
|
-
|
|
7
|
-
from vantage6.common import error
|
|
8
|
-
from vantage6.common.docker.addons import check_docker_running
|
|
9
|
-
from vantage6.common.globals import APPNAME, InstanceType
|
|
10
|
-
from vantage6.cli.common.start import attach_logs
|
|
11
|
-
from vantage6.cli.globals import DEFAULT_SERVER_SYSTEM_FOLDERS
|
|
3
|
+
from vantage6.common import info
|
|
4
|
+
from vantage6.cli.common.utils import attach_logs
|
|
12
5
|
|
|
13
6
|
|
|
14
7
|
@click.command()
|
|
15
|
-
|
|
16
|
-
@click.option("--system", "system_folders", flag_value=True)
|
|
17
|
-
@click.option(
|
|
18
|
-
"--user", "system_folders", flag_value=False, default=DEFAULT_SERVER_SYSTEM_FOLDERS
|
|
19
|
-
)
|
|
20
|
-
def cli_algo_store_attach(name: str, system_folders: bool) -> None:
|
|
8
|
+
def cli_algo_store_attach() -> None:
|
|
21
9
|
"""
|
|
22
|
-
Show the
|
|
10
|
+
Show the store logs in the current console.
|
|
23
11
|
"""
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
running_servers = client.containers.list(
|
|
28
|
-
filters={"label": f"{APPNAME}-type={InstanceType.ALGORITHM_STORE}"}
|
|
29
|
-
)
|
|
30
|
-
running_server_names = [container.name for container in running_servers]
|
|
31
|
-
|
|
32
|
-
if not name:
|
|
33
|
-
try:
|
|
34
|
-
name = q.select(
|
|
35
|
-
"Select the algorithm store you wish to attach:",
|
|
36
|
-
choices=running_server_names,
|
|
37
|
-
).unsafe_ask()
|
|
38
|
-
except KeyboardInterrupt:
|
|
39
|
-
error("Aborted by user!")
|
|
40
|
-
return
|
|
41
|
-
else:
|
|
42
|
-
post_fix = "system" if system_folders else "user"
|
|
43
|
-
name = f"{APPNAME}-{name}-{post_fix}-{InstanceType.ALGORITHM_STORE}"
|
|
44
|
-
|
|
45
|
-
if name in running_server_names:
|
|
46
|
-
container = client.containers.get(name)
|
|
47
|
-
attach_logs(container, InstanceType.ALGORITHM_STORE)
|
|
48
|
-
else:
|
|
49
|
-
error(f"{Fore.RED}{name}{Style.RESET_ALL} is not running!")
|
|
12
|
+
info("Attaching to store logs...")
|
|
13
|
+
attach_logs("app=store", "component=store-server")
|
vantage6/cli/cli.py
CHANGED
|
@@ -22,14 +22,11 @@ from vantage6.cli.node.set_api_key import cli_node_set_api_key
|
|
|
22
22
|
from vantage6.cli.node.start import cli_node_start
|
|
23
23
|
from vantage6.cli.node.stop import cli_node_stop
|
|
24
24
|
from vantage6.cli.node.version import cli_node_version
|
|
25
|
-
from vantage6.cli.dev.create import create_demo_network
|
|
26
|
-
from vantage6.cli.dev.remove import remove_demo_network
|
|
27
|
-
from vantage6.cli.dev.start import start_demo_network
|
|
28
|
-
from vantage6.cli.dev.stop import stop_demo_network
|
|
29
25
|
from vantage6.cli.algorithm.create import cli_algorithm_create
|
|
30
26
|
from vantage6.cli.algorithm.update import cli_algorithm_update
|
|
31
27
|
from vantage6.cli.test.feature_tester import cli_test_features
|
|
32
|
-
|
|
28
|
+
|
|
29
|
+
# from vantage6.cli.test.integration_test import cli_test_integration
|
|
33
30
|
from vantage6.cli.algostore.attach import cli_algo_store_attach
|
|
34
31
|
from vantage6.cli.algostore.new import cli_algo_store_new
|
|
35
32
|
from vantage6.cli.algostore.start import cli_algo_store_start
|
|
@@ -93,11 +90,7 @@ def cli_dev() -> None:
|
|
|
93
90
|
"""
|
|
94
91
|
|
|
95
92
|
|
|
96
|
-
#
|
|
97
|
-
cli_dev.add_command(create_demo_network, name="create-demo-network")
|
|
98
|
-
cli_dev.add_command(remove_demo_network, name="remove-demo-network")
|
|
99
|
-
cli_dev.add_command(start_demo_network, name="start-demo-network")
|
|
100
|
-
cli_dev.add_command(stop_demo_network, name="stop-demo-network")
|
|
93
|
+
# TODO add commands for the dev group
|
|
101
94
|
|
|
102
95
|
|
|
103
96
|
# Define the algorithm group
|
|
@@ -123,7 +116,7 @@ def cli_test() -> None:
|
|
|
123
116
|
|
|
124
117
|
# Define the commands for the test group
|
|
125
118
|
cli_test.add_command(cli_test_features, name="feature-test")
|
|
126
|
-
cli_test.add_command(cli_test_integration, name="integration-test")
|
|
119
|
+
# cli_test.add_command(cli_test_integration, name="integration-test")
|
|
127
120
|
|
|
128
121
|
|
|
129
122
|
# Define the algorithm-store group
|
vantage6/cli/common/utils.py
CHANGED
|
@@ -3,6 +3,7 @@ from colorama import Fore, Style
|
|
|
3
3
|
import click
|
|
4
4
|
from typing import Iterable
|
|
5
5
|
import docker
|
|
6
|
+
from subprocess import Popen
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
from vantage6.common import warning, error
|
|
@@ -158,3 +159,17 @@ def get_name_from_container_name(container_name: str) -> str:
|
|
|
158
159
|
# Container name is structured as: f"{APPNAME}-{name}-{post_fix}"
|
|
159
160
|
# Take into account that name can contain '-'
|
|
160
161
|
return "-".join(container_name.split("-")[1:-1])
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def attach_logs(*labels: list[str]) -> None:
|
|
165
|
+
"""
|
|
166
|
+
Attach to the logs of the given labels.
|
|
167
|
+
|
|
168
|
+
Parameters
|
|
169
|
+
----------
|
|
170
|
+
labels : list[str]
|
|
171
|
+
The labels to attach to
|
|
172
|
+
"""
|
|
173
|
+
command = ["devspace", "logs", "--follow", "--label-selector", ",".join(labels)]
|
|
174
|
+
process = Popen(command, stdout=None, stderr=None)
|
|
175
|
+
process.wait()
|
vantage6/cli/node/attach.py
CHANGED
|
@@ -1,74 +1,13 @@
|
|
|
1
|
-
import time
|
|
2
|
-
from threading import Thread
|
|
3
1
|
import click
|
|
4
|
-
import questionary as q
|
|
5
|
-
import docker
|
|
6
2
|
|
|
7
|
-
from
|
|
8
|
-
|
|
9
|
-
from vantage6.common import warning, error, info
|
|
10
|
-
from vantage6.common.globals import APPNAME
|
|
11
|
-
from vantage6.common.docker.addons import check_docker_running
|
|
12
|
-
|
|
13
|
-
from vantage6.cli.common.utils import print_log_worker
|
|
14
|
-
from vantage6.cli.globals import DEFAULT_NODE_SYSTEM_FOLDERS as N_FOL
|
|
15
|
-
from vantage6.cli.node.common import find_running_node_names
|
|
3
|
+
from vantage6.common import info
|
|
4
|
+
from vantage6.cli.common.utils import attach_logs
|
|
16
5
|
|
|
17
6
|
|
|
18
7
|
@click.command()
|
|
19
|
-
|
|
20
|
-
@click.option(
|
|
21
|
-
"--system",
|
|
22
|
-
"system_folders",
|
|
23
|
-
flag_value=True,
|
|
24
|
-
help="Search for configuration in system folders rather than " "user folders",
|
|
25
|
-
)
|
|
26
|
-
@click.option(
|
|
27
|
-
"--user",
|
|
28
|
-
"system_folders",
|
|
29
|
-
flag_value=False,
|
|
30
|
-
default=N_FOL,
|
|
31
|
-
help="Search for configuration in user folders rather than "
|
|
32
|
-
"system folders. This is the default",
|
|
33
|
-
)
|
|
34
|
-
def cli_node_attach(name: str, system_folders: bool) -> None:
|
|
8
|
+
def cli_node_attach() -> None:
|
|
35
9
|
"""
|
|
36
10
|
Show the node logs in the current console.
|
|
37
11
|
"""
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
running_node_names = find_running_node_names(client)
|
|
42
|
-
|
|
43
|
-
if not running_node_names:
|
|
44
|
-
warning("No nodes are currently running. Cannot show any logs!")
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
if not name:
|
|
48
|
-
try:
|
|
49
|
-
name = q.select(
|
|
50
|
-
"Select the node you wish to attach:", choices=running_node_names
|
|
51
|
-
).unsafe_ask()
|
|
52
|
-
except KeyboardInterrupt:
|
|
53
|
-
error("Aborted by user!")
|
|
54
|
-
return
|
|
55
|
-
else:
|
|
56
|
-
post_fix = "system" if system_folders else "user"
|
|
57
|
-
name = f"{APPNAME}-{name}-{post_fix}"
|
|
58
|
-
|
|
59
|
-
if name in running_node_names:
|
|
60
|
-
container = client.containers.get(name)
|
|
61
|
-
logs = container.attach(stream=True, logs=True)
|
|
62
|
-
Thread(target=print_log_worker, args=(logs,), daemon=True).start()
|
|
63
|
-
while True:
|
|
64
|
-
try:
|
|
65
|
-
time.sleep(1)
|
|
66
|
-
except KeyboardInterrupt:
|
|
67
|
-
info("Closing log file. Keyboard Interrupt.")
|
|
68
|
-
info(
|
|
69
|
-
"Note that your node is still running! Shut it down with "
|
|
70
|
-
f"'{Fore.RED}v6 node stop{Style.RESET_ALL}'"
|
|
71
|
-
)
|
|
72
|
-
exit(0)
|
|
73
|
-
else:
|
|
74
|
-
error(f"{Fore.RED}{name}{Style.RESET_ALL} was not running!?")
|
|
12
|
+
info("Attaching to node logs...")
|
|
13
|
+
attach_logs("app=node")
|
vantage6/cli/server/attach.py
CHANGED
|
@@ -1,63 +1,13 @@
|
|
|
1
|
-
import time
|
|
2
|
-
from threading import Thread
|
|
3
|
-
|
|
4
1
|
import click
|
|
5
|
-
import questionary as q
|
|
6
|
-
import docker
|
|
7
|
-
|
|
8
|
-
from colorama import Fore, Style
|
|
9
|
-
|
|
10
|
-
from vantage6.common import info, error
|
|
11
|
-
from vantage6.common.docker.addons import check_docker_running
|
|
12
|
-
from vantage6.common.globals import APPNAME, InstanceType
|
|
13
2
|
|
|
14
|
-
from vantage6.
|
|
15
|
-
from vantage6.cli.common.utils import
|
|
3
|
+
from vantage6.common import info
|
|
4
|
+
from vantage6.cli.common.utils import attach_logs
|
|
16
5
|
|
|
17
6
|
|
|
18
7
|
@click.command()
|
|
19
|
-
|
|
20
|
-
@click.option("--system", "system_folders", flag_value=True)
|
|
21
|
-
@click.option(
|
|
22
|
-
"--user", "system_folders", flag_value=False, default=DEFAULT_SERVER_SYSTEM_FOLDERS
|
|
23
|
-
)
|
|
24
|
-
def cli_server_attach(name: str, system_folders: bool) -> None:
|
|
8
|
+
def cli_server_attach() -> None:
|
|
25
9
|
"""
|
|
26
10
|
Show the server logs in the current console.
|
|
27
11
|
"""
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
running_servers = client.containers.list(
|
|
32
|
-
filters={"label": f"{APPNAME}-type={InstanceType.SERVER}"}
|
|
33
|
-
)
|
|
34
|
-
running_server_names = [node.name for node in running_servers]
|
|
35
|
-
|
|
36
|
-
if not name:
|
|
37
|
-
try:
|
|
38
|
-
name = q.select(
|
|
39
|
-
"Select the server you wish to attach:", choices=running_server_names
|
|
40
|
-
).unsafe_ask()
|
|
41
|
-
except KeyboardInterrupt:
|
|
42
|
-
error("Aborted by user!")
|
|
43
|
-
return
|
|
44
|
-
else:
|
|
45
|
-
post_fix = "system" if system_folders else "user"
|
|
46
|
-
name = f"{APPNAME}-{name}-{post_fix}-{InstanceType.SERVER}"
|
|
47
|
-
|
|
48
|
-
if name in running_server_names:
|
|
49
|
-
container = client.containers.get(name)
|
|
50
|
-
logs = container.attach(stream=True, logs=True, stdout=True)
|
|
51
|
-
Thread(target=print_log_worker, args=(logs,), daemon=True).start()
|
|
52
|
-
while True:
|
|
53
|
-
try:
|
|
54
|
-
time.sleep(1)
|
|
55
|
-
except KeyboardInterrupt:
|
|
56
|
-
info("Closing log file. Keyboard Interrupt.")
|
|
57
|
-
info(
|
|
58
|
-
"Note that your server is still running! Shut it down "
|
|
59
|
-
f"with {Fore.RED}v6 server stop{Style.RESET_ALL}"
|
|
60
|
-
)
|
|
61
|
-
exit(0)
|
|
62
|
-
else:
|
|
63
|
-
error(f"{Fore.RED}{name}{Style.RESET_ALL} was not running!?")
|
|
12
|
+
info("Attaching to server logs...")
|
|
13
|
+
attach_logs("app=vantage6-server", "component=vantage6-server")
|
|
@@ -97,9 +97,7 @@ class DiagnosticRunner:
|
|
|
97
97
|
name="test",
|
|
98
98
|
description="Basic Diagnostic test",
|
|
99
99
|
image=DIAGNOSTICS_IMAGE,
|
|
100
|
-
|
|
101
|
-
"method": "base_features",
|
|
102
|
-
},
|
|
100
|
+
method="base_features",
|
|
103
101
|
organizations=self.organization_ids,
|
|
104
102
|
databases=[{"label": "default"}],
|
|
105
103
|
)
|
|
@@ -123,8 +121,8 @@ class DiagnosticRunner:
|
|
|
123
121
|
name="test",
|
|
124
122
|
description="VPN Diagnostic test",
|
|
125
123
|
image=DIAGNOSTICS_IMAGE,
|
|
124
|
+
method="vpn_features",
|
|
126
125
|
input_={
|
|
127
|
-
"method": "vpn_features",
|
|
128
126
|
"kwargs": {"other_nodes": self.organization_ids},
|
|
129
127
|
},
|
|
130
128
|
organizations=self.organization_ids,
|
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
import click
|
|
1
|
+
# from pathlib import Path
|
|
2
|
+
# import click
|
|
3
3
|
|
|
4
|
-
from vantage6.common.globals import Ports
|
|
5
|
-
from vantage6.cli.utils import info
|
|
6
|
-
from vantage6.cli.dev.create import create_demo_network
|
|
7
|
-
from vantage6.cli.dev.start import start_demo_network
|
|
8
|
-
from vantage6.cli.dev.stop import stop_demo_network
|
|
9
|
-
from vantage6.cli.dev.remove import remove_demo_network
|
|
10
|
-
from vantage6.cli.utils import prompt_config_name, check_config_name_allowed
|
|
11
|
-
from vantage6.cli.test.feature_tester import cli_test_features
|
|
4
|
+
# from vantage6.common.globals import Ports
|
|
5
|
+
# from vantage6.cli.utils import info
|
|
6
|
+
# from vantage6.cli.dev.create import create_demo_network
|
|
7
|
+
# from vantage6.cli.dev.start import start_demo_network
|
|
8
|
+
# from vantage6.cli.dev.stop import stop_demo_network
|
|
9
|
+
# from vantage6.cli.dev.remove import remove_demo_network
|
|
10
|
+
# from vantage6.cli.utils import prompt_config_name, check_config_name_allowed
|
|
11
|
+
# from vantage6.cli.test.feature_tester import cli_test_features
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
@click.command()
|
|
15
|
-
@click.option(
|
|
16
|
-
|
|
17
|
-
)
|
|
18
|
-
@click.option(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)
|
|
25
|
-
@click.option(
|
|
26
|
-
|
|
27
|
-
)
|
|
28
|
-
@click.option(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)
|
|
34
|
-
@click.option(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
)
|
|
42
|
-
@click.option(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
)
|
|
49
|
-
@click.pass_context
|
|
50
|
-
def cli_test_integration(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
) -> list[dict]:
|
|
59
|
-
|
|
60
|
-
|
|
14
|
+
# @click.command()
|
|
15
|
+
# @click.option(
|
|
16
|
+
# "-n", "--name", default=None, type=str, help="Name for your development setup"
|
|
17
|
+
# )
|
|
18
|
+
# @click.option(
|
|
19
|
+
# "--server-url",
|
|
20
|
+
# type=str,
|
|
21
|
+
# default="http://host.docker.internal",
|
|
22
|
+
# help="Server URL to point to. If you are using Docker Desktop, "
|
|
23
|
+
# "the default http://host.docker.internal should not be changed.",
|
|
24
|
+
# )
|
|
25
|
+
# @click.option(
|
|
26
|
+
# "-i", "--image", type=str, default=None, help="Server Docker image to use"
|
|
27
|
+
# )
|
|
28
|
+
# @click.option(
|
|
29
|
+
# "--keep",
|
|
30
|
+
# type=bool,
|
|
31
|
+
# default=False,
|
|
32
|
+
# help="Keep the dev network after finishing the test",
|
|
33
|
+
# )
|
|
34
|
+
# @click.option(
|
|
35
|
+
# "--extra-server-config",
|
|
36
|
+
# type=click.Path(exists=True),
|
|
37
|
+
# default=None,
|
|
38
|
+
# help="YAML File with additional server "
|
|
39
|
+
# "configuration. This will be appended to the server "
|
|
40
|
+
# "configuration file",
|
|
41
|
+
# )
|
|
42
|
+
# @click.option(
|
|
43
|
+
# "--extra-node-config",
|
|
44
|
+
# type=click.Path("rb"),
|
|
45
|
+
# default=None,
|
|
46
|
+
# help="YAML File with additional node configuration. This will be"
|
|
47
|
+
# " appended to each of the node configuration files",
|
|
48
|
+
# )
|
|
49
|
+
# @click.pass_context
|
|
50
|
+
# def cli_test_integration(
|
|
51
|
+
# click_ctx: click.Context,
|
|
52
|
+
# name: str,
|
|
53
|
+
# server_url: str,
|
|
54
|
+
# image: str,
|
|
55
|
+
# keep: bool = False,
|
|
56
|
+
# extra_server_config: Path = None,
|
|
57
|
+
# extra_node_config: Path = None,
|
|
58
|
+
# ) -> list[dict]:
|
|
59
|
+
# """
|
|
60
|
+
# Create dev network and run diagnostic checks on it.
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
# This is a full integration test of the vantage6 network. It will create
|
|
63
|
+
# a test server with some nodes using the `vdev` commands, and then run the
|
|
64
|
+
# v6-diagnostics algorithm to test all functionality.
|
|
65
|
+
# """
|
|
66
|
+
# # get name for the development setup - if not given - and check if it is
|
|
67
|
+
# # allowed
|
|
68
|
+
# name = prompt_config_name(name)
|
|
69
|
+
# check_config_name_allowed(name)
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
# # create server & node configurations and create test resources (
|
|
72
|
+
# # collaborations, organizations, etc)
|
|
73
|
+
# click_ctx.invoke(
|
|
74
|
+
# create_demo_network,
|
|
75
|
+
# name=name,
|
|
76
|
+
# num_nodes=3,
|
|
77
|
+
# server_url=server_url,
|
|
78
|
+
# server_port=Ports.DEV_SERVER.value,
|
|
79
|
+
# image=image,
|
|
80
|
+
# extra_server_config=extra_server_config,
|
|
81
|
+
# extra_node_config=extra_node_config,
|
|
82
|
+
# )
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
# # start the server and nodes
|
|
85
|
+
# click_ctx.invoke(
|
|
86
|
+
# start_demo_network,
|
|
87
|
+
# name=name,
|
|
88
|
+
# server_image=image,
|
|
89
|
+
# node_image=image,
|
|
90
|
+
# )
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
92
|
+
# # run the diagnostic tests
|
|
93
|
+
# # TODO the username and password should be coordinated with the vdev
|
|
94
|
+
# # command - at present it spits out this username/password combination by
|
|
95
|
+
# # default but both should be defined in the same place
|
|
96
|
+
# # TODO VPN testing is always excluded - allow to include it with a flag
|
|
97
|
+
# # when vdev commands can handle extra config parameters
|
|
98
|
+
# diagnose_results = click_ctx.invoke(
|
|
99
|
+
# cli_test_features,
|
|
100
|
+
# host="http://localhost",
|
|
101
|
+
# port=Ports.DEV_SERVER.value,
|
|
102
|
+
# api_path="/api",
|
|
103
|
+
# username="dev_admin",
|
|
104
|
+
# password="password",
|
|
105
|
+
# collaboration=1,
|
|
106
|
+
# organizations=None,
|
|
107
|
+
# all_nodes=True,
|
|
108
|
+
# online_only=False,
|
|
109
|
+
# no_vpn=True,
|
|
110
|
+
# )
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
# # clean up the test resources
|
|
113
|
+
# click_ctx.invoke(stop_demo_network, name=name)
|
|
114
|
+
# if not keep:
|
|
115
|
+
# click_ctx.invoke(remove_demo_network, name=name)
|
|
116
|
+
# else:
|
|
117
|
+
# info(
|
|
118
|
+
# f"Keeping the demo network {name}. You can start it with `v6 dev "
|
|
119
|
+
# "start-demo-network`"
|
|
120
|
+
# )
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
# return diagnose_results
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vantage6
|
|
3
|
-
Version: 5.0.
|
|
3
|
+
Version: 5.0.0a9
|
|
4
4
|
Summary: vantage6 command line interface
|
|
5
5
|
Home-page: https://github.com/vantage6/vantage6
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -16,8 +16,8 @@ Requires-Dist: questionary==1.10.0
|
|
|
16
16
|
Requires-Dist: rich==13.5.2
|
|
17
17
|
Requires-Dist: schema==0.7.5
|
|
18
18
|
Requires-Dist: sqlalchemy==2.0.37
|
|
19
|
-
Requires-Dist: vantage6-common==5.0.
|
|
20
|
-
Requires-Dist: vantage6-client==5.0.
|
|
19
|
+
Requires-Dist: vantage6-common==5.0.0a9
|
|
20
|
+
Requires-Dist: vantage6-client==5.0.0a9
|
|
21
21
|
Provides-Extra: dev
|
|
22
22
|
Requires-Dist: coverage==6.4.4; extra == "dev"
|
|
23
23
|
Requires-Dist: black; extra == "dev"
|