Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Updating a major R version #441

Open
ldecicco-USGS opened this issue Apr 30, 2019 · 0 comments
Open

Updating a major R version #441

ldecicco-USGS opened this issue Apr 30, 2019 · 0 comments

Comments

@ldecicco-USGS
Copy link
Member

Here's what I currently do.

  1. Install new version of R
  2. Open RStudio as administrator
  3. Change R version
  4. Close RStudio
  5. Open RStudio as administrator
  6. Open project in C:/Program Files (x86)/Jenkins/jobs/CURRENT Jenkins job/workspace"
  7. Run to install a bunch of the packages needed (not all....):
install.packages(c("devtools", "miniCRAN"))

library(miniCRAN)
cat(.libPaths())
pkgs <- pkgAvail(repos = "GRAN", type = "source")

install.packages(pkgs[,1], 
                 repos = c("https://owi.usgs.gov/R",getOption("repos")),
                 type = "source")
  1. Open Jenkins (http://localhost:8080/job/CURRENT Jenkins job)
  2. Copy the CURRENT job to start a new job
  3. Configure the NEW job. Change the R path to the new R version, and the binaries to the new and new-1 R version. Also will need to update the s3 folders that are pushed up.
  4. Run the NEW job. It will fail....that's OK. It will install packages that don't have GRAN dependencies in GRAN/src/contrib
  5. Open a new R Project (in the RStudio that you opened with administration privileges, the project space is the new workspace from the new Jenkins job)
  6. Run:
tools::write_PACKAGES(dir = "GRAN/src/contrib", type = "source")
library(granbuild)
build_bin()
tools::write_PACKAGES(dir = "GRAN/bin/windows/contrib/3.6", type = "win.binary")

Now...we need to manually move the binary packages and the PACKAGES files up to the S3 bucket. I've been doing it via S3Browser.

Then....repeat....a few more packages will install:

dl_build_src(delete = FALSE)
tools::write_PACKAGES(dir = "GRAN/src/contrib", type = "source")
build_bin()
tools::write_PACKAGES(dir = "GRAN/bin/windows/contrib/3.6", type = "win.binary")

Repeat pushing up the new binaries that can be created up to the S3 bucket.

Gotchas:

  1. There's a chance that loadest or others fails. You need to update Rtools then. Change the path of the current Rtools to Rtools34 (or whatever), and install the newer version. You can change the Rtools path in each bash step if it becomes necessary.
  2. There's always...something... Read the NEWS of the new R release, they tend to put significant changes up at the top. For instance, in 3.6...there's a change in the random sampling and how RDS files are saved. Because of the RDS issue...3.6 RDS's can't be read in 3.4. That causes an issue in trying to support 3.4-3.6 at the same time.

(the delete argument is coming with a PR)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant