Skip to content

Commit

Permalink
Modifications to install cmdstan that can be accessed by normal user
Browse files Browse the repository at this point in the history
By default `cmdstanr::install_github` installs cmdstan in
`file.path(Sys.getenv("HOME"),".cmdstan")`. Since the RUN cmd is run as
root cmdstan is installed in `/root/.cmdstan` which is inaccessible to
any other normal user. Since I start the container as a normal user
cmdstan is inaccessible to any of the processes. I anticipate that
setting the CMDSTAN envvar might help with cmdstanpy too.

TODO (vijay): check that `/opt/cmdstan` install works with cmdstanpy
too.
  • Loading branch information
vlulla committed Aug 10, 2024
1 parent 80dbb46 commit 8a42b97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion datascience-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ RUN R --no-restore -e "install.packages(c('remotes'),dependencies=T)"
RUN R --no-restore -e "remotes::install_github('stan-dev/posteriordb-r')"
RUN R --no-restore -e "install.packages(c('devtools','mvtnorm','brms','dagitty','fpp3','bsts'),dependencies=T)"
RUN R --no-restore -e "remotes::install_github('facebook/prophet@*release',subdir='R')"
RUN R --no-restore -e "remotes::install_github(c('stan-dev/cmdstanr','rmcelreath/rethinking'),dependencies=T);cmdstanr::install_cmdstan()"
RUN R --no-restore -e "remotes::install_github(c('stan-dev/cmdstanr','rmcelreath/rethinking'),dependencies=T)"
RUN <<EOT
mkdir -p /opt/cmdstan
R --no-restore -e "cmdstanr::install_cmdstan(dir='/opt/cmdstan')"
EOT
ENV CMDSTAN="/opt/cmdstan"

RUN <<EOT
set -ex
Expand Down

0 comments on commit 8a42b97

Please sign in to comment.