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 dynamic support for the container constraints for the SwarmSpawner #440

Open
drzhouq opened this issue Aug 27, 2021 · 2 comments
Open

Comments

@drzhouq
Copy link

drzhouq commented Aug 27, 2021

Proposed change

One can specify "static" constraint for the container (for example, c.SwarmSpawner.extra_placement_spec = { 'constraints' : ['node.role==worker'] }) to be spawn by the jupyterhub server. Is it possible to dynamic change the constraint based on image chosen by the user or even the user name?

Alternative options

Who would use this feature?

Some images need to use GPU, and not every computer in a swarm has GPU. Enable dynamic constraints for the container will help to ensure the container spawn can have access to the GPU.

(Optional): Suggest a solution

It seems that c.Spawner.pre_spawn_hook is currently too late to apply the constraint to container spawn, but it should be the logic place to implement this "dynamic" container constraint.

@welcome
Copy link

welcome bot commented Aug 27, 2021

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

Copy link
Member

Indeed, most of these extra_ fields should be allowed to be callables. Starting on this in #500, swarm should come next

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

No branches or pull requests

2 participants