vantage6 5.0.0a36__tar.gz → 5.0.0a38__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 (122) hide show
  1. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/.gitignore +4 -1
  2. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/PKG-INFO +4 -4
  3. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/pyproject.toml +6 -7
  4. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/tests_cli/test_node_cli.py +8 -8
  5. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/tests_cli/test_server_cli.py +3 -3
  6. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/tests_cli/test_wizard.py +11 -11
  7. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/algorithm/generate_algorithm_json.py +0 -1
  8. vantage6-5.0.0a38/vantage6/cli/algostore/attach.py +39 -0
  9. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/algostore/list.py +2 -2
  10. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/algostore/new.py +3 -2
  11. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/algostore/start.py +25 -6
  12. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/algostore/stop.py +3 -0
  13. vantage6-5.0.0a38/vantage6/cli/algostore/version.py +62 -0
  14. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/auth/attach.py +1 -1
  15. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/auth/list.py +2 -2
  16. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/auth/new.py +3 -2
  17. vantage6-5.0.0a38/vantage6/cli/auth/remove.py +89 -0
  18. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/auth/start.py +27 -9
  19. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/auth/stop.py +3 -0
  20. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/cli.py +21 -0
  21. vantage6-5.0.0a38/vantage6/cli/common/attach.py +114 -0
  22. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/common/decorator.py +25 -4
  23. vantage6-5.0.0a38/vantage6/cli/common/list.py +68 -0
  24. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/common/new.py +27 -7
  25. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/common/remove.py +18 -0
  26. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/common/start.py +48 -40
  27. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/common/stop.py +16 -4
  28. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/common/utils.py +65 -74
  29. vantage6-5.0.0a38/vantage6/cli/common/version.py +82 -0
  30. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/config.py +10 -2
  31. vantage6-5.0.0a36/vantage6/cli/configuration_wizard.py → vantage6-5.0.0a38/vantage6/cli/configuration_create.py +22 -14
  32. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/configuration_manager.py +70 -21
  33. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/context/__init__.py +10 -5
  34. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/context/algorithm_store.py +13 -7
  35. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/context/auth.py +23 -5
  36. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/context/node.py +25 -8
  37. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/context/server.py +18 -6
  38. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/globals.py +1 -0
  39. vantage6-5.0.0a38/vantage6/cli/node/attach.py +38 -0
  40. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/node/common/__init__.py +26 -10
  41. vantage6-5.0.0a38/vantage6/cli/node/common/task_cleanup.py +153 -0
  42. vantage6-5.0.0a38/vantage6/cli/node/list.py +16 -0
  43. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/node/new.py +13 -6
  44. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/node/set_api_key.py +1 -1
  45. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/node/start.py +30 -7
  46. vantage6-5.0.0a38/vantage6/cli/node/stop.py +215 -0
  47. vantage6-5.0.0a38/vantage6/cli/node/version.py +125 -0
  48. vantage6-5.0.0a38/vantage6/cli/sandbox/config/base.py +109 -0
  49. vantage6-5.0.0a38/vantage6/cli/sandbox/config/core.py +300 -0
  50. vantage6-5.0.0a38/vantage6/cli/sandbox/config/node.py +311 -0
  51. vantage6-5.0.0a38/vantage6/cli/sandbox/data/km_dataset.csv +2401 -0
  52. vantage6-5.0.0a38/vantage6/cli/sandbox/data/olympic_athletes_2016.csv +2425 -0
  53. vantage6-5.0.0a38/vantage6/cli/sandbox/new.py +207 -0
  54. vantage6-5.0.0a38/vantage6/cli/sandbox/populate/__init__.py +173 -0
  55. vantage6-5.0.0a38/vantage6/cli/sandbox/populate/helpers/connect_store.py +203 -0
  56. vantage6-5.0.0a38/vantage6/cli/sandbox/populate/helpers/delete_fixtures.py +67 -0
  57. vantage6-5.0.0a38/vantage6/cli/sandbox/populate/helpers/load_fixtures.py +476 -0
  58. vantage6-5.0.0a38/vantage6/cli/sandbox/populate/helpers/utils.py +35 -0
  59. vantage6-5.0.0a38/vantage6/cli/sandbox/remove.py +155 -0
  60. vantage6-5.0.0a38/vantage6/cli/sandbox/start.py +349 -0
  61. vantage6-5.0.0a38/vantage6/cli/sandbox/stop.py +106 -0
  62. vantage6-5.0.0a38/vantage6/cli/server/attach.py +39 -0
  63. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/server/common/__init__.py +5 -6
  64. vantage6-5.0.0a38/vantage6/cli/server/import_.py +167 -0
  65. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/server/list.py +2 -2
  66. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/server/new.py +5 -3
  67. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/server/start.py +21 -4
  68. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/server/stop.py +2 -0
  69. vantage6-5.0.0a38/vantage6/cli/server/version.py +50 -0
  70. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/template/algo_store_config.j2 +3 -0
  71. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/template/auth_config.j2 +24 -1
  72. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/template/node_config.j2 +2 -0
  73. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/template/server_config.j2 +10 -7
  74. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/use/context.py +8 -1
  75. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/use/namespace.py +10 -7
  76. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/utils.py +33 -1
  77. vantage6-5.0.0a38/vantage6/cli/utils_kubernetes.py +270 -0
  78. vantage6-5.0.0a36/vantage6/cli/algostore/attach.py +0 -14
  79. vantage6-5.0.0a36/vantage6/cli/auth/remove.py +0 -31
  80. vantage6-5.0.0a36/vantage6/cli/node/attach.py +0 -14
  81. vantage6-5.0.0a36/vantage6/cli/node/list.py +0 -57
  82. vantage6-5.0.0a36/vantage6/cli/node/stop.py +0 -71
  83. vantage6-5.0.0a36/vantage6/cli/node/version.py +0 -62
  84. vantage6-5.0.0a36/vantage6/cli/rabbitmq/__init__.py +0 -0
  85. vantage6-5.0.0a36/vantage6/cli/rabbitmq/definitions.py +0 -26
  86. vantage6-5.0.0a36/vantage6/cli/rabbitmq/queue_manager.py +0 -220
  87. vantage6-5.0.0a36/vantage6/cli/rabbitmq/rabbitmq.config +0 -8
  88. vantage6-5.0.0a36/vantage6/cli/server/attach.py +0 -14
  89. vantage6-5.0.0a36/vantage6/cli/server/import_.py +0 -149
  90. vantage6-5.0.0a36/vantage6/cli/server/version.py +0 -37
  91. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/Makefile +0 -0
  92. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/README.md +0 -0
  93. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/tests_cli/__init__.py +0 -0
  94. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/tests_cli/test_client_script.py +0 -0
  95. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/tests_cli/test_example.py +0 -0
  96. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/__init__.py +0 -0
  97. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/algorithm/create.py +0 -0
  98. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/algorithm/update.py +0 -0
  99. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/algostore/files.py +0 -0
  100. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/algostore/remove.py +0 -0
  101. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/auth/files.py +0 -0
  102. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/context/base_server.py +0 -0
  103. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/dev/clean.py +0 -0
  104. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/dev/common.py +0 -0
  105. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/dev/rebuild.py +0 -0
  106. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/dev/start.py +0 -0
  107. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/dev/stop.py +0 -0
  108. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/node/create_private_key.py +0 -0
  109. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/node/files.py +0 -0
  110. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/node/remove.py +0 -0
  111. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/node/restart.py +0 -0
  112. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/prometheus/monitoring_manager.py +0 -0
  113. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/prometheus/prometheus.yml +0 -0
  114. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/server/files.py +0 -0
  115. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/server/remove.py +0 -0
  116. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/template/node_config_nonk8s.j2 +0 -0
  117. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/test/algo_test_scripts/algo_test_arguments.py +0 -0
  118. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/test/algo_test_scripts/algo_test_script.py +0 -0
  119. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/test/client_script.py +0 -0
  120. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/test/common/diagnostic_runner.py +0 -0
  121. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/test/feature_tester.py +0 -0
  122. {vantage6-5.0.0a36 → vantage6-5.0.0a38}/vantage6/cli/test/integration_test.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.0a38
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.0a38
22
+ Requires-Dist: vantage6-common==5.0.0a38
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.0a38"
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.0a38",
33
+ "vantage6-client==5.0.0a38",
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
  }
