Skip to content
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

Prepare images for arm64 compatibility #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion r-debug-1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ FROM wch1/r-devel

# RDvalgrind: Install R-devel with valgrind level 2 instrumentation
RUN /tmp/buildR.sh valgrind
RUN RDvalgrind -q -e 'install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev")'
RUN RDvalgrind -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
RUN RDvalgrind -q -e 'pak::pkg_install(c("devtools", "Rcpp", "cpp11", "decor", "roxygen2", "testthat", "memoise", "rmarkdown"))'
2 changes: 1 addition & 1 deletion r-debug-2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
FROM wch1/r-debug-1

RUN /tmp/buildR.sh san
RUN RDsan -q -e 'install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev")'
RUN RDsan -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
RUN RDsan -q -e 'pak::pkg_install(c("devtools", "Rcpp", "cpp11", "decor", "roxygen2", "testthat", "memoise", "rmarkdown"))'
2 changes: 1 addition & 1 deletion r-debug-3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN sed -i 's/^#!\/bin\/bash/#!\/bin\/bash\nulimit -Ss 131072/' /usr/local/bin/R
# Increase stack size in .bashrc, so that it is picked up by RDscriptcsan.
RUN echo "\nulimit -Ss 131072" >> $HOME/.bashrc

RUN RDcsan -q -e 'install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev")'
RUN RDcsan -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
RUN RDcsan -q -e 'pak::pkg_install(c("devtools", "Rcpp", "cpp11", "decor", "roxygen2", "testthat", "memoise", "rmarkdown"))'
2 changes: 1 addition & 1 deletion r-debug-4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ FROM wch1/r-debug-3

# RDstrictbarrier: Make sure that R objects are protected properly.
RUN /tmp/buildR.sh strictbarrier
RUN RDstrictbarrier -q -e 'install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev")'
RUN RDstrictbarrier -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
RUN RDstrictbarrier -q -e 'pak::pkg_install(c("devtools", "Rcpp", "cpp11", "decor", "roxygen2", "testthat", "memoise", "rmarkdown"))'
2 changes: 1 addition & 1 deletion r-debug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ FROM wch1/r-debug-4
# RDthreadcheck: Make sure that R's memory management functions are called
# only from the main R thread.
RUN /tmp/buildR.sh threadcheck
RUN RDthreadcheck -q -e 'install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev")'
RUN RDthreadcheck -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
RUN RDthreadcheck -q -e 'pak::pkg_install(c("devtools", "Rcpp", "cpp11", "decor", "roxygen2", "testthat", "memoise", "rmarkdown"))'
36 changes: 18 additions & 18 deletions r-devel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ MAINTAINER Winston Chang "[email protected]"
# Don't print "debconf: unable to initialize frontend: Dialog" messages
ARG DEBIAN_FRONTEND=noninteractive

# https://blog.thesparktree.com/docker-multi-arch-github-actions
ARG TARGETARCH

# Need this to add R repo
RUN apt-get update && apt-get install -y software-properties-common wget dirmngr

# LLVM-15
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"

# Add R apt repository
RUN wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
RUN add-apt-repository "deb http://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"

# Install basic stuff, R, and other packages that are useful for compiling R
# and R packages.
RUN apt-get update && apt-get install -y \
Expand All @@ -37,9 +36,7 @@ RUN apt-get update && apt-get install -y \
vim \
less \
wget \
r-base \
r-base-dev \
r-recommended \
curl \
automake \
libtool \
fonts-texgyre \
Expand All @@ -53,6 +50,7 @@ RUN apt-get update && apt-get install -y \
libssl-dev \
libgit2-dev \
libxml2-dev \
libreadline-dev \
texinfo \
rsync \
default-jdk \
Expand Down Expand Up @@ -81,26 +79,28 @@ RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 800 \
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-15 \
--slave /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-15

# https://blog.thesparktree.com/docker-multi-arch-github-actions
RUN case ${TARGETARCH} in \
"amd64") RIG_ARCH= ;; \
"arm64") RIG_ARCH=-arm64 ;; \
*) false ;; \
esac \
&& curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux${RIG_ARCH}-latest.tar.gz | tar xz -C /usr/local \
&& rig add

RUN echo 'options(\n\
repos = c(CRAN = "https://cloud.r-project.org/"),\n\
download.file.method = "libcurl",\n\
# Detect number of physical cores\n\
Ncpus = parallel::detectCores(logical=FALSE)\n\
)' >> /etc/R/Rprofile.site

# Install some common packages specific to R-release
RUN R -q -e 'pak::pkg_install(c("devtools", "Rcpp", "cpp11", "decor", "roxygen2", "testthat", "memoise", "rmarkdown", "tinytex"))'

# Install TinyTeX (subset of TeXLive)
# From FAQ 5 and 6 here: https://yihui.name/tinytex/faq/
# Also install ae, parskip, and listings packages to build R vignettes
RUN wget -qO- \
"https://yihui.org/gh/tinytex/tools/install-unx.sh" | \
sh -s - --admin --no-path \
"https://yihui.org/gh/tinytex/tools/install-unx.sh" | sh -s - --admin --no-path \
&& ~/.TinyTeX/bin/*/tlmgr path add \
&& tlmgr install metafont mfware inconsolata tex ae parskip listings xcolor \
epstopdf-pkg pdftexcmds kvoptions texlive-scripts grfext \
&& tlmgr path add \
&& Rscript -e "install.packages('tinytex'); tinytex::r_texmf()"
&& Rscript -e "tinytex::r_texmf()"


# =====================================================================
Expand Down Expand Up @@ -143,7 +143,7 @@ RUN /tmp/buildR.sh
# Install some commonly-used packages to a location used by all the RD*
# installations. These packages do not have compiled code and do not depend on
# packages that have compiled code.
RUN RD -q -e 'install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/", "/usr/local/RD/lib/R/library")'
RUN RD -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch), "/usr/local/RD/lib/R/library")'
RUN RD -q -e 'pak::pkg_install(c("BH", "R6", "magrittr"), "/usr/local/RD/lib/R/library")'

# Finally, install some common packages specific to this build of R.
Expand Down