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.
- NFS Ganesha is used as the NFS server
- XFS as the filesystem
- xfs_quota through jupyterhub-home-nfs is used to manage storage quotas
- 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.
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.
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.