vantage6 5.0.0a36__tar.gz → 5.0.0a37__tar.gz

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.

Files changed (110) hide show
  1. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/.gitignore +4 -1
  2. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/PKG-INFO +4 -4
  3. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/pyproject.toml +6 -7
  4. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/tests_cli/test_node_cli.py +8 -8
  5. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/tests_cli/test_server_cli.py +3 -3
  6. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/tests_cli/test_wizard.py +11 -11
  7. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/algorithm/generate_algorithm_json.py +0 -1
  8. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/algostore/new.py +3 -2
  9. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/algostore/start.py +14 -3
  10. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/algostore/stop.py +3 -0
  11. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/auth/new.py +3 -2
  12. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/auth/start.py +17 -3
  13. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/auth/stop.py +3 -0
  14. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/cli.py +19 -0
  15. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/common/decorator.py +24 -5
  16. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/common/new.py +27 -7
  17. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/common/start.py +48 -40
  18. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/common/stop.py +23 -5
  19. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/common/utils.py +23 -0
  20. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/config.py +10 -2
  21. vantage6-5.0.0a36/vantage6/cli/configuration_wizard.py → vantage6-5.0.0a37/vantage6/cli/configuration_create.py +22 -14
  22. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/configuration_manager.py +70 -21
  23. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/context/__init__.py +7 -5
  24. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/context/algorithm_store.py +11 -5
  25. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/context/auth.py +23 -5
  26. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/context/node.py +25 -8
  27. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/context/server.py +18 -6
  28. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/globals.py +1 -0
  29. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/node/common/__init__.py +26 -10
  30. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/node/new.py +13 -6
  31. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/node/set_api_key.py +1 -1
  32. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/node/start.py +19 -4
  33. vantage6-5.0.0a37/vantage6/cli/node/stop.py +217 -0
  34. vantage6-5.0.0a37/vantage6/cli/node/task_cleanup/__init__.py +153 -0
  35. vantage6-5.0.0a37/vantage6/cli/sandbox/config/base.py +101 -0
  36. vantage6-5.0.0a37/vantage6/cli/sandbox/config/core.py +300 -0
  37. vantage6-5.0.0a37/vantage6/cli/sandbox/config/node.py +314 -0
  38. vantage6-5.0.0a37/vantage6/cli/sandbox/data/km_dataset.csv +2401 -0
  39. vantage6-5.0.0a37/vantage6/cli/sandbox/data/olympic_athletes_2016.csv +2425 -0
  40. vantage6-5.0.0a37/vantage6/cli/sandbox/new.py +207 -0
  41. vantage6-5.0.0a37/vantage6/cli/sandbox/populate/__init__.py +173 -0
  42. vantage6-5.0.0a37/vantage6/cli/sandbox/populate/helpers/connect_store.py +203 -0
  43. vantage6-5.0.0a37/vantage6/cli/sandbox/populate/helpers/delete_fixtures.py +67 -0
  44. vantage6-5.0.0a37/vantage6/cli/sandbox/populate/helpers/load_fixtures.py +476 -0
  45. vantage6-5.0.0a37/vantage6/cli/sandbox/populate/helpers/utils.py +35 -0
  46. vantage6-5.0.0a37/vantage6/cli/sandbox/remove.py +173 -0
  47. vantage6-5.0.0a37/vantage6/cli/sandbox/start.py +341 -0
  48. vantage6-5.0.0a37/vantage6/cli/sandbox/stop.py +106 -0
  49. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/server/common/__init__.py +5 -6
  50. vantage6-5.0.0a37/vantage6/cli/server/import_.py +167 -0
  51. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/server/new.py +5 -3
  52. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/server/start.py +10 -1
  53. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/server/stop.py +2 -0
  54. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/template/auth_config.j2 +24 -1
  55. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/template/server_config.j2 +10 -7
  56. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/utils.py +33 -1
  57. vantage6-5.0.0a36/vantage6/cli/node/stop.py +0 -71
  58. vantage6-5.0.0a36/vantage6/cli/rabbitmq/__init__.py +0 -0
  59. vantage6-5.0.0a36/vantage6/cli/rabbitmq/definitions.py +0 -26
  60. vantage6-5.0.0a36/vantage6/cli/rabbitmq/queue_manager.py +0 -220
  61. vantage6-5.0.0a36/vantage6/cli/rabbitmq/rabbitmq.config +0 -8
  62. vantage6-5.0.0a36/vantage6/cli/server/import_.py +0 -149
  63. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/Makefile +0 -0
  64. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/README.md +0 -0
  65. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/tests_cli/__init__.py +0 -0
  66. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/tests_cli/test_client_script.py +0 -0
  67. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/tests_cli/test_example.py +0 -0
  68. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/__init__.py +0 -0
  69. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/algorithm/create.py +0 -0
  70. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/algorithm/update.py +0 -0
  71. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/algostore/attach.py +0 -0
  72. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/algostore/files.py +0 -0
  73. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/algostore/list.py +0 -0
  74. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/algostore/remove.py +0 -0
  75. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/auth/attach.py +0 -0
  76. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/auth/files.py +0 -0
  77. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/auth/list.py +0 -0
  78. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/auth/remove.py +0 -0
  79. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/common/remove.py +0 -0
  80. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/context/base_server.py +0 -0
  81. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/dev/clean.py +0 -0
  82. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/dev/common.py +0 -0
  83. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/dev/rebuild.py +0 -0
  84. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/dev/start.py +0 -0
  85. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/dev/stop.py +0 -0
  86. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/node/attach.py +0 -0
  87. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/node/create_private_key.py +0 -0
  88. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/node/files.py +0 -0
  89. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/node/list.py +0 -0
  90. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/node/remove.py +0 -0
  91. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/node/restart.py +0 -0
  92. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/node/version.py +0 -0
  93. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/prometheus/monitoring_manager.py +0 -0
  94. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/prometheus/prometheus.yml +0 -0
  95. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/server/attach.py +0 -0
  96. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/server/files.py +0 -0
  97. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/server/list.py +0 -0
  98. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/server/remove.py +0 -0
  99. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/server/version.py +0 -0
  100. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/template/algo_store_config.j2 +0 -0
  101. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/template/node_config.j2 +0 -0
  102. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/template/node_config_nonk8s.j2 +0 -0
  103. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/test/algo_test_scripts/algo_test_arguments.py +0 -0
  104. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/test/algo_test_scripts/algo_test_script.py +0 -0
  105. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/test/client_script.py +0 -0
  106. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/test/common/diagnostic_runner.py +0 -0
  107. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/test/feature_tester.py +0 -0
  108. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/test/integration_test.py +0 -0
  109. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/use/context.py +0 -0
  110. {vantage6-5.0.0a36 → vantage6-5.0.0a37}/vantage6/cli/use/namespace.py +0 -0