@@ -0,0 +1,39 @@
1
+ import click
2
+
3
+ from vantage6.common import info
4
+
5
+ from vantage6.cli.common.attach import attach_logs
6
+ from vantage6.cli.context import InstanceType
7
+ from vantage6.cli.globals import InfraComponentName
8
+
9
+
10
+ @click.command()
11
+ @click.option("-n", "--name", default=None, help="Name of the configuration")
12
+ @click.option("--system", "system_folders", flag_value=True, help="Use system folders")
13
+ @click.option("--user", "system_folders", flag_value=False, help="Use user folders")
14
+ @click.option("--context", default=None, help="Kubernetes context to use")
15
+ @click.option("--namespace", default=None, help="Kubernetes namespace to use")
16
+ @click.option(
17
+ "--sandbox", "is_sandbox", flag_value=True, help="Attach to a sandbox environment"
18
+ )
19
+ def cli_algo_store_attach(
20
+ name: str | None,
21
+ system_folders: bool,
22
+ context: str,
23
+ namespace: str,
24
+ is_sandbox: bool,
25
+ ) -> None:
26
+ """
27
+ Show the store logs in the current console.
28
+ """
29
+ info("Attaching to store logs...")
30
+ attach_logs(
31
+ name,
32
+ instance_type=InstanceType.ALGORITHM_STORE,
33
+ infra_component=InfraComponentName.ALGORITHM_STORE,
34
+ system_folders=system_folders,
35
+ context=context,
36
+ namespace=namespace,
37
+ is_sandbox=is_sandbox,
38
+ additional_labels="component=store-server",
39
+ )
@@ -2,7 +2,7 @@ import click
2
2
 
3
3
  from vantage6.common.globals import InstanceType
4
4
 
5
- from vantage6.cli.common.utils import get_server_configuration_list
5
+ from vantage6.cli.common.list import get_configuration_list
6
6
 
7
7
 
8
8
  @click.command()
@@ -10,4 +10,4 @@ def cli_algo_store_configuration_list() -> None:
10
10
  """
11
11
  Print the available server configurations.
12
12
  """
13
- get_server_configuration_list(InstanceType.ALGORITHM_STORE)
13
+ get_configuration_list(InstanceType.ALGORITHM_STORE)
@@ -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,
@@ -6,6 +6,7 @@ from vantage6.common.globals import (
6
6
  Ports,
7
7
  )
8
8
 
9
+ from vantage6.cli.common.attach import attach_logs
9
10
  from vantage6.cli.common.decorator import click_insert_context
10
11
  from vantage6.cli.common.start import (
11
12
  helm_install,
@@ -13,11 +14,11 @@ from vantage6.cli.common.start import (
13
14
  start_port_forward,
14
15
  )
15
16
  from vantage6.cli.common.utils import (
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
- from vantage6.cli.globals import ChartName
21
+ from vantage6.cli.globals import ChartName, InfraComponentName
21
22
 
22
23
 
23
24
  @click.command()
@@ -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")
@@ -73,4 +84,12 @@ def cli_algo_store_start(
73
84
  )
74
85
 
75
86
  if attach:
76
- attach_logs("app=store", "component=store-server")
87
+ attach_logs(
88
+ name,
89
+ instance_type=InstanceType.ALGORITHM_STORE,
90
+ infra_component=InfraComponentName.ALGORITHM_STORE,
91
+ system_folders=system_folders,
92
+ context=context,
93
+ namespace=namespace,
94
+ is_sandbox=ctx.is_sandbox,
95
+ )
@@ -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
 
@@ -0,0 +1,62 @@
1
+ import click
2
+ import requests
3
+
4
+ from vantage6.common import error, info
5
+ from vantage6.common.globals import (
6
+ DEFAULT_API_PATH,
7
+ HTTP_LOCALHOST,
8
+ InstanceType,
9
+ Ports,
10
+ )
11
+
12
+ from vantage6.cli import __version__
13
+ from vantage6.cli.common.version import get_and_select_ctx
14
+ from vantage6.cli.globals import DEFAULT_SERVER_SYSTEM_FOLDERS
15
+
16
+
17
+ @click.command()
18
+ @click.option("-n", "--name", default=None, help="Configuration name")
19
+ @click.option("--system", "system_folders", flag_value=True)
20
+ @click.option(
21
+ "--user", "system_folders", flag_value=False, default=DEFAULT_SERVER_SYSTEM_FOLDERS
22
+ )
23
+ @click.option("--context", default=None, help="Kubernetes context to use")
24
+ @click.option("--namespace", default=None, help="Kubernetes namespace to use")
25
+ @click.option(
26
+ "--sandbox", "is_sandbox", flag_value=True, help="Is this a sandbox environment?"
27
+ )
28
+ def cli_algo_store_version(
29
+ name: str, system_folders: bool, context: str, namespace: str, is_sandbox: bool
30
+ ) -> None:
31
+ """
32
+ Print the version of the vantage6 algorithm store.
33
+ """
34
+
35
+ ctx = get_and_select_ctx(
36
+ InstanceType.ALGORITHM_STORE,
37
+ name,
38
+ system_folders,
39
+ context,
40
+ namespace,
41
+ is_sandbox,
42
+ )
43
+ store_config = ctx.config.get("store", {})
44
+
45
+ port = store_config.get("port", Ports.DEV_ALGO_STORE.value)
46
+ api_path = store_config.get("api_path", DEFAULT_API_PATH)
47
+ if not port:
48
+ error("No port found in algorithm store configuration.")
49
+ return
50
+ if not api_path:
51
+ error("No API path found in algorithm store configuration.")
52
+ return
53
+
54
+ response = requests.get(f"{HTTP_LOCALHOST}:{port}{api_path}/version")
55
+ if response.status_code != 200:
56
+ error("Failed to get algorithm store version.")
57
+ return
58
+ algorithm_store_version = response.json().get("version", "")
59
+
60
+ info("")
61
+ info(f"Algorithm store version: {algorithm_store_version}")
62
+ info(f"CLI version: {__version__}")
@@ -3,8 +3,8 @@ import click
3
3
  from vantage6.common import error, info
4
4
  from vantage6.common.globals import InstanceType
5
5
 
6
+ from vantage6.cli.common.attach import attach_logs
6
7
  from vantage6.cli.common.utils import (
7
- attach_logs,
8
8
  find_running_service_names,
9
9
  select_context_and_namespace,
10
10
  select_running_service,
@@ -2,7 +2,7 @@ import click
2
2
 
3
3
  from vantage6.common.globals import InstanceType
4
4
 
5
- from vantage6.cli.common.utils import get_server_configuration_list
5
+ from vantage6.cli.common.list import get_configuration_list
6
6
 
7
7
 
8
8
  @click.command()
@@ -10,4 +10,4 @@ def cli_auth_configuration_list() -> None:
10
10
  """
11
11
  Print the available auth configurations.
12
12
  """
13
- get_server_configuration_list(InstanceType.AUTH)
13
+ get_configuration_list(InstanceType.AUTH)
@@ -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.
@@ -0,0 +1,89 @@
1
+ import click
2
+
3
+ from vantage6.common import info, warning
4
+ from vantage6.common.globals import InstanceType
5
+
6
+ from vantage6.cli.common.decorator import click_insert_context
7
+ from vantage6.cli.common.remove import execute_remove
8
+ from vantage6.cli.context.auth import AuthContext
9
+ from vantage6.cli.globals import InfraComponentName
10
+ from vantage6.cli.utils_kubernetes import get_core_api_with_ssl_handling
11
+
12
+
13
+ @click.command()
14
+ @click_insert_context(
15
+ type_=InstanceType.AUTH, include_name=True, include_system_folders=True
16
+ )
17
+ @click.option("-f", "--force", "force", flag_value=True)
18
+ def cli_auth_remove(
19
+ ctx: AuthContext, name: str, system_folders: bool, force: bool
20
+ ) -> None:
21
+ """
22
+ Function to remove a server.
23
+
24
+ Parameters
25
+ ----------
26
+ ctx : ServerContext
27
+ Server context object
28
+ name : str
29
+ Name of the auth server
30
+ system_folders : bool
31
+ Whether to use system folders or user folders
32
+ force : bool
33
+ Whether to ask for confirmation before removing or not
34
+ """
35
+ auth_remove(ctx, name, system_folders, force)
36
+
37
+
38
+ # this new function is just here so that it can be called from the sandbox remove
39
+ # command
40
+ def auth_remove(ctx: AuthContext, name: str, system_folders: bool, force: bool) -> None:
41
+ # Best-effort cleanup of Keycloak PVCs and their bound PVs after uninstall
42
+ try:
43
+ _cleanup_auth_volumes(ctx)
44
+ except Exception as e:
45
+ # Cleanup is best-effort; do not fail the remove command if cleanup fails
46
+ warning(f"Failed to cleanup auth volumes: {e}")
47
+
48
+ execute_remove(
49
+ ctx, InstanceType.AUTH, InfraComponentName.AUTH, name, system_folders, force
50
+ )
51
+
52
+
53
+ def _cleanup_auth_volumes(ctx: AuthContext) -> None:
54
+ core_api = get_core_api_with_ssl_handling()
55
+
56
+ # Label used by the auth chart to tag its resources
57
+ label_selector = f"app.kubernetes.io/instance={ctx.helm_release_name}"
58
+
59
+ # Collect PVCs across all namespaces that belong to this release
60
+ pvcs = core_api.list_persistent_volume_claim_for_all_namespaces(
61
+ label_selector=label_selector
62
+ ).items
63
+
64
+ # Track PV names bound to these PVCs
65
+ pv_names = {
66
+ pvc.spec.volume_name for pvc in pvcs if pvc.spec and pvc.spec.volume_name
67
+ }
68
+
69
+ # Delete PVCs first (namespaced)
70
+ for pvc in pvcs:
71
+ ns = pvc.metadata.namespace
72
+ name_ = pvc.metadata.name
73
+ try:
74
+ info(f"Deleting persistent volume claim {name_} in namespace {ns}")
75
+ core_api.delete_namespaced_persistent_volume_claim(name=name_, namespace=ns)
76
+ except Exception as e:
77
+ # Ignore failures; continue attempting other deletions
78
+ warning(
79
+ f"Failed to delete persistent volume claim {name_} in namespace {ns}: "
80
+ f"{e}"
81
+ )
82
+
83
+ # Delete PVs that were bound to those PVCs (cluster-scoped)
84
+ for pv_name in pv_names:
85
+ try:
86
+ info(f"Deleting persistent volume: {pv_name}")
87
+ core_api.delete_persistent_volume(name=pv_name)
88
+ except Exception as e:
89
+ warning(f"Failed to delete persistent volume {pv_name}: {e}")