cvpaperchallenge / Crux

Crux is a suite of LLM-empowered summarization and retrieval services for academic activity. Crux is developed by XCCV group of cvpaper.challenge.
MIT License
15 stars 2 forks source link

feat: add dockerfile for backend and add health endpoint #12

Closed gatheluck closed 1 year ago

gatheluck commented 1 year ago

Issue URL

6

Change overview

How to test

  1. Run backend application
% cd environments/cpu
% sudo docker compose up -d
% sudo docker compose exec backend bash

# enter the backend container
$ poetry install
$ make run-backend

poetry run gunicorn 'src.app:main' -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000 -t 60 --log-level info 
[2023-04-26 16:06:13 +0000] [114] [INFO] Starting gunicorn 20.1.0
[2023-04-26 16:06:13 +0000] [114] [INFO] Listening at: http://0.0.0.0:8000 (114)
[2023-04-26 16:06:13 +0000] [114] [INFO] Using worker: uvicorn.workers.UvicornWorker
[2023-04-26 16:06:13 +0000] [117] [INFO] Booting worker with pid: 117
[2023-04-26 16:06:14 +0000] [117] [WARNING] ASGI app factory detected. Using it, but please consider setting the --factory flag explicitly.
[2023-04-26 16:06:14 +0000] [117] [INFO] Started server process [117]
[2023-04-26 16:06:14 +0000] [117] [INFO] Waiting for application startup.
[2023-04-26 16:06:14 +0000] [117] [INFO] Application startup complete.
  1. Visit http://localhost:8000/docs. You will see the page like following. Screenshot from 2023-04-27 01-27-32 You can also try health endpoint by pushing "Try it out" button and "Execute" button. Screenshot from 2023-04-27 01-29-00

  2. After test please don't forget to stop or down containers.

% cd environments/cpu
% sudo docker compose stop

Note for reviewers

NA