From 9f75718caf08b24c47c2bbafdc7377c061af5d6a Mon Sep 17 00:00:00 2001 From: RolandASc Date: Mon, 25 Sep 2023 18:13:12 +0200 Subject: [PATCH 01/13] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..6b14155 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,39 @@ +# Docker +# Build and push an image to Azure Container Registry +# https://docs.microsoft.com/azure/devops/pipelines/languages/docker + +trigger: +- develop + +resources: +- repo: self + +variables: + # Container registry service connection established during pipeline creation + dockerRegistryServiceConnection: '6284f62b-b5ab-43fb-a236-b29ffaaada8e' + imageRepository: 'smarp' + containerRegistry: 'miraiappregistry.azurecr.io' + dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile' + tag: '$(Build.BuildId)' + + # Agent VM image name + vmImageName: 'ubuntu-latest' + +stages: +- stage: Build + displayName: Build and push stage + jobs: + - job: Build + displayName: Build + pool: + vmImage: $(vmImageName) + steps: + - task: Docker@2 + displayName: Build and push an image to container registry + inputs: + command: buildAndPush + repository: $(imageRepository) + dockerfile: $(dockerfilePath) + containerRegistry: $(dockerRegistryServiceConnection) + tags: | + $(tag) From f6da8158833e7b7782d377f35be9272c2c338383 Mon Sep 17 00:00:00 2001 From: Roland Schmid Date: Tue, 26 Sep 2023 10:24:28 +0200 Subject: [PATCH 02/13] switch base, add info --- Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ce5dfff..71c8893 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,13 @@ -FROM rocker/r-ver:3.5.3 +FROM rocker/r-ver:4.2.3 +## Ubuntu 22.04 jammy +# -> don't use latest R release, since that will keep getting linked with later build-dates and RStudio packagemanager +# -> sets repository to RStudio packagemanager for specific build date of R version, being 2023-04-20 for R 4.2.3 +# (see https://github.com/rocker-org/rocker-versioned2/blob/master/dockerfiles/r-ver_4.2.3.Dockerfile for reference) +# -> installs R to /usr/local/lib/R +# libnode-dev ? +# graphics Cairo: libcairo2-dev libxt-dev +# apt-utils ## Install required dependencies RUN apt-get update \ && apt-get install -y --no-install-recommends \ From 2235138efc5915deeb3dcc039ecafbfbe6664060 Mon Sep 17 00:00:00 2001 From: Roland Schmid Date: Tue, 26 Sep 2023 10:50:26 +0200 Subject: [PATCH 03/13] update texlive ctan repo --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 71c8893..8657d9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,8 @@ COPY docker/install_tinytex.sh . # - here we consider the frozen TeXLive 2016 snapshot, corresponding to the TeXLive release # shipped as texlive-* in Debian stretch (base image for the rocker/verse currently used) # - note that https was not supported in TeXLive 2016 for the CTAN repository -ENV CTAN_REPO=http://www.texlive.info/tlnet-archive/2017/04/13/tlnet +# jammy: 2021.20220204-1: all +ENV CTAN_REPO=https://texlive.info/tlnet-archive/2022/02/04/tlnet # - It is important to also install all required LaTeX packages when building the image RUN sh install_tinytex.sh fancyhdr ## Script for re-installation of TinyTeX in the running container From 8acd79dbd515cff471dc64ac3d38acb0a1465c95 Mon Sep 17 00:00:00 2001 From: Roland Schmid Date: Tue, 26 Sep 2023 10:59:25 +0200 Subject: [PATCH 04/13] update (fix) path to yihui's install script --- docker/install_tinytex.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/install_tinytex.sh b/docker/install_tinytex.sh index 6572ac7..e0be2d1 100644 --- a/docker/install_tinytex.sh +++ b/docker/install_tinytex.sh @@ -5,10 +5,10 @@ # - texinfo (for TinyTeX) # - ghostscript (for pdfcrop) -## Admin-based install of TinyTeX: +## Admin-based install of TinyTeX: (raw or tree below?) install2.r --error --skipinstalled tinytex \ && wget -qO- \ - "https://github.com/yihui/tinytex/raw/master/tools/install-unx.sh" | \ + "https://github.com/rstudio/tinytex/tree/main/tools/install-unx.sh" | \ sh -s - --admin --no-path \ && mv ~/.TinyTeX /opt/TinyTeX \ && /opt/TinyTeX/bin/*/tlmgr path add From d2bc47f6327cc2b20d03a66d900c24dcd85af5e8 Mon Sep 17 00:00:00 2001 From: Roland Schmid Date: Tue, 26 Sep 2023 11:28:00 +0200 Subject: [PATCH 05/13] try http --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8657d9f..5b18f6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,7 @@ COPY docker/install_tinytex.sh . # shipped as texlive-* in Debian stretch (base image for the rocker/verse currently used) # - note that https was not supported in TeXLive 2016 for the CTAN repository # jammy: 2021.20220204-1: all -ENV CTAN_REPO=https://texlive.info/tlnet-archive/2022/02/04/tlnet +ENV CTAN_REPO=http://www.texlive.info/tlnet-archive/2022/02/04/tlnet # - It is important to also install all required LaTeX packages when building the image RUN sh install_tinytex.sh fancyhdr ## Script for re-installation of TinyTeX in the running container From 6451c3a19627ebc0e92128cfd7abc8692fada5ca Mon Sep 17 00:00:00 2001 From: Roland Schmid Date: Tue, 26 Sep 2023 11:45:24 +0200 Subject: [PATCH 06/13] ctan repo as in rocker image --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5b18f6f..72702dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,9 @@ COPY docker/install_tinytex.sh . # shipped as texlive-* in Debian stretch (base image for the rocker/verse currently used) # - note that https was not supported in TeXLive 2016 for the CTAN repository # jammy: 2021.20220204-1: all -ENV CTAN_REPO=http://www.texlive.info/tlnet-archive/2022/02/04/tlnet +ENV CTAN_REPO=https://www.texlive.info/tlnet-archive/2022/02/04/tlnet +#ENV CTAN_REPO=https://www.texlive.info/tlnet-archive/2023/04/20/tlnet +#ENV PATH=$PATH:/usr/local/texlive/bin/linux # - It is important to also install all required LaTeX packages when building the image RUN sh install_tinytex.sh fancyhdr ## Script for re-installation of TinyTeX in the running container From bef844d462cb55d70d01b89059aaeac74addba60 Mon Sep 17 00:00:00 2001 From: Roland Schmid Date: Tue, 26 Sep 2023 12:02:50 +0200 Subject: [PATCH 07/13] test raw instead of tree --- docker/install_tinytex.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docker/install_tinytex.sh b/docker/install_tinytex.sh index e0be2d1..53290df 100644 --- a/docker/install_tinytex.sh +++ b/docker/install_tinytex.sh @@ -6,9 +6,10 @@ # - ghostscript (for pdfcrop) ## Admin-based install of TinyTeX: (raw or tree below?) -install2.r --error --skipinstalled tinytex \ -&& wget -qO- \ - "https://github.com/rstudio/tinytex/tree/main/tools/install-unx.sh" | \ +install2.r --error --skipinstalled tinytex + +wget -qO- \ + "https://github.com/rstudio/tinytex/raw/main/tools/install-unx.sh" | \ sh -s - --admin --no-path \ && mv ~/.TinyTeX /opt/TinyTeX \ && /opt/TinyTeX/bin/*/tlmgr path add From d5f7f1ce195ea9f2ebc03cc691dd3e66d58970b2 Mon Sep 17 00:00:00 2001 From: Roland Schmid Date: Tue, 26 Sep 2023 14:04:43 +0200 Subject: [PATCH 08/13] comments --- Dockerfile | 14 ++++++++------ docker/install_tinytex.sh | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 72702dd..63b9d77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,7 @@ RUN apt-get update \ # - https://pandoc.org/installing.html#linux # We should use the same version as in rocker/rstudio: # docker run --rm rocker/rstudio: /usr/lib/rstudio-server/bin/pandoc/pandoc -v +# RSc: TODO: need to check and update pandoc version here ENV PANDOC_DEB="2.3.1/pandoc-2.3.1-1-amd64.deb" COPY docker/install_pandoc.sh . RUN sh install_pandoc.sh $PANDOC_DEB && rm install_pandoc.sh @@ -38,15 +39,16 @@ RUN sh install_pandoc.sh $PANDOC_DEB && rm install_pandoc.sh ## Install TinyTeX as LaTeX installation COPY docker/install_tinytex.sh . # - Use a version-stable tlnet archive CTAN repo from texlive.info -# - here we consider the frozen TeXLive 2016 snapshot, corresponding to the TeXLive release -# shipped as texlive-* in Debian stretch (base image for the rocker/verse currently used) -# - note that https was not supported in TeXLive 2016 for the CTAN repository -# jammy: 2021.20220204-1: all +# - here we consider a frozen TeXLive snapshot, corresponding to the TeXLive +# release shipped as texlive-* in Ubuntu 22.04 jammy (2021.20220204-1: all) ENV CTAN_REPO=https://www.texlive.info/tlnet-archive/2022/02/04/tlnet -#ENV CTAN_REPO=https://www.texlive.info/tlnet-archive/2023/04/20/tlnet -#ENV PATH=$PATH:/usr/local/texlive/bin/linux +# rocker/verse:4.2.3 would pick texlive rather than tinytex, with the following vars: +# ENV CTAN_REPO=https://www.texlive.info/tlnet-archive/2023/04/20/tlnet +# ENV PATH=$PATH:/usr/local/texlive/bin/linux + # - It is important to also install all required LaTeX packages when building the image RUN sh install_tinytex.sh fancyhdr + ## Script for re-installation of TinyTeX in the running container # - needed if at a certain point the "Remote repository is newer than local", # for non-version-stable TinyTeX installations diff --git a/docker/install_tinytex.sh b/docker/install_tinytex.sh index 53290df..fce3aec 100644 --- a/docker/install_tinytex.sh +++ b/docker/install_tinytex.sh @@ -5,7 +5,7 @@ # - texinfo (for TinyTeX) # - ghostscript (for pdfcrop) -## Admin-based install of TinyTeX: (raw or tree below?) +## Admin-based install of TinyTeX: install2.r --error --skipinstalled tinytex wget -qO- \ @@ -13,6 +13,7 @@ wget -qO- \ sh -s - --admin --no-path \ && mv ~/.TinyTeX /opt/TinyTeX \ && /opt/TinyTeX/bin/*/tlmgr path add + ## LaTeX packages from rocker/verse and app-specific packages passed as arguments tlmgr install \ ae inconsolata listings metafont mfware pdfcrop parskip tex \ From 685d66582cc97392f8857442695cfa7b4de29078 Mon Sep 17 00:00:00 2001 From: Roland Schmid Date: Mon, 2 Oct 2023 10:13:06 +0200 Subject: [PATCH 09/13] commit base version of data objects there may be a check that will otherwise assume lazydata is unnecessary and the generated data objects won't be moved to lazyload db --- .gitignore | 2 +- data/IB.rda | Bin 0 -> 805 bytes data/VM.rda | Bin 0 -> 477 bytes 3 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 data/IB.rda create mode 100644 data/VM.rda diff --git a/.gitignore b/.gitignore index 088ab7d..7a9bbe4 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,4 @@ vignettes/*.pdf *.knit.md .Rproj.user # data files created through `configure` -data/*.rda +# data/*.rda diff --git a/data/IB.rda b/data/IB.rda new file mode 100644 index 0000000000000000000000000000000000000000..a6c6d2a18394960f3bdbdfe9e7e3f44370846467 GIT binary patch literal 805 zcmV+=1KRu_iwFP!0000028C5iZ__{!Hhn=WD3vNMz+n;Bwx}scRXL?CR1s=xr4_2U zpp8AYSFCrfeWb}h;8!DNz3U|16mdvm&(7o9Z@!rf&+m@5?zWO7SxwefR+80qd`vdZ z(!<`TUVpuq`;d=jFa&)5@(pZ&M zR6~0y>fw&4W;zP#hpWJ(fy_Yel3OK~QU3yHbXOid9AIte5{BZEPFQVgLTiaw93dp5 zg5;3f%#cFK+LL7HgpN2MzD(l%$BdHk4E{qlkk^G~707CQjSs2RnvED|X6oG04-~1X zDw*pc)*{Mvq^9n+d>Vzn`_lSXpumG$ii`r@T-kbr5vb6tVmwDdVS{qC93Drm-!2ql z!zOdQ*Z~pWs&1_inF z6p(v{n9e;9gTO<>!4c)@z@{NVjm4RudXbnhDvi|4NEK`Bt=Cu%8vXMJ z+oz1F`S_@u9}oSPrjPqs1}MCY^33w~+8Rlv3bzer(|!*%!A@H?wB<%eOL|>kKu7Ry zFm9f@y_~zj2!^m#)1%nX3x=)qXeNZt(u*w5d_(3*Zs}wQoIw!`FP#CaUN^pt!TdCs zyRfUXFqFZtanlY)c-!%B7wsf0ggw8VHjqXb-Jtx$p|MS{Y^OaI)U^=1ioNgtyN0v= j^vmx2)dOP$fBOOixI#k|k8)G~$9?_+l}rHdO9ub|rmKbn literal 0 HcmV?d00001 diff --git a/data/VM.rda b/data/VM.rda new file mode 100644 index 0000000000000000000000000000000000000000..4b1b39d5187c71b8da5d9b04fbc4d38ac2465780 GIT binary patch literal 477 zcmV<30V4h%iwFP!0000025nMJYuqppRW~1yB@1bDX`u~6j%7>ehW>ygrJ;vXvk4{X z#VFRSEwCjaOPlQe_>l33yj!IQ+tQnPGjE<}{{8NJd^cu{?Xca^i0$mrk?mh4UuWND zj3BzbVY}>rzN0_C=ygn|2|Y(!k?U(z0xifII8c2ueFJRxhPM5tTi;l-3n3?SGY{>`(XFLtSWJ3V6W2ivV6)XtB`V_ZHkI7wEpMyp}TOOLS77NX?C#L8u(`-fNYR2L|zsf8O}a=V(scIp&6?EP>e0$3i~*W6_t^qMs_$RqW+iT=ezSVOVf06Vu Date: Mon, 2 Oct 2023 10:34:39 +0200 Subject: [PATCH 10/13] need to keep sth in data --- .gitignore | 2 ++ tools/config/cleanup.R | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7a9bbe4..16ef00a 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,5 @@ vignettes/*.pdf .Rproj.user # data files created through `configure` # data/*.rda +# keep it here, this strategy got broken in Spring 2021, see e.g.: +# https://stackoverflow.com/questions/66860659/lazydata-is-specified-without-a-data-directory-error-when-submitting-r-packa diff --git a/tools/config/cleanup.R b/tools/config/cleanup.R index 5b6ba83..d707af7 100644 --- a/tools/config/cleanup.R +++ b/tools/config/cleanup.R @@ -1,4 +1,6 @@ # Clean up files generated during configuration here. # Use 'remove_file()' to remove files generated during configuration. -unlink("data", recursive = TRUE) +# unlink("data", recursive = TRUE) +# keep it here, this strategy got broken in Spring 2021, see e.g.: +# https://stackoverflow.com/questions/66860659/lazydata-is-specified-without-a-data-directory-error-when-submitting-r-packa From fb9e2042ecdf4773659d56a5a87442de3610e1c4 Mon Sep 17 00:00:00 2001 From: Roland Schmid Date: Mon, 2 Oct 2023 11:03:47 +0200 Subject: [PATCH 11/13] further adjustments for lazyload changes... --- .Rbuildignore | 1 - .gitignore | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index e6b50ed..7f34dbc 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,4 +1,3 @@ -^data$ ^doc$ ^man-roxygen$ ^Meta$ diff --git a/.gitignore b/.gitignore index 16ef00a..ce46b83 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ vignettes/*.pdf # data/*.rda # keep it here, this strategy got broken in Spring 2021, see e.g.: # https://stackoverflow.com/questions/66860659/lazydata-is-specified-without-a-data-directory-error-when-submitting-r-packa +# note: at the same time, it has also become necessary to NOT exclude the data directory in .Rbuildignore. From bc357fca80ce167520a4693efcc58c676dc5b194 Mon Sep 17 00:00:00 2001 From: Roland Schmid Date: Mon, 2 Oct 2023 11:23:31 +0200 Subject: [PATCH 12/13] add latest tag for CD --- .gitignore | 1 + azure-pipelines.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index ce46b83..b32a8f4 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ vignettes/*.pdf # keep it here, this strategy got broken in Spring 2021, see e.g.: # https://stackoverflow.com/questions/66860659/lazydata-is-specified-without-a-data-directory-error-when-submitting-r-packa # note: at the same time, it has also become necessary to NOT exclude the data directory in .Rbuildignore. +# https://stat.ethz.ch/R-manual/R-devel/doc/manual/R-exts.html#Checking-and-building-packages diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6b14155..e8b990a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -37,3 +37,4 @@ stages: containerRegistry: $(dockerRegistryServiceConnection) tags: | $(tag) + latest From 9281ccd7e14487520fef9881ccaa5a9a3205a79f Mon Sep 17 00:00:00 2001 From: RolandASc Date: Tue, 7 Nov 2023 11:34:34 +0100 Subject: [PATCH 13/13] add pandoc info --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 63b9d77..fd65f2b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,8 @@ RUN apt-get update \ # - https://pandoc.org/installing.html#linux # We should use the same version as in rocker/rstudio: # docker run --rm rocker/rstudio: /usr/lib/rstudio-server/bin/pandoc/pandoc -v -# RSc: TODO: need to check and update pandoc version here +# docker run --rm rocker/rstudio:4.2.3 /usr/lib/rstudio-server/bin/quarto/bin/tools/pandoc -v +# --> pandoc 2.19.2 ENV PANDOC_DEB="2.3.1/pandoc-2.3.1-1-amd64.deb" COPY docker/install_pandoc.sh . RUN sh install_pandoc.sh $PANDOC_DEB && rm install_pandoc.sh