From 2c9979447c8dc9bf31647fca1b854c438f1e1ae8 Mon Sep 17 00:00:00 2001 From: Greg Lin Date: Wed, 12 May 2021 17:35:32 -0500 Subject: [PATCH 1/4] Support custom R tarball URL for testing prerelease builds --- builder/build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builder/build.sh b/builder/build.sh index 2e43653..8f77a36 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -40,7 +40,10 @@ archive_r() { fetch_r_source() { echo "Downloading R-${1}" - if [ "${1}" = devel ]; then + if [ -n "${R_TARBALL_URL}" ]; then + # Custom tarball URL for testing (e.g., R alpha and beta releases) + wget -q "${R_TARBALL_URL}" -O /tmp/R-${1}.tar.gz + elif [ "${1}" = devel ]; then # Download the daily tarball of R devel wget -q https://stat.ethz.ch/R/daily/R-devel.tar.gz -O /tmp/R-devel.tar.gz else From 0098d79df4ed2780c154ce5b213dc79fe8749b15 Mon Sep 17 00:00:00 2001 From: Greg Lin Date: Wed, 12 May 2021 17:09:26 -0500 Subject: [PATCH 2/4] Fix AWS CLI installation on openSUSE 42 AWS CLI v1 is no longer supported on openSUSE 42's Python 2.7/3.4 --- builder/Dockerfile.opensuse-42 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/builder/Dockerfile.opensuse-42 b/builder/Dockerfile.opensuse-42 index f7f9435..27aa035 100644 --- a/builder/Dockerfile.opensuse-42 +++ b/builder/Dockerfile.opensuse-42 @@ -35,8 +35,6 @@ RUN zypper --non-interactive --gpg-auto-import-keys -n install \ pcre2-devel \ perl \ perl-macros \ - python \ - python-pip \ readline-devel \ rpm-build \ ruby \ @@ -64,7 +62,10 @@ RUN zypper --non-interactive --gpg-auto-import-keys -n install \ zlib-devel \ && zypper clean -RUN pip install awscli +RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ + unzip awscliv2.zip && \ + ./aws/install && \ + rm -rf aws awscliv2.zip # Pin fpm for compatibility with Ruby < 2.3 RUN gem install ffi:1.12.2 fpm:1.11.0 && \ From 1c168731cd569b59dbb20aa33c6a7e233f758fb6 Mon Sep 17 00:00:00 2001 From: Greg Lin Date: Thu, 13 May 2021 17:00:15 -0500 Subject: [PATCH 3/4] Install missing TeX packages for R 4.1 in openSUSE R 4.1 now additionally requires texlive-ae and texlive-fancyvrb for PDF doc generation (stats package). --- builder/Dockerfile.opensuse-15 | 2 ++ builder/Dockerfile.opensuse-152 | 2 ++ builder/Dockerfile.opensuse-42 | 2 ++ 3 files changed, 6 insertions(+) diff --git a/builder/Dockerfile.opensuse-15 b/builder/Dockerfile.opensuse-15 index e2f6ea2..6cf0a7b 100644 --- a/builder/Dockerfile.opensuse-15 +++ b/builder/Dockerfile.opensuse-15 @@ -43,9 +43,11 @@ RUN zypper --non-interactive --gpg-auto-import-keys -n install \ shadow \ tcl-devel \ texinfo \ + texlive-ae \ texlive-bibtex \ texlive-cm-super \ texlive-dvips \ + texlive-fancyvrb \ texlive-helvetic \ texlive-inconsolata \ texlive-latex \ diff --git a/builder/Dockerfile.opensuse-152 b/builder/Dockerfile.opensuse-152 index 66c94ed..6990536 100644 --- a/builder/Dockerfile.opensuse-152 +++ b/builder/Dockerfile.opensuse-152 @@ -43,9 +43,11 @@ RUN zypper --non-interactive --gpg-auto-import-keys -n install \ shadow \ tcl-devel \ texinfo \ + texlive-ae \ texlive-bibtex \ texlive-cm-super \ texlive-dvips \ + texlive-fancyvrb \ texlive-helvetic \ texlive-inconsolata \ texlive-latex \ diff --git a/builder/Dockerfile.opensuse-42 b/builder/Dockerfile.opensuse-42 index 27aa035..b98f498 100644 --- a/builder/Dockerfile.opensuse-42 +++ b/builder/Dockerfile.opensuse-42 @@ -42,9 +42,11 @@ RUN zypper --non-interactive --gpg-auto-import-keys -n install \ shadow \ tcl-devel \ texinfo \ + texlive-ae \ texlive-bibtex \ texlive-cm-super \ texlive-dvips \ + texlive-fancyvrb \ texlive-helvetic \ texlive-inconsolata \ texlive-latex \ From ce59242db0da9caf72155c46ee1db82159267421 Mon Sep 17 00:00:00 2001 From: Greg Lin Date: Thu, 13 May 2021 17:00:54 -0500 Subject: [PATCH 4/4] Document how to test the R builds locally --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index d696cb1..518f329 100644 --- a/README.md +++ b/README.md @@ -247,3 +247,37 @@ serverless invoke stepf -n rBuilds -d '{"force": true}' # Rebuild specific R versions serverless invoke stepf -n rBuilds -d '{"force": true, "versions": ["3.6.3", "4.0.2"]}' ``` + +## Testing + +To test the R builds locally, you can build the images: + +```bash +# Build images for all platforms +make docker-build + +# Or build the image for a single platform +(cd builder && docker-compose build ubuntu-2004) +``` + +Then run the build script: + +```bash +# Build R for all platforms +R_VERSION=4.0.5 make docker-build-r + +# Build R for a single platform +(cd builder && R_VERSION=4.0.5 docker-compose up ubuntu-2004) + +# Alternatively, run the build script from within a container +docker run -it --rm --entrypoint "/bin/bash" r-builds:ubuntu-2004 + +# Build R 4.0.5 +R_VERSION=4.0.5 ./build.sh + +# Build R devel +R_VERSION=devel ./build.sh + +# Build a prerelease version of R (e.g., alpha or beta) +R_VERSION=rc R_TARBALL_URL=https://cran.r-project.org/src/base-prerelease/R-latest.tar.gz ./build.sh +```