Code Monkey home page Code Monkey logo

Comments (10)

tico24 avatar tico24 commented on August 19, 2024

tl;dr you can't have a http readiness probe checking for a redirect, it must get a 200 response.
So we should check for something else or not have one.

from charts.

tico24 avatar tico24 commented on August 19, 2024

I have removed the probe for now to stop the flapping, but I'll leave this open for now... maybe there's a sensible exec command to use instead.

from charts.

Hackatosh avatar Hackatosh commented on August 19, 2024

Hello ! I think we could use the mongo db health check I implemented : sorry-cypress/sorry-cypress#589

This way the director will be considered ready when the express server is listening and the connexion with MongoDB is working.

from charts.

tico24 avatar tico24 commented on August 19, 2024

This would (obviously) only be a solution if the user has chosen to use a mongodb though.

from charts.

Hackatosh avatar Hackatosh commented on August 19, 2024

Then I think we should just implement an API health check that respond a 200 if the API is running

from charts.

Hackatosh avatar Hackatosh commented on August 19, 2024

Is there really an option to not use a MongoDB though ? 🤔 Of course you can fork the project and implement a new ExecutionDriver but it means you rewrite almost half the codebase

from charts.

tico24 avatar tico24 commented on August 19, 2024

Ah yeh. It's still technically possible.. you just don't get an API.

And executionDriver: "../execution/in-memory" is valid.

from charts.

Hackatosh avatar Hackatosh commented on August 19, 2024

The health check is not specific to the mongodb. Your execution driver must implement a isDbHealthy method (which returns true immediately when you use the in-memory driver)

app.get('/health-check-db', catchRequestHandlerErrors(async (_, res) => { const executionDriver = await getExecutionDriver(); (await executionDriver.isDBHealthy()) ? res.sendStatus(200) : res.sendStatus(503); }) );

So I guess using this as a readyness probe can work. Or else we just write something like this :

app.get( '/health-check', (req, res) => { res.sendStatus(200); } );

from charts.

tico24 avatar tico24 commented on August 19, 2024

Sounds possible then. I probably can't get to this this week, will happily accept PRs :)

from charts.

tico24 avatar tico24 commented on August 19, 2024

Resoved by PR #134

from charts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.