https://github.com/jrosell/playground4rocker
Github actions and docker deployment workflows for R projects.
https://github.com/jrosell/playground4rocker
cran docker github-actions lts packages r r2u renv rocker rstats ubuntu
Last synced: 5 months ago
JSON representation
Github actions and docker deployment workflows for R projects.
- Host: GitHub
- URL: https://github.com/jrosell/playground4rocker
- Owner: jrosell
- License: unlicense
- Created: 2023-12-28T16:02:42.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-29T16:28:47.000Z (over 2 years ago)
- Last Synced: 2024-03-01T12:27:48.741Z (over 2 years ago)
- Topics: cran, docker, github-actions, lts, packages, r, r2u, renv, rocker, rstats, ubuntu
- Language: R
- Homepage:
- Size: 195 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# playground4rocker
In this repo there are multiple github actions and docker deployment workflows available.
I tested to run [R code](https://www.brodrigues.co/blog/2022-11-19-raps/) using different approaches. The output files are uploaded as an artifact zip of the executed jobs.
## Github Actions
Results:
* With [.github/workflows/r2u.yml](.github/workflows/r2u.yml), last R package versions with r2u are used. ETA 49s.
* With [.github/workflows/pak.yml](.github/workflows/pak.yml), last R package versions with pak are used. ETA 1m 18s.
* With [.github/workflows/conda.yml](.github/workflows/conda.yml), last R package versions with conda are used. ETA 1m 25s.
* With [.github/workflows/renv.yml](.github/workflows/renv.yml), locked R package versions with renv are used. ETA 12m 24s (slower but more reproducible).
Conclusions:
* When using Ubuntu, r2u is the fastest approach to run the code with the last R package versions.
* When not using Ubuntu, pak or conda approaches can be used to run the code with the last R package versions.
* When requiring specific versions, renv approach can be used. It will be slower but more reproducible.
## How to build images and run containers locally
First clone the repository in your computer:
```
$ git clone git@github.com:jrosell/playground4rocker.git
$ cd playground4rocker
```
Then run the R code with the fastest approach this way:
```
$ docker build -f r2u.Dockerfile -t my-r2u-name . \
&& docker run --name my_r2u_container --rm -v $(pwd)/output:/workspace/output/:rw my-r2u-name
```
Alternatively, you can run R code with the more reproducible but slow approach this way:
```
$ docker build -f renv.Dockerfile -t my-renv-name . \
&& docker run --name my_renv_container --rm -v $(pwd)/output:/workspace/output/:rw my-renv-name
```
If you have added Python code and need to run both R and Python code, you can use this version:
```
$ docker build -f conda.Dockerfile -t my-conda-name . \
&& docker run --name my_conda_container --rm -v $(pwd)/output:/workspace/output/:rw my-conda-name
```
## Follow up
Feedback is welcome:
* Suggestions? Bugs? You can open an issue.
* You can fork this repo an reuse it. I'm open to PR too.