Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Objective JH-1: Enforce home directory quotas per-user #41

Closed
2 tasks
batpad opened this issue Jul 2, 2024 · 7 comments
Closed
2 tasks

Objective JH-1: Enforce home directory quotas per-user #41

batpad opened this issue Jul 2, 2024 · 7 comments
Labels

Comments

@batpad
Copy link
Collaborator

batpad commented Jul 2, 2024

Motivation

User home directories are meant to store code and notebooks, with data being stored in object storage if possible. They are mounted via NFS, and currently can grow unbounded. The unboundedness can cause cloud cost problems (unlike memory / CPU, which are bounded inherently), as well as encourage coding patterns that are not cloud optimized (like downloading a TB of .nc files to home directory before working on them).

Proposal

We will enforce home directory storage quotas for each user, as well as an overall fixed size for the entire hub. This will require migrating from the existing AWS EFS based setup to running an in-cluster NFS server with XFS based projectquota.

Owners

Success Criteria

  • Users can not use more than their allowed quota of home directory space
  • Migration to this new home directory set up is completed for at least one hub (hub.openveda.io to start)
@batpad batpad added the PI 24.4 label Jul 2, 2024
@batpad
Copy link
Collaborator Author

batpad commented Jul 5, 2024

@yuvipanda are you able to outline a little bit here what steps would be, and give me and @sunu some reading to get started?

And then we should probably get on a call early next week to kick this off.

Thanks!

@yuvipanda
Copy link
Collaborator

yes let's do a call soon to kick this off!

Here's some prior reading that may be useful for @sunu!

I hope that's a useful start, @sunu!

@batpad how do we schedule this?

@sunu
Copy link

sunu commented Jul 8, 2024

Thanks @yuvipanda! This is very useful. I'll give those threads a read.

@sunu
Copy link

sunu commented Aug 13, 2024

Here's an update on the progress on this issue so far:

  • I have set up a repo at https://github.com/sunu/jupyter-home-nfs and created CI workflow to build and publish docker images for the latest NFS Ganesha version
  • I have created some example k8s manifests to test the workflow end-to-end with https://github.com/yuvipanda/get-quota-your-home
  • So far, everything works pretty well.
    • storage quota is enforced effectively. Here's an example of enforcing a 1MB quota:
      $ kubectl exec -it -n nfs-test nfs-client -- sh
      / # 
      / # dd if=/dev/zero of=1mb.bin bs=1M count=1
      1+0 records in
      1+0 records out
      1048576 bytes (1.0MB) copied, 0.002145 seconds, 466.2MB/s
      / # dd if=/dev/zero of=2mb.bin bs=1M count=2
      2+0 records in
      2+0 records out
      2097152 bytes (2.0MB) copied, 0.002712 seconds, 737.5MB/s
      / # cp 1mb.bin /data/
      / # cp 2mb.bin /data/
      cp: can't create '/data/2mb.bin': No space left on device
    • User files are retained after deleting and re-creating the cluster as long as we use a pre-provisioned disk

cc @batpad @yuvipanda

@yuvipanda
Copy link
Collaborator

@sunu AMAZING! This looks great, continue on! I'd like more comments in https://github.com/sunu/jupyter-home-nfs/blob/main/nfs-ganesha/start.sh but otherwise awesome job!

Use https://github.com/jupyterhub/chartpress for CI and packaging. You can also git merge the get-quota-the-home repo into your repo (preserving history) to make this process easier too.

Excited to see this go!

@batpad
Copy link
Collaborator Author

batpad commented Sep 17, 2024

This is moving along really nicely and progress can be tracked here: 2i2c-org/infrastructure#4647

This should be on track to be able to do a full test on staging, ideally by end of this week.

@Gman0909
Copy link

Should this be closed now the tracked issue is complete?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants