vantage6 5.0.0a35__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 (114) hide show
  1. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/.gitignore +4 -1
  2. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/PKG-INFO +4 -4
  3. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/pyproject.toml +8 -8
  4. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/tests_cli/test_node_cli.py +8 -8
  5. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/tests_cli/test_server_cli.py +3 -3
  6. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/tests_cli/test_wizard.py +11 -11
  7. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/algorithm/generate_algorithm_json.py +9 -10
  8. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/algostore/attach.py +1 -0
  9. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/algostore/files.py +3 -2
  10. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/algostore/list.py +0 -3
  11. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/algostore/new.py +3 -2
  12. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/algostore/start.py +14 -3
  13. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/algostore/stop.py +3 -0
  14. vantage6-5.0.0a37/vantage6/cli/auth/attach.py +60 -0
  15. vantage6-5.0.0a37/vantage6/cli/auth/files.py +16 -0
  16. vantage6-5.0.0a37/vantage6/cli/auth/list.py +13 -0
  17. vantage6-5.0.0a37/vantage6/cli/auth/new.py +81 -0
  18. vantage6-5.0.0a37/vantage6/cli/auth/remove.py +31 -0
  19. vantage6-5.0.0a37/vantage6/cli/auth/start.py +94 -0
  20. vantage6-5.0.0a37/vantage6/cli/auth/stop.py +67 -0
  21. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/cli.py +56 -5
  22. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/common/decorator.py +24 -5
  23. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/common/new.py +27 -7
  24. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/common/start.py +49 -41
  25. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/common/stop.py +23 -5
  26. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/common/utils.py +25 -0
  27. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/config.py +10 -2
  28. vantage6-5.0.0a35/vantage6/cli/configuration_wizard.py → vantage6-5.0.0a37/vantage6/cli/configuration_create.py +28 -15
  29. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/configuration_manager.py +97 -17
  30. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/context/__init__.py +10 -5
  31. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/context/algorithm_store.py +11 -5
  32. vantage6-5.0.0a37/vantage6/cli/context/auth.py +125 -0
  33. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/context/base_server.py +0 -4
  34. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/context/node.py +25 -8
  35. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/context/server.py +18 -6
  36. vantage6-5.0.0a37/vantage6/cli/dev/clean.py +28 -0
  37. vantage6-5.0.0a37/vantage6/cli/dev/common.py +34 -0
  38. vantage6-5.0.0a37/vantage6/cli/dev/rebuild.py +39 -0
  39. vantage6-5.0.0a37/vantage6/cli/dev/start.py +36 -0
  40. vantage6-5.0.0a37/vantage6/cli/dev/stop.py +23 -0
  41. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/globals.py +5 -1
  42. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/node/common/__init__.py +26 -10
  43. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/node/list.py +5 -4
  44. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/node/new.py +13 -6
  45. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/node/set_api_key.py +1 -1
  46. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/node/start.py +19 -4
  47. vantage6-5.0.0a37/vantage6/cli/node/stop.py +217 -0
  48. vantage6-5.0.0a37/vantage6/cli/node/task_cleanup/__init__.py +153 -0
  49. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/node/version.py +5 -4
  50. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/prometheus/monitoring_manager.py +5 -3
  51. vantage6-5.0.0a37/vantage6/cli/sandbox/config/base.py +101 -0
  52. vantage6-5.0.0a37/vantage6/cli/sandbox/config/core.py +300 -0
  53. vantage6-5.0.0a37/vantage6/cli/sandbox/config/node.py +314 -0
  54. vantage6-5.0.0a37/vantage6/cli/sandbox/data/olympic_athletes_2016.csv +2425 -0
  55. vantage6-5.0.0a37/vantage6/cli/sandbox/new.py +207 -0
  56. vantage6-5.0.0a37/vantage6/cli/sandbox/populate/__init__.py +173 -0
  57. vantage6-5.0.0a37/vantage6/cli/sandbox/populate/helpers/connect_store.py +203 -0
  58. vantage6-5.0.0a37/vantage6/cli/sandbox/populate/helpers/delete_fixtures.py +67 -0
  59. vantage6-5.0.0a37/vantage6/cli/sandbox/populate/helpers/load_fixtures.py +476 -0
  60. vantage6-5.0.0a37/vantage6/cli/sandbox/populate/helpers/utils.py +35 -0
  61. vantage6-5.0.0a37/vantage6/cli/sandbox/remove.py +173 -0
  62. vantage6-5.0.0a37/vantage6/cli/sandbox/start.py +341 -0
  63. vantage6-5.0.0a37/vantage6/cli/sandbox/stop.py +106 -0
  64. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/server/attach.py +1 -0
  65. vantage6-5.0.0a37/vantage6/cli/server/common/__init__.py +41 -0
  66. vantage6-5.0.0a37/vantage6/cli/server/import_.py +167 -0
  67. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/server/new.py +22 -7
  68. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/server/start.py +10 -1
  69. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/server/stop.py +2 -0
  70. vantage6-5.0.0a37/vantage6/cli/template/auth_config.j2 +253 -0
  71. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/template/node_config.j2 +8 -8
  72. vantage6-5.0.0a37/vantage6/cli/template/node_config_nonk8s.j2 +33 -0
  73. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/template/server_config.j2 +10 -7
  74. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/test/common/diagnostic_runner.py +5 -3
  75. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/use/namespace.py +2 -1
  76. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/utils.py +33 -1
  77. vantage6-5.0.0a35/vantage6/cli/dev/create.py +0 -693
  78. vantage6-5.0.0a35/vantage6/cli/dev/remove.py +0 -112
  79. vantage6-5.0.0a35/vantage6/cli/node/stop.py +0 -71
  80. vantage6-5.0.0a35/vantage6/cli/rabbitmq/__init__.py +0 -0
  81. vantage6-5.0.0a35/vantage6/cli/rabbitmq/definitions.py +0 -26
  82. vantage6-5.0.0a35/vantage6/cli/rabbitmq/queue_manager.py +0 -218
  83. vantage6-5.0.0a35/vantage6/cli/rabbitmq/rabbitmq.config +0 -8
  84. vantage6-5.0.0a35/vantage6/cli/server/common/__init__.py +0 -68
  85. vantage6-5.0.0a35/vantage6/cli/server/import_.py +0 -149
  86. vantage6-5.0.0a35/vantage6/cli/server/shell.py +0 -54
  87. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/Makefile +0 -0
  88. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/README.md +0 -0
  89. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/tests_cli/__init__.py +0 -0
  90. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/tests_cli/test_client_script.py +0 -0
  91. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/tests_cli/test_example.py +0 -0
  92. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/__init__.py +0 -0
  93. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/algorithm/create.py +0 -0
  94. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/algorithm/update.py +1 -1
  95. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/algostore/remove.py +0 -0
  96. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/common/remove.py +0 -0
  97. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/node/attach.py +0 -0
  98. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/node/create_private_key.py +0 -0
  99. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/node/files.py +0 -0
  100. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/node/remove.py +0 -0
  101. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/node/restart.py +0 -0
  102. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/prometheus/prometheus.yml +0 -0
  103. {vantage6-5.0.0a35/vantage6/cli/dev → vantage6-5.0.0a37/vantage6/cli/sandbox}/data/km_dataset.csv +0 -0
  104. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/server/files.py +0 -0
  105. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/server/list.py +0 -0
  106. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/server/remove.py +0 -0
  107. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/server/version.py +0 -0
  108. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/template/algo_store_config.j2 +0 -0
  109. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/test/algo_test_scripts/algo_test_arguments.py +0 -0
  110. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/test/algo_test_scripts/algo_test_script.py +0 -0
  111. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/test/client_script.py +0 -0
  112. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/test/feature_tester.py +0 -0
  113. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/test/integration_test.py +0 -0
  114. {vantage6-5.0.0a35 → vantage6-5.0.0a37}/vantage6/cli/use/context.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.0a35
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.0a35
22
- Requires-Dist: vantage6-common==5.0.0a35
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.0a35"
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.0a35",
33
- "vantage6-client==5.0.0a35",
32
+ "vantage6-common==5.0.0a37",
33
+ "vantage6-client==5.0.0a37",
34
34
  ]