@@ -30,4 +30,7 @@ dev/.tasks/
30
30
  dev/.db/
31
31
 
32
32
  # Helm
33
- charts/**/*.tgz
33
+ charts/**/*.tgz
34
+
35
+ # MacOS
36
+ .DS_Store
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vantage6
3
- Version: 5.0.0a36
3
+ Version: 5.0.0a37
4
4
  Summary: vantage6 command line interface
5
5
  Author: Vantage6 Team
6
6
  Maintainer-email: Frank Martin <f.martin@iknl.nl>, Bart van Beusekom <b.vanbeusekom@iknl.nl>
@@ -14,12 +14,12 @@ Requires-Dist: ipython==8.10.0
14
14
  Requires-Dist: jinja2==3.1.6
15
15
  Requires-Dist: kubernetes==28.1.0
16
16
  Requires-Dist: pandas>=2.2.3
17
- Requires-Dist: questionary==1.10.0
17
+ Requires-Dist: questionary==2.1.1
18
18
  Requires-Dist: rich==13.5.2
19
19
  Requires-Dist: schema==0.7.5
20
20
  Requires-Dist: sqlalchemy==2.0.37
21
- Requires-Dist: vantage6-client==5.0.0a36
22
- Requires-Dist: vantage6-common==5.0.0a36
21
+ Requires-Dist: vantage6-client==5.0.0a37
22
+ Requires-Dist: vantage6-common==5.0.0a37
23
23
  Provides-Extra: dev
24
24
  Requires-Dist: black; extra == 'dev'
