Version/Environment (if relevant):
This applies to Compute Environments running specific version of R, like R version 4.0
Issue:
This article is an illustration of some of the complexities of package and library dependencies when building environments. The cases below are meant as examples to help you and your R experts foster your own ideas for determining how you want to build your compute environment.
When attempting to use R 4.0, adding R's devtools package to a Compute Environment's dockerfile instructions resulted in a build error, like:
Oct 04 2022 11:26:06 -0400 #9 153.9 ERROR: dependency ‘pkgdown’ is not available for package ‘devtools’ ip-10-196-141-106.ec2.internal domino-build-633c4dfd85cc072d6da5ecac-6d7m9 forge-build
Oct 04 2022 11:26:06 -0400 ip-10-196-141-106.ec2.internal domino-build-633c4dfd85cc072d6da5ecac-6d7m9 forge-build
Oct 04 2022 11:26:06 -0400 #9 153.9 * removing ‘/usr/local/lib/R/site-library/devtools’
Root Cause:
The above error can occur with all versions of R, but to date I haven't found a resolution for R4.0 specifically, while we have found resolutions for other version of R. Looking thru https://community.rstudio.com/ , github forums and other online communities it appears there are a variety of permutations of this error, pointing to the culprit lying between R, the OS, and other R package dependencies, the problem is not occurring due to Domino components or functionality.
Resolution:
The resolution varies depending on the base version of R, but we haven't found one for R4.0. Rather here are working examples from older and newer versions.
R4.2 example
Using quay.io/domino/compute-environment-images:ubuntu20-py3.9-r4.2-domino5.3-standard the following instructions work to install devtools (and test it):
RUN sudo apt-get update
RUN sudo apt install --yes libharfbuzz-dev libfribidi-dev
RUN R --no-save -e 'install.packages("devtools")'
RUN R -e 'devtools::install_version("shinydashboardPlus", version = "0.7.5", dependencies=T)'
R3.5 example
Using quay.io/domino/base:Ubuntu18_DAD_Py3.7_R3.5-20190501 the following instructions work to install devtools (and test it):
#other necessary steps above, like nvidia gpg key fix
RUN sudo apt-get update
#avoid hang in build to to 'restart?' prompt
RUN echo '* libraries/restart-without-asking boolean true' | sudo debconf-set-selections
RUN sudo apt install --yes build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev
RUN sudo apt install --yes libharfbuzz-dev libfribidi-dev
RUN R --no-save -e 'install.packages("devtools")'
RUN R -e 'devtools::install_version("shinydashboardPlus", version = "0.7.5", dependencies=T)'
We aren't R experts, so the above aren't a definitive means for correcting the error, rather a simple listing of a combo of packages that act as a working example.
A smart approach to determining dockerfile instructions is to spin-up on your base image then test your 'apt install, 'pip install' and 'R -e install.packages' cmds directly in a terminal to watch the validity of those commands prior to inserting them into a dockerfile of your compute environment.
References:
https://github.com/r-lib/devtools/issues/2472
https://community.rstudio.com/t/unable-to-install-devtools/146869/4
https://dominoup.zendesk.com/agent/tickets/68472 (internal ticket)
Comments
0 comments
Please sign in to leave a comment.