35
35
 
36
36
  [project.optional-dependencies]
@@ -54,12 +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",
58
+ "template/node_config_nonk8s.j2",
59
59
  "template/server_config.j2",
60
- "template/server_import_config.j2",
61
60
  "template/algo_store_config.j2",
62
- "dev/data/olympic_athletes_2016.csv",
63
- "dev/data/km_dataset.csv",
61
+ "template/auth_config.j2",
62
+ "sandbox/data/olympic_athletes_2016.csv",
63
+ "sandbox/data/km_dataset.csv",
64
64
  "prometheus/prometheus.yml",
65
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
  }
@@ -276,23 +275,23 @@ class Function:
276
275
  else:
277
276
  type_ = param.annotation
278
277
 
279
- if type_ == str:
278
+ if type_ is str:
280
279
  return AlgorithmArgumentType.STRING
281
- elif type_ == dict:
280
+ elif type_ is dict:
282
281
  return AlgorithmArgumentType.JSON
283
- elif type_ == int:
282
+ elif type_ is int:
284
283
  return AlgorithmArgumentType.INTEGER
285
- elif type_ == float:
284
+ elif type_ is float:
286
285
  return AlgorithmArgumentType.FLOAT
287
- elif type_ == bool:
286
+ elif type_ is bool:
288
287
  return AlgorithmArgumentType.BOOLEAN
