digitalhub 0.14.0b1__py3-none-any.whl → 0.14.0b2__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 digitalhub might be problematic. Click here for more details.
- digitalhub/entities/_base/executable/entity.py +20 -12
- digitalhub/entities/_base/material/entity.py +8 -4
- digitalhub/entities/_processors/base.py +8 -8
- digitalhub/entities/_processors/context.py +15 -15
- digitalhub/entities/_processors/utils.py +2 -2
- digitalhub/entities/artifact/crud.py +23 -7
- digitalhub/entities/dataitem/crud.py +28 -9
- digitalhub/entities/dataitem/table/entity.py +28 -1
- digitalhub/entities/dataitem/utils.py +4 -0
- digitalhub/entities/function/_base/entity.py +3 -3
- digitalhub/entities/function/crud.py +23 -7
- digitalhub/entities/model/_base/entity.py +51 -9
- digitalhub/entities/model/crud.py +21 -7
- digitalhub/entities/project/_base/entity.py +121 -41
- digitalhub/entities/project/crud.py +20 -6
- digitalhub/entities/run/_base/entity.py +58 -15
- digitalhub/entities/run/crud.py +22 -7
- digitalhub/entities/secret/crud.py +21 -7
- digitalhub/entities/task/_base/entity.py +4 -4
- digitalhub/entities/task/crud.py +18 -6
- digitalhub/entities/trigger/crud.py +23 -7
- digitalhub/entities/workflow/_base/entity.py +3 -3
- digitalhub/entities/workflow/crud.py +23 -7
- digitalhub/factory/entity.py +283 -0
- digitalhub/factory/registry.py +221 -0
- digitalhub/factory/runtime.py +44 -0
- digitalhub/runtimes/_base.py +2 -2
- digitalhub/stores/client/dhcore/client.py +6 -2
- digitalhub/stores/credentials/configurator.py +4 -5
- digitalhub/stores/data/s3/configurator.py +2 -2
- digitalhub/stores/readers/data/pandas/reader.py +9 -3
- {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b2.dist-info}/METADATA +1 -1
- {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b2.dist-info}/RECORD +36 -34
- digitalhub/factory/factory.py +0 -460
- {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b2.dist-info}/WHEEL +0 -0
- {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b2.dist-info}/licenses/AUTHORS +0 -0
- {digitalhub-0.14.0b1.dist-info → digitalhub-0.14.0b2.dist-info}/licenses/LICENSE +0 -0
|
@@ -88,19 +88,37 @@ class Model(MaterialEntity):
|
|
|
88
88
|
Examples
|
|
89
89
|
--------
|
|
90
90
|
Log a new value in a list
|
|
91
|
-
>>> entity.log_metric(
|
|
91
|
+
>>> entity.log_metric(
|
|
92
|
+
... "loss", 0.002
|
|
93
|
+
... )
|
|
92
94
|
|
|
93
95
|
Append a new value in a list
|
|
94
|
-
>>> entity.log_metric(
|
|
96
|
+
>>> entity.log_metric(
|
|
97
|
+
... "loss", 0.0019
|
|
98
|
+
... )
|
|
95
99
|
|
|
96
100
|
Log a list of values and append them to existing metric:
|
|
97
|
-
>>> entity.log_metric(
|
|
101
|
+
>>> entity.log_metric(
|
|
102
|
+
... "loss",
|
|
103
|
+
... [
|
|
104
|
+
... 0.0018,
|
|
105
|
+
... 0.0015,
|
|
106
|
+
... ],
|
|
107
|
+
... )
|
|
98
108
|
|
|
99
109
|
Log a single value (not represented as list):
|
|
100
|
-
>>> entity.log_metric(
|
|
110
|
+
>>> entity.log_metric(
|
|
111
|
+
... "accuracy",
|
|
112
|
+
... 0.9,
|
|
113
|
+
... single_value=True,
|
|
114
|
+
... )
|
|
101
115
|
|
|
102
116
|
Log a list of values and overwrite existing metric:
|
|
103
|
-
>>> entity.log_metric(
|
|
117
|
+
>>> entity.log_metric(
|
|
118
|
+
... "accuracy",
|
|
119
|
+
... [0.8, 0.9],
|
|
120
|
+
... overwrite=True,
|
|
121
|
+
... )
|
|
104
122
|
"""
|
|
105
123
|
self._set_metrics(key, value, overwrite, single_value)
|
|
106
124
|
context_processor.update_metric(self.project, self.ENTITY_TYPE, self.id, key, self.status.metrics[key])
|
|
@@ -128,16 +146,40 @@ class Model(MaterialEntity):
|
|
|
128
146
|
Examples
|
|
129
147
|
--------
|
|
130
148
|
Log multiple metrics at once
|
|
131
|
-
>>> entity.log_metrics(
|
|
149
|
+
>>> entity.log_metrics(
|
|
150
|
+
... {
|
|
151
|
+
... "loss": 0.002,
|
|
152
|
+
... "accuracy": 0.95,
|
|
153
|
+
... }
|
|
154
|
+
... )
|
|
132
155
|
|
|
133
156
|
Log metrics with lists and single values
|
|
134
|
-
>>> entity.log_metrics(
|
|
157
|
+
>>> entity.log_metrics(
|
|
158
|
+
... {
|
|
159
|
+
... "loss": [
|
|
160
|
+
... 0.1,
|
|
161
|
+
... 0.05,
|
|
162
|
+
... ],
|
|
163
|
+
... "epoch": 10,
|
|
164
|
+
... }
|
|
165
|
+
... )
|
|
135
166
|
|
|
136
167
|
Append to existing metrics (default behavior)
|
|
137
|
-
>>> entity.log_metrics(
|
|
168
|
+
>>> entity.log_metrics(
|
|
169
|
+
... {
|
|
170
|
+
... "loss": 0.001,
|
|
171
|
+
... "accuracy": 0.96,
|
|
172
|
+
... }
|
|
173
|
+
... ) # Appends to existing
|
|
138
174
|
|
|
139
175
|
Overwrite existing metrics
|
|
140
|
-
>>> entity.log_metrics(
|
|
176
|
+
>>> entity.log_metrics(
|
|
177
|
+
... {
|
|
178
|
+
... "loss": 0.0005,
|
|
179
|
+
... "accuracy": 0.98,
|
|
180
|
+
... },
|
|
181
|
+
... overwrite=True,
|
|
182
|
+
... )
|
|
141
183
|
|
|
142
184
|
See also
|
|
143
185
|
--------
|
|
@@ -155,7 +155,9 @@ def get_model(
|
|
|
155
155
|
Examples
|
|
156
156
|
--------
|
|
157
157
|
Using entity key:
|
|
158
|
-
>>> obj = get_model(
|
|
158
|
+
>>> obj = get_model(
|
|
159
|
+
... "store://my-model-key"
|
|
160
|
+
... )
|
|
159
161
|
|
|
160
162
|
Using entity name:
|
|
161
163
|
>>> obj = get_model("my-model-name"
|
|
@@ -196,7 +198,9 @@ def get_model_versions(
|
|
|
196
198
|
Examples
|
|
197
199
|
--------
|
|
198
200
|
Using entity key:
|
|
199
|
-
>>> objs = get_model_versions(
|
|
201
|
+
>>> objs = get_model_versions(
|
|
202
|
+
... "store://my-model-key"
|
|
203
|
+
... )
|
|
200
204
|
|
|
201
205
|
Using entity name:
|
|
202
206
|
>>> objs = get_model_versions("my-model-name",
|
|
@@ -228,7 +232,9 @@ def list_models(project: str, **kwargs) -> list[Model]:
|
|
|
228
232
|
|
|
229
233
|
Examples
|
|
230
234
|
--------
|
|
231
|
-
>>> objs = list_models(
|
|
235
|
+
>>> objs = list_models(
|
|
236
|
+
... project="my-project"
|
|
237
|
+
... )
|
|
232
238
|
"""
|
|
233
239
|
return context_processor.list_context_entities(
|
|
234
240
|
project=project,
|
|
@@ -264,7 +270,9 @@ def import_model(
|
|
|
264
270
|
|
|
265
271
|
Examples
|
|
266
272
|
--------
|
|
267
|
-
>>> obj = import_model(
|
|
273
|
+
>>> obj = import_model(
|
|
274
|
+
... "my-model.yaml"
|
|
275
|
+
... )
|
|
268
276
|
"""
|
|
269
277
|
return context_processor.import_context_entity(
|
|
270
278
|
file,
|
|
@@ -290,7 +298,9 @@ def load_model(file: str) -> Model:
|
|
|
290
298
|
|
|
291
299
|
Examples
|
|
292
300
|
--------
|
|
293
|
-
>>> obj = load_model(
|
|
301
|
+
>>> obj = load_model(
|
|
302
|
+
... "my-model.yaml"
|
|
303
|
+
... )
|
|
294
304
|
"""
|
|
295
305
|
return context_processor.load_context_entity(file)
|
|
296
306
|
|
|
@@ -311,7 +321,9 @@ def update_model(entity: Model) -> Model:
|
|
|
311
321
|
|
|
312
322
|
Examples
|
|
313
323
|
--------
|
|
314
|
-
>>> obj = get_model(
|
|
324
|
+
>>> obj = get_model(
|
|
325
|
+
... "store://my-model-key"
|
|
326
|
+
... )
|
|
315
327
|
"""
|
|
316
328
|
return context_processor.update_context_entity(
|
|
317
329
|
project=entity.project,
|
|
@@ -355,7 +367,9 @@ def delete_model(
|
|
|
355
367
|
Examples
|
|
356
368
|
--------
|
|
357
369
|
If delete_all_versions is False:
|
|
358
|
-
>>> obj = delete_model(
|
|
370
|
+
>>> obj = delete_model(
|
|
371
|
+
... "store://my-model-key"
|
|
372
|
+
... )
|
|
359
373
|
|
|
360
374
|
Otherwise:
|
|
361
375
|
>>> obj = delete_model("my-model-name",
|
|
@@ -72,7 +72,7 @@ from digitalhub.entities.workflow.crud import (
|
|
|
72
72
|
new_workflow,
|
|
73
73
|
update_workflow,
|
|
74
74
|
)
|
|
75
|
-
from digitalhub.factory.
|
|
75
|
+
from digitalhub.factory.entity import entity_factory
|
|
76
76
|
from digitalhub.stores.client.api import get_client
|
|
77
77
|
from digitalhub.utils.exceptions import BackendError, EntityAlreadyExistsError, EntityError
|
|
78
78
|
from digitalhub.utils.generic_utils import get_timestamp
|
|
@@ -350,7 +350,7 @@ class Project(Entity):
|
|
|
350
350
|
entity["metadata"]["version"] = new_id
|
|
351
351
|
|
|
352
352
|
try:
|
|
353
|
-
|
|
353
|
+
entity_factory.build_entity_from_dict(entity).save()
|
|
354
354
|
except EntityAlreadyExistsError:
|
|
355
355
|
pass
|
|
356
356
|
|
|
@@ -563,7 +563,9 @@ class Project(Entity):
|
|
|
563
563
|
Examples
|
|
564
564
|
--------
|
|
565
565
|
Using entity key:
|
|
566
|
-
>>> obj = project.get_artifact(
|
|
566
|
+
>>> obj = project.get_artifact(
|
|
567
|
+
... "store://my-artifact-key"
|
|
568
|
+
... )
|
|
567
569
|
|
|
568
570
|
Using entity name:
|
|
569
571
|
>>> obj = project.get_artifact("my-artifact-name"
|
|
@@ -601,10 +603,14 @@ class Project(Entity):
|
|
|
601
603
|
Examples
|
|
602
604
|
--------
|
|
603
605
|
Using entity key:
|
|
604
|
-
>>> obj = project.get_artifact_versions(
|
|
606
|
+
>>> obj = project.get_artifact_versions(
|
|
607
|
+
... "store://my-artifact-key"
|
|
608
|
+
... )
|
|
605
609
|
|
|
606
610
|
Using entity name:
|
|
607
|
-
>>> obj = project.get_artifact_versions(
|
|
611
|
+
>>> obj = project.get_artifact_versions(
|
|
612
|
+
... "my-artifact-name"
|
|
613
|
+
... )
|
|
608
614
|
"""
|
|
609
615
|
return get_artifact_versions(identifier, project=self.name, **kwargs)
|
|
610
616
|
|
|
@@ -653,7 +659,9 @@ class Project(Entity):
|
|
|
653
659
|
|
|
654
660
|
Examples
|
|
655
661
|
--------
|
|
656
|
-
>>> obj = project.import_artifact(
|
|
662
|
+
>>> obj = project.import_artifact(
|
|
663
|
+
... "my-artifact.yaml"
|
|
664
|
+
... )
|
|
657
665
|
"""
|
|
658
666
|
return import_artifact(file, key, reset_id, self.name)
|
|
659
667
|
|
|
@@ -673,7 +681,9 @@ class Project(Entity):
|
|
|
673
681
|
|
|
674
682
|
Examples
|
|
675
683
|
--------
|
|
676
|
-
>>> obj = project.update_artifact(
|
|
684
|
+
>>> obj = project.update_artifact(
|
|
685
|
+
... obj
|
|
686
|
+
... )
|
|
677
687
|
"""
|
|
678
688
|
if entity.project != self.name:
|
|
679
689
|
raise ValueError(f"Entity {entity.name} is not in project {self.name}.")
|
|
@@ -708,7 +718,9 @@ class Project(Entity):
|
|
|
708
718
|
Examples
|
|
709
719
|
--------
|
|
710
720
|
If delete_all_versions is False:
|
|
711
|
-
>>> project.delete_artifact(
|
|
721
|
+
>>> project.delete_artifact(
|
|
722
|
+
... "store://my-artifact-key"
|
|
723
|
+
... )
|
|
712
724
|
|
|
713
725
|
Otherwise:
|
|
714
726
|
>>> project.delete_artifact("my-artifact-name",
|
|
@@ -869,7 +881,9 @@ class Project(Entity):
|
|
|
869
881
|
Examples
|
|
870
882
|
--------
|
|
871
883
|
Using entity key:
|
|
872
|
-
>>> obj = project.get_dataitem(
|
|
884
|
+
>>> obj = project.get_dataitem(
|
|
885
|
+
... "store://my-dataitem-key"
|
|
886
|
+
... )
|
|
873
887
|
|
|
874
888
|
Using entity name:
|
|
875
889
|
>>> obj = project.get_dataitem("my-dataitem-name"
|
|
@@ -907,10 +921,14 @@ class Project(Entity):
|
|
|
907
921
|
Examples
|
|
908
922
|
--------
|
|
909
923
|
Using entity key:
|
|
910
|
-
>>> obj = project.get_dataitem_versions(
|
|
924
|
+
>>> obj = project.get_dataitem_versions(
|
|
925
|
+
... "store://my-dataitem-key"
|
|
926
|
+
... )
|
|
911
927
|
|
|
912
928
|
Using entity name:
|
|
913
|
-
>>> obj = project.get_dataitem_versions(
|
|
929
|
+
>>> obj = project.get_dataitem_versions(
|
|
930
|
+
... "my-dataitem-name"
|
|
931
|
+
... )
|
|
914
932
|
"""
|
|
915
933
|
return get_dataitem_versions(identifier, project=self.name, **kwargs)
|
|
916
934
|
|
|
@@ -959,7 +977,9 @@ class Project(Entity):
|
|
|
959
977
|
|
|
960
978
|
Examples
|
|
961
979
|
--------
|
|
962
|
-
>>> obj = project.import_dataitem(
|
|
980
|
+
>>> obj = project.import_dataitem(
|
|
981
|
+
... "my-dataitem.yaml"
|
|
982
|
+
... )
|
|
963
983
|
"""
|
|
964
984
|
return import_dataitem(file, key, reset_id, self.name)
|
|
965
985
|
|
|
@@ -979,7 +999,9 @@ class Project(Entity):
|
|
|
979
999
|
|
|
980
1000
|
Examples
|
|
981
1001
|
--------
|
|
982
|
-
>>> obj = project.update_dataitem(
|
|
1002
|
+
>>> obj = project.update_dataitem(
|
|
1003
|
+
... obj
|
|
1004
|
+
... )
|
|
983
1005
|
"""
|
|
984
1006
|
if entity.project != self.name:
|
|
985
1007
|
raise ValueError(f"Entity {entity.name} is not in project {self.name}.")
|
|
@@ -1014,7 +1036,9 @@ class Project(Entity):
|
|
|
1014
1036
|
Examples
|
|
1015
1037
|
--------
|
|
1016
1038
|
If delete_all_versions is False:
|
|
1017
|
-
>>> project.delete_dataitem(
|
|
1039
|
+
>>> project.delete_dataitem(
|
|
1040
|
+
... "store://my-dataitem-key"
|
|
1041
|
+
... )
|
|
1018
1042
|
|
|
1019
1043
|
Otherwise:
|
|
1020
1044
|
>>> project.delete_dataitem("my-dataitem-name",
|
|
@@ -1164,7 +1188,9 @@ class Project(Entity):
|
|
|
1164
1188
|
Examples
|
|
1165
1189
|
--------
|
|
1166
1190
|
Using entity key:
|
|
1167
|
-
>>> obj = project.get_model(
|
|
1191
|
+
>>> obj = project.get_model(
|
|
1192
|
+
... "store://my-model-key"
|
|
1193
|
+
... )
|
|
1168
1194
|
|
|
1169
1195
|
Using entity name:
|
|
1170
1196
|
>>> obj = project.get_model("my-model-name"
|
|
@@ -1202,10 +1228,14 @@ class Project(Entity):
|
|
|
1202
1228
|
Examples
|
|
1203
1229
|
--------
|
|
1204
1230
|
Using entity key:
|
|
1205
|
-
>>> obj = project.get_model_versions(
|
|
1231
|
+
>>> obj = project.get_model_versions(
|
|
1232
|
+
... "store://my-model-key"
|
|
1233
|
+
... )
|
|
1206
1234
|
|
|
1207
1235
|
Using entity name:
|
|
1208
|
-
>>> obj = project.get_model_versions(
|
|
1236
|
+
>>> obj = project.get_model_versions(
|
|
1237
|
+
... "my-model-name"
|
|
1238
|
+
... )
|
|
1209
1239
|
"""
|
|
1210
1240
|
return get_model_versions(identifier, project=self.name, **kwargs)
|
|
1211
1241
|
|
|
@@ -1254,7 +1284,9 @@ class Project(Entity):
|
|
|
1254
1284
|
|
|
1255
1285
|
Examples
|
|
1256
1286
|
--------
|
|
1257
|
-
>>> obj = project.import_model(
|
|
1287
|
+
>>> obj = project.import_model(
|
|
1288
|
+
... "my-model.yaml"
|
|
1289
|
+
... )
|
|
1258
1290
|
"""
|
|
1259
1291
|
return import_model(file, key, reset_id, self.name)
|
|
1260
1292
|
|
|
@@ -1274,7 +1306,9 @@ class Project(Entity):
|
|
|
1274
1306
|
|
|
1275
1307
|
Examples
|
|
1276
1308
|
--------
|
|
1277
|
-
>>> obj = project.update_model(
|
|
1309
|
+
>>> obj = project.update_model(
|
|
1310
|
+
... obj
|
|
1311
|
+
... )
|
|
1278
1312
|
"""
|
|
1279
1313
|
if entity.project != self.name:
|
|
1280
1314
|
raise ValueError(f"Entity {entity.name} is not in project {self.name}.")
|
|
@@ -1309,7 +1343,9 @@ class Project(Entity):
|
|
|
1309
1343
|
Examples
|
|
1310
1344
|
--------
|
|
1311
1345
|
If delete_all_versions is False:
|
|
1312
|
-
>>> project.delete_model(
|
|
1346
|
+
>>> project.delete_model(
|
|
1347
|
+
... "store://my-model-key"
|
|
1348
|
+
... )
|
|
1313
1349
|
|
|
1314
1350
|
Otherwise:
|
|
1315
1351
|
>>> project.delete_model("my-model-name",
|
|
@@ -1410,7 +1446,9 @@ class Project(Entity):
|
|
|
1410
1446
|
Examples
|
|
1411
1447
|
--------
|
|
1412
1448
|
Using entity key:
|
|
1413
|
-
>>> obj = project.get_function(
|
|
1449
|
+
>>> obj = project.get_function(
|
|
1450
|
+
... "store://my-function-key"
|
|
1451
|
+
... )
|
|
1414
1452
|
|
|
1415
1453
|
Using entity name:
|
|
1416
1454
|
>>> obj = project.get_function("my-function-name"
|
|
@@ -1448,10 +1486,14 @@ class Project(Entity):
|
|
|
1448
1486
|
Examples
|
|
1449
1487
|
--------
|
|
1450
1488
|
Using entity key:
|
|
1451
|
-
>>> obj = project.get_function_versions(
|
|
1489
|
+
>>> obj = project.get_function_versions(
|
|
1490
|
+
... "store://my-function-key"
|
|
1491
|
+
... )
|
|
1452
1492
|
|
|
1453
1493
|
Using entity name:
|
|
1454
|
-
>>> obj = project.get_function_versions(
|
|
1494
|
+
>>> obj = project.get_function_versions(
|
|
1495
|
+
... "my-function-name"
|
|
1496
|
+
... )
|
|
1455
1497
|
"""
|
|
1456
1498
|
return get_function_versions(identifier, project=self.name, **kwargs)
|
|
1457
1499
|
|
|
@@ -1500,7 +1542,9 @@ class Project(Entity):
|
|
|
1500
1542
|
|
|
1501
1543
|
Examples
|
|
1502
1544
|
--------
|
|
1503
|
-
>>> obj = project.import_function(
|
|
1545
|
+
>>> obj = project.import_function(
|
|
1546
|
+
... "my-function.yaml"
|
|
1547
|
+
... )
|
|
1504
1548
|
"""
|
|
1505
1549
|
return import_function(file, key, reset_id, self.name)
|
|
1506
1550
|
|
|
@@ -1520,7 +1564,9 @@ class Project(Entity):
|
|
|
1520
1564
|
|
|
1521
1565
|
Examples
|
|
1522
1566
|
--------
|
|
1523
|
-
>>> obj = project.update_function(
|
|
1567
|
+
>>> obj = project.update_function(
|
|
1568
|
+
... obj
|
|
1569
|
+
... )
|
|
1524
1570
|
"""
|
|
1525
1571
|
if entity.project != self.name:
|
|
1526
1572
|
raise ValueError(f"Entity {entity.name} is not in project {self.name}.")
|
|
@@ -1558,7 +1604,9 @@ class Project(Entity):
|
|
|
1558
1604
|
Examples
|
|
1559
1605
|
--------
|
|
1560
1606
|
If delete_all_versions is False:
|
|
1561
|
-
>>> project.delete_function(
|
|
1607
|
+
>>> project.delete_function(
|
|
1608
|
+
... "store://my-function-key"
|
|
1609
|
+
... )
|
|
1562
1610
|
|
|
1563
1611
|
Otherwise:
|
|
1564
1612
|
>>> project.delete_function("my-function-name",
|
|
@@ -1659,7 +1707,9 @@ class Project(Entity):
|
|
|
1659
1707
|
Examples
|
|
1660
1708
|
--------
|
|
1661
1709
|
Using entity key:
|
|
1662
|
-
>>> obj = project.get_workflow(
|
|
1710
|
+
>>> obj = project.get_workflow(
|
|
1711
|
+
... "store://my-workflow-key"
|
|
1712
|
+
... )
|
|
1663
1713
|
|
|
1664
1714
|
Using entity name:
|
|
1665
1715
|
>>> obj = project.get_workflow("my-workflow-name"
|
|
@@ -1697,10 +1747,14 @@ class Project(Entity):
|
|
|
1697
1747
|
Examples
|
|
1698
1748
|
--------
|
|
1699
1749
|
Using entity key:
|
|
1700
|
-
>>> obj = project.get_workflow_versions(
|
|
1750
|
+
>>> obj = project.get_workflow_versions(
|
|
1751
|
+
... "store://my-workflow-key"
|
|
1752
|
+
... )
|
|
1701
1753
|
|
|
1702
1754
|
Using entity name:
|
|
1703
|
-
>>> obj = project.get_workflow_versions(
|
|
1755
|
+
>>> obj = project.get_workflow_versions(
|
|
1756
|
+
... "my-workflow-name"
|
|
1757
|
+
... )
|
|
1704
1758
|
"""
|
|
1705
1759
|
return get_workflow_versions(identifier, project=self.name, **kwargs)
|
|
1706
1760
|
|
|
@@ -1749,7 +1803,9 @@ class Project(Entity):
|
|
|
1749
1803
|
|
|
1750
1804
|
Examples
|
|
1751
1805
|
--------
|
|
1752
|
-
>>> obj = project.import_workflow(
|
|
1806
|
+
>>> obj = project.import_workflow(
|
|
1807
|
+
... "my-workflow.yaml"
|
|
1808
|
+
... )
|
|
1753
1809
|
"""
|
|
1754
1810
|
return import_workflow(file, key, reset_id, self.name)
|
|
1755
1811
|
|
|
@@ -1769,7 +1825,9 @@ class Project(Entity):
|
|
|
1769
1825
|
|
|
1770
1826
|
Examples
|
|
1771
1827
|
--------
|
|
1772
|
-
>>> obj = project.update_workflow(
|
|
1828
|
+
>>> obj = project.update_workflow(
|
|
1829
|
+
... obj
|
|
1830
|
+
... )
|
|
1773
1831
|
"""
|
|
1774
1832
|
if entity.project != self.name:
|
|
1775
1833
|
raise ValueError(f"Entity {entity.name} is not in project {self.name}.")
|
|
@@ -1807,7 +1865,9 @@ class Project(Entity):
|
|
|
1807
1865
|
Examples
|
|
1808
1866
|
--------
|
|
1809
1867
|
If delete_all_versions is False:
|
|
1810
|
-
>>> project.delete_workflow(
|
|
1868
|
+
>>> project.delete_workflow(
|
|
1869
|
+
... "store://my-workflow-key"
|
|
1870
|
+
... )
|
|
1811
1871
|
|
|
1812
1872
|
Otherwise:
|
|
1813
1873
|
>>> project.delete_workflow("my-workflow-name",
|
|
@@ -1906,7 +1966,9 @@ class Project(Entity):
|
|
|
1906
1966
|
Examples
|
|
1907
1967
|
--------
|
|
1908
1968
|
Using entity key:
|
|
1909
|
-
>>> obj = project.get_secret(
|
|
1969
|
+
>>> obj = project.get_secret(
|
|
1970
|
+
... "store://my-secret-key"
|
|
1971
|
+
... )
|
|
1910
1972
|
|
|
1911
1973
|
Using entity name:
|
|
1912
1974
|
>>> obj = project.get_secret("my-secret-name"
|
|
@@ -1944,10 +2006,14 @@ class Project(Entity):
|
|
|
1944
2006
|
Examples
|
|
1945
2007
|
--------
|
|
1946
2008
|
Using entity key:
|
|
1947
|
-
>>> obj = project.get_secret_versions(
|
|
2009
|
+
>>> obj = project.get_secret_versions(
|
|
2010
|
+
... "store://my-secret-key"
|
|
2011
|
+
... )
|
|
1948
2012
|
|
|
1949
2013
|
Using entity name:
|
|
1950
|
-
>>> obj = project.get_secret_versions(
|
|
2014
|
+
>>> obj = project.get_secret_versions(
|
|
2015
|
+
... "my-secret-name"
|
|
2016
|
+
... )
|
|
1951
2017
|
"""
|
|
1952
2018
|
return get_secret_versions(identifier, project=self.name, **kwargs)
|
|
1953
2019
|
|
|
@@ -1996,7 +2062,9 @@ class Project(Entity):
|
|
|
1996
2062
|
|
|
1997
2063
|
Examples
|
|
1998
2064
|
--------
|
|
1999
|
-
>>> obj = project.import_secret(
|
|
2065
|
+
>>> obj = project.import_secret(
|
|
2066
|
+
... "my-secret.yaml"
|
|
2067
|
+
... )
|
|
2000
2068
|
"""
|
|
2001
2069
|
return import_secret(file, key, reset_id, self.name)
|
|
2002
2070
|
|
|
@@ -2016,7 +2084,9 @@ class Project(Entity):
|
|
|
2016
2084
|
|
|
2017
2085
|
Examples
|
|
2018
2086
|
--------
|
|
2019
|
-
>>> obj = project.update_secret(
|
|
2087
|
+
>>> obj = project.update_secret(
|
|
2088
|
+
... obj
|
|
2089
|
+
... )
|
|
2020
2090
|
"""
|
|
2021
2091
|
if entity.project != self.name:
|
|
2022
2092
|
raise ValueError(f"Entity {entity.name} is not in project {self.name}.")
|
|
@@ -2051,7 +2121,9 @@ class Project(Entity):
|
|
|
2051
2121
|
Examples
|
|
2052
2122
|
--------
|
|
2053
2123
|
If delete_all_versions is False:
|
|
2054
|
-
>>> project.delete_secret(
|
|
2124
|
+
>>> project.delete_secret(
|
|
2125
|
+
... "store://my-secret-key"
|
|
2126
|
+
... )
|
|
2055
2127
|
|
|
2056
2128
|
Otherwise:
|
|
2057
2129
|
>>> project.delete_secret("my-secret-name",
|
|
@@ -2093,10 +2165,16 @@ class Project(Entity):
|
|
|
2093
2165
|
Examples
|
|
2094
2166
|
--------
|
|
2095
2167
|
Using entity key:
|
|
2096
|
-
>>> obj = project.get_run(
|
|
2168
|
+
>>> obj = project.get_run(
|
|
2169
|
+
... "store://my-secret-key"
|
|
2170
|
+
... )
|
|
2097
2171
|
|
|
2098
2172
|
Using entity ID:
|
|
2099
|
-
>>> obj =
|
|
2173
|
+
>>> obj = (
|
|
2174
|
+
... project.get_run(
|
|
2175
|
+
... "123"
|
|
2176
|
+
... )
|
|
2177
|
+
... )
|
|
2100
2178
|
"""
|
|
2101
2179
|
obj = get_run(
|
|
2102
2180
|
identifier=identifier,
|
|
@@ -2148,7 +2226,9 @@ class Project(Entity):
|
|
|
2148
2226
|
|
|
2149
2227
|
Examples
|
|
2150
2228
|
--------
|
|
2151
|
-
>>> project.delete_run(
|
|
2229
|
+
>>> project.delete_run(
|
|
2230
|
+
... "store://my-run-key"
|
|
2231
|
+
... )
|
|
2152
2232
|
|
|
2153
2233
|
"""
|
|
2154
2234
|
delete_run(
|
|
@@ -59,7 +59,9 @@ def new_project(
|
|
|
59
59
|
|
|
60
60
|
Examples
|
|
61
61
|
--------
|
|
62
|
-
>>> obj = new_project(
|
|
62
|
+
>>> obj = new_project(
|
|
63
|
+
... "my-project"
|
|
64
|
+
... )
|
|
63
65
|
"""
|
|
64
66
|
if context is None:
|
|
65
67
|
context = "./"
|
|
@@ -103,7 +105,9 @@ def get_project(
|
|
|
103
105
|
|
|
104
106
|
Examples
|
|
105
107
|
--------
|
|
106
|
-
>>> obj = get_project(
|
|
108
|
+
>>> obj = get_project(
|
|
109
|
+
... "my-project"
|
|
110
|
+
... )
|
|
107
111
|
"""
|
|
108
112
|
obj = base_processor.read_project_entity(
|
|
109
113
|
entity_type=ENTITY_TYPE,
|
|
@@ -141,7 +145,9 @@ def import_project(
|
|
|
141
145
|
|
|
142
146
|
Examples
|
|
143
147
|
--------
|
|
144
|
-
>>> obj = import_project(
|
|
148
|
+
>>> obj = import_project(
|
|
149
|
+
... "my-project.yaml"
|
|
150
|
+
... )
|
|
145
151
|
"""
|
|
146
152
|
obj = base_processor.import_project_entity(
|
|
147
153
|
file=file,
|
|
@@ -175,7 +181,9 @@ def load_project(
|
|
|
175
181
|
|
|
176
182
|
Examples
|
|
177
183
|
--------
|
|
178
|
-
>>> obj = load_project(
|
|
184
|
+
>>> obj = load_project(
|
|
185
|
+
... "my-project.yaml"
|
|
186
|
+
... )
|
|
179
187
|
"""
|
|
180
188
|
obj = base_processor.load_project_entity(file=file, local=local)
|
|
181
189
|
return setup_project(obj, setup_kwargs)
|
|
@@ -267,7 +275,11 @@ def update_project(entity: Project, **kwargs) -> Project:
|
|
|
267
275
|
|
|
268
276
|
Examples
|
|
269
277
|
--------
|
|
270
|
-
>>> obj =
|
|
278
|
+
>>> obj = (
|
|
279
|
+
... update_project(
|
|
280
|
+
... obj
|
|
281
|
+
... )
|
|
282
|
+
... )
|
|
271
283
|
"""
|
|
272
284
|
return base_processor.update_project_entity(
|
|
273
285
|
entity_type=entity.ENTITY_TYPE,
|
|
@@ -308,7 +320,9 @@ def delete_project(
|
|
|
308
320
|
|
|
309
321
|
Examples
|
|
310
322
|
--------
|
|
311
|
-
>>> delete_project(
|
|
323
|
+
>>> delete_project(
|
|
324
|
+
... "my-project"
|
|
325
|
+
... )
|
|
312
326
|
"""
|
|
313
327
|
return base_processor.delete_project_entity(
|
|
314
328
|
entity_type=ENTITY_TYPE,
|