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

Options independent of any profile #802

Open
miwig opened this issue Oct 24, 2023 · 4 comments
Open

Options independent of any profile #802

miwig opened this issue Oct 24, 2023 · 4 comments

Comments

@miwig
Copy link

miwig commented Oct 24, 2023

Proposed change

It would be nice if we could define options that are independent of any profile. If profiles are defined, these options should apply to all profiles.

Alternative options

If profiles are not needed and only independent options are desired, a somewhat ugly workaround would be to have a single profile and define the options there. If both profiles and independent options are needed, the only solution is to duplicate the "independent" options into each profile.

Who would use this feature?

Admins that want to give users more fine-grained control over spawn options, e.g. independent settings for CPU limit, image, etc.

Suggest a solution

Mostly duplicating the functionality of profile_options to work without a profile, possibly

  • Add a new traitlet option_list that is either a Dict of the same format as profile_options or a callable that returns such a Dict
  • Change options_from_form to accept these options
  • Adapt the default jinja template to render these options
  • Adapt load_user_options to apply the overrides in the same way as profile_options are applied

If you agree that this is a desirable feature and I haven't overlooked anything, I'd be happy to attempt a PR :)

@welcome
Copy link

welcome bot commented Oct 24, 2023

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! 🎉

@manics
Copy link
Member

manics commented Oct 24, 2023

The options set directly on KubeSpawner should already be inherited by all the profiles. Can you give us an example of your desired configuration?

@miwig
Copy link
Author

miwig commented Oct 24, 2023

As I understand it, setting options directly on KubeSpawner allows a static configuration, which is modified by the selected profile and further customizable by the user using profile_options. What I would like is to let the user select options, e.g. the CPU limit, independent of a profile. It seems that this is not currently possible.

@dimm0
Copy link

dimm0 commented Apr 24, 2024

Screenshot 2024-04-24 at 2 16 40 PM

I currently have this form for users. They can pick memory, gpus, region etc, and also pick an image.
The way I do it now is super ugly and breaks with every spawner update. It would be nice to have something like this officially supported.

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

3 participants