├── tests ├── gpu │ ├── misc │ │ ├── test-gpu.sh │ │ ├── hosts │ │ ├── test-gpu-outside.sh │ │ ├── Dockerfile.cuda9 │ │ ├── cuda_ver.awk │ │ ├── docker-compose.yml │ │ ├── Dockerfile.cuda11 │ │ ├── Dockerfile.cuda10 │ │ ├── build-fix-notes.md │ │ ├── test-drivers.yml │ │ └── deploy-aws-rocker-ml-gpu.yml │ └── test-gpu.sh ├── rstudio │ ├── env.batch-users02 │ ├── env.batch-users03 │ ├── env.batch-users01 │ ├── env.batch-users04 │ ├── env.batch-users05 │ ├── batch-users.Dockerfile │ └── README.md ├── rocker_scripts │ ├── Dockerfile │ ├── README.md │ ├── test.sh │ └── matrix.json ├── Dockerfile_tidyverse_4.0.0 └── ml │ ├── greta.R │ ├── keras.R │ └── h2o.R ├── .hadolint.yaml ├── .yaml-lint.yml ├── .editorconfig ├── .lintr ├── .gitignore ├── .jscpd.json ├── scripts ├── tests │ ├── nvblas.R │ └── examples_tf.R ├── experimental │ ├── cuda10.2-tf.sh │ ├── install_rl.sh │ ├── install_geospatial_unstable.sh │ ├── install_R_binary.sh │ ├── batch_user_creation.sh │ └── install_dev_osgeo.sh ├── install_nvtop.sh ├── pam-helper.sh ├── rsession.sh ├── install_tensorflow.sh ├── init_set_env.sh ├── install_tf1_cuda_10_0.sh ├── default_user.sh ├── install_s6init.sh ├── install_pyenv.sh ├── install_wgrib2.sh ├── install_tidyverse.sh ├── install_julia.sh ├── install_R_ppa.sh ├── install_geospatial.sh ├── install_jupyter.sh ├── config_R_cuda.sh ├── install_shiny_server.sh ├── install_quarto.sh ├── install_python.sh ├── install_cuda-11.1.sh ├── install_verse.sh ├── install_texlive.sh ├── setup_R.sh ├── install_pandoc.sh ├── install_cuda-10.1.sh ├── install_rstudio.sh ├── install_R_source.sh ├── bin │ └── install2.r └── init_userconf.sh ├── .markdownlint.yaml ├── .github ├── dependabot.yml ├── workflows │ ├── bakefile-test.yml │ ├── test-experimental.yml │ ├── linting.yml │ ├── experimental.yml │ ├── release.yml │ ├── dockerfiles.yml │ ├── scripts-test.yml │ ├── core.yml │ ├── devel.yml │ ├── reports.yml │ └── r-build-test.yml └── ISSUE_TEMPLATE │ ├── question.yml │ └── bug-images.yml ├── bakefiles ├── README.md ├── experimental.docker-bake.json └── devel.docker-bake.json ├── dockerfiles ├── geospatial-dev-osgeo.Dockerfile ├── README.md ├── r-ver_devel.Dockerfile ├── r-ver_4.4.3.Dockerfile ├── r-ver_4.5.1.Dockerfile ├── r-ver_4.5.2.Dockerfile ├── shiny_devel.Dockerfile ├── shiny_4.5.2.Dockerfile ├── shiny_4.4.3.Dockerfile ├── shiny_4.5.1.Dockerfile ├── shiny-verse_devel.Dockerfile ├── shiny-verse_4.5.2.Dockerfile ├── shiny-verse_4.4.3.Dockerfile ├── shiny-verse_4.5.1.Dockerfile ├── rstudio_devel.Dockerfile ├── rstudio_4.4.3.Dockerfile ├── rstudio_4.5.1.Dockerfile ├── rstudio_4.5.2.Dockerfile ├── tidyverse_devel.Dockerfile ├── tidyverse_4.4.3.Dockerfile ├── tidyverse_4.5.1.Dockerfile ├── tidyverse_4.5.2.Dockerfile ├── verse_devel.Dockerfile ├── verse_4.5.2.Dockerfile ├── verse_4.4.3.Dockerfile ├── verse_4.5.1.Dockerfile ├── geospatial_devel.Dockerfile ├── geospatial_4.5.2.Dockerfile ├── geospatial_4.4.3.Dockerfile └── geospatial_4.5.1.Dockerfile ├── .devcontainer └── devcontainer.json ├── Makefile └── README.md /tests/gpu/misc/test-gpu.sh: -------------------------------------------------------------------------------- 1 | ../test-gpu.sh -------------------------------------------------------------------------------- /tests/rstudio/env.batch-users02: -------------------------------------------------------------------------------- 1 | BATCH_USER_CREATION= -------------------------------------------------------------------------------- /tests/rstudio/env.batch-users03: -------------------------------------------------------------------------------- 1 | BATCH_USER_CREATION=;;;;; -------------------------------------------------------------------------------- /.hadolint.yaml: -------------------------------------------------------------------------------- 1 | ignored: 2 | - "DL3007" 3 | - "DL3059" 4 | -------------------------------------------------------------------------------- /tests/rstudio/env.batch-users01: -------------------------------------------------------------------------------- 1 | BATCH_USER_CREATION=user1:pass1;user2:pass2;user3:pass3 -------------------------------------------------------------------------------- /tests/rstudio/env.batch-users04: -------------------------------------------------------------------------------- 1 | BATCH_USER_CREATION=rstudio:newpass;1001:pass;user1;user2:pass2;; -------------------------------------------------------------------------------- /tests/rstudio/env.batch-users05: -------------------------------------------------------------------------------- 1 | BATCH_USER_CREATION=user1: pass1; user2 : pass2 ; user3 :pass3; -------------------------------------------------------------------------------- /.yaml-lint.yml: -------------------------------------------------------------------------------- 1 | extends: default 2 | 3 | rules: 4 | line-length: 5 | max: 120 6 | level: warning 7 | document-start: disable 8 | -------------------------------------------------------------------------------- /tests/gpu/misc/hosts: -------------------------------------------------------------------------------- 1 | [rocker-server-aws] 2 | 18.234.180.110 ansible_ssh_private_key_file=~/Projects/Rocker/Rocker-aws-1/rocker-gpu.pem ansible_ssh_user=ubuntu 3 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.json] 2 | indent_style = space 3 | indent_size = 2 4 | insert_final_newline = true 5 | 6 | [*.sh] 7 | indent_style = space 8 | indent_size = 4 9 | insert_final_newline = true 10 | -------------------------------------------------------------------------------- /.lintr: -------------------------------------------------------------------------------- 1 | linters: with_defaults( 2 | object_usage_linter = NULL, 3 | line_length_linter = line_length_linter(120), 4 | object_name_linter = NULL, 5 | commented_code_linter = NULL 6 | ) 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | *.Rproj 6 | .*.swp 7 | tests/gpu/misc/hosts 8 | 9 | tests/gpu/misc/hosts 10 | 11 | tmp 12 | 13 | # Use for build reports 14 | /reports 15 | -------------------------------------------------------------------------------- /.jscpd.json: -------------------------------------------------------------------------------- 1 | { 2 | "threshold": 0, 3 | "reporters": [ 4 | "consoleFull" 5 | ], 6 | "ignore": [ 7 | "**/bakefiles/*.json", 8 | "**/dockerfiles/*.json", 9 | "**/templates/*" 10 | ], 11 | "absolute": true 12 | } 13 | -------------------------------------------------------------------------------- /scripts/tests/nvblas.R: -------------------------------------------------------------------------------- 1 | install.packages("callr") 2 | 3 | 4 | callr::r(function(){ 5 | system.time({ 6 | N <- 2^14 7 | M <- matrix(rnorm(N*N), nrow=N, ncol=N) 8 | M %*% M 9 | }) 10 | }, env = c(LD_PRELOAD="libnvblas.so") 11 | ) 12 | -------------------------------------------------------------------------------- /scripts/experimental/cuda10.2-tf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## not sure why cuda-cudart-dev-10-1 when this is 10.2 and we already have 10.2... 4 | 5 | sudo apt update && \ 6 | sudo apt install \ 7 | libnvinfer-dev \ 8 | cuda-cudart-dev-10-1 9 | 10 | 11 | -------------------------------------------------------------------------------- /.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | default: true 2 | 3 | MD013: 4 | line_length: 120 5 | heading_line_length: 120 6 | code_block_line_length: 120 7 | tables: false 8 | 9 | MD024: 10 | allow_different_nesting: true 11 | 12 | MD033: 13 | allowed_elements: ["img"] 14 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | - package-ecosystem: "devcontainers" 8 | directory: "/" 9 | schedule: 10 | interval: weekly 11 | -------------------------------------------------------------------------------- /scripts/experimental/install_rl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | python -m venv /opt/venv/rl 5 | . /opt/venv/rl/bin/activate 6 | 7 | pip install wheel 8 | pip install gym tensorflow keras keras-rl 9 | 10 | chown -R :staff /opt/venv/rl 11 | chmod g+rx /opt/venv/rl 12 | -------------------------------------------------------------------------------- /tests/gpu/misc/test-gpu-outside.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script tests for gpu fuctionality in any found images named rocker_cuda10 or rocker_cuda11 4 | 5 | docker ps | tail -n +2 | awk -f /root/cuda_ver.awk 6 | 7 | cat /test-gpu-10.log /test-gpu-11.log >> /test-gpu.log 8 | -------------------------------------------------------------------------------- /bakefiles/README.md: -------------------------------------------------------------------------------- 1 | # Build configuration files for the `docker buildx bake` command 2 | 3 | :warning: JSON files except `devel.docker-bake.json` in this directory are generated by 4 | [`generate-main-bakefiles.R`](../build/scripts/generate-main-bakefiles.R), 5 | **Don't edit manually.** :warning: 6 | -------------------------------------------------------------------------------- /tests/rstudio/batch-users.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rocker/rstudio:latest 2 | 3 | # Script for to set up multiple users 4 | COPY scripts/experimental/batch_user_creation.sh /rocker_scripts/experimental/batch_user_creation.sh 5 | 6 | CMD [ "sh", "-c", "/rocker_scripts/experimental/batch_user_creation.sh && /init" ] 7 | -------------------------------------------------------------------------------- /tests/rocker_scripts/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG base_image="rocker/r-ver" 2 | ARG tag="latest" 3 | FROM ${base_image}:${tag} 4 | 5 | COPY tests/rocker_scripts/test.sh /test.sh 6 | COPY scripts /rocker_scripts 7 | 8 | ARG script_name=install_rstudio.sh 9 | ARG script_arg=skip 10 | RUN /test.sh ${script_name} ${script_arg} 11 | -------------------------------------------------------------------------------- /dockerfiles/geospatial-dev-osgeo.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rocker/verse:4.5.2 2 | 3 | ENV PROJ_VERSION="9.7.1" 4 | ENV GDAL_VERSION="3.12.0" 5 | ENV GEOS_VERSION="3.14.1" 6 | 7 | COPY scripts/experimental/install_dev_osgeo.sh /rocker_scripts/experimental/install_dev_osgeo.sh 8 | RUN /rocker_scripts/experimental/install_dev_osgeo.sh 9 | -------------------------------------------------------------------------------- /scripts/install_nvtop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | apt-get update && apt-get -y install cmake libncurses5-dev libncursesw5-dev git 5 | git clone https://github.com/Syllo/nvtop.git 6 | mkdir -p nvtop/build && cd nvtop/build 7 | cmake .. -DNVML_RETRIEVE_HEADER_ONLINE=True 8 | make 9 | make install 10 | 11 | # Clean up 12 | rm -rf /var/lib/apt/lists/* 13 | -------------------------------------------------------------------------------- /scripts/pam-helper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o nounset 3 | 4 | ## Enforces the custom password specified in the PASSWORD environment variable 5 | ## The accepted RStudio username is the same as the USER environment variable (i.e., local user name). 6 | 7 | 8 | IFS='' read -r password 9 | 10 | [ "${USER}" = "${1}" ] && [ "${PASSWORD}" = "${password}" ] 11 | -------------------------------------------------------------------------------- /tests/rocker_scripts/README.md: -------------------------------------------------------------------------------- 1 | # Test for Rocker scripts 2 | 3 | If changes are made to the Rocker scripts in PR, 4 | use GitHub Actions workflow to test if they run correctly under multiple conditions. 5 | 6 | This directory contains the Dockerfile used for the test build, 7 | the test script file, and the matrix file that sets the conditions used in the test. 8 | -------------------------------------------------------------------------------- /scripts/rsession.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | R_DOC_DIR=$R_HOME/doc 4 | R_INCLUDE_DIR=$R_HOME/include 5 | R_SHARE_DIR=$R_HOME/share 6 | RSTUDIO_DEFAULT_R_VERSION_HOME=$R_HOME 7 | RSTUDIO_DEFAULT_R_VERSION=$R_VERSION 8 | PATH=$PATH:/usr/lib/rstudio-server/bin 9 | rsession --standalone=1 \ 10 | --program-mode=server \ 11 | --session-timeout-minutes=0 \ 12 | --user-identity=rstudio \ 13 | --www-port=8787 14 | -------------------------------------------------------------------------------- /tests/gpu/misc/Dockerfile.cuda9: -------------------------------------------------------------------------------- 1 | FROM rocker/ml-gpu 2 | 3 | RUN apt-get update && apt-get install -y --no-install-recommends \ 4 | cuda-samples-9-0 \ 5 | python3-dev \ 6 | python3-pip \ 7 | python3-venv 8 | 9 | RUN pip install --upgrade tensorflow 10 | 11 | WORKDIR /usr/local/cuda-9.0/samples 12 | RUN make 13 | 14 | COPY ./test-gpu.sh /test-gpu.sh 15 | RUN chmod +x /test-gpu.sh 16 | 17 | ENTRYPOINT ["tail"] 18 | CMD ["-f","/dev/null"] 19 | -------------------------------------------------------------------------------- /scripts/install_tensorflow.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | ## build ARGs 5 | NCPUS=${NCPUS:--1} 6 | 7 | ## Install python dependency 8 | /rocker_scripts/install_python.sh 9 | 10 | install2.r --error --skipinstalled -n "$NCPUS" keras 11 | 12 | rm -r /tmp/downloaded_packages 13 | 14 | ## Strip binary installed lybraries from RSPM 15 | ## https://github.com/rocker-org/rocker-versioned2/issues/340 16 | strip /usr/local/lib/R/site-library/*/libs/*.so 17 | -------------------------------------------------------------------------------- /tests/Dockerfile_tidyverse_4.0.0: -------------------------------------------------------------------------------- 1 | FROM rocker/rstudio:3.6.3-ubuntu18.04 2 | 3 | LABEL org.label-schema.license="GPL-2.0" \ 4 | org.label-schema.vcs-url="https://github.com/rocker-org/rocker-versioned" \ 5 | org.label-schema.vendor="Rocker Project" \ 6 | maintainer="Carl Boettiger " 7 | 8 | 9 | ARG NCPUS 10 | COPY scripts/install_tidyverse.sh /rocker_scripts/install_tidyverse.sh 11 | RUN /rocker_scripts/install_tidyverse.sh 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.github/workflows/bakefile-test.yml: -------------------------------------------------------------------------------- 1 | name: test for docker-bake.json 2 | 3 | permissions: 4 | contents: read 5 | 6 | on: 7 | pull_request: 8 | branches: 9 | - master 10 | paths: 11 | - bakefiles/*.json 12 | workflow_dispatch: 13 | 14 | concurrency: 15 | group: ${{ github.workflow }} 16 | cancel-in-progress: true 17 | 18 | jobs: 19 | make_test: 20 | runs-on: ubuntu-latest 21 | steps: 22 | - name: Check out code 23 | uses: actions/checkout@v6 24 | - name: Run make test 25 | run: make test 26 | -------------------------------------------------------------------------------- /tests/gpu/misc/cuda_ver.awk: -------------------------------------------------------------------------------- 1 | { 2 | container_name=$2 3 | if (container_name == "rocker_cuda11"){ 4 | cmd = sprintf("docker exec %s /test-gpu.sh 11 /root/test-gpu.log", $1) 5 | system(cmd) 6 | cmd = sprintf("docker cp %s:/root/test-gpu.log /test-gpu-11.log", $1) 7 | system(cmd) 8 | }else if (container_name == "rocker_cuda10"){ 9 | cmd = sprintf("docker exec %s /test-gpu.sh 10 /root/test-gpu.log", $1) 10 | system(cmd) 11 | cmd = sprintf("docker cp %s:/root/test-gpu.log /test-gpu-10.log", $1) 12 | system(cmd) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/gpu/misc/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | rocker10: 6 | image: rocker_cuda10 7 | build: 8 | context: . 9 | dockerfile: "Dockerfile.cuda10" 10 | deploy: 11 | resources: 12 | reservations: 13 | devices: 14 | - capabilities: [gpu] 15 | rocker11: 16 | image: rocker_cuda11 17 | build: 18 | context: . 19 | dockerfile: "Dockerfile.cuda11" 20 | deploy: 21 | resources: 22 | reservations: 23 | devices: 24 | - capabilities: [gpu] 25 | -------------------------------------------------------------------------------- /tests/gpu/misc/Dockerfile.cuda11: -------------------------------------------------------------------------------- 1 | FROM rocker/ml:cuda11.1 2 | 3 | ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64 4 | 5 | RUN apt-get update && apt-get install -y --no-install-recommends \ 6 | cuda-samples-11-1 \ 7 | python3-dev \ 8 | python3-pip 9 | 10 | # install tensorflow 1.15.5 11 | RUN pip install nvidia-pyindex 12 | RUN pip install nvidia-tensorflow[horovod] 13 | 14 | WORKDIR /usr/local/cuda-11.1/samples 15 | RUN make 16 | 17 | COPY nvblas.R / 18 | COPY test-gpu.sh / 19 | COPY examples_tf.R / 20 | 21 | ENTRYPOINT ["tail"] 22 | CMD ["-f","/dev/null"] 23 | -------------------------------------------------------------------------------- /.github/workflows/test-experimental.yml: -------------------------------------------------------------------------------- 1 | name: test for experimental scripts 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - scripts/experimental/install_dev_osgeo.sh 7 | workflow_dispatch: 8 | 9 | concurrency: 10 | group: ${{ github.workflow }}-${{ github.ref }} 11 | cancel-in-progress: true 12 | 13 | jobs: 14 | build: 15 | runs-on: ubuntu-latest 16 | container: 17 | image: rocker/r-ver 18 | steps: 19 | - name: Checkout repo 20 | uses: actions/checkout@v6 21 | with: 22 | fetch-depth: 0 23 | - name: build 24 | run: ./scripts/experimental/install_dev_osgeo.sh 25 | -------------------------------------------------------------------------------- /scripts/init_set_env.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bash 2 | # shellcheck shell=bash 3 | 4 | ## Set our dynamic variables in Renviron.site to be reflected by RStudio Server or Shiny Server 5 | exclude_vars="HOME PASSWORD RSTUDIO_VERSION BATCH_USER_CREATION" 6 | for file in /var/run/s6/container_environment/*; do 7 | sed -i "/^${file##*/}=/d" "${R_HOME}/etc/Renviron.site" 8 | regex="(^| )${file##*/}($| )" 9 | [[ ! $exclude_vars =~ $regex ]] && echo "${file##*/}=$(cat "${file}")" >>"${R_HOME}/etc/Renviron.site" || echo "skipping ${file}" 10 | done 11 | 12 | ## only file-owner (root) should read container_environment files: 13 | chmod 600 /var/run/s6/container_environment/* 14 | -------------------------------------------------------------------------------- /dockerfiles/README.md: -------------------------------------------------------------------------------- 1 | # Dockerfiles for container images on Docker Hub 2 | 3 | :warning: Dockerfiles in this directory are generated from the stack files by [`generate-dockerfiles.R`](../build/scripts/generate-dockerfiles.R). **Don't edit manually.** :warning: 4 | 5 | ## Build container images by yourself 6 | 7 | Building container images with GitHub Actions is done via the [`Makefile`](../Makefile) with the `docker buildx bake` command to control tags, labels, and platforms. 8 | 9 | To build a container image for your local use, a simple command like the one below should be fine. 10 | 11 | ```shell 12 | docker build . -f dockerfiles/rstudio_latest-daily.Dockerfile -t imagename 13 | ``` 14 | -------------------------------------------------------------------------------- /dockerfiles/r-ver_devel.Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | 3 | FROM docker.io/library/ubuntu:latest 4 | 5 | ENV R_VERSION="devel" 6 | ENV R_HOME="/usr/local/lib/R" 7 | ENV TZ="Etc/UTC" 8 | 9 | COPY scripts/install_R_source.sh /rocker_scripts/install_R_source.sh 10 | RUN /rocker_scripts/install_R_source.sh 11 | 12 | ENV CRAN="https://cloud.r-project.org" 13 | ENV LANG=en_US.UTF-8 14 | 15 | COPY scripts/bin/ /rocker_scripts/bin/ 16 | COPY scripts/setup_R.sh /rocker_scripts/setup_R.sh 17 | RUN <