Skip to content

Commit

Permalink
fix readiness probe
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsmechtel committed Dec 19, 2024
1 parent 808aacf commit 7ce7479
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions bioimageio_colab/register_sam_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,11 @@ async def compute_image_embedding(
# raise e


async def check_readiness(func) -> dict:
async def check_readiness() -> dict:
"""
Readiness probe for the SAM service.
"""
logger.info("Checking the readiness of the SAM service...")
result = await func()
logger.info(f"Readiness check result: {result}")
assert result == "pong"

return {"status": "ok"}

Expand Down Expand Up @@ -247,10 +244,8 @@ async def register_service(args: dict) -> None:
logger.info(f"Test the service here: {client_base_url}:{args.service_id}/hello")

# Register probes for the service
service = await colab_client.get_service(sid)
ping = service.get("ping")
await colab_client.register_probes({
"readiness": partial(check_readiness, ping),
"readiness": check_readiness,
"liveness": partial(check_liveness, handles=handles),
})

Expand Down

0 comments on commit 7ce7479

Please sign in to comment.