25
25
  Requires-Dist: coverage==7.10.2; extra == 'dev'
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "vantage6"
7
- version = "5.0.0a36"
7
+ version = "5.0.0a37"
8
8
  description = "vantage6 command line interface"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -25,12 +25,12 @@ dependencies = [
25
25
  "jinja2==3.1.6",
26
26
  "kubernetes==28.1.0",
27
27
  "pandas>=2.2.3",
28
- "questionary==1.10.0",
28
+ "questionary==2.1.1",
29
29
  "rich==13.5.2",
30
30
  "schema==0.7.5",
31
31
  "sqlalchemy==2.0.37",
32
- "vantage6-common==5.0.0a36",
33
- "vantage6-client==5.0.0a36",
32
+ "vantage6-common==5.0.0a37",
33
+ "vantage6-client==5.0.0a37",
34
34
  ]
35
35
 
36
36
  [project.optional-dependencies]
@@ -54,13 +54,12 @@ where = ["vantage6/cli"]
54
54
 
55
55
  [tool.setuptools.package-data]
56
56
  "vantage6/cli/" = [
57
- "rabbimq/rabbitmq.config",
58
57
  "template/node_config.j2",
59
58
  "template/node_config_nonk8s.j2",
60
59
  "template/server_config.j2",
61
60
  "template/algo_store_config.j2",
62
61
  "template/auth_config.j2",
63
- "dev/data/olympic_athletes_2016.csv",
64
- "dev/data/km_dataset.csv",
62
+ "sandbox/data/olympic_athletes_2016.csv",
63
+ "sandbox/data/km_dataset.csv",
65
64
  "prometheus/prometheus.yml",
66
65
  ]
@@ -9,7 +9,7 @@ from unittest.mock import MagicMock, patch
9
9
  from click.testing import CliRunner
10
10
 
11
11
  from vantage6.common import STRING_ENCODING
12
- from vantage6.common.globals import Ports
12
+ from vantage6.common.globals import LOCALHOST, Ports
13
13
 
14
14
  from vantage6.cli.common.utils import print_log_worker
15
15
  from vantage6.cli.globals import APPNAME
@@ -84,14 +84,14 @@ class NodeCLITest(unittest.TestCase):
84
84
  "-----------------------------------------------------\n",
85
85
  )
86
86
 
87
- @patch("vantage6.cli.node.new.configuration_wizard")
87
+ @patch("vantage6.cli.node.new.make_configuration")
88
88
  @patch("vantage6.cli.node.new.ensure_config_dir_writable")
89
89
  @patch("vantage6.cli.node.common.NodeContext")
90
- def test_new_config(self, context, permissions, wizard):
90
+ def test_new_config(self, context, permissions, make_configuration):
91
91
  """No error produced when creating new configuration."""
92
92
  context.config_exists.return_value = False
93
93
  permissions.return_value = True
94
- wizard.return_value = "/some/file/path"
94
+ make_configuration.return_value = "/some/file/path"
95
95
 
96
96
  runner = CliRunner()
97
97
  result = runner.invoke(
@@ -108,8 +108,8 @@ class NodeCLITest(unittest.TestCase):
108
108
  # check OK exit code
109
109
  self.assertEqual(result.exit_code, 0)
110
110
 
111
- @patch("vantage6.cli.node.new.configuration_wizard")
112
- def test_new_config_replace_whitespace_in_name(self, _):
111
+ @patch("vantage6.cli.node.new.make_configuration")
112
+ def test_new_config_replace_whitespace_in_name(self, make_configuration):
113
113
  """Whitespaces are replaced in the name."""
114
114
 
115
115
  runner = CliRunner()
@@ -172,7 +172,7 @@ class NodeCLITest(unittest.TestCase):
172
172
 
173
173
  @patch("vantage6.cli.node.common.NodeContext")
174
174
  @patch("vantage6.cli.node.files.NodeContext")
175
- @patch("vantage6.cli.node.common.select_configuration_questionaire")
175
+ @patch("vantage6.cli.node.common.select_configuration_questionnaire")
176
176
  def test_files(self, select_config, context, common_context):
177
177
  """No errors produced when retrieving filepaths."""
178
178
 
@@ -382,7 +382,7 @@ class NodeCLITest(unittest.TestCase):
382
382
  def test_client(self, client, error, debug, info):
383
383
  ctx = MagicMock(
384
384
  config={
385
- "server_url": "localhost",
385
+ "server_url": LOCALHOST,
386
386
  "port": Ports.DEV_SERVER.value,
387
387
  "api_path": "",
388
388
  }
@@ -113,15 +113,15 @@ class ServerCLITest(unittest.TestCase):
113
113
  self.assertIsNone(result.exception)
114
114
  self.assertEqual(result.exit_code, 0)
115
115
 
116
- @patch("vantage6.cli.server.new.configuration_wizard")
116
+ @patch("vantage6.cli.server.new.make_configuration")
117
117
  @patch("vantage6.cli.server.new.ensure_config_dir_writable")
118
118
  @patch("vantage6.cli.server.new.ServerContext")
119
- def test_new(self, context, permissions, wizard):
119
+ def test_new(self, context, permissions, make_configuration):
120
120
  """New configuration without errors."""
121
121
 
122
122
  context.config_exists.return_value = False
123
123
  permissions.return_value = True
124
- wizard.return_value = "/some/file.yaml"
124
+ make_configuration.return_value = "/some/file.yaml"
125
125
 
126
126
  runner = CliRunner()
127
127
  result = runner.invoke(cli_server_new, ["--name", "iknl"])
@@ -4,14 +4,14 @@ from unittest.mock import MagicMock, patch
4
4
 
5
5
  from vantage6.common.globals import InstanceType, NodePolicy
6
6
 
7
- from vantage6.cli.configuration_wizard import (
8
- configuration_wizard,
7
+ from vantage6.cli.configuration_create import (
8
+ make_configuration,
9
9
  node_configuration_questionaire,
10
- select_configuration_questionaire,
10
+ select_configuration_questionnaire,
11
11
  server_configuration_questionaire,
12
12
  )
13
13
 
14
- module_path = "vantage6.cli.configuration_wizard"
14
+ module_path = "vantage6.cli.configuration_create"
15
15
 
16
16
 
17
17
  class WizardTest(unittest.TestCase):
@@ -29,7 +29,7 @@ class WizardTest(unittest.TestCase):
29
29
  result[name] = None
30
30
  return result
31
31
 
32
- @patch("vantage6.cli.configuration_wizard.NodeClient.authenticate")
32
+ @patch("vantage6.cli.configuration_create.NodeClient.authenticate")
33
33
  def test_node_wizard(self, authenticate):
34
34
  """An error is printed when docker is not running"""
35
35
  authenticate.return_value = None
@@ -115,19 +115,19 @@ class WizardTest(unittest.TestCase):
115
115
  @patch(f"{module_path}.server_configuration_questionaire")
116
116
  @patch(f"{module_path}.ServerConfigurationManager")
117
117
  @patch(f"{module_path}.NodeConfigurationManager")
118
- @patch("vantage6.cli.configuration_wizard.AppContext")
119
- def test_configuration_wizard_interface(
118
+ @patch("vantage6.cli.configuration_create.AppContext")
119
+ def test_configuration_create_interface(
120
120
  self, context, node_m, server_m, server_q, node_q
121
121
  ):
122
122
  context.instance_folders.return_value = {"config": "/some/path/"}
123
123
 
124
- file_ = configuration_wizard(InstanceType.NODE, "vtg6", False)
124
+ file_ = make_configuration(InstanceType.NODE, "vtg6", False)
125
125
  self.assertEqual(Path("/some/path/vtg6.yaml"), file_)
126
126
 
127
- file_ = configuration_wizard(InstanceType.SERVER, "vtg6", True)
127
+ file_ = make_configuration(InstanceType.SERVER, "vtg6", True)
128
128
  self.assertEqual(Path("/some/path/vtg6.yaml"), file_)
129
129
 
130
- @patch("vantage6.cli.configuration_wizard.AppContext.available_configurations")
130
+ @patch("vantage6.cli.configuration_create.AppContext.available_configurations")
131
131
  def test_select_configuration(self, available_configurations):
132
132
  config = MagicMock()
133
133
  config.name = "vtg6"
@@ -136,6 +136,6 @@ class WizardTest(unittest.TestCase):
136
136
 
137
137
  with patch(f"{module_path}.q") as q:
138
138
  q.select.return_value.unsafe_ask.return_value = "vtg6"
139
- name = select_configuration_questionaire(InstanceType.NODE, True)
139
+ name = select_configuration_questionnaire(InstanceType.NODE, True)
140
140
 
141
141
  self.assertEqual(name, "vtg6")
@@ -215,7 +215,6 @@ class Function:
215
215
  "display_name": self._pretty_print_name(name),
216
216
  "description": self._extract_parameter_description(name),
217
217
  "type": type_.value if type_ else None,
218
- "required": param.default == inspect.Parameter.empty,
219
218
  "has_default_value": param.default != inspect.Parameter.empty,
220
219
  "is_frontend_only": False,
221
220
  }
@@ -8,7 +8,7 @@ from vantage6.common.globals import (
8
8
  )
9
9
 
10
10
  from vantage6.cli.common.new import new
11
- from vantage6.cli.configuration_wizard import add_common_server_config
11
+ from vantage6.cli.configuration_create import add_common_server_config
12
12
  from vantage6.cli.globals import DEFAULT_SERVER_SYSTEM_FOLDERS
13
13
 
14
14
 
@@ -43,7 +43,8 @@ def cli_algo_store_new(
43
43
  """
44
44
 
45
45
  new(
46
- questionnaire_function=algo_store_configuration_questionaire,
46
+ config_producing_func=algo_store_configuration_questionaire,
47
+ config_producing_func_args=(name,),
47
48
  name=name,
48
49
  system_folders=system_folders,
49
50
  namespace=namespace,
@@ -15,6 +15,7 @@ from vantage6.cli.common.start import (
15
15
  from vantage6.cli.common.utils import (
16
16
  attach_logs,
17
17
  create_directory_if_not_exists,
18
+ select_context_and_namespace,
18
19
  )
19
20
  from vantage6.cli.context.algorithm_store import AlgorithmStoreContext
20
21
  from vantage6.cli.globals import ChartName
@@ -30,8 +31,13 @@ from vantage6.cli.globals import ChartName
30
31
  default=False,
31
32
  help="Print server logs to the console after start",
32
33
  )
34
+ @click.option("--local-chart-dir", default=None, help="Local chart directory to use")
35
+ @click.option("--sandbox/--no-sandbox", "sandbox", default=False)
33
36
  @click_insert_context(
34
- InstanceType.ALGORITHM_STORE, include_name=True, include_system_folders=True
37
+ InstanceType.ALGORITHM_STORE,
38
+ include_name=True,
39
+ include_system_folders=True,
40
+ sandbox_param="sandbox",
35
41
  )
36
42
  def cli_algo_store_start(
37
43
  ctx: AlgorithmStoreContext,
@@ -42,14 +48,18 @@ def cli_algo_store_start(
42
48
  ip: str,
43
49
  port: int,
44
50
  attach: bool,
51
+ local_chart_dir: str,
45
52
  ) -> None:
46
53
  """
47
54
  Start the algorithm store.
48
55
  """
49
56
  info("Starting algorithm store...")
50
57
 
51
- prestart_checks(
52
- ctx, InstanceType.ALGORITHM_STORE, name, system_folders, context, namespace
58
+ prestart_checks(ctx, InstanceType.ALGORITHM_STORE, name, system_folders)
59
+
60
+ context, namespace = select_context_and_namespace(
61
+ context=context,
62
+ namespace=namespace,
53
63
  )
54
64
 
55
65
  create_directory_if_not_exists(ctx.log_dir)
@@ -60,6 +70,7 @@ def cli_algo_store_start(
60
70
  values_file=ctx.config_file,
61
71
  context=context,
62
72
  namespace=namespace,
73
+ local_chart_dir=local_chart_dir,
63
74
  )
64
75
 
65
76
  info("Port forwarding for algorithm store")
@@ -25,6 +25,7 @@ from vantage6.cli.globals import DEFAULT_SERVER_SYSTEM_FOLDERS, InfraComponentNa
25
25
  flag_value=False,
26
26
  help="Search for configuration in the user folders instead of system folders.",
27
27
  )
28
+ @click.option("--sandbox/--no-sandbox", "sandbox", default=False)
28
29
  @click.option("--all", "all_stores", flag_value=True, help="Stop all algorithm stores")
29
30
  def cli_algo_store_stop(
30
31
  name: str,
@@ -32,6 +33,7 @@ def cli_algo_store_stop(
32
33
  namespace: str,
33
34
  system_folders: bool,
34
35
  all_stores: bool,
36
+ sandbox: bool,
35
37
  ):
36
38
  """
37
39
  Stop one or all running algorithm store(s).
@@ -45,6 +47,7 @@ def cli_algo_store_stop(
45
47
  namespace=namespace,
46
48
  context=context,
47
49
  system_folders=system_folders,
50
+ is_sandbox=sandbox,
48
51
  )
49
52
 
50
53
 
@@ -44,7 +44,8 @@ def cli_auth_new(
44
44
  Create a new server configuration.
45
45
  """
46
46
  new(
47
- questionnaire_function=auth_configuration_questionaire,
47
+ config_producing_func=auth_configuration_questionaire,
48
+ config_producing_func_args=tuple(),
48
49
  name=name,
49
50
  system_folders=system_folders,
50
51
  namespace=namespace,
@@ -53,7 +54,7 @@ def cli_auth_new(
53
54
  )
54
55
 
55
56
 
56
- def auth_configuration_questionaire(instance_name: str) -> dict[str, Any]:
57
+ def auth_configuration_questionaire() -> dict[str, Any]:
57
58
  """
58
59
  Kubernetes-specific questionnaire to generate Helm values for the Keycloak helm
59
60
  chart.
@@ -11,6 +11,7 @@ from vantage6.cli.common.start import (
11
11
  )
12
12
  from vantage6.cli.common.utils import (
13
13
  attach_logs,
14
+ select_context_and_namespace,
14
15
  )
15
16
  from vantage6.cli.context.auth import AuthContext
16
17
  from vantage6.cli.globals import ChartName
@@ -32,8 +33,13 @@ from vantage6.cli.globals import ChartName
32
33
  default=False,
33
34
  help="Print server logs to the console after start",
34
35
  )
36
+ @click.option("--local-chart-dir", default=None, help="Local chart directory to use")
37
+ @click.option("--sandbox/--no-sandbox", "sandbox", default=False)
35
38
  @click_insert_context(
36
- type_=InstanceType.AUTH, include_name=True, include_system_folders=True
39
+ type_=InstanceType.AUTH,
40
+ include_name=True,
41
+ include_system_folders=True,
42
+ sandbox_param="sandbox",
37
43
  )
38
44
  def cli_auth_start(
39
45
  ctx: AuthContext,
@@ -44,23 +50,31 @@ def cli_auth_start(
44
50
  ip: str,
45
51
  port: int,
46
52
  attach: bool,
53
+ local_chart_dir: str,
47
54
  ) -> None:
48
55
  """
49
56
  Start the auth service.
50
57
  """
51
58
  info("Starting authentication service...")
52
59
 
53
- prestart_checks(ctx, InstanceType.AUTH, name, system_folders, context, namespace)
60
+ prestart_checks(ctx, InstanceType.AUTH, name, system_folders)
61
+
62
+ context, namespace = select_context_and_namespace(
63
+ context=context,
64
+ namespace=namespace,
65
+ )
54
66
 
55
67
  # TODO: re-enable when we save the auth logs
56
68
  # create_directory_if_not_exists(ctx.log_dir)
57
69
 
70
+ info("Starting auth service. This may take a few minutes...")
58
71
  helm_install(
59
72
  release_name=ctx.helm_release_name,
60
73
  chart_name=ChartName.AUTH,
61
74
  values_file=ctx.config_file,
62
75
  context=context,
63
76
  namespace=namespace,
77
+ local_chart_dir=local_chart_dir,
64
78
  )
65
79
 
66
80
  # port forward for auth service
@@ -76,5 +90,5 @@ def cli_auth_start(
76
90
 
77
91
  if attach:
78
92
  attach_logs(
79
- f"app.kubernetes.io/instance={ctx.helm_release_name}",
93
+ [f"app.kubernetes.io/instance={ctx.helm_release_name}"],
80
94
  )
@@ -25,11 +25,13 @@ from vantage6.cli.globals import DEFAULT_SERVER_SYSTEM_FOLDERS, InfraComponentNa
25
25
  flag_value=False,
26
26
  help="Search for configuration in the user folders instead of system folders.",
27
27
  )
28
+ @click.option("--sandbox/--no-sandbox", "sandbox", default=False)
28
29
  def cli_auth_stop(
29
30
  name: str,
30
31
  context: str,
31
32
  namespace: str,
32
33
  system_folders: bool,
34
+ sandbox: bool,
33
35
  ):
34
36
  """
35
37
  Stop a running auth service.
@@ -43,6 +45,7 @@ def cli_auth_stop(
43
45
  namespace=namespace,
44
46
  context=context,
45
47
  system_folders=system_folders,
48
+ is_sandbox=sandbox,
46
49
  )
47
50
 
48
51
 
@@ -35,6 +35,10 @@ from vantage6.cli.node.set_api_key import cli_node_set_api_key
35
35
  from vantage6.cli.node.start import cli_node_start
36
36
  from vantage6.cli.node.stop import cli_node_stop
37
37
  from vantage6.cli.node.version import cli_node_version
38
+ from vantage6.cli.sandbox.new import cli_new_sandbox
39
+ from vantage6.cli.sandbox.remove import cli_sandbox_remove
40
+ from vantage6.cli.sandbox.start import cli_sandbox_start
41
+ from vantage6.cli.sandbox.stop import cli_sandbox_stop
38
42
  from vantage6.cli.server.attach import cli_server_attach
39
43
  from vantage6.cli.server.files import cli_server_files
40
44
  from vantage6.cli.server.import_ import cli_server_import
@@ -94,6 +98,20 @@ cli_node.add_command(cli_node_stop, name="stop")
94
98
  cli_node.add_command(cli_node_version, name="version")
95
99
 
96
100
 
101
+ # Define the sandbox group
102
+ @click.group(name=CLICommandName.SANDBOX.value)
103
+ def cli_sandbox() -> None:
104
+ """
105
+ Setup and manage a sandbox environment.
106
+ """
107
+
108
+
109
+ cli_sandbox.add_command(cli_new_sandbox, name="new")
110
+ cli_sandbox.add_command(cli_sandbox_start, name="start")
111
+ cli_sandbox.add_command(cli_sandbox_stop, name="stop")
112
+ cli_sandbox.add_command(cli_sandbox_remove, name="remove")
113
+
114
+
97
115
  # Define the dev group
98
116
  @click.group(name=CLICommandName.DEV.value)
99
117
  def cli_dev() -> None:
@@ -204,6 +222,7 @@ def cli_complete() -> None:
204
222
  # Add the subcommands to the overall group
205
223
  cli_complete.add_command(cli_node)
206
224
  cli_complete.add_command(cli_server)
225
+ cli_complete.add_command(cli_sandbox)
207
226
  cli_complete.add_command(cli_dev)
208
227
  cli_complete.add_command(cli_algorithm)
209
228
  cli_complete.add_command(cli_test)
@@ -4,9 +4,9 @@ from pathlib import Path
4
4
  import click
5
5
 
6
6
  from vantage6.common import error
7
- from vantage6.common.globals import InstanceType
7
+ from vantage6.common.globals import SANDBOX_SUFFIX, InstanceType
8
8
 
9
- from vantage6.cli.configuration_wizard import select_configuration_questionaire
9
+ from vantage6.cli.configuration_create import select_configuration_questionnaire
10
10
  from vantage6.cli.context import get_context, select_context_class
11
11
 
12
12
 
@@ -14,6 +14,8 @@ def click_insert_context(
14
14
  type_: InstanceType,
15
15
  include_name: bool = False,
16
16
  include_system_folders: bool = False,
17
+ is_sandbox: bool = False,
18
+ sandbox_param: str | None = None,
17
19
  ) -> callable:
18
20
  """
19
21
  Supply the Click function with an additional context parameter. The context
@@ -27,6 +29,12 @@ def click_insert_context(
27
29
  Include the name of the configuration as an argument
28
30
  include_system_folders : bool
29
31
  Include whether or not to use the system folders as an argument
32
+ is_sandbox : bool
33
+ Include whether or not to use the sandbox configurations as an argument
34
+ sandbox_param : str | None
35
+ Name of a Click option/parameter in the command function whose boolean
36
+ value should determine sandbox mode at runtime. If provided, this value
37
+ overrides the static is_sandbox parameter.
30
38
 
31
39
  Returns
32
40
  -------
@@ -58,7 +66,7 @@ def click_insert_context(
58
66
  "--user",
59
67
  "system_folders",
60
68
  flag_value=False,
61
- default=False if type_ == InstanceType.NODE else True,
69
+ default=False if type_ == InstanceType.NODE or is_sandbox else True,
62
70
  help="Use user folders instead of system folders",
63
71
  )
64
72
  @wraps(func)
@@ -74,6 +82,15 @@ def click_insert_context(
74
82
  Decorated function
75
83
  """
76
84
  ctx_class = select_context_class(type_)
85
+
86
+ # Determine sandbox mode, preferring runtime option when provided
87
+ runtime_is_sandbox = is_sandbox
88
+ if sandbox_param is not None:
89
+ # Pop to avoid passing unknown kwarg to the wrapped function
90
+ runtime_is_sandbox = bool(kwargs.pop(sandbox_param, False))
91
+ if runtime_is_sandbox and name and name.endswith(SANDBOX_SUFFIX):
92
+ name = name[: -len(SANDBOX_SUFFIX)]
93
+
77
94
  # path to configuration file always overrides name
78
95
  if config:
79
96
  ctx = ctx_class.from_external_config_file(config, system_folders)
@@ -87,12 +104,14 @@ def click_insert_context(
87
104
  if not name:
88
105
  try:
89
106
  # select configuration if none supplied
90
- name = select_configuration_questionaire(type_, system_folders)
107
+ name = select_configuration_questionnaire(
108
+ type_, system_folders, runtime_is_sandbox
109
+ )
91
110
  except Exception:
92
111
  error("No configurations could be found!")
93
112
  exit(1)
94
113
 
95
- ctx = get_context(type_, name, system_folders)
114
+ ctx = get_context(type_, name, system_folders, runtime_is_sandbox)
96
115
  extra_args = []
97
116
  if include_name:
98
117
  if not name:
@@ -1,3 +1,5 @@
1
+ from pathlib import Path
2
+
1
3
  from colorama import Fore, Style
2
4
 
3
5
  from vantage6.common import ensure_config_dir_writable, error, info
@@ -5,26 +7,30 @@ from vantage6.common.globals import InstanceType
5
7
 
6
8
  from vantage6.cli.common.utils import get_main_cli_command_name
7
9
  from vantage6.cli.config import CliConfig
8
- from vantage6.cli.configuration_wizard import configuration_wizard
10
+ from vantage6.cli.configuration_create import make_configuration
9
11
  from vantage6.cli.context import select_context_class
10
12
  from vantage6.cli.utils import check_config_name_allowed, prompt_config_name
11
13
 
12
14
 
13
15
  def new(
14
- questionnaire_function: callable,
16
+ config_producing_func: callable,
17
+ config_producing_func_args: tuple,
15
18
  name: str,
16
19
  system_folders: bool,
17
20
  namespace: str,
18
21
  context: str,
19
22
  type_: InstanceType,
20
- ) -> None:
23
+ is_sandbox: bool = False,
24
+ ) -> Path | None:
21
25
  """
22
26
  Create a new configuration.
23
27
 
24
28
  Parameters
25
29
  ----------
26
- questionnaire_function : callable
30
+ config_producing_func : callable
27
31
  Function to generate the configuration
32
+ config_producing_func_args : tuple
33
+ Arguments to pass to the config producing function
28
34
  name : str
29
35
  Name of the configuration
30
36
  system_folders : bool
@@ -35,6 +41,13 @@ def new(
35
41
  Context to use
36
42
  type_ : InstanceType
37
43
  Type of the configuration (node, server, algorithm store, etc)
44
+ is_sandbox : bool
45
+ Whether to create a sandbox configuration or not
46
+
47
+ Returns
48
+ -------
49
+ Path | None
50
+ Path to the configuration file. None if the process is aborted for any reason.
38
51
  """
39
52
  cli_config = CliConfig()
40
53
  context, namespace = cli_config.compare_changes_config(
@@ -50,11 +63,12 @@ def new(
50
63
  # check that this config does not exist
51
64
  ctx_class = select_context_class(type_)
52
65
  try:
53
- if ctx_class.config_exists(name, system_folders):
66
+ if ctx_class.config_exists(name, system_folders, is_sandbox):
54
67
  error(f"Configuration {Fore.RED}{name}{Style.RESET_ALL} already exists!")
55
68
  exit(1)
56
69
  except Exception as e:
57
70
  error(e)
71
+
58
72
  exit(1)
59
73
 
60
74
  command_name = get_main_cli_command_name(type_)
@@ -70,8 +84,13 @@ def new(
70
84
 
71
85
  # create config in ctx location
72
86
  try:
73
- cfg_file = configuration_wizard(
74
- questionnaire_function, type_, name, system_folders
87
+ cfg_file = make_configuration(
88
+ config_producing_func=config_producing_func,
89
+ config_producing_func_args=config_producing_func_args,
90
+ type_=type_,
91
+ instance_name=name,
92
+ system_folders=system_folders,
93
+ is_sandbox=is_sandbox,
75
94
  )
76
95
  except KeyboardInterrupt:
77
96
  error("Configuration creation aborted.")
@@ -83,3 +102,4 @@ def new(
83
102
  f"You can start the {command_name} by running {Fore.GREEN}v6 {command_name} "
84
103
  f"start {flag}{Style.RESET_ALL}"
85
104
  )
105
+ return cfg_file