1
0
Fork 0
mirror of https://github.com/overleaf/toolkit.git synced 2025-04-19 07:18:06 +02:00

bin/up: pull TeX Live images before starting up

This commit is contained in:
Jakob Ackermann 2024-05-27 15:32:53 +01:00
parent ca2b2fb2fb
commit 91851d8887
No known key found for this signature in database
GPG key ID: 30C56800FCA3828A
4 changed files with 40 additions and 1 deletions

27
bin/up
View file

@ -46,6 +46,29 @@ function initiate_mongo_replica_set() {
mongo --eval "rs.initiate({ _id: \"overleaf\", members: [ { _id: 0, host: \"mongo:27017\" } ] })" > /dev/null'
}
function pull_sandboxed_compiles() {
if [[ "${SIBLING_CONTAINERS_PULL:-true}" == "false" ]]; then
echo "Skipping pulling of TeX Live images"
return
fi
local images=$(read_variable "ALL_TEX_LIVE_DOCKER_IMAGES")
if [[ -z "$images" ]]; then
echo
echo "Please configure ALL_TEX_LIVE_DOCKER_IMAGES in $TOOLKIT_ROOT/config/variables.env"
echo
echo "You can read more about configuring Sandboxed Compiles in our documentation:"
echo " https://github.com/overleaf/overleaf/wiki/Server-Pro:-sandboxed-compiles#changing-the-texlive-image"
echo
exit 1
fi
echo "Pulling TeX Live images..."
for image in ${images//,/ }; do
echo " - $image download started (may take some time)"
docker pull $image
echo " - $image download finished"
done
}
function __main__() {
if [[ "${1:-null}" == "help" ]] || [[ "${1:-null}" == "--help" ]]; then
usage
@ -60,6 +83,10 @@ function __main__() {
initiate_mongo_replica_set
fi
if [[ "$SIBLING_CONTAINERS_ENABLED" == "true" ]]; then
pull_sandboxed_compiles
fi
exec "$TOOLKIT_ROOT/bin/docker-compose" up "$@"
}