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

Add user specific quotas #26

Closed
wants to merge 3 commits into from

Conversation

RobinFrcd
Copy link

@RobinFrcd RobinFrcd commented Oct 20, 2017

Hi,
I've added two configuration parameters:

  • user_without_quotas will overwrite mem_limit/cpu_limit. Users in this
    list will have unlimited RAM and CPU.

  • special_user_quotas will overwrite mem_limit and cpu_limit for a
    specific user. It is possible to set mem_limit OR/AND cpu_limit.

user_without_quotas  = {'user1', 'user2'}
special_user_quotas = {
    'user3': {
        'mem_litmit': '2G'
    },
    'user4': {
        'mem_limit': '4G',
        'cpu_limit: 1.5
    }
}

user_without_quotas is stronger than special_user_quotas.

Hope it will be useful.

@RobinFrcd
Copy link
Author

/cc @yuvipanda for his opinion

@yuvipanda
Copy link
Collaborator

(thank you for the patch! I'll look into this sometime within the next week!)

Also cc @minrk for his thoughts, if he has time to spare.

@RobinFrcd RobinFrcd force-pushed the user_specific_quotas branch from 53d2307 to c942549 Compare October 23, 2017 08:41
user_without_quotas will overwrite mem_limit/cpu_limit. Users in this
list will have unlimited RAM and CPU.

special_user_quotas will overwrite mem_limit and cpu_limit for a
specific user. It is possible to set mem_limit OR/AND cpu_limit.

user_without_quotas is stronger than special_user_quotas.
@RobinFrcd RobinFrcd force-pushed the user_specific_quotas branch from c942549 to fb25e8f Compare October 23, 2017 08:43
Copy link
Contributor

@willingc willingc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @RobinFrcd. Some small suggestions for now. Probably should add in the unlimited help text that by setting unlimited to true that the user could use all the resources of the cluster.

@@ -70,6 +69,21 @@ class SystemdSpawner(Spawner):
"""
).tag(config=True)

users_without_quotas = Set(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi and thanks for the PR :-)

Perhaps this would be better as a Bool similar to https://github.com/jupyterhub/jupyterhub/blob/master/jupyterhub/app.py#L453

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, in that case, we would enable this 'no quotas mode' for all user in the admin group ? So you want to check that the user is in Authenticator.admin_users and that users_without_quotas is True ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @RobinFrcd. I didn't mean to confuse. The overarching point that I'm trying to make (though not eloquently) is that any time a user (admin or otherwise) has the ability to use all the resources that should be an opt-in action instead of the default.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, if a user is in users_without_quotas he has the ability to use all the resources. If he's not in, he can't. So the default is that a user can't use all the resources. I think I don't get the point here ! :)

special_user_quotas = Dict(
None,
allow_none=True,
help='Dict with users as key and cpu_limit/mem_limit as value. It will overwrite mem_limit/cpu_limit.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's put the help in triple quotes. help="""Dict with...

@astro-arphid
Copy link

Is this something that's still a possibiltiy? The abilitiy to have different resource limits on a user or group level would be fantastic.

@consideRatio
Copy link
Member

This seems like a very relevant feature, soo much that it should be relevant for other cases than quotas - such as user specific .

This is whats proposed in #98, I'll close this in favor of that.

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

Successfully merging this pull request may close these issues.

5 participants