Skip to content

Plugin for The Littlest JupyterHub to build multiple user environments with repo2docker

License

Notifications You must be signed in to change notification settings

RCOSDP/CS-tljh-repo2docker

 
 

Repository files navigation

tljh-repo2docker

Github Actions Status

TLJH plugin to build and use Docker images as user environments. The Docker images are built using repo2docker.

Installation

During the TLJH installation process, use the following post-installation script:

#!/bin/bash

# install Docker
sudo apt update
sudo apt install -y ca-certificates curl gnupg
sudo mkdir -m 0755 /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list
sudo apt update

sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

sudo apt-get update
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
sudo chmod a+r /etc/apt/keyrings/nodesource.gpg



NODE_MAJOR=21
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | \
 sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt update
sudo apt install -y nodejs python3-dev libcurl4-openssl-dev
sudo modprobe fuse

# pull the repo2docker image
sudo docker pull gcr.io/nii-ap-ops/repo2docker:20231102
sudo docker pull gcr.io/nii-ap-ops/rdmfs:20230802

# install yarn
sudo npm install -g yarn

# install TLJH
curl https://raw.githubusercontent.com/jupyterhub/the-littlest-jupyterhub/master/bootstrap/bootstrap.py \
  | sudo python3 - \
    --admin test:test \
    --plugin git+https://github.com/RCOSDP/CS-tljh-repo2docker.git@master

# fix to use the RCOSDP's one as binderhub package.
sudo /opt/tljh/hub/bin/python -m pip install --upgrade git+https://github.com/RCOSDP/CS-binderhub.git
# restart TLJH
sudo systemctl restart jupyterhub

Refer to The Littlest JupyterHub documentation for more info on installing TLJH plugins.

Usage

List the environments

The Environments page shows the list of built environments, as well as the ones currently being built:

environments

Add a new environment

Just like on Binder, new environments can be added by clicking on the Add New button and providing a URL to the repository. Optional names, memory, and CPU limits can also be set for the environment:

add-new

Follow the build logs

Clicking on the Logs button will open a new dialog with the build logs:

logs

Select an environment

Once ready, the environments can be selected from the JupyterHub spawn page:

select-env

Private Repositories

tljh-repo2docker also supports building environments from private repositories.

It is possible to provide the username and password in the Credentials section of the form:

image

On GitHub and GitLab, a user might have to first create an access token with read access to use as the password:

image

Extra documentation

tljh-repo2docker is currently developed as part of the Plasma project.

See the Plasma documentation on user environments for more info.

Building JupyterHub-ready images

See: https://repo2docker.readthedocs.io/en/latest/howto/jupyterhub_images.html

Run Locally

Check out the instructions in CONTRIBUTING.md to setup a local environment.

About

Plugin for The Littlest JupyterHub to build multiple user environments with repo2docker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 76.7%
  • HTML 13.8%
  • JavaScript 8.6%
  • CSS 0.9%