Skip to content

Commit

Permalink
refactor(datascience): merge r-build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
adamblake committed Feb 9, 2024
1 parent fb1d5ca commit e3ba51e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions datascience-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ LABEL maintainer="CourseKata <[email protected]>"

# install cmdstan and related requests
RUN --mount=type=cache,target=${CONDA_DIR}/pkgs,uid=${NB_UID},sharing=locked \
# install packages from conda where possible
mamba install --yes \
"r-brms" \
# "r-ggstatsplot" \
Expand Down Expand Up @@ -81,10 +82,10 @@ RUN --mount=type=cache,target=${CONDA_DIR}/pkgs,uid=${NB_UID},sharing=locked \
"r-zeallot" \
# "r-rethinking"
"r-coda" \
"r-digest"
"r-digest" \
# "r-rstanarm"

RUN R_REMOTES_UPGRADE="never" Rscript \
# install all other R packages
&& R_REMOTES_UPGRADE="never" Rscript \
-e 'stan <- "https://mc-stan.org/r-packages/"' \
-e 'remotes::install_cran("cmdstanr", repos = c(stan, getOption("repos")), dependencies = TRUE)' \
-e 'cmdstanr::install_cmdstan()' \
Expand Down
2 changes: 1 addition & 1 deletion r-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ RUN --mount=type=bind,source="${PY_REQUIREMENTS}",target=/tmp/requirements.txt \
FROM ${PARENT_IMAGE} as final
LABEL maintainer="CourseKata <[email protected]>"

# install R packages from conda where possible
ARG R_REQUIREMENTS
RUN --mount=type=cache,target=${CONDA_DIR}/pkgs,uid=${NB_UID},sharing=locked \
--mount=type=bind,source="${R_REQUIREMENTS}",target=/tmp/requirements.r \
--mount=type=secret,id=github_token,uid=${NB_UID} \
# install R packages from conda where possible
mamba install --yes \
"r-av" \
"r-bayesplot" \
Expand Down

0 comments on commit e3ba51e

Please sign in to comment.