IACR / latex-submit

Web server to receive uploaded LaTeX and execute it in a docker container.
GNU Affero General Public License v3.0
11 stars 0 forks source link

We need a clean way to shut down for maintenance #36

Open kmccurley opened 1 year ago

kmccurley commented 1 year ago

It is relatively straightforward to shut down apache to stop taking new requests, but it's a bit awkward when there are compilations in the queue to be run. The author's browser would then be polling on the status of the compilation, but once you shut down apache it would lose the executor for tasks, and would cancel any existing task including any that are running. The python could would probably receive some kind of exception, but I'm not sure what kind. The browser would never receive another response to the polling, so we should probably set something up to respond to those with a status message that the system was taken down for maintenance.

kmccurley commented 1 year ago

We need this because I'm not sure what happens when we rebuild the docker file. Rebuilding the docker file is currently required if we add or remove packages, update to a newer texlive, update cryptobib, or update the iacrcc.cls. If we have to rebuild the docker file from scratch, I've timed it at 18 minutes on my fast desktop. I'm not sure if rebuilding a docker image is atomic - in other words I don't know what happens if someone starts a compilation while a docker image is being rebuilt.

There is a separate issue about how often we need to update cryptobib.

kmccurley commented 5 months ago

I have now figured out a way to take the site offline, but it's a bit clumsy. There are three lines in /etc/apache2/sites-available/000-default-le-ssl.conf that need to be commented out, and this disables the mapping of the site to the flask app and instead serves a static page saying that the site is offline. This is documented in the config file. Unfortunately it requires restarting the apache server using apachectl restart (maybe we could just do an apachectl reload to reload the config).