nlmatics / nlm-ingestor

This repo provides the server side code for llmsherpa API to connect. It includes parsers for various file formats.
https://www.nlmatics.com
Apache License 2.0
972 stars 124 forks source link

Health endpoint #4

Closed jpbalarini closed 5 months ago

jpbalarini commented 6 months ago

I deployed this as an ECS service, but ECS needs a way to check the health of the service (to determine if the deployment was successful). Generally, you can do something like this:

{
    "Command": [
        "CMD-SHELL",
        "curl -f http://localhost:5001/ || exit 1"
    ],
    "Interval": 30,
    "Retries": 5,
    "StartPeriod": 20,
    "Timeout": 5
}

but this does not work since the only defined endpoint is a POST to /api/parseDocument that requires an input file. Is there any way of doing this? A GET to / returns 404. What about adding an endpoint to / that just returns 200 to check service status? Thanks!

ansukla commented 6 months ago

This is a good idea. You can submit a PR for this change. Alternatively, you can write your own service endpoint with your choice of WSGI and create a docker image based on the one provided here.

potus84 commented 3 months ago

@ansukla can you build a new release with this health-check functionality? I noticed that the v.0.1.6 did not include this new PR.