arXiv / arxiv-submission-ui

User interface of NG submit system.
MIT License
2 stars 6 forks source link

ARXIVNG-2787 Implement mock compiler service. #163

Closed DavidLFielding closed 4 years ago

DavidLFielding commented 4 years ago

This PR implements a basic mock compiler service for the submission UI ARXIVNG-2787.

The compiler service's converter image (performs TeX compilation) is very large and takes extra time and disk space to download and install. The mock compiler allows developers to skip installation of the large convert image. This is mainly useful when you are evaluating the submission UI and not interested in the compilation details for a specific TeX-based paper.

The initial mock compiler service responds to compilation service API requests and provides a fixed compilation log (/log) and PDF (/product).

By substituting your own PDF and autotex.log file (as compilation_log), and rebuilding the mock compiler service, you may simulate the visual behavior of a specific TeX-based paper. This might be useful when investigating log highlighting on the process page.

I've refactored and reworked the README.md file to have two threads, one for the mock compiler service, and one for the full compilation service. Please feel free to make improvements to the documentation.

To make installation and configuration of the mock compilation service easier for developers I've created a separate docker-compose configuration file call "docker-compose-mock-compiler.yml". Use this configuration file with the '-f ' argument to all docker-compose commands.

The mock compiler service is intended to look and behave like the real thing. The process page checks the compilation status when you advance to the page so the mock compile service must transition through different states. Once you initiate the compilation the mock compile returns the 'In Progress" status in order to render the "Processing Underway" view. The state then changes to 'Complete" for the next status check (after five seconds page refreshes). At this point the PDF and log are available in the process page.

The idea is that someone using the submission UI with mock compiler shouldn't notice anything different from the live compilation service other than the PDF and log being static. If you use the upload2.tar.gz test submission (File Manager Tests) you may not even realize you are using the mock compiler service.

Clearly, there are a lot of things we could do with the mock service, like making it easier to substitute in PDF/logs, and support this for a series of submissions. The initial version seems workable for now.

You should be able to check out the branch, build with "-f docker-compose-mock-compiler.yml" added to all docker-compose commands, and bring up the mock compiler service. Alternatively, you could overwrite the default configuration file with the mock configuration file.

Note: When using the mock compiler service the compiler-api and compiler-worker do not show up in a 'docker-compose ps' command. You should check to make sure the correct series of micoservices is running, including a 'mock-compiler-api' service.

SBBCornell commented 4 years ago

I dont think I know how to review this PR, sorry. Appending "-f docker-compose-mock-compiler.yml" to the docker commands does not spin up submission-ui, just displays information about the docker command. Spinning up this branch without appending it appears to work as expected, though Im not sure what to look for...

David straightened me out on this. There is no error, I was typing the commands incorrectly.