zenml-nightly 0.82.1.dev20250526__py3-none-any.whl → 0.82.1.dev20250527__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.
- zenml/VERSION +1 -1
- zenml/artifacts/utils.py +8 -0
- zenml/logging/step_logging.py +17 -4
- zenml/zen_server/cloud_utils.py +2 -2
- zenml/zen_server/rbac/zenml_cloud_rbac.py +4 -3
- zenml/zen_server/routers/steps_endpoints.py +3 -0
- {zenml_nightly-0.82.1.dev20250526.dist-info → zenml_nightly-0.82.1.dev20250527.dist-info}/METADATA +1 -1
- {zenml_nightly-0.82.1.dev20250526.dist-info → zenml_nightly-0.82.1.dev20250527.dist-info}/RECORD +11 -11
- {zenml_nightly-0.82.1.dev20250526.dist-info → zenml_nightly-0.82.1.dev20250527.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.82.1.dev20250526.dist-info → zenml_nightly-0.82.1.dev20250527.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.82.1.dev20250526.dist-info → zenml_nightly-0.82.1.dev20250527.dist-info}/entry_points.txt +0 -0
zenml/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.82.1.
|
1
|
+
0.82.1.dev20250527
|
zenml/artifacts/utils.py
CHANGED
@@ -16,6 +16,7 @@
|
|
16
16
|
import base64
|
17
17
|
import contextlib
|
18
18
|
import os
|
19
|
+
import re
|
19
20
|
import tempfile
|
20
21
|
import zipfile
|
21
22
|
from pathlib import Path
|
@@ -940,6 +941,13 @@ def _load_file_from_artifact_store(
|
|
940
941
|
)
|
941
942
|
|
942
943
|
|
944
|
+
def _strip_timestamp_from_multiline_string(
|
945
|
+
input: str,
|
946
|
+
pattern: str = r"^\[?\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} UTC\]?\s*",
|
947
|
+
) -> str:
|
948
|
+
return re.sub(pattern, "", input, flags=re.MULTILINE)
|
949
|
+
|
950
|
+
|
943
951
|
# --------------------
|
944
952
|
# Model Artifact Utils
|
945
953
|
# --------------------
|
zenml/logging/step_logging.py
CHANGED
@@ -28,6 +28,7 @@ from zenml.artifact_stores import BaseArtifactStore
|
|
28
28
|
from zenml.artifacts.utils import (
|
29
29
|
_load_artifact_store,
|
30
30
|
_load_file_from_artifact_store,
|
31
|
+
_strip_timestamp_from_multiline_string,
|
31
32
|
)
|
32
33
|
from zenml.constants import (
|
33
34
|
ENV_ZENML_DISABLE_STEP_NAMES_IN_LOGS,
|
@@ -117,6 +118,7 @@ def fetch_logs(
|
|
117
118
|
logs_uri: str,
|
118
119
|
offset: int = 0,
|
119
120
|
length: int = 1024 * 1024 * 16, # Default to 16MiB of data
|
121
|
+
strip_timestamp: bool = False,
|
120
122
|
) -> str:
|
121
123
|
"""Fetches the logs from the artifact store.
|
122
124
|
|
@@ -126,6 +128,7 @@ def fetch_logs(
|
|
126
128
|
logs_uri: The URI of the artifact.
|
127
129
|
offset: The offset from which to start reading.
|
128
130
|
length: The amount of bytes that should be read.
|
131
|
+
strip_timestamp: Whether to strip timestamps in logs or not
|
129
132
|
|
130
133
|
Returns:
|
131
134
|
The logs as a string.
|
@@ -136,9 +139,12 @@ def fetch_logs(
|
|
136
139
|
"""
|
137
140
|
|
138
141
|
def _read_file(
|
139
|
-
uri: str,
|
142
|
+
uri: str,
|
143
|
+
offset: int = 0,
|
144
|
+
length: Optional[int] = None,
|
145
|
+
strip_timestamp: bool = False,
|
140
146
|
) -> str:
|
141
|
-
|
147
|
+
file_content = str(
|
142
148
|
_load_file_from_artifact_store(
|
143
149
|
uri,
|
144
150
|
artifact_store=artifact_store,
|
@@ -147,16 +153,22 @@ def fetch_logs(
|
|
147
153
|
length=length,
|
148
154
|
).decode()
|
149
155
|
)
|
156
|
+
if strip_timestamp:
|
157
|
+
file_content = _strip_timestamp_from_multiline_string(file_content)
|
158
|
+
return file_content
|
150
159
|
|
151
160
|
artifact_store = _load_artifact_store(artifact_store_id, zen_store)
|
152
161
|
try:
|
153
162
|
if not artifact_store.isdir(logs_uri):
|
154
|
-
return _read_file(logs_uri, offset, length)
|
163
|
+
return _read_file(logs_uri, offset, length, strip_timestamp)
|
155
164
|
else:
|
156
165
|
files = artifact_store.listdir(logs_uri)
|
157
166
|
if len(files) == 1:
|
158
167
|
return _read_file(
|
159
|
-
os.path.join(logs_uri, str(files[0])),
|
168
|
+
os.path.join(logs_uri, str(files[0])),
|
169
|
+
offset,
|
170
|
+
length,
|
171
|
+
strip_timestamp,
|
160
172
|
)
|
161
173
|
else:
|
162
174
|
is_negative_offset = offset < 0
|
@@ -191,6 +203,7 @@ def fetch_logs(
|
|
191
203
|
os.path.join(logs_uri, str(file)),
|
192
204
|
offset,
|
193
205
|
length,
|
206
|
+
strip_timestamp,
|
194
207
|
)
|
195
208
|
)
|
196
209
|
offset = 0
|
zenml/zen_server/cloud_utils.py
CHANGED
@@ -40,7 +40,7 @@ class ZenMLCloudConnection:
|
|
40
40
|
method: str,
|
41
41
|
endpoint: str,
|
42
42
|
params: Optional[Dict[str, Any]] = None,
|
43
|
-
data:
|
43
|
+
data: Any = None,
|
44
44
|
) -> requests.Response:
|
45
45
|
"""Send a request using the active session.
|
46
46
|
|
@@ -132,7 +132,7 @@ class ZenMLCloudConnection:
|
|
132
132
|
self,
|
133
133
|
endpoint: str,
|
134
134
|
params: Optional[Dict[str, Any]] = None,
|
135
|
-
data:
|
135
|
+
data: Any = None,
|
136
136
|
) -> requests.Response:
|
137
137
|
"""Send a POST request using the active session.
|
138
138
|
|
@@ -64,11 +64,12 @@ class ZenMLCloudRBAC(RBACInterface):
|
|
64
64
|
|
65
65
|
params = {
|
66
66
|
"user_id": str(user.external_user_id),
|
67
|
-
"resources": resources,
|
68
67
|
"action": str(action),
|
69
68
|
}
|
70
|
-
response = self._connection.
|
71
|
-
endpoint=PERMISSIONS_ENDPOINT,
|
69
|
+
response = self._connection.post(
|
70
|
+
endpoint=PERMISSIONS_ENDPOINT,
|
71
|
+
params=params,
|
72
|
+
data=[str(resource) for resource in resources],
|
72
73
|
)
|
73
74
|
value = response.json()
|
74
75
|
|
@@ -251,6 +251,7 @@ def get_step_logs(
|
|
251
251
|
step_id: UUID,
|
252
252
|
offset: int = 0,
|
253
253
|
length: int = 1024 * 1024 * 16, # Default to 16MiB of data
|
254
|
+
strip_timestamp: bool = False,
|
254
255
|
_: AuthContext = Security(authorize),
|
255
256
|
) -> str:
|
256
257
|
"""Get the logs of a specific step.
|
@@ -259,6 +260,7 @@ def get_step_logs(
|
|
259
260
|
step_id: ID of the step for which to get the logs.
|
260
261
|
offset: The offset from which to start reading.
|
261
262
|
length: The amount of bytes that should be read.
|
263
|
+
strip_timestamp: Whether to strip the timestamp in logs or not.
|
262
264
|
|
263
265
|
Returns:
|
264
266
|
The logs of the step.
|
@@ -282,4 +284,5 @@ def get_step_logs(
|
|
282
284
|
logs_uri=logs.uri,
|
283
285
|
offset=offset,
|
284
286
|
length=length,
|
287
|
+
strip_timestamp=strip_timestamp,
|
285
288
|
)
|
{zenml_nightly-0.82.1.dev20250526.dist-info → zenml_nightly-0.82.1.dev20250527.dist-info}/RECORD
RENAMED
@@ -1,5 +1,5 @@
|
|
1
1
|
zenml/README.md,sha256=827dekbOWAs1BpW7VF1a4d7EbwPbjwccX-2zdXBENZo,1777
|
2
|
-
zenml/VERSION,sha256
|
2
|
+
zenml/VERSION,sha256=-wGxpLHmRzljSa9KO0HqAlwwblx2bkKt1yCBHUi-kA0,19
|
3
3
|
zenml/__init__.py,sha256=CKEyepFK-7akXYiMrNVh92Nb01Cjs23w4_YyI6sgdc8,2242
|
4
4
|
zenml/actions/__init__.py,sha256=mrt6wPo73iKRxK754_NqsGyJ3buW7RnVeIGXr1xEw8Y,681
|
5
5
|
zenml/actions/base_action.py,sha256=UcaHev6BTuLDwuswnyaPjdA8AgUqB5xPZ-lRtuvf2FU,25553
|
@@ -25,7 +25,7 @@ zenml/artifacts/external_artifact.py,sha256=7nLANV0vsGC36H1s_B_awX4hnZgXHCGIscQ2
|
|
25
25
|
zenml/artifacts/external_artifact_config.py,sha256=P172p0JOu8Xx1F8RCQut1dnRpt5lpWXGNqMbY-V90sI,3323
|
26
26
|
zenml/artifacts/preexisting_data_materializer.py,sha256=dcahDcHUD3Lvn0-6zE2BG84bkyo_ydAgzBWxtbyJJZQ,3325
|
27
27
|
zenml/artifacts/unmaterialized_artifact.py,sha256=JNPKq_sNifQx5wP8jEw7TGBEi26zwKirPGlWX9uxbJI,1300
|
28
|
-
zenml/artifacts/utils.py,sha256=
|
28
|
+
zenml/artifacts/utils.py,sha256=JEsqAKXsfJoK7TP2ycaVaTBu0O4UwDmQzFTpjoWEyqU,35468
|
29
29
|
zenml/cli/__init__.py,sha256=nxq4ifwLV5qT7Qghb42h02XUOcOihBkZp2xBqgiykM8,75670
|
30
30
|
zenml/cli/annotator.py,sha256=JRR7_TJOWKyiKGv1kwSjG1Ay6RBWPVgm0X-D0uSBlyE,6976
|
31
31
|
zenml/cli/artifact.py,sha256=7lsAS52DroBTFkFWxkyb-lIDOGP5jPL_Se_RDG_2jgg,9564
|
@@ -577,7 +577,7 @@ zenml/io/filesystem_registry.py,sha256=stujDg4a5k983WMwp3rj4Z4puiUco4REyVoIoMIpI
|
|
577
577
|
zenml/io/local_filesystem.py,sha256=xQTZPT5cpooptUV8KiifxZojS6pWCv1-6UUxitUYb_E,7386
|
578
578
|
zenml/logger.py,sha256=LMV2sMFQ-6JK9xEn6kEt1C9vAoQ0lwuHVM5XHIeKubE,6966
|
579
579
|
zenml/logging/__init__.py,sha256=lnqbOa31wAHwPP5f8vZazOrUwnP2QviLiIVwxoAefD8,975
|
580
|
-
zenml/logging/step_logging.py,sha256=
|
580
|
+
zenml/logging/step_logging.py,sha256=GApmyuFGybkj1rFbv8Ej3fNym2P4HzGKyUBKFu2YO90,20907
|
581
581
|
zenml/login/__init__.py,sha256=Evi7hq8tpUn57IM3iX3hYP0r8oIeEWUhS471TAOyVGs,644
|
582
582
|
zenml/login/credentials.py,sha256=RtLmYkFQ5trbprhsO8NCRKwBA136KzGoUWY52dZP9GA,12722
|
583
583
|
zenml/login/credentials_store.py,sha256=k55mNSqc_RaBuvLWtg5ubQAwlSbaTxTVAqoZ1OQ2YcM,24750
|
@@ -805,7 +805,7 @@ zenml/utils/yaml_utils.py,sha256=RvEr-N84wwG1Aq8rfdPAP7lev_SEaSQlqcL9fB_vHk8,584
|
|
805
805
|
zenml/zen_server/__init__.py,sha256=WyltI9TzFW2mEHZVOs6alLWMCQrrZaFALtrQXs83STA,1355
|
806
806
|
zenml/zen_server/auth.py,sha256=sJ_UAG58Qa0sUx8P1QkWmwp5zfAafFnm8WBHAOnPi4w,40070
|
807
807
|
zenml/zen_server/cache.py,sha256=Tc4TSugmsU1bhThxlYfE8rv0KmltIX1CcVHgzrJ0Eus,6633
|
808
|
-
zenml/zen_server/cloud_utils.py,sha256=
|
808
|
+
zenml/zen_server/cloud_utils.py,sha256=aHuMn3-oAsl-glrnv_JUgc5AE0m6Ep5lSLNhXx7F-eU,11832
|
809
809
|
zenml/zen_server/csrf.py,sha256=Jsbi_IKriWCOuquSYTOEWqSXiGORJATIhR5Wrkm4XzQ,2684
|
810
810
|
zenml/zen_server/dashboard/assets/404-_AtuLtaX.js,sha256=Y2jAo7K2feru-k7QcMxjnfUNkDrO7xv341YyKKpjZiU,1033
|
811
811
|
zenml/zen_server/dashboard/assets/@radix-C7hRs6Kx.js,sha256=cNA9UX8LGrKUQubGrls3E3Wq1fCrlK51W14yh22FE_U,296700
|
@@ -1025,7 +1025,7 @@ zenml/zen_server/rbac/models.py,sha256=Xhz0XqmVqg3ji9uTwjlhQ4IuQ2ivrT4gVdHi5ZkjF
|
|
1025
1025
|
zenml/zen_server/rbac/rbac_interface.py,sha256=VPMNnUIPcqJWDngITX6cfaPlM6zJwzCApXAnT_oaxSQ,3431
|
1026
1026
|
zenml/zen_server/rbac/rbac_sql_zen_store.py,sha256=ZBjAbCUlhMsp8GZiIkULl2ztJ8K2Wf-0QdSxzQXwovM,5930
|
1027
1027
|
zenml/zen_server/rbac/utils.py,sha256=09r1dSZ04hcag21rg6Ug2fMCdYfNjSBnx_W8C336GzE,24254
|
1028
|
-
zenml/zen_server/rbac/zenml_cloud_rbac.py,sha256=
|
1028
|
+
zenml/zen_server/rbac/zenml_cloud_rbac.py,sha256=fQRQsHYZsifjAAYAZALqiSB8ZjqIxjF1FfnXcyU7HF8,6093
|
1029
1029
|
zenml/zen_server/routers/__init__.py,sha256=ViyAhWL-ogHxE9wBvB_iMcur5H1NRVrzXkpogVY7FBA,641
|
1030
1030
|
zenml/zen_server/routers/actions_endpoints.py,sha256=-zzeTawwTrkWOnp8ltrGS_tUnWnyiXMFNaBRXI3zddk,9500
|
1031
1031
|
zenml/zen_server/routers/artifact_endpoint.py,sha256=d-5yPQO4N9O2W97j0f_5fghNThnNe0izT9WpZLaJyuA,5054
|
@@ -1055,7 +1055,7 @@ zenml/zen_server/routers/service_endpoints.py,sha256=37CY-22h4hTscEkBByKJqdHcOWs
|
|
1055
1055
|
zenml/zen_server/routers/stack_components_endpoints.py,sha256=MBQ3iz29WN1n9T_BLpd2BtWxWoLIBP6QT7BfaAkGEMY,8580
|
1056
1056
|
zenml/zen_server/routers/stack_deployment_endpoints.py,sha256=r7N4UaDAwj9ACYfdyUofRHpNPRrzWl-vmGoSErN9oYI,5381
|
1057
1057
|
zenml/zen_server/routers/stacks_endpoints.py,sha256=ci-WZ774Q2T3-XN6cZARJ95wmRUW2-W1mh7gKlbNE54,7527
|
1058
|
-
zenml/zen_server/routers/steps_endpoints.py,sha256=
|
1058
|
+
zenml/zen_server/routers/steps_endpoints.py,sha256=L-hnCASvhI4H5wmJwWuuHjX-yCuIOGIVuf0gw1fceLo,8387
|
1059
1059
|
zenml/zen_server/routers/tag_resource_endpoints.py,sha256=54HBt31whSj7wjzhw9Xzb6aJLBDVPd5iyg5fJ2Ej5qU,3268
|
1060
1060
|
zenml/zen_server/routers/tags_endpoints.py,sha256=H0aXms8iAkcxo9lsBwpDrVhJnY5n2cqBd3Iz1OI8r_k,4545
|
1061
1061
|
zenml/zen_server/routers/triggers_endpoints.py,sha256=Z9ry01MMpCZ2wcjcvJjnEu1eDhkcGACKuBL_F9m8smI,10100
|
@@ -1319,8 +1319,8 @@ zenml/zen_stores/secrets_stores/sql_secrets_store.py,sha256=LPFW757WCJLP1S8vrvjs
|
|
1319
1319
|
zenml/zen_stores/sql_zen_store.py,sha256=jsx_1_MJZE4dnNXxj8bAMX8pT5JfoJliADSBF9n6kJc,444809
|
1320
1320
|
zenml/zen_stores/template_utils.py,sha256=GbJ7LgGVYHSCKPEA8RNTxPoVTWqpC77F_lGzjJ4O1Fw,9220
|
1321
1321
|
zenml/zen_stores/zen_store_interface.py,sha256=fF_uL_FplnvGvM5o3jOQ8i1zHXhuhKLL2n4nvIKSR7E,92090
|
1322
|
-
zenml_nightly-0.82.1.
|
1323
|
-
zenml_nightly-0.82.1.
|
1324
|
-
zenml_nightly-0.82.1.
|
1325
|
-
zenml_nightly-0.82.1.
|
1326
|
-
zenml_nightly-0.82.1.
|
1322
|
+
zenml_nightly-0.82.1.dev20250527.dist-info/LICENSE,sha256=wbnfEnXnafPbqwANHkV6LUsPKOtdpsd-SNw37rogLtc,11359
|
1323
|
+
zenml_nightly-0.82.1.dev20250527.dist-info/METADATA,sha256=iB0qEGvEML3Ql26mih_FjKfI34M9Lh8W_ao9jWBXn9E,24317
|
1324
|
+
zenml_nightly-0.82.1.dev20250527.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
1325
|
+
zenml_nightly-0.82.1.dev20250527.dist-info/entry_points.txt,sha256=QK3ETQE0YswAM2mWypNMOv8TLtr7EjnqAFq1br_jEFE,43
|
1326
|
+
zenml_nightly-0.82.1.dev20250527.dist-info/RECORD,,
|
{zenml_nightly-0.82.1.dev20250526.dist-info → zenml_nightly-0.82.1.dev20250527.dist-info}/LICENSE
RENAMED
File without changes
|
{zenml_nightly-0.82.1.dev20250526.dist-info → zenml_nightly-0.82.1.dev20250527.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|