Skip to content

Commit 295f7b6

Browse files
committed
Fix deployment URL to use actual Space domain instead of HF page
CRITICAL BUG FIX: The deployer was returning the HuggingFace Space page URL (https://huggingface.co/spaces/{space_id}) instead of the actual deployment endpoint URL. This caused the base deployer to continuously poll because the health check was hitting the HF page instead of the deployment server. Changes: - Extract the actual domain from runtime.raw['domains'] - Construct proper deployment URL: https://{domain} - Only set URL when status is RUNNING (follows GCP/AWS pattern) - URL is None for non-RUNNING states Example: - Before: https://huggingface.co/spaces/zenml/zenml-weather_agent-5917ffec - After: https://zenml-zenml-weather_agent-5917ffec.hf.space This allows the base deployer's health check to succeed and stop polling once the deployment is fully ready.
1 parent ff9599c commit 295f7b6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/zenml/integrations/huggingface/deployers/huggingface_deployer.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,19 @@ def do_get_deployment_state(
529529
# Unknown/future stages
530530
status = DeploymentStatus.UNKNOWN
531531

532+
# Get deployment URL from Space domains (only available when RUNNING)
533+
url = None
534+
if status == DeploymentStatus.RUNNING and runtime.raw.get(
535+
"domains"
536+
):
537+
# Extract the first domain (primary domain for the Space)
538+
domains = runtime.raw.get("domains", [])
539+
if domains and domains[0].get("domain"):
540+
url = f"https://{domains[0]['domain']}"
541+
532542
return DeploymentOperationalState(
533543
status=status,
534-
url=f"https://huggingface.co/spaces/{space_id}",
544+
url=url,
535545
metadata={
536546
"space_id": space_id,
537547
"external_state": runtime.stage,

0 commit comments

Comments
 (0)