289
- elif type_ == list:
288
+ elif type_ is list:
290
289
  return AlgorithmArgumentType.STRINGS
291
- elif type_ == list[str]:
290
+ elif type_ is list[str]:
292
291
  return AlgorithmArgumentType.STRINGS
293
- elif type_ == list[int]:
292
+ elif type_ is list[int]:
294
293
  return AlgorithmArgumentType.INTEGERS
295
- elif type_ == list[float]:
294
+ elif type_ is list[float]:
296
295
  return AlgorithmArgumentType.FLOATS
297
296
  else:
298
297
  warning(
@@ -1,6 +1,7 @@
1
1
  import click
2
2
 
3
3
  from vantage6.common import info
4
+
4
5
  from vantage6.cli.common.utils import attach_logs
5
6
 
6
7
 
@@ -1,10 +1,11 @@
1
1
  import click
2
2
 
3
3
  from vantage6.common import info
4
- from vantage6.cli.context.server import ServerContext
5
- from vantage6.cli.common.decorator import click_insert_context
6
4
  from vantage6.common.globals import InstanceType
7
5
 
6
+ from vantage6.cli.common.decorator import click_insert_context
7
+ from vantage6.cli.context.server import ServerContext
8
+
8
9
 
9
10
  @click.command()
10
11
  @click_insert_context(type_=InstanceType.ALGORITHM_STORE)
@@ -1,6 +1,5 @@
1
1
  import click
2
2
 
3
- from vantage6.common.docker.addons import check_docker_running
4
3
  from vantage6.common.globals import InstanceType
5
4
 
6
5
  from vantage6.cli.common.utils import get_server_configuration_list
@@ -11,6 +10,4 @@ def cli_algo_store_configuration_list() -> None:
11
10
  """
12
11
  Print the available server configurations.
13
12
  """
14
- check_docker_running()
15
-
16
13
  get_server_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,
@@ -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
 
@@ -0,0 +1,60 @@
1
+ import click
2
+
3
+ from vantage6.common import error, info
4
+ from vantage6.common.globals import InstanceType
5
+
6
+ from vantage6.cli.common.utils import (
7
+ attach_logs,
8
+ find_running_service_names,
9
+ select_context_and_namespace,
10
+ select_running_service,
11
+ )
12
+
13
+
14
+ @click.command()
15
+ @click.option("--context", default=None, help="Kubernetes context to use")
16
+ @click.option("--namespace", default=None, help="Kubernetes namespace to use")
17
+ @click.option(
18
+ "-n", "--name", default=None, help="Name of the auth service to attach to"
19
+ )
20
+ def cli_auth_attach(context: str, namespace: str, name: str) -> None:
21
+ """
22
+ Show the server logs in the current console.
23
+ """
24
+ info("Attaching to auth logs...")
25
+
26
+ context, namespace = select_context_and_namespace(
27
+ context=context,
28
+ namespace=namespace,
29
+ )
30
+
31
+ running_services = find_running_service_names(
32
+ instance_type=InstanceType.AUTH,
33
+ only_system_folders=False,
34
+ only_user_folders=False,
35
+ context=context,
36
+ namespace=namespace,
37
+ )
38
+
39
+ if not running_services:
40
+ error("No running auth services found.")
41
+ return
42
+
43
+ if name:
44
+ # search for a running auth service started up either in user or system folders
45
+ svc_name_options = [
46
+ f"vantage6-{name}-user-auth",
47
+ f"vantage6-{name}-system-auth",
48
+ ]
49
+ helm_name = next(
50
+ (svc for svc in svc_name_options if svc in running_services), None
51
+ )
52
+ if not helm_name:
53
+ error(f"No running auth service found for {name}.")
54
+ return
55
+ else:
56
+ helm_name = select_running_service(running_services, InstanceType.AUTH)
57
+
58
+ attach_logs(
59
+ f"app.kubernetes.io/instance={helm_name}",
60
+ )
@@ -0,0 +1,16 @@
1
+ import click
2
+
3
+ from vantage6.common import info
4
+ from vantage6.common.globals import InstanceType
5
+
6
+ from vantage6.cli.common.decorator import click_insert_context
7
+ from vantage6.cli.context.auth import AuthContext
8
+
9
+
10
+ @click.command()
11
+ @click_insert_context(type_=InstanceType.AUTH)
12
+ def cli_auth_files(ctx: AuthContext) -> None:
13
+ """
14
+ List files that belong to a particular auth instance.
15
+ """
16
+ info(f"Configuration file = {ctx.config_file}")
@@ -0,0 +1,13 @@
1
+ import click
2
+
3
+ from vantage6.common.globals import InstanceType
4
+
5
+ from vantage6.cli.common.utils import get_server_configuration_list
6
+
7
+
8
+ @click.command()
9
+ def cli_auth_configuration_list() -> None:
10
+ """
11
+ Print the available auth configurations.
12
+ """
13
+ get_server_configuration_list(InstanceType.AUTH)
@@ -0,0 +1,81 @@
1
+ from typing import Any
2
+
3
+ import click
4
+ import questionary as q
5
+
6
+ from vantage6.common.globals import (
7
+ InstanceType,
8
+ )
9
+
10
+ from vantage6.cli.common.new import new
11
+ from vantage6.cli.globals import DEFAULT_SERVER_SYSTEM_FOLDERS
12
+
13
+
14
+ @click.command()
15
+ @click.option(
16
+ "-n", "--name", default=None, help="name of the configuration you want to use."
17
+ )
18
+ @click.option(
19
+ "--system",
20
+ "system_folders",
21
+ flag_value=True,
22
+ help="Use system folders instead of user folders. This is the default",
23
+ )
24
+ @click.option(
25
+ "--user",
26
+ "system_folders",
27
+ flag_value=False,
28
+ default=DEFAULT_SERVER_SYSTEM_FOLDERS,
29
+ help="Use user folders instead of system folders",
30
+ )
31
+ @click.option("--context", default=None, help="Kubernetes context to use")
32
+ @click.option(
33
+ "--namespace",
34
+ default=None,
35
+ help="Kubernetes namespace to use",
36
+ )
37
+ def cli_auth_new(
38
+ name: str,
39
+ system_folders: bool,
40
+ namespace: str,
41
+ context: str,
42
+ ) -> None:
43
+ """
44
+ Create a new server configuration.
45
+ """
46
+ new(
47
+ config_producing_func=auth_configuration_questionaire,
48
+ config_producing_func_args=tuple(),
49
+ name=name,
50
+ system_folders=system_folders,
51
+ namespace=namespace,
52
+ context=context,
53
+ type_=InstanceType.AUTH,
54
+ )
55
+
56
+
57
+ def auth_configuration_questionaire() -> dict[str, Any]:
58
+ """
59
+ Kubernetes-specific questionnaire to generate Helm values for the Keycloak helm
60
+ chart.
61
+ """
62
+ config = {"keycloak": {}}
63
+
64
+ is_production = q.confirm(
65
+ "Do you want to use production settings? If not, the service will be configured"
66
+ " to be more suitable for development or testing purposes.",
67
+ default=True,
68
+ ).unsafe_ask()
69
+
70
+ config["keycloak"]["production"] = is_production
71
+
72
+ if is_production:
73
+ ui_url = q.text(
74
+ "Please provide the URL of the UI. This is the URL that users will use to "
75
+ "log in to the service.",
76
+ default="https://ui.vantage6.ai",
77
+ ).unsafe_ask()
78
+ # add http://localhost:7681 as that is used by the Python client
79
+ config["keycloak"]["redirectUris"] = [ui_url, "http://localhost:7681"]
80
+
81
+ return config
@@ -0,0 +1,31 @@
1
+ import click
2
+
3
+ from vantage6.common.globals import InstanceType
4
+
5
+ from vantage6.cli.common.decorator import click_insert_context
6
+ from vantage6.cli.common.remove import execute_remove
7
+ from vantage6.cli.context.auth import AuthContext
8
+ from vantage6.cli.globals import InfraComponentName
9
+
10
+
11
+ @click.command()
12
+ @click_insert_context(
13
+ type_=InstanceType.AUTH, include_name=True, include_system_folders=True
14
+ )
15
+ @click.option("-f", "--force", "force", flag_value=True)
16
+ def cli_auth_remove(
17
+ ctx: AuthContext, name: str, system_folders: bool, force: bool
18
+ ) -> None:
19
+ """
20
+ Function to remove a server.
21
+
22
+ Parameters
23
+ ----------
24
+ ctx : ServerContext
25
+ Server context object
26
+ force : bool
27
+ Whether to ask for confirmation before removing or not
28
+ """
29
+ execute_remove(
30
+ ctx, InstanceType.AUTH, InfraComponentName.AUTH, name, system_folders, force
31
+ )