-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
PostgresSQL DB v15 and health check endpoint #5312
Conversation
/check |
❌ Some checks failed |
@azhavoro , I think a little bit and I propose another solution. Could you please think and give me your opinion? Let's have a health check endpoint for CVAT. Thus we can use it in our UI and show that the server is not ready yet. Of course, we don't know the reason why, but we can show possible reasons and recommendations, a link to our documentation. I believe it is a step in the right direction. I will recommend to integrate https://github.com/revsys/django-health-check app. Also we can write small custom plugins and detect some popular problems. For example, OPA isn't running. The problem already can be shown in UI. |
/check |
❌ Some checks failed |
/check |
✔️ All checks completed successfully |
Probably we can try to speed up our tests by simplifying I would suggest: DROP DATABASE IF EXISTS :to WITH FORCE; instead of current: SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'cvat' AND pid <> pg_backend_pid();
DROP DATABASE IF EXISTS :to; But it's necessary to ensure that such solution will give speeding up |
@azhavoro , healthcheck django package provides a command health_check. It can be used to implement https://docs.docker.com/compose/compose-file/compose-file-v3/#healthcheck. Thus we will have a status for cvat_server. https://docs.docker.com/engine/reference/builder/#healthcheck |
/check |
❌ Some checks failed |
docker-compose.yml
Outdated
@@ -155,13 +155,14 @@ services: | |||
labels: | |||
- traefik.enable=true | |||
- traefik.http.services.cvat-ui.loadbalancer.server.port=80 | |||
- traefik.http.routers.cvat-ui.rule=Host(`${CVAT_HOST:-localhost}`) | |||
- traefik.http.routers.cvat-ui.rule=Host(`${CVAT_HOST:-localhost}`) && | |||
! PathPrefix(`/api/`, `/git/`, `/opencv/`, `/static/`, `/admin`, `/documentation/`, `/django-rq`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@azhavoro , why do we need the line now? How is it connected with the patch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nmanovic I think it's better to remove the HEALTHCHECK
command from the Dockerfile for this PR, this currently leads to routing issues related to Traefik container health check behavior traefik/traefik#7732. At the moment I don't find a suitable workaround, so I propose to create a separate issue about adding HEALTHCHECK
instruction to CVAT server docker image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Let's do that in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Motivation and context
How has this been tested?
Checklist
develop
branchcvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.