Skip to content

In-cluster NFS server for Jupyterhub home directories with usage quota enforcement

License

Notifications You must be signed in to change notification settings

2i2c-org/jupyterhub-home-nfs

JupyterHub Home NFS

An NFS server for JupyterHub that runs within your Kubernetes cluster to provide persistent storage for users and a Python module to enforce storage quotas.

Key Components

Development

Prerequisites

  • Docker
  • Docker Compose

Note

On Mac, Docker Desktop might not support mounting loopback devices as XFS filesystems. If you are on Mac, consider using an alternative implementation like colima.

Developing locally

For development, we use a loopback device and mount it as an XFS filesystem inside the container.

Run the following command to start the development container:

docker compose up --build app

This will start the development container, mount a loopback device as an XFS filesystem at /mnt/docker-test-xfs.

Once the container is running, we can run the following command to get a shell into the container:

docker compose exec -it app bash

Once we have a shell into the container, we can run /usr/local/bin/generate.py with the appropriate arguments to enforce storage quotas on the XFS filesystem.

Running the tests

It's recommended to run the tests in the development container rather than your local machine.

You can run the tests with the following command:

docker compose --profile test up --build test

This will start the test container, mount a loopback device as an XFS filesystem and run the tests.