-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Difficulty with rspm when working with renv #24
Comments
|
Thanks @Enchufa2 for the help. I tried that, but unfortunately an error appears during the build, as before. The error message is identical next build.log ## Dockerfile
FROM rocker/r-base:4.2.2
RUN apt-get update -yq \
&& apt-get install -yq \
apt-file
WORKDIR /opt/example
RUN Rscript -e 'install.packages("renv"); install.packages("rspm"); rspm::renv_init(); rspm::install_sysreqs(); renv::install("units")' Just incase there is something session based that I might be missing, I've tried to reproduce the docs https://rdrr.io/cran/rspm/man/renv_init.html, and its not possible for me. ## Dockerfile
FROM rocker/r-base:4.2.2
RUN apt-get update -yq \
&& apt-get install -yq \
apt-file
WORKDIR /opt/example
RUN Rscript -e 'install.packages("renv"); install.packages("rspm")' docker build --progress plain -t minimal:example .
docker run --rm -it minimal:example R Within the same R session: rspm::renv_init()
renv::install("[email protected]") # <--- fails here again (same error as log)
rspm::install_sysreqs() ## never run, as previous step fails
install.packages("units") # <--- runs perfectly, rspm shims working as expected |
Also, just for reference > packageVersion("rspm")
[1] ‘0.5.2’
> packageVersion("renv")
[1] ‘1.0.7’ |
Mmmh... this is supposed to work: ## Dockerfile
FROM rocker/r-base:4.2.2
RUN apt-get update -yq \
&& apt-get install -yq \
apt-file
WORKDIR /opt/example
RUN Rscript -e 'install.packages(c("renv", "rspm")); rspm::renv_init()'
RUN Rscript -e 'install.packages("units")' At least it worked at some point. But it seems that now |
Thank you for taking a look. This does work. ...
RUN Rscript -e 'install.packages(c("renv", "rspm")); rspm::renv_init()'
RUN Rscript -e 'install.packages("units")' But tragically for long running scientific projects or for deterministically building docker images, version pinning of dependencies is crucial. Pinning is not possible with
|
That is why |
Thanks @Enchufa2 - I'll test it going via the |
I've been having a little trouble trying to get your package to work for me in a Docker context, and suspect it's my own misunderstanding.
Without renv
I know that working without
renv
works well, as this minimal Dockerfile works perfectly:With renv
But with renv I'm doing something wrong but can't see what.
I have a small reproducible example where I try to install the
units
package withrspm
andrenv
.Then I run it as follows (Docker version 24.0.5) but fails to build:
And the logs yield the following (complete build.log attached)
While it is a very helpful error message and I could resolve the installation manually, but was hoping from the documentation that
renv::install("[email protected]")
followed byrspm::install_sysreqs()
would work.Please let me know what I've missed.
Our workflow revolves around
renv
andrenv::install
- so moving back toinstall.packages
wouldn't be desirable.The text was updated successfully, but these errors were encountered: