Closed zmalkmus closed 1 year ago
I am doing a code review for myself. I ended up added updated print statements and error checking because I didn't feel like it was adequate. I believe what I have now is good. I have tested it on a couple PCs. It interacts the same, if not better than it did before.
In the Dockerfile, there is a line that clones the repository from my agvisdev repository to compile and run agvis. When the merge is complete it will have to be updated to be the official repository. I had to leave this in for testing docker with this pull request.
With that being said, I was successfully able to convert the SimpleHTTPServer backend to a Flask web application. I took care to make the installation and use work exactly the same as before. After installing agvis normally, the web app can be run through the Gunicorn web server gateway interface (WSGI) using
agvis run
. The default host and port is stilllocalhost:8810
. The --static parameter of the command has now been removed as all static files must be served from the static folder included in the build.AGVis can be run easily now without the use of docker.
When running agvis through docker, it requires waiting a couple seconds for the flask app to launch.
Starting Agvis
agvis run --host <host> --port <port>
gunicorn -b <host>:<port> -w 1 agvis.app:app
.export FLASK_APP=app.py
, setting the flask environmentexport FLASK_ENV=development
, and running the flask appflask run
.I have not tested using other WSGIs but they should all be able to be used to start AGVis manually in a similar manner. I believe Gunicorn to be the best option and, thus, I have made it a requirement of AGVis.