zenml-nightly 0.66.0.dev20240923__py3-none-any.whl → 0.66.0.dev20240927__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/cli/__init__.py +7 -0
- zenml/cli/base.py +2 -2
- zenml/cli/pipeline.py +21 -0
- zenml/cli/utils.py +14 -11
- zenml/client.py +68 -3
- zenml/config/step_configurations.py +0 -5
- zenml/constants.py +3 -0
- zenml/enums.py +2 -0
- zenml/integrations/__init__.py +1 -0
- zenml/integrations/aws/flavors/sagemaker_orchestrator_flavor.py +76 -7
- zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py +370 -115
- zenml/integrations/azure/orchestrators/azureml_orchestrator.py +157 -4
- zenml/integrations/constants.py +1 -0
- zenml/integrations/deepchecks/__init__.py +1 -1
- zenml/integrations/deepchecks/data_validators/deepchecks_data_validator.py +55 -14
- zenml/integrations/deepchecks/validation_checks.py +62 -5
- zenml/integrations/gcp/orchestrators/vertex_orchestrator.py +207 -18
- zenml/integrations/lightning/__init__.py +1 -1
- zenml/integrations/lightning/flavors/lightning_orchestrator_flavor.py +9 -0
- zenml/integrations/lightning/orchestrators/lightning_orchestrator.py +18 -17
- zenml/integrations/lightning/orchestrators/lightning_orchestrator_entrypoint.py +2 -6
- zenml/integrations/mlflow/steps/mlflow_registry.py +2 -0
- zenml/integrations/skypilot/orchestrators/skypilot_base_vm_orchestrator.py +38 -26
- zenml/integrations/skypilot_kubernetes/__init__.py +52 -0
- zenml/integrations/skypilot_kubernetes/flavors/__init__.py +26 -0
- zenml/integrations/skypilot_kubernetes/flavors/skypilot_orchestrator_kubernetes_vm_flavor.py +125 -0
- zenml/integrations/skypilot_kubernetes/orchestrators/__init__.py +25 -0
- zenml/integrations/skypilot_kubernetes/orchestrators/skypilot_kubernetes_vm_orchestrator.py +74 -0
- zenml/integrations/tensorboard/visualizers/tensorboard_visualizer.py +1 -1
- zenml/models/v2/base/filter.py +315 -149
- zenml/models/v2/base/scoped.py +5 -2
- zenml/models/v2/core/artifact_version.py +69 -8
- zenml/models/v2/core/model.py +43 -6
- zenml/models/v2/core/model_version.py +49 -1
- zenml/models/v2/core/model_version_artifact.py +18 -3
- zenml/models/v2/core/model_version_pipeline_run.py +18 -4
- zenml/models/v2/core/pipeline.py +108 -1
- zenml/models/v2/core/pipeline_run.py +172 -21
- zenml/models/v2/core/run_template.py +53 -1
- zenml/models/v2/core/stack.py +33 -5
- zenml/models/v2/core/step_run.py +7 -0
- zenml/new/pipelines/pipeline.py +4 -0
- zenml/new/pipelines/run_utils.py +4 -1
- zenml/orchestrators/base_orchestrator.py +41 -12
- zenml/stack/stack.py +11 -2
- zenml/utils/env_utils.py +54 -1
- zenml/utils/string_utils.py +50 -0
- zenml/zen_server/cloud_utils.py +33 -8
- zenml/zen_server/dashboard/assets/{404-iO8vpun1.js → 404-Y50hSt65.js} +1 -1
- zenml/zen_server/dashboard/assets/{@reactflow-B6kq9fJZ.js → @reactflow-ytavUpwh.js} +1 -1
- zenml/zen_server/dashboard/assets/AlertDialogDropdownItem-xLR9a1iw.js +1 -0
- zenml/zen_server/dashboard/assets/{CodeSnippet-DNWdQmbo.js → CodeSnippet-IxXNxUDa.js} +2 -2
- zenml/zen_server/dashboard/assets/{CollapsibleCard-B2OVjWYE.js → CollapsibleCard-BhutZbBL.js} +1 -1
- zenml/zen_server/dashboard/assets/{Commands-DsoaVElZ.js → Commands-Bf-rd1z8.js} +1 -1
- zenml/zen_server/dashboard/assets/ComponentBadge-gKR1OIwG.js +1 -0
- zenml/zen_server/dashboard/assets/{CopyButton-BqE_-PHO.js → CopyButton-DcFHidFJ.js} +1 -1
- zenml/zen_server/dashboard/assets/{CsvVizualization-Dyasr2jU.js → CsvVizualization-QSbjrfxw.js} +1 -1
- zenml/zen_server/dashboard/assets/{DialogItem-Cz1VLRwa.js → DialogItem-Cd3HqST4.js} +1 -1
- zenml/zen_server/dashboard/assets/{Error-DorJD_va.js → Error-BhwdmqK7.js} +1 -1
- zenml/zen_server/dashboard/assets/{ExecutionStatus-CIfQTutR.js → ExecutionStatus-D6r6aK8J.js} +1 -1
- zenml/zen_server/dashboard/assets/{Helpbox-CmfvtNeq.js → Helpbox-0pBpTwTm.js} +1 -1
- zenml/zen_server/dashboard/assets/Infobox-BTK_EUKT.js +1 -0
- zenml/zen_server/dashboard/assets/{InlineAvatar-Ds2ZFHPc.js → InlineAvatar-CA3DFMcM.js} +1 -1
- zenml/zen_server/dashboard/assets/Partials-QLOZw624.js +1 -0
- zenml/zen_server/dashboard/assets/{ProviderIcon-BOQJgapd.js → ProviderIcon-C16CCIN4.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderRadio-BsYBw9YA.js → ProviderRadio-D3FuCHf3.js} +1 -1
- zenml/zen_server/dashboard/assets/{SearchField-W3GXpLlI.js → SearchField-BzmfxS0L.js} +1 -1
- zenml/zen_server/dashboard/assets/SecretTooltip-BaMwHF-Q.js +1 -0
- zenml/zen_server/dashboard/assets/{SetPassword-B-0a8UCj.js → SetPassword-DuIC65H9.js} +1 -1
- zenml/zen_server/dashboard/assets/{Tick-i1DYsVcX.js → Tick-DJTCF0Re.js} +1 -1
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-C6Zb7ASL.js → UpdatePasswordSchemas-CUm-DMpw.js} +1 -1
- zenml/zen_server/dashboard/assets/UsageReason-CKw0juLF.js +1 -0
- zenml/zen_server/dashboard/assets/{WizardFooter-BHbO7zOa.js → WizardFooter-Cv9ApYWU.js} +1 -1
- zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-BBEe6I9-.js → all-pipeline-runs-query-BA3R2Sey.js} +1 -1
- zenml/zen_server/dashboard/assets/{cloud-only-BuP4Kt_7.js → cloud-only-BB4BVa6E.js} +1 -1
- zenml/zen_server/dashboard/assets/{create-stack-B2x2d4r1.js → create-stack-F29xAUEx.js} +1 -1
- zenml/zen_server/dashboard/assets/delete-run-CP0pcJ3U.js +1 -0
- zenml/zen_server/dashboard/assets/{form-schemas-Bap0f854.js → form-schemas-BKXwSDK2.js} +1 -1
- zenml/zen_server/dashboard/assets/index-BhJ6ZJxv.css +1 -0
- zenml/zen_server/dashboard/assets/{index-B9wVwe7u.js → index-Ci0nJ8EZ.js} +5 -5
- zenml/zen_server/dashboard/assets/{index-DFi8BroH.js → index-D-mtoBj3.js} +1 -1
- zenml/zen_server/dashboard/assets/{login-mutation-DwxUz8VA.js → login-mutation-ax6iL2Mb.js} +1 -1
- zenml/zen_server/dashboard/assets/{not-found-D5i9DunU.js → not-found-DbjllLY_.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-oS4hqS8M.js → page-3qPX9WYH.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-iwoJnwPv.js → page-6mfzecin.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DGMa3ZQL.js → page-8kYmrh0B.js} +1 -1
- zenml/zen_server/dashboard/assets/page-B1n7_W7z.js +1 -0
- zenml/zen_server/dashboard/assets/page-BDg1F-Ug.js +6 -0
- zenml/zen_server/dashboard/assets/{page-xQG6GmFJ.js → page-BXarY9K2.js} +1 -1
- zenml/zen_server/dashboard/assets/page-BZZhLo2u.js +1 -0
- zenml/zen_server/dashboard/assets/page-Bbf_oBjn.js +1 -0
- zenml/zen_server/dashboard/assets/page-BjjuBvZG.js +9 -0
- zenml/zen_server/dashboard/assets/{page-J0s8Sq3N.js → page-BukXK1Aa.js} +1 -1
- zenml/zen_server/dashboard/assets/page-CHaQkFK5.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BitfWsiW.js → page-CKHNAq7z.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DE03uZZR.js → page-CS0SYFK8.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-WCQ659by.js → page-CvKnNK1S.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CrSdkteO.js → page-DGM1CbYT.js} +2 -2
- zenml/zen_server/dashboard/assets/{page-DQGCHKrQ.js → page-DMSLXKGT.js} +1 -1
- zenml/zen_server/dashboard/assets/page-DOmIZ2ra.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DgM-N9RL.js → page-DRfcRK1w.js} +1 -1
- zenml/zen_server/dashboard/assets/page-DYVmJ9_w.js +3 -0
- zenml/zen_server/dashboard/assets/{page-BiF8hLbO.js → page-DcTjHmYZ.js} +1 -1
- zenml/zen_server/dashboard/assets/page-DuqYMYmH.js +1 -0
- zenml/zen_server/dashboard/assets/page-Dwow2doB.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DQdwZZ9x.js → page-HkVBdZl6.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-bimkItOg.js → page-MAXyfXBq.js} +1 -1
- zenml/zen_server/dashboard/assets/page-miU2rhYG.js +1 -0
- zenml/zen_server/dashboard/assets/page-p0BhSAWx.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DFCK65G9.js → page-uORspyRu.js} +1 -1
- zenml/zen_server/dashboard/assets/persist-BxIR2XZs.js +1 -0
- zenml/zen_server/dashboard/assets/{persist-xsYgVtR1.js → persist-CfJMar_k.js} +1 -1
- zenml/zen_server/dashboard/assets/sharedSchema-vub0rii3.js +14 -0
- zenml/zen_server/dashboard/assets/stack-detail-query-DQcyzG-2.js +1 -0
- zenml/zen_server/dashboard/assets/tick-circle-m-hJG8i9.js +1 -0
- zenml/zen_server/dashboard/assets/{update-server-settings-mutation-DNqmQXDM.js → update-server-settings-mutation-FGVP7X2U.js} +1 -1
- zenml/zen_server/dashboard/assets/{url-DwbuKk1b.js → url-CbAPzsmT.js} +1 -1
- zenml/zen_server/dashboard/index.html +4 -4
- zenml/zen_server/dashboard_legacy/asset-manifest.json +4 -4
- zenml/zen_server/dashboard_legacy/index.html +1 -1
- zenml/zen_server/dashboard_legacy/{precache-manifest.290b95d5b43efa3368b3dc63d20c4782.js → precache-manifest.6d320abb70db612019dda6c4948e7a90.js} +4 -4
- zenml/zen_server/dashboard_legacy/service-worker.js +1 -1
- zenml/zen_server/dashboard_legacy/static/js/{main.840d1bf0.chunk.js → main.fa9299d5.chunk.js} +2 -2
- zenml/zen_server/dashboard_legacy/static/js/{main.840d1bf0.chunk.js.map → main.fa9299d5.chunk.js.map} +1 -1
- zenml/zen_server/routers/runs_endpoints.py +89 -3
- zenml/zen_stores/sql_zen_store.py +1 -0
- {zenml_nightly-0.66.0.dev20240923.dist-info → zenml_nightly-0.66.0.dev20240927.dist-info}/METADATA +8 -1
- {zenml_nightly-0.66.0.dev20240923.dist-info → zenml_nightly-0.66.0.dev20240927.dist-info}/RECORD +132 -124
- zenml/zen_server/dashboard/assets/AlertDialogDropdownItem-BXeSvmMY.js +0 -1
- zenml/zen_server/dashboard/assets/EditSecretDialog-Du423_3U.js +0 -1
- zenml/zen_server/dashboard/assets/Infobox-BL9NOS37.js +0 -1
- zenml/zen_server/dashboard/assets/Partials-DX-8iEa1.js +0 -1
- zenml/zen_server/dashboard/assets/UsageReason-CCnzmwS8.js +0 -1
- zenml/zen_server/dashboard/assets/index-6DYjZgDn.css +0 -1
- zenml/zen_server/dashboard/assets/page-BFuJICXM.js +0 -9
- zenml/zen_server/dashboard/assets/page-CDOQLrPC.js +0 -1
- zenml/zen_server/dashboard/assets/page-CEJWu1YO.js +0 -1
- zenml/zen_server/dashboard/assets/page-CIbehp7V.js +0 -1
- zenml/zen_server/dashboard/assets/page-CLiRGfWo.js +0 -1
- zenml/zen_server/dashboard/assets/page-CV44mQn9.js +0 -1
- zenml/zen_server/dashboard/assets/page-D5F3DJjm.js +0 -1
- zenml/zen_server/dashboard/assets/page-DI-qTWrm.js +0 -1
- zenml/zen_server/dashboard/assets/page-Dt8VgzbE.js +0 -1
- zenml/zen_server/dashboard/assets/page-oSqx9dkH.js +0 -1
- zenml/zen_server/dashboard/assets/page-p3GqEAUW.js +0 -1
- zenml/zen_server/dashboard/assets/page-qvcUVPE-.js +0 -1
- zenml/zen_server/dashboard/assets/persist-mEZN_fgH.js +0 -1
- zenml/zen_server/dashboard/assets/sharedSchema-BfZcy7aP.js +0 -14
- zenml/zen_server/dashboard/assets/stack-detail-query-CU4egfhp.js +0 -1
- {zenml_nightly-0.66.0.dev20240923.dist-info → zenml_nightly-0.66.0.dev20240927.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.66.0.dev20240923.dist-info → zenml_nightly-0.66.0.dev20240927.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.66.0.dev20240923.dist-info → zenml_nightly-0.66.0.dev20240927.dist-info}/entry_points.txt +0 -0
zenml/utils/string_utils.py
CHANGED
@@ -15,13 +15,17 @@
|
|
15
15
|
|
16
16
|
import base64
|
17
17
|
import datetime
|
18
|
+
import functools
|
18
19
|
import random
|
19
20
|
import string
|
21
|
+
from typing import Any, Callable, Dict, TypeVar, cast
|
20
22
|
|
21
23
|
from pydantic import BaseModel
|
22
24
|
|
23
25
|
from zenml.constants import BANNED_NAME_CHARACTERS
|
24
26
|
|
27
|
+
V = TypeVar("V", bound=Any)
|
28
|
+
|
25
29
|
|
26
30
|
def get_human_readable_time(seconds: float) -> str:
|
27
31
|
"""Convert seconds into a human-readable string.
|
@@ -167,3 +171,49 @@ def format_name_template(
|
|
167
171
|
datetime.datetime.now(datetime.timezone.utc).strftime("%H_%M_%S_%f"),
|
168
172
|
)
|
169
173
|
return name_template.format(**kwargs)
|
174
|
+
|
175
|
+
|
176
|
+
def substitute_string(value: V, substitution_func: Callable[[str], str]) -> V:
|
177
|
+
"""Recursively substitute strings in objects.
|
178
|
+
|
179
|
+
Args:
|
180
|
+
value: An object in which the strings should be recursively substituted.
|
181
|
+
This can be a pydantic model, dict, set, list, tuple or any
|
182
|
+
primitive type.
|
183
|
+
substitution_func: The function that does the actual string
|
184
|
+
substitution.
|
185
|
+
|
186
|
+
Returns:
|
187
|
+
The object with the substitution function applied to all string values.
|
188
|
+
"""
|
189
|
+
substitute_ = functools.partial(
|
190
|
+
substitute_string, substitution_func=substitution_func
|
191
|
+
)
|
192
|
+
|
193
|
+
if isinstance(value, BaseModel):
|
194
|
+
model_values = {}
|
195
|
+
|
196
|
+
for k, v in value.__iter__():
|
197
|
+
new_value = substitute_(v)
|
198
|
+
|
199
|
+
if k not in value.model_fields_set and new_value == getattr(
|
200
|
+
value, k
|
201
|
+
):
|
202
|
+
# This is a default value on the model and was not set
|
203
|
+
# explicitly. In this case, we don't include it in the model
|
204
|
+
# values to keep the `exclude_unset` behavior the same
|
205
|
+
continue
|
206
|
+
|
207
|
+
model_values[k] = new_value
|
208
|
+
|
209
|
+
return cast(V, type(value).model_validate(model_values))
|
210
|
+
elif isinstance(value, Dict):
|
211
|
+
return cast(
|
212
|
+
V, {substitute_(k): substitute_(v) for k, v in value.items()}
|
213
|
+
)
|
214
|
+
elif isinstance(value, (list, set, tuple)):
|
215
|
+
return cast(V, type(value)(substitute_(v) for v in value))
|
216
|
+
elif isinstance(value, str):
|
217
|
+
return cast(V, substitution_func(value))
|
218
|
+
|
219
|
+
return value
|
zenml/zen_server/cloud_utils.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
"""Utils concerning anything concerning the cloud control plane backend."""
|
2
2
|
|
3
3
|
import os
|
4
|
+
from datetime import datetime, timedelta, timezone
|
4
5
|
from typing import Any, Dict, Optional
|
5
6
|
|
6
7
|
import requests
|
@@ -19,11 +20,9 @@ class ZenMLCloudConfiguration(BaseModel):
|
|
19
20
|
"""ZenML Pro RBAC configuration."""
|
20
21
|
|
21
22
|
api_url: str
|
22
|
-
|
23
23
|
oauth2_client_id: str
|
24
24
|
oauth2_client_secret: str
|
25
25
|
oauth2_audience: str
|
26
|
-
auth0_domain: str
|
27
26
|
|
28
27
|
@field_validator("api_url")
|
29
28
|
@classmethod
|
@@ -68,6 +67,8 @@ class ZenMLCloudConnection:
|
|
68
67
|
"""Initialize the RBAC component."""
|
69
68
|
self._config = ZenMLCloudConfiguration.from_environment()
|
70
69
|
self._session: Optional[requests.Session] = None
|
70
|
+
self._token: Optional[str] = None
|
71
|
+
self._token_expires_at: Optional[datetime] = None
|
71
72
|
|
72
73
|
def get(
|
73
74
|
self, endpoint: str, params: Optional[Dict[str, Any]]
|
@@ -91,7 +92,8 @@ class ZenMLCloudConnection:
|
|
91
92
|
|
92
93
|
response = self.session.get(url=url, params=params, timeout=7)
|
93
94
|
if response.status_code == 401:
|
94
|
-
#
|
95
|
+
# If we get an Unauthorized error from the API serer, we refresh the
|
96
|
+
# auth token and try again
|
95
97
|
self._clear_session()
|
96
98
|
response = self.session.get(url=url, params=params, timeout=7)
|
97
99
|
|
@@ -186,6 +188,8 @@ class ZenMLCloudConnection:
|
|
186
188
|
def _clear_session(self) -> None:
|
187
189
|
"""Clear the authentication session."""
|
188
190
|
self._session = None
|
191
|
+
self._token = None
|
192
|
+
self._token_expires_at = None
|
189
193
|
|
190
194
|
def _fetch_auth_token(self) -> str:
|
191
195
|
"""Fetch an auth token for the Cloud API from auth0.
|
@@ -196,8 +200,16 @@ class ZenMLCloudConnection:
|
|
196
200
|
Returns:
|
197
201
|
Auth token.
|
198
202
|
"""
|
203
|
+
if (
|
204
|
+
self._token is not None
|
205
|
+
and self._token_expires_at is not None
|
206
|
+
and datetime.now(timezone.utc) + timedelta(minutes=5)
|
207
|
+
< self._token_expires_at
|
208
|
+
):
|
209
|
+
return self._token
|
210
|
+
|
199
211
|
# Get an auth token from auth0
|
200
|
-
|
212
|
+
login_url = f"{self._config.api_url}/auth/login"
|
201
213
|
headers = {"content-type": "application/x-www-form-urlencoded"}
|
202
214
|
payload = {
|
203
215
|
"client_id": self._config.oauth2_client_id,
|
@@ -207,18 +219,31 @@ class ZenMLCloudConnection:
|
|
207
219
|
}
|
208
220
|
try:
|
209
221
|
response = requests.post(
|
210
|
-
|
222
|
+
login_url, headers=headers, data=payload, timeout=7
|
211
223
|
)
|
212
224
|
response.raise_for_status()
|
213
225
|
except Exception as e:
|
214
226
|
raise RuntimeError(f"Error fetching auth token from auth0: {e}")
|
215
227
|
|
216
|
-
|
228
|
+
json_response = response.json()
|
229
|
+
access_token = json_response.get("access_token", "")
|
230
|
+
expires_in = json_response.get("expires_in", 0)
|
217
231
|
|
218
|
-
if
|
232
|
+
if (
|
233
|
+
not access_token
|
234
|
+
or not isinstance(access_token, str)
|
235
|
+
or not expires_in
|
236
|
+
or not isinstance(expires_in, int)
|
237
|
+
):
|
219
238
|
raise RuntimeError("Could not fetch auth token from auth0.")
|
220
239
|
|
221
|
-
|
240
|
+
self._token = access_token
|
241
|
+
self._token_expires_at = datetime.now(timezone.utc) + timedelta(
|
242
|
+
seconds=expires_in
|
243
|
+
)
|
244
|
+
|
245
|
+
assert self._token is not None
|
246
|
+
return self._token
|
222
247
|
|
223
248
|
|
224
249
|
def cloud_connection() -> ZenMLCloudConnection:
|
@@ -1 +1 @@
|
|
1
|
-
import{j as e}from"./@radix-DnFH_oo1.js";import{f as s,r as t}from"./index-
|
1
|
+
import{j as e}from"./@radix-DnFH_oo1.js";import{f as s,r as t}from"./index-Ci0nJ8EZ.js";import{E as r}from"./EmptyState-Cs3DEmso.js";import{H as a}from"./help-CwN931fX.js";import{L as o}from"./@react-router-APVeuk-U.js";import"./@tanstack-QbMbTrh5.js";import"./@reactflow-ytavUpwh.js";function d(){return e.jsx("div",{className:"flex min-h-screen w-full flex-col",children:e.jsx(r,{icon:e.jsx(a,{className:"h-[120px] w-[120px] fill-neutral-300"}),children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"mb-2 text-display-xs font-semibold",children:"We can't find the page you are looking for"}),e.jsx("p",{className:"text-lg text-theme-text-secondary",children:"You can try typing a different URL or we can bring you back to your Homepage."}),e.jsx("div",{className:"mt-5 flex justify-center",children:e.jsx(s,{size:"md",asChild:!0,children:e.jsx(o,{className:"w-min self-center whitespace-nowrap",to:t.home,children:e.jsx("span",{className:"px-0.5",children:"Go to Home"})})})})]})})})}export{d as default};
|