From 33b588aeb04fad4a5dfbe7fd1ff3028a4425d440 Mon Sep 17 00:00:00 2001 From: Carl Date: Tue, 23 Jan 2024 16:31:54 -0800 Subject: [PATCH 1/7] install texlive conditionally --- scripts/install_texlive.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/install_texlive.sh b/scripts/install_texlive.sh index 98060b00..aabd5131 100755 --- a/scripts/install_texlive.sh +++ b/scripts/install_texlive.sh @@ -1,4 +1,10 @@ #!/bin/bash + +if [[ -x "/usr/bin/latex" ]]; then + echo "texlive already installed" + exit 0 +fi + set -e CTAN_REPO=${1:-${CTAN_REPO:-"https://mirror.ctan.org/systems/texlive/tlnet"}} From 9cd27b923520606e62e232ed5db92696aab0adb0 Mon Sep 17 00:00:00 2001 From: Carl Date: Tue, 23 Jan 2024 21:10:09 -0800 Subject: [PATCH 2/7] update install scripts that assume manual tlmgr-based texlive --- scripts/install_jupyter.sh | 15 +++++++++------ scripts/install_verse.sh | 10 +++++++--- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/scripts/install_jupyter.sh b/scripts/install_jupyter.sh index 00db0ab2..832dde5c 100755 --- a/scripts/install_jupyter.sh +++ b/scripts/install_jupyter.sh @@ -43,12 +43,15 @@ if ! command -v tlmgr; then source /rocker_scripts/install_texlive.sh fi -# Install tex packages needed for Jupyter's nbconvert to work correctly & convert to PDF -# Sourced from https://github.com/jupyter/nbconvert/issues/1328 -tlmgr install adjustbox caption collectbox enumitem environ eurosym etoolbox jknapltx parskip \ - pdfcol pgf rsfs tcolorbox titling trimspaces ucs ulem upquote \ - ltxcmds infwarerr iftex kvoptions kvsetkeys float geometry amsmath fontspec \ - unicode-math fancyvrb grffile hyperref booktabs soul ec +# If we are using official Ubuntu binaries, we do not need tex packages installed manually with tlmgr +if [[ ! -x "/usr/bin/latex" ]]; then + # Install tex packages needed for Jupyter's nbconvert to work correctly & convert to PDF + # Sourced from https://github.com/jupyter/nbconvert/issues/1328 + tlmgr install adjustbox caption collectbox enumitem environ eurosym etoolbox jknapltx parskip \ + pdfcol pgf rsfs tcolorbox titling trimspaces ucs ulem upquote \ + ltxcmds infwarerr iftex kvoptions kvsetkeys float geometry amsmath fontspec \ + unicode-math fancyvrb grffile hyperref booktabs soul ec +fi # Clean up rm -rf /var/lib/apt/lists/* diff --git a/scripts/install_verse.sh b/scripts/install_verse.sh index 97f3d368..49d87f86 100755 --- a/scripts/install_verse.sh +++ b/scripts/install_verse.sh @@ -74,9 +74,13 @@ apt-get remove -y systemd apt-get -y autoremove ## Add LaTeX, rticles and bookdown support -wget "https://travis-bin.yihui.name/texlive-local.deb" -dpkg -i texlive-local.deb -rm texlive-local.deb + +## tinytex recommends a dummy texlive if using tlmgr manually +if [[ ! -x "/usr/bin/latex" ]]; then + wget "https://travis-bin.yihui.name/texlive-local.deb" + dpkg -i texlive-local.deb + rm texlive-local.deb +fi ## Install texlive /rocker_scripts/install_texlive.sh From e35ab9a5ee1ee5d8df6658f0a71ce7b7b30a86b3 Mon Sep 17 00:00:00 2001 From: Carl Date: Tue, 23 Jan 2024 21:10:25 -0800 Subject: [PATCH 3/7] update test matrix --- tests/rocker_scripts/matrix.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/rocker_scripts/matrix.json b/tests/rocker_scripts/matrix.json index bf07564a..bc602018 100644 --- a/tests/rocker_scripts/matrix.json +++ b/tests/rocker_scripts/matrix.json @@ -17,7 +17,8 @@ "install_python.sh", "install_jupyter.sh", "install_julia.sh", - "install_cuda-10.1.sh" + "install_cuda-10.1.sh", + "install_texlive.sh" ], "script_arg": [ "none" @@ -65,6 +66,12 @@ "script_name": "install_tensorflow.sh", "script_arg": "none" }, + { + "base_image": "rocker/cuda", + "tag": "cuda11.1", + "script_name": "install_texlive.sh", + "script_arg": "none" + }, { "base_image": "rocker/cuda", "tag": "cuda11.1", From 20e6673ac3c20810a30d5a0ccb9e73f83031f78f Mon Sep 17 00:00:00 2001 From: Carl Boettiger Date: Wed, 24 Jan 2024 12:37:09 -0800 Subject: [PATCH 4/7] Update scripts/install_verse.sh Co-authored-by: eitsupi <50911393+eitsupi@users.noreply.github.com> --- scripts/install_verse.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install_verse.sh b/scripts/install_verse.sh index 49d87f86..54fabed8 100755 --- a/scripts/install_verse.sh +++ b/scripts/install_verse.sh @@ -74,7 +74,6 @@ apt-get remove -y systemd apt-get -y autoremove ## Add LaTeX, rticles and bookdown support - ## tinytex recommends a dummy texlive if using tlmgr manually if [[ ! -x "/usr/bin/latex" ]]; then wget "https://travis-bin.yihui.name/texlive-local.deb" From 26cd4757648546b23c3fead803af9c16fe9a9e03 Mon Sep 17 00:00:00 2001 From: Carl Boettiger Date: Wed, 24 Jan 2024 12:59:18 -0800 Subject: [PATCH 5/7] Update tests/rocker_scripts/matrix.json Co-authored-by: eitsupi <50911393+eitsupi@users.noreply.github.com> --- tests/rocker_scripts/matrix.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/rocker_scripts/matrix.json b/tests/rocker_scripts/matrix.json index bc602018..d3a95122 100644 --- a/tests/rocker_scripts/matrix.json +++ b/tests/rocker_scripts/matrix.json @@ -68,7 +68,7 @@ }, { "base_image": "rocker/cuda", - "tag": "cuda11.1", + "tag": "latest", "script_name": "install_texlive.sh", "script_arg": "none" }, From e09ba25f095b384dda42f00df84f5e76c6f841c3 Mon Sep 17 00:00:00 2001 From: Carl Date: Wed, 24 Jan 2024 13:00:41 -0800 Subject: [PATCH 6/7] set -e first --- scripts/install_texlive.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install_texlive.sh b/scripts/install_texlive.sh index aabd5131..c76b4ac3 100755 --- a/scripts/install_texlive.sh +++ b/scripts/install_texlive.sh @@ -1,12 +1,11 @@ #!/bin/bash +set -e if [[ -x "/usr/bin/latex" ]]; then echo "texlive already installed" exit 0 fi -set -e - CTAN_REPO=${1:-${CTAN_REPO:-"https://mirror.ctan.org/systems/texlive/tlnet"}} ARCH=$(uname -m) From 862715ba4f8d12be2c794daa41dc64fc5509b3f7 Mon Sep 17 00:00:00 2001 From: Carl Date: Wed, 24 Jan 2024 13:02:37 -0800 Subject: [PATCH 7/7] fix test matrix --- tests/rocker_scripts/matrix.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/rocker_scripts/matrix.json b/tests/rocker_scripts/matrix.json index d3a95122..6201f189 100644 --- a/tests/rocker_scripts/matrix.json +++ b/tests/rocker_scripts/matrix.json @@ -17,8 +17,7 @@ "install_python.sh", "install_jupyter.sh", "install_julia.sh", - "install_cuda-10.1.sh", - "install_texlive.sh" + "install_cuda-10.1.sh" ], "script_arg": [ "none" @@ -69,7 +68,7 @@ { "base_image": "rocker/cuda", "tag": "latest", - "script_name": "install_texlive.sh", + "script_name": "install_verse.sh", "script_arg": "none" }, {