Rocker Project
  • Home
  • Code of Conduct
  • Images
    • The Rocker Images

    • versioned stack
    • r-ver
    • rstudio, tidyverse, verse, geospatial
    • binder
    • shiny, shiny-verse
    • cuda, ml, ml-verse

    • base stack
    • r-base
    • rocker/r-base
    • r-devel, drd, drp, r-devel-san, r-devel-ubsan-clang

    • Additional images
    • r-ubuntu
    • r-bspm
    • r2u

    • Dev Container
    • Features
    • Images
    • Templates

    • Other projects
    • External images and tools for R
  • Use
    • Extending images
    • GUI
    • Edit in containers
    • Networking
    • Shared Volumes
    • Running without root privileges using Podman
    • Reproducibility
    • Singularity
  1. versioned stack
  2. cuda, ml, ml-verse
  1. versioned stack
  2. cuda, ml, ml-verse

cuda, ml, ml-verse

  • The Rocker Images
  • versioned stack
    • r-ver
    • rstudio, tidyverse, verse, geospatial
    • binder
    • shiny, shiny-verse
    • cuda, ml, ml-verse
  • base stack
    • r-base
    • rocker/r-base
    • r-devel, drd, drp, r-devel-san, r-devel-ubsan-clang
  • Additional images
    • r-ubuntu
    • r-bspm
    • r2u

  • Dev Container
    • Features
    • Images
    • Templates

  • Other projects
    • External images and tools for R

On this page

  • 1 Quick reference
  • 2 Overview
  • 3 Quick start
  • 4 How to use
    • 4.1 Python versions and environments
  • View source
  • Edit this page

1 Quick reference

  • Source repository: rocker-org/rocker-versioned2
  • Dockerfile
    • rocker/cuda
    • rocker/ml
    • rocker/ml-verse
  • tags
    • rocker/cuda
      • DockerHub
      • GitHub Container Registry
    • rocker/ml
      • DockerHub
      • GitHub Container Registry
    • rocker/ml-verse
      • DockerHub
      • GitHub Container Registry
  • Published image details: rocker-org/rocker-versioned2’s wiki
  • Non-root default user:
    • rocker/cuda: not exist
    • rocker/ml: rstudio
    • rocker/ml-verse: rstudio

2 Overview

rocker/cuda, rocker/ml, and rocker/ml-verse are Docker images for machine learning and GPU-based computation in R. These images correspond to rocker/r-ver, rocker/tidyverse, and rocker/geospatial, respectively.

All images are based on the official NVIDIA CUDA docker build recipes, and are installed the reticulate package.

3 Quick start

The basic usage is the same as rocker/r-ver or rocker/rstudio except for the GPU setting.

R command line:

# CPU-only
docker run --rm -ti rocker/cuda
# Machines with nvidia-docker and GPU support
docker run --gpus all --rm -ti rocker/cuda

RStudio Server instance:

# CPU-only
docker run -p 8787:8787 rocker/ml
# Machines with nvidia-docker and GPU support
docker run --gpus all -p 8787:8787 rocker/ml
Important

GPU use requires nvidia-container-toolkit runtime to run!

4 How to use

See also the rocker/r-ver’s reference (for rocker/cuda) and the rocker/rstudio’s reference (for rocker/ml and rocker/ml-verse).

4.1 Python versions and environments

If you want to switch the Python version called from reticulate, you can use the reticulate’s functions to install Python. For example, with the following command, reticulate installs miniconda and miniconda installs Python 3.7.

reticulate::install_miniconda()
reticulate::conda_install(packages = "python=3.7")

The Python version used by the reticulate package can be checked with the reticulate::py_config() function.

reticulate::py_config()
#> python:         /root/.local/share/r-miniconda/envs/r-reticulate/bin/python
#> libpython:      /root/.local/share/r-miniconda/envs/r-reticulate/lib/libpython3.7m.so
#> pythonhome:     /root/.local/share/r-miniconda/envs/r-reticulate:/root/.local/share/r-miniconda/envs/r-reticulate
#> version:        3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21)  [GCC 9.4.0]
#> numpy:          /root/.local/share/r-miniconda/envs/r-reticulate/lib/python3.7/site-packages/numpy
#> numpy_version:  1.17.5
Important

pyenv and pipenv, which were previously installed, are no longer installed. And, the previously set environment variables WORKON_HOME and PYTHON_VENV_PATH are no longer set. (rocker-org/rocker-versioned2#494)

 

CC-BY
  • View source
  • Edit this page