Skip to content

Commit 7cd539a

Browse files
committed
Remove verbose debug and polling logs
Cleaned up excessive logging that was added for debugging: - Removed deployment URL log that printed on every poll - Removed all debug logs showing space state details - Simplified unknown stage warning message - Removed health check debug log Kept important informational logs: - Creating/updating Space - Restarting sleeping Spaces - Unknown stage warnings (simplified) This significantly reduces log verbosity while maintaining visibility into key deployment lifecycle events. Note: HTTP Request logs visible in output are from huggingface_hub library's own logging, not from our deployer code.
1 parent e3cf79c commit 7cd539a

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

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

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -499,13 +499,8 @@ def do_get_deployment_state(
499499

500500
runtime = api.get_space_runtime(repo_id=space_id)
501501

502-
# Debug logging
503502
domains = runtime.raw.get("domains", [])
504503
domain_stage = domains[0].get("stage") if domains else None
505-
logger.debug(
506-
f"Space {space_id} state: stage={runtime.stage}, "
507-
f"domain_stage={domain_stage}, has_domains={bool(domains)}"
508-
)
509504

510505
# Map HuggingFace Space stages to ZenML standard deployment states
511506
# Note: runtime.stage is a string, compare using enum.value
@@ -514,17 +509,9 @@ def do_get_deployment_state(
514509
# Check if domain is also ready (not just Space running)
515510
if domains and domains[0].get("stage") == "READY":
516511
status = DeploymentStatus.RUNNING
517-
logger.debug(
518-
f"Space {space_id} is fully ready: "
519-
f"stage=RUNNING, domain_stage=READY"
520-
)
521512
else:
522513
# Space is running but domain not ready yet (DNS propagating, etc.)
523514
status = DeploymentStatus.PENDING
524-
logger.debug(
525-
f"Space {space_id} is running but domain not ready: "
526-
f"domain_stage={domain_stage}"
527-
)
528515
# Building/updating states - health endpoint not yet available
529516
elif runtime.stage in [
530517
SpaceStage.BUILDING.value,
@@ -548,27 +535,20 @@ def do_get_deployment_state(
548535
]:
549536
status = DeploymentStatus.ABSENT
550537
else:
551-
# Unknown/future stages
538+
# Unknown/future stages - log once for visibility
552539
logger.warning(
553-
f"Space {space_id} has unrecognized stage: '{runtime.stage}'. "
554-
f"This might be a new HuggingFace stage. Treating as UNKNOWN. "
555-
f"Known stages: {[s.value for s in SpaceStage]}"
540+
f"Space {space_id} has unrecognized stage: '{runtime.stage}'"
556541
)
557542
status = DeploymentStatus.UNKNOWN
558543

559544
# Get deployment URL from Space domains (only when fully ready)
560545
url = None
561-
# Only set URL if domain is ready for traffic
562546
if (
563547
domain_stage == "READY"
564548
and domains
565549
and domains[0].get("domain")
566550
):
567551
url = f"https://{domains[0]['domain']}"
568-
logger.info(
569-
f"Space {space_id} deployment URL: {url} "
570-
f"(status={status}, stage={runtime.stage}, domain_stage={domain_stage})"
571-
)
572552

573553
return DeploymentOperationalState(
574554
status=status,
@@ -604,10 +584,6 @@ def _check_deployment_health(
604584
"""
605585
# HuggingFace Spaces: Skip HTTP health check, rely on Space runtime state
606586
# We already verified Space is RUNNING and domain is READY in get_deployment_state
607-
logger.debug(
608-
f"Skipping HTTP health check for HuggingFace Space deployment "
609-
f"{deployment.name} (relying on Space runtime state)"
610-
)
611587
return True
612588

613589
def do_get_deployment_state_logs(

0 commit comments

Comments
 (0)