Skip to content

Commit

Permalink
Install R-Package with version locks
Browse files Browse the repository at this point in the history
  • Loading branch information
dibryant committed Apr 3, 2024
1 parent c0355fc commit 8a403d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions rstudio/c9s-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ RUN chmod -R a+w /usr/lib64/R/library
ENV LIBLOC /usr/lib64/R/library

# set User R Library path
RUN mkdir -p /opt/app-root/src/Rpackages/4.3 && chmod -R a+w /opt/app-root/src/Rpackages/4.3
ENV R_LIBS_USER /opt/app-root/src/Rpackages/4.3
RUN mkdir -p /opt/app-root/bin/Rpackages/4.3 && chmod -R a+w /opt/app-root/bin/Rpackages/4.3
ENV R_LIBS_USER /opt/app-root/bin/Rpackages/4.3

WORKDIR /tmp/

Expand All @@ -50,9 +50,17 @@ COPY rsession.conf /etc/rstudio/rsession.conf
# package installation
RUN dnf install -y libsodium-devel.x86_64 libgit2-devel.x86_64 libcurl-devel harfbuzz-devel.x86_64 fribidi-devel.x86_64 cmake "flexiblas-*" \
&& dnf clean all && rm -rf /var/cache/yum
RUN R -e "install.packages('Rcpp')"

# Install NGINX to proxy RStudio and pass probes check
# Install R packages
RUN R -e "install.packages('remotes')"
RUN R -e "require('remotes'); \
remotes::install_version('Rcpp','1.0.12'); \
remotes::install_version('tidyverse','2.0.0'); \
remotes::install_version('tidymodels','1.1.1'); \
remotes::install_version('plumber','1.2.1'); \
remotes::install_version('vetiver','0.2.5'); \
remotes::install_version('devtools','2.4.5');"

# Install NGINX to proxy RStudio and pass probes check
ENV NGINX_VERSION=1.24 \
NGINX_SHORT_VER=124 \
NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \
Expand Down
2 changes: 1 addition & 1 deletion rstudio/c9s-python-3.9/run-rstudio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fi

# Create lib folders if it does not exist
mkdir -p /opt/app-root/src/Rpackages/4.3

cp -r /opt/app-root/bin/Rpackages/4.3/* /opt/app-root/src/Rpackages/4.3/
# rstudio terminal cant see environment variables set by the container runtime
# (which breaks kubectl, to fix this we store the KUBERNETES_* env vars in Renviron.site)
env | grep KUBERNETES_ >> /usr/lib64/R/etc/Renviron.site
Expand Down

0 comments on commit 8a403d6

Please sign in to comment.