vantage6 5.0.0a26__py3-none-any.whl → 5.0.0a33__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of vantage6 might be problematic. Click here for more details.

Files changed (44) hide show
  1. vantage6/cli/__init__.py +5 -1
  2. vantage6/cli/algorithm/generate_algorithm_json.py +28 -34
  3. vantage6/cli/algostore/list.py +2 -1
  4. vantage6/cli/algostore/start.py +6 -6
  5. vantage6/cli/algostore/stop.py +3 -2
  6. vantage6/cli/common/decorator.py +3 -1
  7. vantage6/cli/common/start.py +2 -4
  8. vantage6/cli/common/utils.py +7 -13
  9. vantage6/cli/configuration_manager.py +5 -3
  10. vantage6/cli/configuration_wizard.py +6 -10
  11. vantage6/cli/context/__init__.py +2 -1
  12. vantage6/cli/context/algorithm_store.py +10 -7
  13. vantage6/cli/context/node.py +7 -7
  14. vantage6/cli/context/server.py +10 -5
  15. vantage6/cli/dev/create.py +11 -13
  16. vantage6/cli/dev/remove.py +2 -2
  17. vantage6/cli/globals.py +5 -5
  18. vantage6/cli/node/common/__init__.py +6 -5
  19. vantage6/cli/node/start.py +18 -24
  20. vantage6/cli/server/files.py +4 -2
  21. vantage6/cli/server/import_.py +7 -7
  22. vantage6/cli/server/list.py +2 -1
  23. vantage6/cli/server/shell.py +5 -4
  24. vantage6/cli/server/start.py +2 -1
  25. vantage6/cli/server/stop.py +3 -2
  26. vantage6/cli/server/version.py +5 -4
  27. vantage6/cli/template/node_config.j2 +2 -0
  28. vantage6/cli/test/algo_test_scripts/algo_test_script.py +6 -5
  29. vantage6/cli/test/feature_tester.py +5 -2
  30. vantage6-5.0.0a33.dist-info/METADATA +54 -0
  31. {vantage6-5.0.0a26.dist-info → vantage6-5.0.0a33.dist-info}/RECORD +33 -42
  32. {vantage6-5.0.0a26.dist-info → vantage6-5.0.0a33.dist-info}/WHEEL +1 -2
  33. vantage6-5.0.0a33.dist-info/entry_points.txt +2 -0
  34. tests_cli/__init__.py +0 -0
  35. tests_cli/test_client_script.py +0 -23
  36. tests_cli/test_example.py +0 -7
  37. tests_cli/test_node_cli.py +0 -452
  38. tests_cli/test_server_cli.py +0 -179
  39. tests_cli/test_wizard.py +0 -141
  40. vantage6/cli/__build__ +0 -1
  41. vantage6/cli/_version.py +0 -23
  42. vantage6-5.0.0a26.dist-info/METADATA +0 -231
  43. vantage6-5.0.0a26.dist-info/entry_points.txt +0 -5
  44. vantage6-5.0.0a26.dist-info/top_level.txt +0 -2
tests_cli/test_wizard.py DELETED
@@ -1,141 +0,0 @@
1
- import unittest
2
-
3
- from pathlib import Path
4
- from unittest.mock import patch, MagicMock
5
-
6
- from vantage6.cli.configuration_wizard import (
7
- node_configuration_questionaire,
8
- server_configuration_questionaire,
9
- configuration_wizard,
10
- select_configuration_questionaire,
11
- )
12
- from vantage6.common.globals import InstanceType, NodePolicy
13
-
14
- module_path = "vantage6.cli.configuration_wizard"
15
-
16
-
17
- class WizardTest(unittest.TestCase):
18
- @staticmethod
19
- def prompts(*args, **kwargs):
20
- result = {}
21
- for arg in args[0]:
22
- name = arg["name"]
23
- if name == "default": # default db path
24
- result[name] = "/some/path/db.sqlite"
25
- else:
26
- if "default" in arg:
27
- result[name] = arg["default"]
28
- else:
29
- result[name] = None
30
- return result
31
-
32
- @patch("vantage6.cli.configuration_wizard.NodeClient.authenticate")
33
- def test_node_wizard(self, authenticate):
34
- """An error is printed when docker is not running"""
35
- authenticate.return_value = None
36
-
37
- with patch(f"{module_path}.q") as q:
38
- q.unsafe_prompt.side_effect = self.prompts
39
- q.confirm.return_value.unsafe_ask.side_effect = [
40
- True, # add a database
41
- False, # don't enable two-factor authentication
42
- True, # add VPN server
43
- True, # add algorithm policies
44
- True, # add single algorithms to allowed_algorithms
45
- "some-image", # algorithm image to whitelist
46
- False, # don't add another algorithm image
47
- True, # add algorithm stores to allowed_algorithm_stores
48
- "some-store", # algorithm store to whitelist
49
- False, # don't add another algorithm store
50
- False, # answer question on combining policies on store level and
51
- # single algorithm level
52
- False, # don't abort if no server connection is made to pull
53
- # collaboration settings
54
- True, # Enable encryption
55
- ]
56
- dirs = MagicMock(data="/")
57
- config = node_configuration_questionaire(dirs, "iknl")
58
-
59
- keys = [
60
- "api_key",
61
- "server_url",
62
- "port",
63
- "api_path",
64
- "task_dir",
65
- "databases",
66
- "logging",
67
- "encryption",
68
- "vpn_subnet",
69
- ]
70
- for key in keys:
71
- self.assertIn(key, config)
72
- nested_keys = [
73
- ["policies", NodePolicy.ALLOWED_ALGORITHMS],
74
- ["policies", NodePolicy.ALLOWED_ALGORITHM_STORES],
75
- ]
76
- for nesting in nested_keys:
77
- current_config = config
78
- for key in nesting:
79
- self.assertIn(key, current_config)
80
- current_config = current_config[key]
81
-
82
- def test_server_wizard(self):
83
- with patch(f"{module_path}.q") as q:
84
- q.unsafe_prompt.side_effect = self.prompts
85
- q.confirm.return_value.unsafe_ask.side_effect = [
86
- True,
87
- True,
88
- True,
89
- True,
90
- True,
91
- True,
92
- False,
93
- ]
94
-
95
- config = server_configuration_questionaire("vantage6")
96
-
97
- keys = [
98
- "description",
99
- "ip",
100
- "port",
101
- "api_path",
102
- "uri",
103
- "allow_drop_all",
104
- "logging",
105
- "vpn_server",
106
- "rabbitmq",
107
- "two_factor_auth",
108
- "algorithm_stores",
109
- ]
110
-
111
- for key in keys:
112
- self.assertIn(key, config)
113
-
114
- @patch(f"{module_path}.node_configuration_questionaire")
115
- @patch(f"{module_path}.server_configuration_questionaire")
116
- @patch(f"{module_path}.ServerConfigurationManager")
117
- @patch(f"{module_path}.NodeConfigurationManager")
118
- @patch("vantage6.cli.configuration_wizard.AppContext")
119
- def test_configuration_wizard_interface(
120
- self, context, node_m, server_m, server_q, node_q
121
- ):
122
- context.instance_folders.return_value = {"config": "/some/path/"}
123
-
124
- file_ = configuration_wizard(InstanceType.NODE, "vtg6", False)
125
- self.assertEqual(Path("/some/path/vtg6.yaml"), file_)
126
-
127
- file_ = configuration_wizard(InstanceType.SERVER, "vtg6", True)
128
- self.assertEqual(Path("/some/path/vtg6.yaml"), file_)
129
-
130
- @patch("vantage6.cli.configuration_wizard.AppContext.available_configurations")
131
- def test_select_configuration(self, available_configurations):
132
- config = MagicMock()
133
- config.name = "vtg6"
134
-
135
- available_configurations.return_value = [[config], []]
136
-
137
- with patch(f"{module_path}.q") as q:
138
- q.select.return_value.unsafe_ask.return_value = "vtg6"
139
- name = select_configuration_questionaire(InstanceType.NODE, True)
140
-
141
- self.assertEqual(name, "vtg6")
vantage6/cli/__build__ DELETED
@@ -1 +0,0 @@
1
- 26
vantage6/cli/_version.py DELETED
@@ -1,23 +0,0 @@
1
- import os
2
- import json
3
-
4
- here = os.path.abspath(os.path.dirname(__file__))
5
-
6
- with open(os.path.join(here, "__build__")) as fp:
7
- __build__ = json.load(fp)
8
-
9
- # Module version
10
- version_info = (5, 0, 0, "alpha", __build__, 0)
11
-
12
- # Module version stage suffix map
13
- _specifier_ = {"alpha": "a", "beta": "b", "candidate": "rc", "final": ""}
14
- version = f"{version_info[0]}.{version_info[1]}.{version_info[2]}"
15
- pre_release = (
16
- ""
17
- if version_info[3] == "final"
18
- else _specifier_[version_info[3]] + str(version_info[4])
19
- )
20
- post_release = "" if not version_info[5] else f".post{version_info[5]}"
21
-
22
- # Module version accessible using thomas.__version__
23
- __version__ = f"{version}{pre_release}{post_release}"
@@ -1,231 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: vantage6
3
- Version: 5.0.0a26
4
- Summary: vantage6 command line interface
5
- Home-page: https://github.com/vantage6/vantage6
6
- Requires-Python: >=3.10
7
- Description-Content-Type: text/markdown
8
- Requires-Dist: click==8.1.3
9
- Requires-Dist: colorama==0.4.6
10
- Requires-Dist: copier==9.2.0
11
- Requires-Dist: docker==7.1.0
12
- Requires-Dist: ipython==8.10.0
13
- Requires-Dist: jinja2==3.1.6
14
- Requires-Dist: kubernetes==28.1.0
15
- Requires-Dist: pandas>=1.5.3
16
- Requires-Dist: questionary==1.10.0
17
- Requires-Dist: rich==13.5.2
18
- Requires-Dist: schema==0.7.5
19
- Requires-Dist: sqlalchemy==2.0.37
20
- Requires-Dist: vantage6-common==5.0.0a26
21
- Requires-Dist: vantage6-client==5.0.0a26
22
- Provides-Extra: dev
23
- Requires-Dist: coverage==6.4.4; extra == "dev"
24
- Requires-Dist: black; extra == "dev"
25
- Requires-Dist: pre-commit; extra == "dev"
26
-
27
- <h1 align="center">
28
- <br>
29
- <a href="https://vantage6.ai"><img src="https://github.com/IKNL/guidelines/blob/master/resources/logos/vantage6.png?raw=true" alt="vantage6" width="350"></a>
30
- </h1>
31
-
32
- <h3 align=center> A Privacy Enhancing Technology (PET) Operations platform</h3>
33
- <h3 align="center">
34
-
35
- <!-- Badges go here-->
36
-
37
- [![Release](https://github.com/vantage6/vantage6/actions/workflows/release.yml/badge.svg)](https://github.com/vantage6/vantage6/actions/workflows/release.yml)
38
- [![PyPI vantage6](https://badge.fury.io/py/vantage6.svg)](https://badge.fury.io/py/vantage6)
39
- [![Unittests](https://github.com/vantage6/vantage6/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/vantage6/vantage6/actions/workflows/unit_tests.yml)
40
- [![Coverage Status](https://coveralls.io/repos/github/vantage6/vantage6/badge.svg?branch=main)](https://coveralls.io/github/vantage6/vantage6?branch=main)
41
- [![Codacy Badge](https://app.codacy.com/project/badge/Grade/2e60ac3b3f284620805f7399cba317be)](https://app.codacy.com/gh/vantage6/vantage6/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
42
- [![DOI](https://zenodo.org/badge/492818831.svg)](https://zenodo.org/badge/latestdoi/492818831)
43
- [![Discord](https://img.shields.io/discord/643526403207331841)](https://discord.gg/yAyFf6Y)
44
- [![Research software directory](https://img.shields.io/badge/rsd-vantage6-deepskyblue)](https://research-software-directory.org/software/vantage6)
45
-
46
- </h3>
47
-
48
- <p align="center">
49
- <a href="#books-quickstart">Quickstart</a> •
50
- <a href="#project-structure">Project structure</a> •
51
- <a href="#gift_heart-join-the-community">Join the community</a> •
52
- <a href="#scroll-license">License</a> •
53
- <a href="#black_nib-code-of-conduct">Code of conduct</a> •
54
- <a href="#black_nib-references">References</a>
55
- </p>
56
-
57
- ---
58
-
59
- This repository is contains all the **vantage6** infrastructure source code. The **vantage6** technology enables to manage and deploy privacy enhancing technologies like Federated Learning (FL) and Multi-Party Computation (MPC). Please visit our [website](https://vantage6.ai) to learn more!
60
-
61
- You can find more (user) documentation at [readthedocs](https://docs.vantage6.ai). If you have any questions, suggestions or just want to chat about federated learning: join our [Discord)](https://discord.gg/yAyFf6Y) channel.
62
-
63
- ## Infrastructure overview
64
-
65
- ![Vantage6 architecture overview](docs/images/overview-infrastructure.png)
66
-
67
- _A High level overview of the vantage6 infrastructure. Vantage6 has both a
68
- client-server and peer-to-peer architecture. The client is used by the researcher to
69
- create (PET) computation requests. It is also used to manage users, organizations and
70
- collaborations. The server contains users, organizations, collaborations, tasks and
71
- their results. It provides a central access point for both the clients and nodes. The
72
- nodes have access to privacy sensitive data and handle computation requests retrieved
73
- from the server. Computation request are executed as separate containers on the node.
74
- These containers are connected to containers at other nodes by a internal network._
75
-
76
- ## :books: Quickstart
77
-
78
- ### Requirements
79
-
80
- The **vantage6** infrastructure is delivered in Docker images. To run these images, you
81
- need to have [Docker](https://docs.docker.com/get-docker/) installed. To install the
82
- latest version of the vantage6 CLI, you need to have
83
- [Python](https://www.python.org/downloads/), we recommend using an environment manager
84
- like [mini-conda](https://docs.conda.io/en/latest/miniconda.html).
85
-
86
- Install the latest version of the vantage6 CLI by using:
87
-
88
- ```bash
89
- pip install vantage6
90
- ```
91
-
92
- This install the `v6` commands, which allows you to manage your nodes and servers. To view all available options, run:
93
-
94
- ```bash
95
- v6 --help
96
- ```
97
-
98
- For example you can create a local test setup by using:
99
-
100
- ```bash
101
- v6 dev create-demo-network
102
- ```
103
-
104
- This creates a local network with a server and two nodes. You can start the network by running:
105
-
106
- ```bash
107
- v6 dev start-demo-network
108
- ```
109
-
110
- This will start the server and nodes in the background. You can view the logs by running:
111
-
112
- ```bash
113
- # View node logs
114
- v6 node attach
115
-
116
- # View server logs
117
- v6 server attach
118
- ```
119
-
120
- From here you can use the [vantage6-client](https://pypi.org/project/vantage6-client)
121
- to interact with the server. The demo network has a pre-configured organization with
122
- the following credentials:
123
-
124
- - Username: `dev_admin`
125
- - Password: `password`
126
-
127
- For example, you can create a new organization by running:
128
-
129
- ```python
130
- from vantage6.client import Client
131
-
132
- client = Client(
133
- server_url='http://127.0.0.1:7601/api',
134
- auth_url='http://127.0.0.1:8080',
135
- log_level='debug'
136
- )
137
- client.authenticate()
138
- client.setup_encryption(None)
139
-
140
- client.organization.create(
141
- name='My organization',
142
- address1='My address',
143
- address2='My address',
144
- zipcode='1234AB',
145
- country='The Netherlands',
146
- domain='my-organization.com'
147
- )
148
- ```
149
-
150
- You can find more (user) documentation at [readthedocs](https://docs.vantage6.ai)
151
-
152
- ## Project structure
153
-
154
- ### PYPI packages
155
-
156
- This repository is home to 6 PyPi packages:
157
-
158
- - [vantage6](https://pypi.org/project/vantage6) -> _CLI for managing node and server instances_
159
- - [vantage6-client](https://pypi.org/project/vantage6-client) -> _Python client for interacting with the vantage6-server_
160
- - [vantage6-algorithm-tools](https://pypi.org/project/vantage6-algorithm-tools) -> _Python tools to facilitate algorithm development_
161
- - [vantage6-node](https://pypi.org/project/vantage6-node) -> _Node application package_
162
- - [vantage6-server](https://pypi.org/project/vantage6-server) -> _Server application package_
163
- - [vantage6-algorithm-store](https://pypi.org/project/vantage6-algorithm-store) -> _Algorithm store application package_
164
- - [vantage6-common](https://pypi.org/project/vantage6-common) -> _Package with common vantage6 functions_
165
- - [vantage6-backend-common](https://pypi.org/project/vantage6-backend-common) -> _Package with functions common to central server and algorithm store_
166
-
167
- **Note that when using vantage6 you do not install the _server_ and _node_ packages. These are delivered to you in Docker images.**
168
-
169
- This repository also hosts the code for the vantage6 user interface (UI). The UI
170
- is an Angular web application that can be used to interact with the vantage6 server
171
- easily.
172
-
173
- ### Docker images
174
-
175
- The vantage6 infrastructure is delivered in Docker images. All Docker images are stored
176
- in our private [Harbor](https://goharbor.io/) registry. The most important images are:
177
-
178
- - `harbor2.vantage6.ai/infrastructure/node:VERSION` -> _Node application Docker image_
179
- - `harbor2.vantage6.ai/infrastructure/server:VERSION` -> _Server application Docker image_
180
- - `harbor2.vantage6.ai/infrastructure/ui:VERSION` -> _User interface Docker image_
181
- - `harbor2.vantage6.ai/infrastructure/algorithm-store:VERSION` -> _Algorithm store Docker image_
182
-
183
- with `VERSION` being the full semantic version of the vantage6 infrastructure, e.g.
184
- `4.0.0` or `4.1.0rc0`.
185
-
186
- Several other images are used to support the infrastructure:
187
-
188
- - `harbor2.vantage6.ai/infrastructure/infrastructure-base:VERSION` -> _Base image for the infrastructure_
189
- - `harbor2.vantage6.ai/infrastructure/alpine` -> _Alpine image used for vpn traffic forwarding_
190
-
191
- And finally there are some images released for algorithm development:
192
-
193
- - `harbor2.vantage6.ai/infrastructure/algorithm-base:MAJOR.MINOR` -> _Base image for algorithm development_
194
- - `harbor2.vantage6.ai/infrastructure/algorithm-ohdsi-base:MAJOR.MINOR` -> _Extended algorithm base image for OHDSI algorithm development_
195
-
196
- ## :gift_heart: Join the community!
197
-
198
- We hope to continue developing, improving, and supporting **vantage6** with the help of
199
- the federated learning community. If you are interested in contributing, first of all,
200
- thank you! Second, please take a look at our
201
- [contributing guidelines](https://docs.vantage6.ai/en/main/devops/contribute.html)
202
- and our [code of conduct](CODE_OF_CONDUCT.md).
203
-
204
- <a href="https://github.com/vantage6/vantage6/graphs/contributors">
205
- <img src="https://contrib.rocks/image?repo=vantage6/vantage6" />
206
- </a>
207
-
208
- ## :scroll: License
209
-
210
- This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
211
-
212
- ## :black_nib: Code of Conduct
213
-
214
- Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). **By participating in any way in this project you agree to abide by its terms.**
215
-
216
- ## :black_nib: References
217
-
218
- If you are using **vantage6**, please cite this repository as well as the accompanying papers as follows:
219
-
220
- > - F. Martin, M. Sieswerda, H. Alradhi, et al. vantage6. Available at https://doi.org/10.5281/zenodo.7221216. Accessed on MONTH, 20XX.
221
- > - A. Moncada-Torres, F. Martin, M. Sieswerda, J. van Soest, G. Gelijnse. VANTAGE6: an open source priVAcy preserviNg federaTed leArninG infrastructurE for Secure Insight eXchange. AMIA Annual Symposium Proceedings, 2020, p. 870-877. [[BibTeX](https://arturomoncadatorres.com/bibtex/moncada-torres2020vantage6.txt), [PDF](https://vantage6.ai/vantage6/)]
222
- > - D. Smits\*, B. van Beusekom\*, F. Martin, L. Veen, G. Geleijnse, A. Moncada-Torres, An Improved Infrastructure for Privacy-Preserving Analysis of Patient Data, Proceedings of the International Conference of Informatics, Management, and Technology in Healthcare (ICIMTH), vol. 25, 2022, p. 144-147. [[BibTeX](https://arturomoncadatorres.com/bibtex/smits2022improved.txt), [PDF](https://ebooks.iospress.nl/volumearticle/60190)]
223
-
224
- ---
225
-
226
- <p align="center">
227
- <a href="https://vantage6.ai">vantage6.ai</a> •
228
- <a href="https://discord.gg/yAyFf6Y">Discord</a> •
229
- <a href="https://vantage6.discourse.group/">Discourse</a> •
230
- <a href="https://docs.vantage6.ai">User documentation</a>
231
- </p>
@@ -1,5 +0,0 @@
1
- [console_scripts]
2
- v6 = vantage6.cli.cli:cli_complete
3
- vdev = vantage6.cli.cli:cli_dev
4
- vnode = vantage6.cli.cli:cli_node
5
- vserver = vantage6.cli.cli:cli_server
@@ -1,2 +0,0 @@
1
- tests_cli
2
- vantage6