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

Does the AI server have a method of externally checking its health? #114

Open
4 tasks
UntouchedWagons opened this issue Jun 8, 2024 · 1 comment
Open
4 tasks

Comments

@UntouchedWagons
Copy link

Area of Concern

  • [ ? ] Server
  • Behaviour of one or more Modules [provide name(s), e.g. ObjectDetectionYolo]
  • Installer
  • Runtime [e.g. Python3.7, .NET]
  • Module packages [e.g. PyTorch)
  • [ ? ] Something else

Describe the bug
I would like to know if there's a web path (or something similar) that I can have a liveness probe check to make sure the AI server is healthy so that if it is unhealthy, the AI server can be restarted. Right now I have a liveness probe that just checks the main page. Is there a better page I should be using?

Your System (please complete the following information):

  • CodeProject.AI Server version: cpu-2.6.5
  • OS: Debian 12
  • System RAM: 64GB
  • GPU (if available): Intel UHD Graphics 630
  • GPU RAM (if available): Unsure

Additional context
I am running AI Server in a kubernetes cluster

@SlothCroissant
Copy link

Not sure if the API is "official" or meant to be used outside of the dashboard, but there are some endpoints available that do variations of this, I think. There is a /ping endpoint to check aliveness, a "system-status" endpoint which returns some deeper info, etc. Based on the comments, there are some opportunities to expand on this to make it more "health-y" if you will, but it may do the job for now.

Check it out:

https://github.com/codeproject/CodeProject.AI-Server/blob/56b69a2ed87bc4a521c0156fce7c97c5626a5132/src/server/Controllers/ServerStatusController.cs#L53C1-L72C10

    /// <summary>
    /// Allows for a client to ping the service to test for aliveness.
    /// </summary>
    /// <returns>A ResponseBase object.</returns>
    [HttpGet("ping"/*, Name = "Ping"*/)]
    [Produces("application/json")]
    [ProducesResponseType(StatusCodes.Status200OK)]
    [ProducesResponseType(StatusCodes.Status400BadRequest)]
    public ServerResponse GetPing()
    {
        /* This is a simple and sensible response. But let's do better
        var response = new ResponseBase
        {
            success = true,
        };
        return response;
        */


        return GetVersion();
    }

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

No branches or pull requests

2 participants