digitalhub 0.11.0b4__py3-none-any.whl → 0.11.0b6__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/_processors/context.py +6 -1
- digitalhub/entities/project/_base/models.py +2 -2
- digitalhub/entities/task/_base/models.py +2 -4
- digitalhub/stores/client/dhcore/configurator.py +2 -3
- digitalhub/stores/data/s3/enums.py +2 -3
- digitalhub/stores/data/s3/store.py +2 -2
- digitalhub/stores/data/utils.py +1 -1
- digitalhub/utils/file_utils.py +1 -1
- digitalhub/utils/generic_utils.py +37 -0
- {digitalhub-0.11.0b4.dist-info → digitalhub-0.11.0b6.dist-info}/METADATA +1 -1
- {digitalhub-0.11.0b4.dist-info → digitalhub-0.11.0b6.dist-info}/RECORD +13 -13
- {digitalhub-0.11.0b4.dist-info → digitalhub-0.11.0b6.dist-info}/WHEEL +0 -0
- {digitalhub-0.11.0b4.dist-info → digitalhub-0.11.0b6.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -128,8 +128,12 @@ class ContextEntityOperationsProcessor:
|
|
|
128
128
|
try:
|
|
129
129
|
new_obj.upload(source)
|
|
130
130
|
uploaded = True
|
|
131
|
-
|
|
131
|
+
msg = None
|
|
132
|
+
except Exception as e:
|
|
132
133
|
uploaded = False
|
|
134
|
+
msg = str(e)
|
|
135
|
+
|
|
136
|
+
new_obj.status.message = msg
|
|
133
137
|
|
|
134
138
|
# Update status after upload
|
|
135
139
|
if uploaded:
|
|
@@ -138,6 +142,7 @@ class ContextEntityOperationsProcessor:
|
|
|
138
142
|
else:
|
|
139
143
|
new_obj.status.state = State.ERROR.value
|
|
140
144
|
new_obj = self._update_material_entity(new_obj)
|
|
145
|
+
raise EntityError(msg)
|
|
141
146
|
|
|
142
147
|
return new_obj
|
|
143
148
|
|
|
@@ -4,7 +4,7 @@ from typing import Optional
|
|
|
4
4
|
|
|
5
5
|
from pydantic import BaseModel
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
_DEFAULT_FILES_STORE = "s3://datalake"
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class ProfileConfig(BaseModel):
|
|
@@ -12,7 +12,7 @@ class ProfileConfig(BaseModel):
|
|
|
12
12
|
Configuration profiles.
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
-
default_files_store: Optional[str] =
|
|
15
|
+
default_files_store: Optional[str] = _DEFAULT_FILES_STORE
|
|
16
16
|
|
|
17
17
|
def to_dict(self) -> dict:
|
|
18
18
|
return self.model_dump(by_alias=True, exclude_none=True)
|
|
@@ -20,9 +20,9 @@ class SpecEmptyDir(BaseModel):
|
|
|
20
20
|
Spec empty dir model.
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
size_limit: str
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
medium: Optional[str] = None
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class SpecPVC(BaseModel):
|
|
@@ -32,8 +32,6 @@ class SpecPVC(BaseModel):
|
|
|
32
32
|
|
|
33
33
|
size: str
|
|
34
34
|
|
|
35
|
-
storage_class: str
|
|
36
|
-
|
|
37
35
|
|
|
38
36
|
class Volume(BaseModel):
|
|
39
37
|
"""
|
|
@@ -297,7 +297,7 @@ class ClientDHCoreConfigurator:
|
|
|
297
297
|
DhcoreEnvVar.REFRESH_TOKEN.value,
|
|
298
298
|
DhcoreEnvVar.ACCESS_TOKEN.value,
|
|
299
299
|
DhcoreEnvVar.ISSUER.value,
|
|
300
|
-
|
|
300
|
+
DhcoreEnvVar.CLIENT_ID.value,
|
|
301
301
|
):
|
|
302
302
|
new_list.append(key.removeprefix("DHCORE_"))
|
|
303
303
|
else:
|
|
@@ -345,8 +345,7 @@ class ClientDHCoreConfigurator:
|
|
|
345
345
|
Response object.
|
|
346
346
|
"""
|
|
347
347
|
# Get client id
|
|
348
|
-
client_id =
|
|
349
|
-
# client_id = self._load_dhcore_oauth_vars(DhcoreEnvVar.CLIENT_ID.value)
|
|
348
|
+
client_id = self._load_dhcore_oauth_vars(DhcoreEnvVar.CLIENT_ID.value)
|
|
350
349
|
if client_id is None:
|
|
351
350
|
raise ClientError("Client id not set.")
|
|
352
351
|
|
|
@@ -8,10 +8,9 @@ class S3StoreEnv(Enum):
|
|
|
8
8
|
S3Store environment
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
|
-
ENDPOINT_URL = "
|
|
11
|
+
ENDPOINT_URL = "AWS_ENDPOINT_URL"
|
|
12
12
|
ACCESS_KEY_ID = "AWS_ACCESS_KEY_ID"
|
|
13
13
|
SECRET_ACCESS_KEY = "AWS_SECRET_ACCESS_KEY"
|
|
14
14
|
SESSION_TOKEN = "AWS_SESSION_TOKEN"
|
|
15
|
-
|
|
16
|
-
REGION = "S3_REGION"
|
|
15
|
+
REGION = "AWS_REGION"
|
|
17
16
|
SIGNATURE_VERSION = "S3_SIGNATURE_VERSION"
|
|
@@ -649,8 +649,8 @@ class S3Store(Store):
|
|
|
649
649
|
"""
|
|
650
650
|
try:
|
|
651
651
|
client.head_bucket(Bucket=bucket)
|
|
652
|
-
except (ClientError, NoCredentialsError):
|
|
653
|
-
raise StoreError("No access to s3 bucket!")
|
|
652
|
+
except (ClientError, NoCredentialsError) as err:
|
|
653
|
+
raise StoreError(f"No access to s3 bucket! Error: {err}")
|
|
654
654
|
|
|
655
655
|
@staticmethod
|
|
656
656
|
def _get_key(path: str) -> str:
|
digitalhub/stores/data/utils.py
CHANGED
|
@@ -28,7 +28,7 @@ def get_default_store(project: str) -> str:
|
|
|
28
28
|
raise ValueError(
|
|
29
29
|
"No default store found. "
|
|
30
30
|
"Please set a default store "
|
|
31
|
-
"in your environment (e.g. export DEFAULT_FILES_STORE=) "
|
|
31
|
+
f"in your environment (e.g. export {StoreEnv.DEFAULT_FILES_STORE.value}=) "
|
|
32
32
|
"or set it in project config."
|
|
33
33
|
)
|
|
34
34
|
return store
|
digitalhub/utils/file_utils.py
CHANGED
|
@@ -190,7 +190,7 @@ def get_file_info_from_s3(path: str, metadata: dict) -> None | dict:
|
|
|
190
190
|
if size < file_size_limit_multipart:
|
|
191
191
|
file_hash = "md5:" + file_hash
|
|
192
192
|
else:
|
|
193
|
-
file_hash = "
|
|
193
|
+
file_hash = "ETag:" + file_hash
|
|
194
194
|
|
|
195
195
|
name = get_path_name(path)
|
|
196
196
|
content_type = metadata["ContentType"]
|
|
@@ -8,6 +8,7 @@ from enum import Enum, EnumMeta
|
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
from types import MappingProxyType
|
|
10
10
|
from typing import Any, Callable
|
|
11
|
+
from warnings import warn
|
|
11
12
|
from zipfile import ZipFile
|
|
12
13
|
|
|
13
14
|
import numpy as np
|
|
@@ -235,3 +236,39 @@ def list_enum(enum: EnumMeta) -> list[Any]:
|
|
|
235
236
|
"""
|
|
236
237
|
vals: MappingProxyType[str, Enum] = enum.__members__
|
|
237
238
|
return [member.value for member in vals.values()]
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def carriage_return_warn(string: str) -> None:
|
|
242
|
+
"""
|
|
243
|
+
Print a warning message if string contains a carriage return (\r\n).
|
|
244
|
+
|
|
245
|
+
Parameters
|
|
246
|
+
----------
|
|
247
|
+
string : str
|
|
248
|
+
The string to check.
|
|
249
|
+
|
|
250
|
+
Returns
|
|
251
|
+
-------
|
|
252
|
+
None
|
|
253
|
+
"""
|
|
254
|
+
if "\r\n" in string:
|
|
255
|
+
warn("String contains a carriage return. It may not be parsed correctly from remote runtimes.")
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
def read_source(path: str) -> str:
|
|
259
|
+
"""
|
|
260
|
+
Read a file.
|
|
261
|
+
|
|
262
|
+
Parameters
|
|
263
|
+
----------
|
|
264
|
+
path : Path
|
|
265
|
+
Path to the file.
|
|
266
|
+
|
|
267
|
+
Returns
|
|
268
|
+
-------
|
|
269
|
+
str
|
|
270
|
+
File content.
|
|
271
|
+
"""
|
|
272
|
+
text = read_text(path)
|
|
273
|
+
carriage_return_warn(text)
|
|
274
|
+
return encode_string(text)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: digitalhub
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.0b6
|
|
4
4
|
Summary: Python SDK for Digitalhub
|
|
5
5
|
Project-URL: Homepage, https://github.com/scc-digitalhub/digitalhub-sdk
|
|
6
6
|
Author-email: Fondazione Bruno Kessler <dslab@fbk.eu>, Matteo Martini <mmartini@fbk.eu>
|
|
@@ -43,7 +43,7 @@ digitalhub/entities/_commons/types.py,sha256=bwK-2iQHL2gdtOPfRcXWBRWqqS1Tic6ywRQ
|
|
|
43
43
|
digitalhub/entities/_commons/utils.py,sha256=354ZL5wKvijJ2A25pM0xK5JMhgTyZF6urjHZNjosINI,1846
|
|
44
44
|
digitalhub/entities/_processors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
45
|
digitalhub/entities/_processors/base.py,sha256=K_XfwgzsYWKMQ5Que1C_oTwQU67jQJPbA98g26OND58,13440
|
|
46
|
-
digitalhub/entities/_processors/context.py,sha256=
|
|
46
|
+
digitalhub/entities/_processors/context.py,sha256=euGE8yM2nthFbq7PNcTUjGIR5kHNCmOyNM1m7u957No,34571
|
|
47
47
|
digitalhub/entities/_processors/utils.py,sha256=byhWUv3CfaS-RNPu5FdOdNNCakaKh5zNQFziJvwZdkY,3791
|
|
48
48
|
digitalhub/entities/artifact/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
49
|
digitalhub/entities/artifact/crud.py,sha256=smyZLWfkBEH1pxwFJXhoqfFpLrKeeWTqXmahyPj8QAY,7983
|
|
@@ -126,7 +126,7 @@ digitalhub/entities/project/utils.py,sha256=zwm82RaIVLJNYrg70jRnGdsP0IVWW86y3OrH
|
|
|
126
126
|
digitalhub/entities/project/_base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
127
127
|
digitalhub/entities/project/_base/builder.py,sha256=AnD5BNVYBrj8W3rtLUZe5tptJWzt_UKDielogLdEpAE,3776
|
|
128
128
|
digitalhub/entities/project/_base/entity.py,sha256=LmHXEiSwJmU6Bkqw-OSQF4JwYkiVPDkknOBA3lf53oU,57210
|
|
129
|
-
digitalhub/entities/project/_base/models.py,sha256=
|
|
129
|
+
digitalhub/entities/project/_base/models.py,sha256=9_MYF468b_mwhHXb7VnIORihM9kJaEWr0-LwUgc9Nmg,374
|
|
130
130
|
digitalhub/entities/project/_base/spec.py,sha256=742_h3q8yvUGqW63vym9OO8mT4TVMgd9Q5TXXwMh1kU,1669
|
|
131
131
|
digitalhub/entities/project/_base/status.py,sha256=w1Hj_yFwr_5X7ZH7SmtZRto4qUdCWb010viFfvbqX48,168
|
|
132
132
|
digitalhub/entities/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -148,7 +148,7 @@ digitalhub/entities/task/crud.py,sha256=-tQNtWU7r3nfoVn3WmmrHBvSyHpGqQIa1_3Ges4k
|
|
|
148
148
|
digitalhub/entities/task/_base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
149
149
|
digitalhub/entities/task/_base/builder.py,sha256=21WEbycCR8yaOPcLLcAITaoQ4ZmBNXJXB-Oy0VfSPrg,2358
|
|
150
150
|
digitalhub/entities/task/_base/entity.py,sha256=g08i-iexrcfuYAOz_O4Nw6tfLEDprTst05b9ZvjJUVc,3524
|
|
151
|
-
digitalhub/entities/task/_base/models.py,sha256=
|
|
151
|
+
digitalhub/entities/task/_base/models.py,sha256=HmR8dei9ivF0JYbDlICkAIuQlhAD_ilwwE1fymkr-_c,5556
|
|
152
152
|
digitalhub/entities/task/_base/spec.py,sha256=4JsbQxx05UYjAerSNBCrLSjwMLYeMSqgPIYdkJhH7ik,2500
|
|
153
153
|
digitalhub/entities/task/_base/status.py,sha256=FCSSQscQ0dHEpXdc5vSrIkTXon9FNNOr0M1KVh2ZVAA,162
|
|
154
154
|
digitalhub/entities/task/_base/utils.py,sha256=faeAN7r_5q0KWDj1vrbVvFMcCpeMw7fK7vGScSpFZCI,448
|
|
@@ -190,7 +190,7 @@ digitalhub/stores/client/_base/params_builder.py,sha256=lCk4WE6DqvGP7-cx0anZEC8G
|
|
|
190
190
|
digitalhub/stores/client/dhcore/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
191
191
|
digitalhub/stores/client/dhcore/api_builder.py,sha256=J1kOMw4B4_PZKkEs7GPNcEkd1w-ZyJeB9G1UBZiMbl0,3975
|
|
192
192
|
digitalhub/stores/client/dhcore/client.py,sha256=SdwtCZ3HsQIxzYGUI3BPbwDEeRbcdpMliQNMWMEV4MA,9890
|
|
193
|
-
digitalhub/stores/client/dhcore/configurator.py,sha256=
|
|
193
|
+
digitalhub/stores/client/dhcore/configurator.py,sha256=lEZISBH_kKWpbf4z5YX_qQuiQzny_5FP2_iBIgD-5cY,11193
|
|
194
194
|
digitalhub/stores/client/dhcore/enums.py,sha256=kaVXZTTa2WmsFbcc1CKWNLOM0JtUtcjL-KpspnTOhEE,523
|
|
195
195
|
digitalhub/stores/client/dhcore/error_parser.py,sha256=GJUUkhp12cvC_LBIrC0teh4msmyb5WFxY2g4WNOkUwM,3305
|
|
196
196
|
digitalhub/stores/client/dhcore/key_builder.py,sha256=YuSS5tRNRJTYlH14buetFSCU_bLuBBKLqMFO3MQ6r4g,1324
|
|
@@ -213,7 +213,7 @@ digitalhub/stores/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
213
213
|
digitalhub/stores/data/api.py,sha256=R-yBTWpLDrFfcFAju0PJVl0_CDROM8lV2QHKtIMwGrI,543
|
|
214
214
|
digitalhub/stores/data/builder.py,sha256=fh1JFFos7TpfgWlEWL9WmIEdrpt4t1dQU2Ivq8qE4QE,2291
|
|
215
215
|
digitalhub/stores/data/enums.py,sha256=8KyVhA5jTffomloR9pwR9FX21Dd3e9h2_qFCsVfd9yo,197
|
|
216
|
-
digitalhub/stores/data/utils.py,sha256
|
|
216
|
+
digitalhub/stores/data/utils.py,sha256=-pzN9JOrS_xz6Qc7Q2M7xI7Ksth31DFnF9LZeuvFBig,951
|
|
217
217
|
digitalhub/stores/data/_base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
218
218
|
digitalhub/stores/data/_base/store.py,sha256=VC1r7b9EIoObuG2DiqtFk2DQDSOgaS9jYL_UmiOTMHg,5241
|
|
219
219
|
digitalhub/stores/data/local/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -222,8 +222,8 @@ digitalhub/stores/data/remote/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
|
222
222
|
digitalhub/stores/data/remote/store.py,sha256=9KCFk8Fz1Mr7AK8gEITMh2sMw_jQldNPaVpk5_Oko9w,6098
|
|
223
223
|
digitalhub/stores/data/s3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
224
224
|
digitalhub/stores/data/s3/configurator.py,sha256=QowR285g3FBY6IktTLq0e8Y3XJdXL_eutzfM2mumLY8,3648
|
|
225
|
-
digitalhub/stores/data/s3/enums.py,sha256=
|
|
226
|
-
digitalhub/stores/data/s3/store.py,sha256=
|
|
225
|
+
digitalhub/stores/data/s3/enums.py,sha256=lgqcuCMbO00Ic8thcELifoebUL5Zqn1hb6hkos1v8ps,364
|
|
226
|
+
digitalhub/stores/data/s3/store.py,sha256=2DXDywVRFMoU24FWHXcqIToP9ZU2JikuabdbWAwLi0s,19685
|
|
227
227
|
digitalhub/stores/data/s3/utils.py,sha256=vkgYL9auoyvPtWay50biIfSJ1T4gZT4CmpJdq83L4t8,1650
|
|
228
228
|
digitalhub/stores/data/sql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
229
229
|
digitalhub/stores/data/sql/configurator.py,sha256=VCGukcuVpHDWHdL-hv4aPzyOXlhk-4tkjgIcfEIPXDM,3230
|
|
@@ -243,14 +243,14 @@ digitalhub/stores/readers/query/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
|
|
|
243
243
|
digitalhub/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
244
244
|
digitalhub/utils/enums.py,sha256=BjsLkUQ15W3KYTRYd0kuut77jTNMDBtTfJbixMReEew,269
|
|
245
245
|
digitalhub/utils/exceptions.py,sha256=CGiRXx6OvYpjg6d9yEn2OvyfF0FA5n1l8uH6loCDoAY,1233
|
|
246
|
-
digitalhub/utils/file_utils.py,sha256=
|
|
247
|
-
digitalhub/utils/generic_utils.py,sha256=
|
|
246
|
+
digitalhub/utils/file_utils.py,sha256=D6h8yt52nJMn_3Y3NDQM1waPCRM_zE48N2eJjyJmbjQ,5110
|
|
247
|
+
digitalhub/utils/generic_utils.py,sha256=gyFCRvujBreTarv7YCWbQ4WnFBPOeE3pNoaqvGVnrhw,5561
|
|
248
248
|
digitalhub/utils/git_utils.py,sha256=6vnZoJnL6uMZj0ZtHj3Tf-NYJsw3V9yitTJooSaFYEg,3407
|
|
249
249
|
digitalhub/utils/io_utils.py,sha256=8jD4Rp_b7LZEpY5JSMxVUowZsnifKnbGpHT5Hijx9-g,3299
|
|
250
250
|
digitalhub/utils/logger.py,sha256=ml3ne6D8wuRdNZ4F6ywmvWotSxjmZWnmKgNiuHb4R5M,437
|
|
251
251
|
digitalhub/utils/types.py,sha256=x8zXsbivD8vdaNeNRZLKOPvGbz6d-59nncuvO0FsueY,109
|
|
252
252
|
digitalhub/utils/uri_utils.py,sha256=wVkA2OcfHG5EcQOr9YxLJzo--VV6sjFjgXDNx-gP94I,4021
|
|
253
|
-
digitalhub-0.11.
|
|
254
|
-
digitalhub-0.11.
|
|
255
|
-
digitalhub-0.11.
|
|
256
|
-
digitalhub-0.11.
|
|
253
|
+
digitalhub-0.11.0b6.dist-info/METADATA,sha256=smZg332rpxDxzwAon79H6fxpKN-U82T-wLN8xQTO0sk,15037
|
|
254
|
+
digitalhub-0.11.0b6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
255
|
+
digitalhub-0.11.0b6.dist-info/licenses/LICENSE.txt,sha256=qmrTTXPlgU0kSRlRVbjhlyGs1IXs2QPxo_Y-Mn06J0k,11589
|
|
256
|
+
digitalhub-0.11.0b6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|