-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: LaTeX processing in external Docker container #446
Refactor: LaTeX processing in external Docker container #446
Conversation
* solves current permission issues that prevented the working folder from being rm -rf'd from the api * this ensures that input.pdf and input.log still exist when the script successfully completes
We also probably need to make sure to update the GitHub actions so that it tests using the separate containers |
…atex-docker-downsize-api
eddd49b
to
2e0c0a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty close now - just a few minor things to look at.
# This script is copied into tmp/rails-latex/$WORK_DIR/ and executed by rails-latex | ||
|
||
WORK_DIR=$(basename "$PWD") | ||
docker exec -t $LATEX_CONTAINER_NAME $LATEX_BUILD_PATH $WORK_DIR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check that these environment variables exist - either here or in the application.rb file. Then report an error so that the config can be checked.
$LATEX_CONTAINER_NAME
$LATEX_BUILD_PATH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we default LATEX_BUILD_PATH to /texlive/shell/latex_build.sh if it is not set?
Depends on doubtfire-lms/doubtfire-deploy#29
Description
This update moves LaTeX processing into a dedicated TeX Live container. Instead of running
lualatex
from the latex_config, the latex_run.sh script is executed after being copied into the working directory (along with other input files such asinput.tex
andjupynotex.py
).latex_run.sh
then runsdocker exec ...
into the TeX Live container and executes latex_build.sh, which is in charge of running thelualatex
commands.latex_run.sh
relies on two environment variables to be set:The
render_to_string()
method that renders the PDFs is now wrapped in agenerate_pdf()
method defined in latex_helper.rb, ensuring the environment variables are set before executinglatex_run.sh
viarender_to_string
.Type of change
How Has This Been Tested?
rake test
indoubtfire-api
to validate PDF generation.rake db:simulate_signoff
which will create several tasks and render them with lualatex.doubtfire-api/lib/shell/generate_pdfs.sh
Checklist: