SwissDataScienceCenter / contributed-project-templates

A repository of community-developed project templates.
Apache License 2.0
4 stars 15 forks source link

chore: fix conda installs #54

Closed rokroskar closed 11 months ago

rokroskar commented 1 year ago
olevski commented 11 months ago

So the renv template does not build. Not because of this change though - or at least I think not:

Step 7/15 : RUN bash .renv_install.sh
 ---> Running in 181ef48e0461
Installing renv
renv.lock file detected
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.r-project.org/src/contrib/00Archive/renv/renv_0.15.5.tar.gz'
Error in download.file(p, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.r-project.org/src/contrib/00Archive/renv/renv_0.15.5.tar.gz'
In addition: Warning message:
In download.file(p, destfile, method, mode = "wb", ...) :
  URL 'https://cran.r-project.org/src/contrib/00Archive/renv/renv_0.15.5.tar.gz': status was 'Couldn't resolve host name'
installed renv v0.15.5
Removing intermediate container 181ef48e0461
 ---> a22dc1e7adfe
Step 8/15 : COPY renv.lock /home/rstudio/renv.lock
 ---> f6a734ffc9b9
Step 9/15 : COPY install.R /tmp/
 ---> [385](https://gitlab.dev.renku.ch/tasko.olevski/test-project-30/-/jobs/365489#L385)2af64fa03
Step 10/15 : RUN R -f /tmp/install.R
 ---> Running in dbc974a7b173
R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
  Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> # The renv library will be located on the docker image, in the /home/rstudio directory,
> # yet it will use the renv.lock file located in the project's main directory to determine which dependencies to install.
> setwd('/home/rstudio')
> options(renv.consent = TRUE)
> write("options(renv.consent = TRUE)", file="/home/rstudio/.Rprofile", append = TRUE)
> renv::init(force = TRUE)
Error in loadNamespace(x) : there is no package called ‘renv’
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
The command '/bin/bash -c -o pipefail R -f /tmp/install.R' returned a non-zero code: 1
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
olevski commented 11 months ago

I will approve because the error in the renv template is in the bash script that installs r packages with renv not in the stuff we changed.

rokroskar commented 11 months ago

Thanks @olevski - @RichardJActon would you be able to have a look at this error?

RichardJActon commented 11 months ago

@rokroskar yes - I'll take a look.

The log suggests it's trying to download renv from an incorrect url ...00Archive... not ...Archive...- not sure why that would have changed but I'll see if I can reproduce it and fix the script

rokroskar commented 11 months ago

Thank you!!