vantage6 5.0.0a34__py3-none-any.whl → 5.0.0a36__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 (69) hide show
  1. vantage6/cli/algorithm/generate_algorithm_json.py +9 -9
  2. vantage6/cli/algorithm/update.py +1 -1
  3. vantage6/cli/algostore/attach.py +1 -0
  4. vantage6/cli/algostore/files.py +3 -2
  5. vantage6/cli/algostore/list.py +0 -3
  6. vantage6/cli/algostore/new.py +83 -2
  7. vantage6/cli/algostore/remove.py +18 -34
  8. vantage6/cli/algostore/start.py +10 -7
  9. vantage6/cli/algostore/stop.py +12 -50
  10. vantage6/cli/auth/attach.py +60 -0
  11. vantage6/cli/auth/files.py +16 -0
  12. vantage6/cli/auth/list.py +13 -0
  13. vantage6/cli/auth/new.py +80 -0
  14. vantage6/cli/auth/remove.py +31 -0
  15. vantage6/cli/auth/start.py +80 -0
  16. vantage6/cli/auth/stop.py +64 -0
  17. vantage6/cli/cli.py +67 -37
  18. vantage6/cli/common/new.py +28 -3
  19. vantage6/cli/common/remove.py +54 -0
  20. vantage6/cli/common/start.py +31 -2
  21. vantage6/cli/common/stop.py +79 -1
  22. vantage6/cli/common/utils.py +47 -4
  23. vantage6/cli/configuration_manager.py +57 -13
  24. vantage6/cli/configuration_wizard.py +18 -397
  25. vantage6/cli/context/__init__.py +3 -0
  26. vantage6/cli/context/auth.py +107 -0
  27. vantage6/cli/context/base_server.py +0 -4
  28. vantage6/cli/context/node.py +10 -17
  29. vantage6/cli/dev/clean.py +28 -0
  30. vantage6/cli/dev/common.py +34 -0
  31. vantage6/cli/dev/rebuild.py +39 -0
  32. vantage6/cli/dev/start.py +36 -0
  33. vantage6/cli/dev/stop.py +23 -0
  34. vantage6/cli/globals.py +24 -1
  35. vantage6/cli/node/attach.py +1 -0
  36. vantage6/cli/node/files.py +12 -25
  37. vantage6/cli/node/list.py +5 -4
  38. vantage6/cli/node/new.py +348 -28
  39. vantage6/cli/node/remove.py +14 -90
  40. vantage6/cli/node/restart.py +30 -51
  41. vantage6/cli/node/start.py +81 -304
  42. vantage6/cli/node/stop.py +36 -96
  43. vantage6/cli/node/version.py +5 -4
  44. vantage6/cli/prometheus/monitoring_manager.py +5 -3
  45. vantage6/cli/rabbitmq/queue_manager.py +13 -11
  46. vantage6/cli/server/attach.py +1 -0
  47. vantage6/cli/server/common/__init__.py +1 -27
  48. vantage6/cli/server/import_.py +1 -1
  49. vantage6/cli/server/new.py +83 -2
  50. vantage6/cli/server/remove.py +12 -33
  51. vantage6/cli/server/start.py +8 -6
  52. vantage6/cli/server/stop.py +10 -39
  53. vantage6/cli/template/algo_store_config.j2 +1 -1
  54. vantage6/cli/template/auth_config.j2 +230 -0
  55. vantage6/cli/template/node_config.j2 +336 -33
  56. vantage6/cli/template/node_config_nonk8s.j2 +33 -0
  57. vantage6/cli/test/common/diagnostic_runner.py +5 -3
  58. vantage6/cli/use/namespace.py +2 -1
  59. vantage6/cli/utils.py +0 -2
  60. {vantage6-5.0.0a34.dist-info → vantage6-5.0.0a36.dist-info}/METADATA +3 -3
  61. vantage6-5.0.0a36.dist-info/RECORD +86 -0
  62. vantage6/cli/dev/create.py +0 -693
  63. vantage6/cli/dev/data/km_dataset.csv +0 -2401
  64. vantage6/cli/dev/remove.py +0 -112
  65. vantage6/cli/node/clean.py +0 -46
  66. vantage6/cli/server/shell.py +0 -54
  67. vantage6-5.0.0a34.dist-info/RECORD +0 -75
  68. {vantage6-5.0.0a34.dist-info → vantage6-5.0.0a36.dist-info}/WHEEL +0 -0
  69. {vantage6-5.0.0a34.dist-info → vantage6-5.0.0a36.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,230 @@
1
+ # for more options on the deployment of this chart, see:
2
+ # https://artifacthub.io/packages/helm/bitnami/keycloak
3
+ keycloak:
4
+
5
+ # for development, use a local PostgreSQL instance.
6
+ {% if keycloak.production %}
7
+ postgresql:
8
+ enabled: false
9
+
10
+ # TODO v5+ set these variables from the CLI
11
+ externalDatabase:
12
+ host: "sql.example.vantage6.ai"
13
+ port: 5432
14
+ username: my-username
15
+ password: my-secret-password
16
+ database: my-keycloak-database
17
+ schema: public
18
+ existingSecretHostKey: my-secret-contains-the-host
19
+ existingSecretPortKey: my-secret-contains-the-port
20
+ existingSecretUsernameKey: my-secret-contains-the-username
21
+ existingSecretPasswordKey: my-secret-contains-the-password
22
+ existingSecretDatabaseKey: my-secret-contains-the-database
23
+
24
+ # TODO v5+ set secrets in CLI
25
+ auth:
26
+ # Set the username and password for the Keycloak admin. This user is created when
27
+ # the service is initialized.
28
+ adminUser: {{ keycloak.adminUser | default('admin') }}
29
+ existingSecret: secret-containing-admin-password
30
+ passwordSecretKey: key-to-admin-password-in-secret
31
+ # For a development environment, you can set the admin user and password directly.
32
+ # adminPassword: admin
33
+
34
+ # for production, TLS should be enabled for internal Keycloak communication
35
+ # TODO v5+ we should test if this works when we have CLI commands (#1923)
36
+ production: true
37
+ tls:
38
+ enabled: true
39
+ autoGenerated: true
40
+ {% else %}
41
+ postgresql:
42
+ enabled: true
43
+ auth:
44
+ postgresPassword: postgres
45
+ password: keycloak
46
+ database: keycloak
47
+
48
+ # for production, use an external PostgreSQL instance. This requires setting up config
49
+ # as follows. Be sure to set postgres.enabled to false just above here.
50
+ # externalDatabase:
51
+ # host: "sql.example.vantage6.ai"
52
+ # port: 5432
53
+ # username: my-username
54
+ # password: my-secret-password
55
+ # database: my-keycloak-database
56
+ # schema: public
57
+ # # or alternatively, use secrets for all of the above formatted as:
58
+ # existingSecretHostKey: my-secret-contains-the-host
59
+ # existingSecretPortKey: my-secret-contains-the-port
60
+ # existingSecretUsernameKey: my-secret-contains-the-username
61
+ # existingSecretPasswordKey: my-secret-contains-the-password
62
+ # existingSecretDatabaseKey: my-secret-contains-the-database
63
+
64
+ auth:
65
+ # for development environment, set a dummy password for the admin user.
66
+ adminUser: admin
67
+ adminPassword: admin
68
+ # for production, the password should be stored in a secret. Below you should then
69
+ # give the name of the secret and the key to where the password is within the
70
+ # secret.
71
+ # existingSecret: secret-containing-admin-password
72
+ # passwordSecretKey: key-to-admin-password-in-secret
73
+
74
+ # if you want to switch to production, you should set the following settings to true.
75
+ production: false
76
+ tls:
77
+ enabled: false
78
+ autoGenerated: false
79
+ {% endif %}
80
+
81
+ # ensure that the auth pod has enough resources to run. The default values are enough
82
+ # in most cases, but for a larger environment, you might need to increase the limits.
83
+ resources:
84
+ limits:
85
+ memory: 2Gi
86
+ cpu: 1000m
87
+ requests:
88
+ memory: 1Gi
89
+ cpu: 500m
90
+
91
+ # The following configuration is run via the CLI when the Keycloak service is
92
+ # initialized. It creates a number of users, roles and secrets that are required for
93
+ # vantage6 to work properly.
94
+ keycloakConfigCli:
95
+ enabled: true
96
+ configuration:
97
+ # Keycloak realm configuration. For all options, see
98
+ # https://www.keycloak.org/docs-api/latest/rest-api/index.html#RealmRepresentation
99
+ realm:
100
+ # Keycloak realm name
101
+ realm: {{ keycloak.realm | default('vantage6') }}
102
+ enabled: true
103
+
104
+ # access token lifespan in seconds
105
+ accessTokenLifespan: {{ keycloak.accessTokenLifespan | default(300) }}
106
+
107
+ # sso session idle timeout in seconds. This is the time before the refresh token
108
+ # expires. With default settings, this value controls the time before the
109
+ # refresh token expires. Note that if setting this to >3600, you also need to
110
+ # set ssoSessionMaxLifespan and/or clientSessionIdleTimeout and/or
111
+ # clientSessionMaxLifespan to higher values to effectively lengthen the session.
112
+ ssoSessionIdleTimeout: {{ keycloak.ssoSessionIdleTimeout | default(1800) }}
113
+
114
+ # password policy configuration. If you prefer not to have a
115
+ passwordPolicy: "length(8) and upperCase(1) and lowerCase(1) and digits(1) and specialChars(1)"
116
+
117
+ # do not allow users to edit their username - this would lead to problems with
118
+ # syncing the user between keycloak and vantage6 server/store. This setting
119
+ # should always be set to false.
120
+ editUsernameAllowed: false
121
+
122
+ {% if keycloak.production %}
123
+ # required actions for users. By setting defaultAction to true for configuring
124
+ # OTP, the user will be prompted to configure OTP (for two-factor
125
+ # authentication) on first login.
126
+ requiredActions:
127
+ - alias: CONFIGURE_TOTP
128
+ name: Configure OTP
129
+ providerId: CONFIGURE_TOTP
130
+ enabled: true
131
+ defaultAction: true
132
+ priority: 10
133
+ {% else %}
134
+ # If you want to require users to use two-factor authentication on first login,
135
+ # enable the settings below.
136
+ # requiredActions:
137
+ # - alias: CONFIGURE_TOTP
138
+ # name: Configure OTP
139
+ # providerId: CONFIGURE_TOTP
140
+ # enabled: true
141
+ # defaultAction: true
142
+ # priority: 10
143
+ {% endif %}
144
+
145
+ # users to be created in the realm. This initializes the realm with a default
146
+ # admin user. It also initializes the service account for the backend admin
147
+ # client to give it the necessary permissions to manage the realm.
148
+ # TODO v5+ configure secrets where necessary
149
+ users:
150
+ # create the vantage6 admin user. The name of this user should also be present
151
+ # in the vantage6 server and store configuration - it is the user that will be
152
+ # assigned admin permissions on initial startup.
153
+ - username: {{ keycloak.adminUser | default('admin') }}
154
+ enabled: true
155
+ credentials:
156
+ - type: password
157
+ value: {{ keycloak.adminPassword | default('Admin123!') }}
158
+ requiredActions:
159
+ {% if keycloak.production %}
160
+ - CONFIGURE_TOTP
161
+ - UPDATE_PASSWORD
162
+ {% else %}
163
+ # enable configure OTP only if you want to use two-factor authentication
164
+ # - CONFIGURE_TOTP
165
+ - UPDATE_PASSWORD
166
+ {% endif %}
167
+ # create a service account user for the backend admin client. The
168
+ # serviceAccountClientId should match the value set in the client section
169
+ # below. The vantage6 server and store will use this user to create new
170
+ # accounts for users and nodes in keycloak - that is why it gets assigned some
171
+ # realm-management permissions.
172
+ - username: service-account-backend-admin-client
173
+ enabled: true
174
+ serviceAccountClientId: backend-admin-client
175
+ clientRoles:
176
+ realm-management:
177
+ - view-users
178
+ - manage-users
179
+ - view-clients
180
+ - manage-clients
181
+ - create-client
182
+
183
+ # clients to be created in the realm. This initializes the realm with a default
184
+ # public client and a backend admin client. The public client is used by users
185
+ # to authenticate in the browser. Either the UI or the Python client will
186
+ # redirect to this client.
187
+ clients:
188
+ - clientId: public_client
189
+ publicClient: true
190
+ # redirect URIs are the URIs that keycloak is allowed to redirect to after
191
+ # authentication. This should be set to the UI URL, and to the Keyloak
192
+ # service on port 7681. The latter is needed for authentication from outside
193
+ # the browser - if e.g. the Python client authenticates, it will open a
194
+ # browser window to authenticate that redirects to the Keycloak service on
195
+ # port 7681.
196
+ {% if keycloak.redirectUris %}
197
+ redirectUris:
198
+ {% for uri in keycloak.redirectUris %}
199
+ - "{{ uri }}/*"
200
+ {% endfor %}
201
+ {% else %}
202
+ redirectUris:
203
+ # allow logging in via a local UI
204
+ - "http://localhost:7600/*"
205
+ # allow logging in via the Python client (which spins up a local server
206
+ # on port 7681)
207
+ - "http://localhost:7681/*"
208
+ {% endif %}
209
+ # By setting webOrigins to "+", we allow the same origins as redirectUris.
210
+ webOrigins:
211
+ - "+"
212
+ # The public client is only for users, not for nodes. Therefore, map a
213
+ # constant claim to indicate the that the client is a user.
214
+ protocolMappers:
215
+ - name: vantage6_client_type
216
+ protocol: openid-connect
217
+ protocolMapper: oidc-hardcoded-claim-mapper
218
+ consentRequired: false
219
+ config:
220
+ claim.name: vantage6_client_type
221
+ claim.value: user
222
+ access.token.claim: true
223
+ # create a client that will allow the backend to manage users and clients in
224
+ # keycloak.
225
+ - clientId: backend-admin-client
226
+ publicClient: false
227
+ # TODO v5+ configure secrets where necessary
228
+ secret: myadminclientsecret
229
+ serviceAccountsEnabled: true
230
+ standardFlowEnabled: false
@@ -1,33 +1,336 @@
1
- api_path: {{ api_path }}
2
- encryption:
3
- enabled: false
4
- private_key: null
5
- logging:
6
- backup_count: 5
7
- datefmt: '%Y-%m-%d %H:%M:%S'
8
- file: {{ logging["file"] }}
9
- format: '%(asctime)s - %(name)-14s - %(levelname)-8s - %(message)s'
10
- level: DEBUG
11
- max_size: 1024
12
- use_console: true
13
- loggers:
14
- - level: warning
15
- name: urllib3
16
- - level: warning
17
- name: requests
18
- - level: warning
19
- name: engineio.client
20
- - level: warning
21
- name: docker.utils.config
22
- - level: warning
23
- name: docker.auth
24
- - level: warning
25
- name: kubernetes.client.rest
26
- node_proxy_port: {{ node_proxy_port }}
27
- port: {{ port }}
28
- server_url: {{ server_url }}
29
- task_dir: {{ task_dir}}
30
- dev:
31
- task_dir_extension: {{ task_dir_extension }}
32
- task_namespace: {{ task_namespace }}
33
- {{- user_provided_config -}}
1
+ # override the chart name
2
+ nameOverride: {{ nameOverride | default('vantage6-node') }}
3
+ # Optional, by default the Release.Namespace is used
4
+ # namespace: vantage6-node
5
+ node:
6
+
7
+ # Set to false to prevent creation of node secrets (useful when secrets are managed
8
+ # externally)
9
+ createSecrets: {{ node.createSecrets | default(true) }}
10
+
11
+ name: {{ node.name | default('put-your-node-name-here') }}
12
+ apiKey: {{ node.apiKey | default('put-your-api-key-here') }}
13
+
14
+ # Keycloak configuration
15
+ keycloakUrl: {{ node.keycloakUrl | default('http://vantage6-auth-keycloak.vantage6.svc.cluster.local') }}
16
+ keycloakRealm: {{ node.keycloakRealm | default('vantage6') }}
17
+
18
+ # TODO v5+ set the url/port directly on node-configmap.yaml using \{\{ .Release.Name \}\}-vantage6-server-service
19
+ {% if node.server is defined %}
20
+ server:
21
+ url: {{ node.server.url | default('http://vantage6-server-vantage6-server-service') }}
22
+ port: {{ node.server.port | default(7601) }}
23
+ path: {{ node.server.path | default('/server') }}
24
+ {% else %}
25
+ server:
26
+ url: http://vantage6-server-vantage6-server-service
27
+ port: 7601
28
+ path: /server
29
+ {% endif %}
30
+
31
+
32
+ image: {{ node.image | default('harbor2.vantage6.ai/infrastructure/node:latest') }}
33
+
34
+ # Namespace in which the task kubernetes resources are created. This must be a
35
+ # namespace where the node has access to create pods.
36
+ taskNamespace: {{ node.taskNamespace | default('vantage6-tasks') }}
37
+
38
+ # Kubernetes node name, used for local persistent volumes
39
+ k8sNodeName: {{ node.k8sNodeName | default('docker-desktop') }}
40
+
41
+ logging:
42
+ # Controls the logging output level. Could be one of the following
43
+ # levels: CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET
44
+ level: {{ node.logging.level | default('INFO') }}
45
+
46
+ # Location to the log file
47
+ file: {{ node.logging.file | default('node.log') }}
48
+
49
+ # Size in kb of a single log file
50
+ max_size: {{ node.logging.max_size | default(1024) }}
51
+ use_console: {{ node.logging.use_console | default(true) }}
52
+
53
+ # Date format for the log file
54
+ datefmt: "{{ node.logging.datefmt | default('%Y-%m-%d %H:%M:%S') }}"
55
+
56
+ # Format for the log file
57
+ format: "{{ node.logging.format | default('%(asctime)s - %(name)-14s - %(levelname)-8s - %(message)s') }}"
58
+
59
+ # Maximum number of log files to keep. Log files are rotated when the size of the
60
+ # current log file exceeds `max_size`.
61
+ backup_count: {{ node.logging.backup_count | default(5) }}
62
+
63
+ # Loggers to include in the log file
64
+ loggers:
65
+ {% if node.logging.loggers is defined %}
66
+ {% for logger in node.logging.loggers %}
67
+ - level: {{ logger.level }}
68
+ name: {{ logger.name }}
69
+ {% endfor %}
70
+ {% endif %}
71
+ {% if node.logging.loggers is not defined %}
72
+ - level: warning
73
+ name: urllib3
74
+ - level: warning
75
+ name: socketIO-client
76
+ - level: warning
77
+ name: socketio.server
78
+ - level: warning
79
+ name: engineio.server
80
+ - level: warning
81
+ name: sqlalchemy.engine
82
+ {% endif %}
83
+
84
+ {% if node.encryption is defined %}
85
+ encryption:
86
+ # Whether encryption is enabled or not. This should be the same as the `encrypted`
87
+ # setting of the collaboration to which this node belongs.
88
+ enabled: {{ node.encryption.enabled | default(false) }}
89
+
90
+ # Location to the private key file. Required if encryption is enabled.
91
+ {% if node.encryption.enabled | default(false) %}
92
+ private_key: {{ node.encryption.private_key | default('/path/to/private_key.pem') }}
93
+ {% else %}
94
+ # private_key: /path/to/private_key.pem
95
+ {% endif %}
96
+ {% else %}
97
+ encryption:
98
+ # Whether encryption is enabled or not. This should be the same as the `encrypted`
99
+ # setting of the collaboration to which this node belongs.
100
+ enabled: false
101
+
102
+ # Location to the private key file. Required if encryption is enabled.
103
+ # private_key: /path/to/private_key.pem
104
+ {% endif %}
105
+
106
+ # Port for the node proxy to run on
107
+ proxyPort: {{ node.proxyPort | default(7654) }}
108
+
109
+ # Storage settings on host of the node machine. This defines where the database is
110
+ # stored as well as the task directory (which will contain the input/output of the
111
+ # tasks).
112
+ persistence:
113
+ tasks:
114
+ {% if node.persistence is defined and node.persistence.tasks is defined %}
115
+ storageClass: {{ node.persistence.tasks.storageClass | default('local-storage') }}
116
+ size: {{ node.persistence.tasks.size | default('10Gi') }}
117
+ hostPath: {{ node.persistence.tasks.hostPath | default('/path/to/where/task/files/are/stored') }}
118
+ {% else %}
119
+ storageClass: local-storage
120
+ size: 10Gi
121
+ hostPath: /path/to/where/task/files/are/stored
122
+ {% endif %}
123
+ database:
124
+ {% if node.persistence is defined and node.persistence.database is defined %}
125
+ storageClass: {{ node.persistence.database.storageClass | default('local-storage') }}
126
+ size: {{ node.persistence.database.size | default('5Gi') }}
127
+ {% else %}
128
+ storageClass: local-storage
129
+ size: 5Gi
130
+ {% endif %}
131
+
132
+
133
+ # It is also possible not to specify the details of the service-based databases
134
+ # here. The node will then automatically detect the databases in the environment
135
+ # variables. This allows parent charts to specify the databases in their own
136
+ # values.yaml file or define them runtime using the CLI.
137
+ #
138
+ # In this case, the node expects the following environment variables to be set:
139
+ #
140
+ # DATABASE_LABELS: comma-separated list of database labels
141
+ # DATABASE_[LABEL]_URI: URI of the database
142
+ # DATABASE_[LABEL]_TYPE: type of the database
143
+ #
144
+ # Optionally, you can also specify additional environment variables for each
145
+ # database by setting the DATABASE_[LABEL]_SOME_OTHER_KEY variable.
146
+ #
147
+ # DATABASE_[LABEL]_SOME_OTHER_KEY: some_other_value
148
+ #
149
+ # It is recommended to do this through Kubernetes secrets. If you specify the
150
+ # details here, secrets will be used. File-based databases are automatically made
151
+ # available to your node.
152
+ {% if node.databases is defined %}
153
+ databases:
154
+ {% if node.databases.fileBased is defined %}
155
+ fileBased:
156
+ {% for db in node.databases.fileBased %}
157
+ - name: {{ db.name }}
158
+ uri: {{ db.uri }}
159
+ type: {{ db.type }}
160
+ volumePath: {{ db.volumePath }}
161
+ originalName: {{ db.originalName }}
162
+ {% endfor %}
163
+ {% endif %}
164
+ {% if node.databases.serviceBased is defined %}
165
+ serviceBased:
166
+ {% for db in node.databases.serviceBased %}
167
+ - name: {{ db.name }}
168
+ uri: {{ db.uri }}
169
+ type: {{ db.type }}
170
+ env:
171
+ {% for key, value in db.env.items() %}
172
+ {{ key }}: {{ value }}
173
+ {% endfor %}
174
+ {% endfor %}
175
+ {% endif %}
176
+ {% else %}
177
+ databases: []
178
+ {% endif %}
179
+
180
+ # Whether or not your node shares some configuration (e.g. which images are
181
+ # allowed to run on your node) with the central server. This can be useful
182
+ # for other organizations in your collaboration to understand why a task
183
+ # is not completed. Obviously, no sensitive data is shared. Default true
184
+ share_config: {{ node.share_config | default(true) }}
185
+
186
+ # Whether or not to share algorithm logs with the server. Otherwise they will
187
+ # only be displayed as part of the node logs. Default is true.
188
+ # NOTE: It's recommented to set this to false when using sensitive data
189
+ share_algorithm_logs: {{ node.share_algorithm_logs | default(true) }}
190
+
191
+ # Define who is allowed to run which algorithms on this node.
192
+ {% if node.policies is defined %}
193
+ policies:
194
+ # Control which algorithm images are allowed to run on this node. This is
195
+ # expected to be a valid regular expression. If you don't specify this, all algorithm
196
+ # images are allowed to run on this node (unless other policies restrict this).
197
+ {% if node.policies.allowed_algorithms is defined %}
198
+ allowed_algorithms:
199
+ {% for algo in node.policies.allowed_algorithms %}
200
+ - {{ algo }}
201
+ {% endfor %}
202
+ {% else %}
203
+ # allowed_algorithms:
204
+ # - ^harbor2\.vantage6\.ai/[a-zA-Z]+/[a-zA-Z]+
205
+ # - ^myalgorithm\.ai/some-algorithm
206
+ {% endif %}
207
+
208
+ # It is also possible to allow all algorithms from particular algorithm stores. Set
209
+ # these stores here. They may be strings or regular expressions. If you don't specify
210
+ # this, algorithms from any store are allowed (unless other policies prevent this).
211
+ {% if node.policies.allowed_algorithm_stores is defined %}
212
+ allowed_algorithm_stores:
213
+ {% for store in node.policies.allowed_algorithm_stores %}
214
+ - {{ store }}
215
+ {% endfor %}
216
+ {% else %}
217
+ # allowed_algorithm_stores:
218
+ # # allow all algorithms from the vantage6 community store
219
+ # - https://store.cotopaxi.vantage6.ai
220
+ # # allow any store that is a subdomain of vantage6.ai
221
+ # - ^https://[a-z]+\.vantage6\.ai$
222
+ {% endif %}
223
+
224
+ # If you define both `allowed_algorithm_stores` and `allowed_algorithms`, you can
225
+ # choose to only allow algorithms that both policies allow, or you can allow
226
+ # algorithms that either of them allows. By default, only algorithms that are given
227
+ # in *both* the `allowed_algorithms` and `allowed_algorithm_stores` are allowed by
228
+ # setting this to the default value `false`.
229
+ allow_either_whitelist_or_store: {{ node.policies.allow_either_whitelist_or_store | default(false) }}
230
+
231
+ # Define which users are allowed to run algorithms on your node by their ID
232
+ {% if node.policies.allowed_users is defined %}
233
+ allowed_users:
234
+ {% for user in node.policies.allowed_users %}
235
+ - {{ user }}
236
+ {% endfor %}
237
+ {% else %}
238
+ # allowed_users:
239
+ # - 2
240
+ {% endif %}
241
+
242
+ # Define which organizations are allowed to run images on your node by
243
+ # their ID or name
244
+ {% if node.policies.allowed_organizations is defined %}
245
+ allowed_organizations:
246
+ {% for org in node.policies.allowed_organizations %}
247
+ - {{ org }}
248
+ {% endfor %}
249
+ {% else %}
250
+ # allowed_organizations:
251
+ # - 6
252
+ # - root
253
+ {% endif %}
254
+
255
+ # Set to true to always require that the algorithm image is successfully pulled. This
256
+ # ensures that no potentially outdated local images are used if internet connection
257
+ # is not available. This option should be set to false if you are testing with local
258
+ # algorithm images. Default value is true.
259
+ require_algorithm_pull: {{ node.policies.require_algorithm_pull | default(true) }}
260
+ {% else %}
261
+ policies:
262
+ # Control which algorithm images are allowed to run on this node. This is
263
+ # expected to be a valid regular expression. If you don't specify this, all algorithm
264
+ # images are allowed to run on this node (unless other policies restrict this).
265
+ # allowed_algorithms:
266
+ # - ^harbor2\.vantage6\.ai/[a-zA-Z]+/[a-zA-Z]+
267
+ # - ^myalgorithm\.ai/some-algorithm
268
+
269
+ # It is also possible to allow all algorithms from particular algorithm stores. Set
270
+ # these stores here. They may be strings or regular expressions. If you don't specify
271
+ # this, algorithms from any store are allowed (unless other policies prevent this).
272
+ # allowed_algorithm_stores:
273
+ # # allow all algorithms from the vantage6 community store
274
+ # - https://store.cotopaxi.vantage6.ai
275
+ # # allow any store that is a subdomain of vantage6.ai
276
+ # - ^https://[a-z]+\.vantage6\.ai$
277
+
278
+ # If you define both `allowed_algorithm_stores` and `allowed_algorithms`, you can
279
+ # choose to only allow algorithms that both policies allow, or you can allow
280
+ # algorithms that either of them allows. By default, only algorithms that are given
281
+ # in *both* the `allowed_algorithms` and `allowed_algorithm_stores` are allowed by
282
+ # setting this to the default value `false`.
283
+ # allow_either_whitelist_or_store: false
284
+
285
+ # Define which users are allowed to run algorithms on your node by their ID
286
+ # allowed_users:
287
+ # - 2
288
+ # Define which organizations are allowed to run images on your node by
289
+ # their ID or name
290
+ # allowed_organizations:
291
+ # - 6
292
+ # - root
293
+
294
+ # Set to true to always require that the algorithm image is successfully pulled. This
295
+ # ensures that no potentially outdated local images are used if internet connection
296
+ # is not available. This option should be set to false if you are testing with local
297
+ # algorithm images. Default value is true.
298
+ require_algorithm_pull: true
299
+ {% endif %}
300
+
301
+ # Prometheus settings, for sending system metadata to the server.
302
+ {% if node.prometheus is defined %}
303
+ prometheus:
304
+ # Whether or not to enable Prometheus reporting. Default is false.
305
+ enabled: {{ node.prometheus.enabled | default(false) }}
306
+
307
+ # Interval (in seconds) at which the node sends system metadata to the server.
308
+ # This should align with the Prometheus scrape_interval to avoid stale data.
309
+ report_interval_seconds: {{ node.prometheus.report_interval_seconds | default(45) }}
310
+ {% else %}
311
+ prometheus:
312
+ # Whether or not to enable Prometheus reporting. Default is false.
313
+ enabled: false
314
+
315
+ # Interval (in seconds) at which the node sends system metadata to the server.
316
+ # This should align with the Prometheus scrape_interval to avoid stale data.
317
+ # report_interval_seconds: 45
318
+ {% endif %}
319
+
320
+ {% if node.debug is defined %}
321
+ # Debug settings
322
+ debug:
323
+ # Set to `true` to enable print debug messages from Flask/socketio.
324
+ socketio: {{ node.debug.socketio | default(false) }}
325
+
326
+ # Set to `true` to set the Flask app used for proxy service into debug mode.
327
+ proxy_server: {{ node.debug.proxy_server | default(false) }}
328
+ {% endif %}
329
+
330
+ {% if node.dev is defined %}
331
+ dev:
332
+ # Set extension for the task directory. In the development environment, the task
333
+ # directory is mounted as a volume. If multiple nodes are then running on the same
334
+ # machine, this extension is added to the task directory to avoid conflicts.
335
+ task_dir_extension: {{ node.dev.task_dir_extension }}
336
+ {% endif %}
@@ -0,0 +1,33 @@
1
+ api_path: {{ api_path }}
2
+ encryption:
3
+ enabled: false
4
+ private_key: null
5
+ logging:
6
+ backup_count: 5
7
+ datefmt: '%Y-%m-%d %H:%M:%S'
8
+ file: {{ logging["file"] }}
9
+ format: '%(asctime)s - %(name)-14s - %(levelname)-8s - %(message)s'
10
+ level: DEBUG
11
+ max_size: 1024
12
+ use_console: true
13
+ loggers:
14
+ - level: warning
15
+ name: urllib3
16
+ - level: warning
17
+ name: requests
18
+ - level: warning
19
+ name: engineio.client
20
+ - level: warning
21
+ name: docker.utils.config
22
+ - level: warning
23
+ name: docker.auth
24
+ - level: warning
25
+ name: kubernetes.client.rest
26
+ node_proxy_port: {{ node_proxy_port }}
27
+ port: {{ port }}
28
+ server_url: {{ server_url }}
29
+ task_dir: {{ task_dir}}
30
+ dev:
31
+ task_dir_extension: {{ task_dir_extension }}
32
+ task_namespace: {{ task_namespace }}
33
+ {{- user_provided_config -}}
@@ -1,11 +1,13 @@
1
1
  import json
2
-
3
2
  from typing import Any
3
+
4
4
  from rich.console import Console
5
5
  from rich.table import Table
6
6
 
7
+ from vantage6.common import debug, info
8
+
7
9
  from vantage6.client import UserClient
8
- from vantage6.common import info, debug
10
+
9
11
  from vantage6.cli.globals import DIAGNOSTICS_IMAGE
10
12
 
11
13
 
@@ -62,7 +64,7 @@ class DiagnosticRunner:
62
64
  set(self.organization_ids).intersection(online_orgs)
63
65
  )
64
66
 
65
- info(f"Running diagnostics to {len(self.organization_ids)} " "organization(s)")
67
+ info(f"Running diagnostics to {len(self.organization_ids)} organization(s)")
66
68
  info(f" organizations: {self.organization_ids}")
67
69
  info(f" collaboration: {self.collaboration_id}")
68
70
 
@@ -2,9 +2,10 @@ import click
2
2
  import questionary
3
3
  from kubernetes import client, config
4
4
 
5
+ from vantage6.common import error
6
+
5
7
  from vantage6.cli.config import CliConfig
6
8
  from vantage6.cli.utils import switch_context_and_namespace
7
- from vantage6.common import error
8
9
 
9
10
 
10
11
  @click.command()
vantage6/cli/utils.py CHANGED
@@ -32,8 +32,6 @@ def check_config_name_allowed(name: str) -> None:
32
32
  f"Name '{name}' is not allowed. Please use only the following "
33
33
  "characters: a-zA-Z0-9_.-"
34
34
  )
35
- # FIXME: FM, 2023-01-03: I dont think this is a good side effect. This
36
- # should be handled by the caller.
37
35
  exit(1)
38
36
 
39
37