Skip to content

Commit cd516a9

Browse files
committed
Fix ZenML Pro project URLs for pipeline runs and model versions
1 parent 14d245d commit cd516a9

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/zenml/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ def handle_int_env_var(var: str, default: int = 0) -> int:
368368
PIPELINES = "/pipelines"
369369
PIPELINE_SPEC = "/pipeline-spec"
370370
PLUGIN_FLAVORS = "/plugin-flavors"
371+
PROJECTS = "/projects"
371372
REFRESH = "/refresh"
372373
RUNS = "/runs"
373374
RUN_TEMPLATES = "/run_templates"

src/zenml/orchestrators/step_run_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def log_model_version_dashboard_url(
352352
"""
353353
from zenml.utils.dashboard_utils import get_model_version_url
354354

355-
if model_version_url := get_model_version_url(model_version.id):
355+
if model_version_url := get_model_version_url(model_version):
356356
logger.info(
357357
"Dashboard URL for Model Version `%s (%s)`:\n%s",
358358
model_version.model.name,

src/zenml/utils/dashboard_utils.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import os
1717
from typing import Optional
18-
from uuid import UUID
1918

2019
from zenml import constants
2120
from zenml.client import Client
@@ -24,6 +23,7 @@
2423
from zenml.logger import get_logger
2524
from zenml.models import (
2625
ComponentResponse,
26+
ModelVersionResponse,
2727
PipelineRunResponse,
2828
ServerDeploymentType,
2929
StackResponse,
@@ -115,7 +115,7 @@ def get_run_url(run: PipelineRunResponse) -> Optional[str]:
115115
"""
116116
cloud_url = get_cloud_dashboard_url()
117117
if cloud_url:
118-
return f"{cloud_url}{constants.RUNS}/{run.id}"
118+
return f"{cloud_url}{constants.PROJECTS}/{run.project.id}{constants.RUNS}/{run.id}"
119119

120120
dashboard_url = get_server_dashboard_url()
121121
if dashboard_url:
@@ -124,18 +124,20 @@ def get_run_url(run: PipelineRunResponse) -> Optional[str]:
124124
return None
125125

126126

127-
def get_model_version_url(model_version_id: UUID) -> Optional[str]:
127+
def get_model_version_url(
128+
model_version: ModelVersionResponse,
129+
) -> Optional[str]:
128130
"""Function to get the dashboard URL of a given model version.
129131
130132
Args:
131-
model_version_id: the id of the model version.
133+
model_version: the response model of the given model version.
132134
133135
Returns:
134136
the URL to the model version if the dashboard is available, else None.
135137
"""
136138
cloud_url = get_cloud_dashboard_url()
137139
if cloud_url:
138-
return f"{cloud_url}/model-versions/{str(model_version_id)}"
140+
return f"{cloud_url}{constants.PROJECTS}/{model_version.project.id}/model-versions/{str(model_version.id)}"
139141

140142
return None
141143

0 commit comments

Comments
 (0)