Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add readiness check to HTTP server #1855

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kylemclaren
Copy link

This differs from the /health-check endpoint in that it only returns 200 if the health status is READY — i.e. ready to make a prediction.

In my particular use-case, this will be useful when running Cog on Fly.io GPUs (see here, here and here) with cold start requests; in my testing, I would regularly hit 409 - Conflict ("Already running a prediction") when sending an HTTP request to Cog and starting the VM. This occurs even with the idempotent endpoint. I am not sure if I this is intended behaviour — but it's not working for my use-case.

A readiness endpoint would allow me to set a health check to only forward the request to the Machine when it's ready to make a prediction:

  [[http_service.checks]]
    grace_period = "60s"
    interval = "30s"
    method = "GET"
    timeout = "5s"
    path = "/ready"

Happy to elaborate further!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant