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

Support per-workspace filesystem quota on /workspace #5982

Merged
merged 1 commit into from
Oct 6, 2021
Merged

Conversation

csweichel
Copy link
Contributor

Description

This PR implements XFS based filesystem quota for each workspace in their resp. /workspace directory.

Related Issue(s)

Fixes #4938

How to test

  1. Open a workspace
  2. Run df -h and you should see a limit of 50gb on /workspace

Release Notes

[workspaces] Add support filesystem quota on /workspace

Caveats

  • Before this PR can be merged we should drop the nodepool 4 commit. @wulfthimm can you confirm?
  • For this to work the workspace content filesystem must be XFS and mounted with prjquota. In core-dev this means we need to deploy this ws-daemon first on a nodepool so that the raid-local-disks container can mount the XFS filesystem with prjquota

@codecov
Copy link

codecov bot commented Oct 1, 2021

Codecov Report

Merging #5982 (fff2e9d) into main (c5c7c6f) will increase coverage by 3.09%.
The diff coverage is 22.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5982      +/-   ##
==========================================
+ Coverage   19.04%   22.13%   +3.09%     
==========================================
  Files           2       13      +11     
  Lines         168     2141    +1973     
==========================================
+ Hits           32      474     +442     
- Misses        134     1606    +1472     
- Partials        2       61      +59     
Flag Coverage Δ
components-local-app-app-linux ?
components-local-app-app-windows ?
components-ws-daemon-app 22.13% <22.28%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/ws-daemon/pkg/content/hooks.go 0.00% <0.00%> (ø)
components/ws-daemon/pkg/content/initializer.go 0.00% <0.00%> (ø)
components/ws-daemon/pkg/content/service.go 0.00% <0.00%> (ø)
...onents/ws-daemon/pkg/internal/session/workspace.go 50.73% <ø> (ø)
components/ws-daemon/pkg/quota/xfs.go 45.05% <45.05%> (ø)
components/local-app/pkg/auth/pkce.go
components/local-app/pkg/auth/auth.go
components/ws-daemon/pkg/resources/dispatch.go 0.00% <0.00%> (ø)
components/ws-daemon/pkg/resources/limiter.go 77.77% <0.00%> (ø)
components/ws-daemon/pkg/resources/controller.go 31.06% <0.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5c7c6f...fff2e9d. Read the comment docs.

@csweichel
Copy link
Contributor Author

/hold

until it's clear if we need to remove the nodepool commit (which we need for testing)

@csweichel csweichel requested review from aledbf and removed request for mrsimonemms, jeanp413 and rl-gitpod October 1, 2021 11:18
@aledbf
Copy link
Member

aledbf commented Oct 5, 2021

/werft run

👍 started the job as gitpod-build-cw-fix-a-4938.15

@aledbf
Copy link
Member

aledbf commented Oct 5, 2021

Works as advertised. I fill the disk using yes abcdefghijklmnopqrstuvwxyz0123456789 > until.full

/lgtm
/approve

@roboquat
Copy link
Contributor

roboquat commented Oct 5, 2021

LGTM label has been added.

Git tree hash: 4cd92f9ce637a067d02f63f2968051e50e42f04f

@aledbf
Copy link
Member

aledbf commented Oct 5, 2021

Also checked the project is removed when the workspace is stopped

from ws-daemon when /workspace is full

xfs_quota -x -c 'report -h' 
Project quota on /mnt/workingarea (/dev/md42)
                        Blocks              
Project ID   Used   Soft   Hard Warn/Grace   
---------- --------------------------------- 
#0            20K      0      0  00 [------]
#1000          4K    50G    50G  00 [------]
#1002       50.0G    50G    50G  00 [------]
#1003        6.0M    50G    50G  00 [------]
#1004         50G    50G    50G  00 [------]

after deleting the file

bash-5.1# xfs_quota -x -c 'report -h' 
Project quota on /mnt/workingarea (/dev/md42)
                        Blocks              
Project ID   Used   Soft   Hard Warn/Grace   
---------- --------------------------------- 
#0            24K      0      0  00 [------]
#1000          4K    50G    50G  00 [------]
#1001          4K    50G    50G  00 [------]
#1002       50.0G    50G    50G  00 [------]
#1003        6.0M    50G    50G  00 [------]
#1004      222.1M    50G    50G  00 [------]

@csweichel
Copy link
Contributor Author

@wulfthimm what would be the consequence if we merged this PR with the nodepool change?

@fullmetalrooster
Copy link
Contributor

@wulfthimm what would be the consequence if we merged this PR with the nodepool change?

In my first PR which introduced nodepool-2 and nodepool-3 which have 4 local ssds XFS support has been added. nodepool-4 has only been added to give you an own nodepool where no other was working. I would suggest to remove nodepool-4 and only use the previous nodepools. Otherwise you would reduce the number of nodepools for workspaces to one. That might lead to a nodepool being filled up with daemonsets.

@csweichel
Copy link
Contributor Author

/hold cancel

@aledbf
Copy link
Member

aledbf commented Oct 6, 2021

/lgtm

@roboquat roboquat added the lgtm label Oct 6, 2021
@roboquat
Copy link
Contributor

roboquat commented Oct 6, 2021

LGTM label has been added.

Git tree hash: 55ace7f7294ff6c9122772eb602387a89130ca4e

@roboquat
Copy link
Contributor

roboquat commented Oct 6, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf

Associated issue: #4938

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roboquat roboquat merged commit 47bd9d6 into main Oct 6, 2021
@roboquat roboquat deleted the cw/fix-a-4938 branch October 6, 2021 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support per-workspace disk space quota
4 participants