SlangLab-NU / VoiceCollector

Apache License 2.0
1 stars 1 forks source link

26 change backend server to gunicorn #29

Closed macarious closed 10 months ago

macarious commented 10 months ago

Major changes

Split the original docker-compose.yml into 2 versions:

Minor changes

Instructions to build and run the containers

See DOCKER_REAMD.md.

Server Log

Using docker-compose.dev.yml, the server log should state that it is a development server:

2023-08-30 10:28:57  * Serving Flask app '__init__.py'
2023-08-30 10:28:57  * Debug mode: off
2023-08-30 10:28:57 Level: INFO
2023-08-30 10:28:57 Time: 2023-08-30 17:28:57,453
2023-08-30 10:28:57 Logger: werkzeug
2023-08-30 10:28:57 Path: _internal:224
2023-08-30 10:28:57 Function :_log
2023-08-30 10:28:57 Message: WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
2023-08-30 10:28:57  * Running on all addresses (0.0.0.0)
2023-08-30 10:28:57  * Running on http://127.0.0.1:5000
2023-08-30 10:28:57  * Running on http://172.18.0.4:5000
2023-08-30 10:28:57 
2023-08-30 10:28:57 Level: INFO
2023-08-30 10:28:57 Time: 2023-08-30 17:28:57,454
2023-08-30 10:28:57 Logger: werkzeug
2023-08-30 10:28:57 Path: _internal:224
2023-08-30 10:28:57 Function :_log
2023-08-30 10:28:57 Message: Press CTRL+C to quit
2023-08-30 10:28:57

Using docker-compose.prod.yml, the server log, when starting, states that it is using gunicorn:

2023-08-30 10:31:11 [2023-08-30 17:31:11 +0000] [1] [INFO] Starting gunicorn 20.0.4
2023-08-30 10:31:11 [2023-08-30 17:31:11 +0000] [1] [INFO] Listening at: http://0.0.0.0:5000 (1)
2023-08-30 10:31:11 [2023-08-30 17:31:11 +0000] [1] [INFO] Using worker: sync
2023-08-30 10:31:11 [2023-08-30 17:31:11 +0000] [7] [INFO] Booting worker with pid: 7
2023-08-30 10:31:11 [2023-08-30 17:31:11 +0000] [8] [INFO] Booting worker with pid: 8
2023-08-30 10:31:11 [2023-08-30 17:31:11 +0000] [9] [INFO] Booting worker with pid: 9
2023-08-30 10:31:11 [2023-08-30 17:31:11 +0000] [10] [INFO] Booting worker with pid: 10
macarious commented 10 months ago

Everything is working except please move server folder and web folder into dockerfiles folder otherwise those images won't build.

I was able to recreate the issue by clearing my cache in my docker app. I have updated the paths in the following files:

The containers should be able to be built and ran now.

ztybigcat commented 10 months ago

I misunderstood the behaviour of the app and thought the recording function is still under development thus not working, but after some communication, it seems not be the case. Upon further testing, I find the recording function is not working unless the server is serving on localhost; Even when I run the program on localhost (with port forwarding), the app is missing some assets (thomas_birthday?) and the submission function is not working. I might be missing something here as I am not familiar with the app and the issue could be totally unrelated to docker, but I suggest we hold off merging until we can figure it out. Please let me know

aanchan commented 10 months ago

Hey @ztybigcat @macarious I think references.txt needs to be reverted to this old version : https://github.com/SlangLab-NU/VoiceCollector/blob/585a11ef2442279cdd4f969734aa9875e2a00992/server/app/references.txt. The one that is on dev I think crept in by error somehow.