Working with R/Jupyter Notebooks at CSC

All material (C) 2022-2024 by CSC -IT Center for Science Ltd. This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 Unported License, http://creativecommons.org/licenses/by-sa/4.0/

Outline

  • In this lecture, we will learn:
    • CSC resources for notebooks
    • Deploying containerised notebooks

Why use Jupyter/Rstudio?

  • Easy-to-use and popular
  • Visually pleasing interfaces
  • Interactivity
  • Hides complexity

Why use CSC services for Jupyter/RStudio?

  • Free-of-charge (for Finnish higher education and research institutes)
  • Resource availability and their scalability
  • Easy-to-use services
  • Customization possibilities
  • Reproducibility of environment
  • Same environment for all students
  • CSC specialist support

CSC’s options for notebooks

Puhti web interface

Puhti web interface: Access some of applications on Puhti via browser

CSC Noppe

CSC noppe: Easy-to-use applications for courses/collaborations

Rahti container cloud

Rahti container cloud: Containers-as-a-service platform at CSC

Port mapping in docker containers

  • Containers communicate each other in the same network
  • Port mapping enables a process inside the container to outside world
  • Port mapping is not mandatory for all containers
  • Syntax: docker run -p <hostport:containerport> imagename:tag

Deploying notebooks on Puhti web interface

  • Understand how notebooks are run on Puhti
  • Web interface eases the process of deployment for users
  • Notebooks are not for heavy jobs

Deploying Jupyter notebooks on Puhti web interface

  • Existing Jupyter notebook can be easily launched from Puhti Web Interface
  • Custom installation with Jupyter Notebook:
    • Use tykky container wrapper to download Docker images from a registry or use a local image and launch notebook on Puhti web interface
    • Create environment/module(s) and then launch notebook from Puhti Web interface
  • As a special case “Jupyter for courses” can be used to customise for your course

Deploying Rstudio on Puhti web interface

  • Existing Rstudio versions on Puhti can be launched easily on Puhti Web Interface
  • Custom installation with Rstudio:
    • Approach 1: Intall your own packages on /projappl directory and then launch version-specific rstudio environment from Puhti web interface

    • Approach 2: Use existing Docker images from e.g., DockerHub

      • e.g., rocker/rstudio: Base R + RStudio Server installation
      • Launch custom Rstudio with SSH tunneling (bit involved on HPC system)