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

Brainstorming: new use of entry_points for composability of Jupyter ecosystem software? #552

Open
consideRatio opened this issue Aug 12, 2022 · 2 comments

Comments

@consideRatio
Copy link
Member

Code in the Jupyter ecosystem sometimes make use of Python entry_points to identity other code to integrate with. I

Examples of entry_points

New uses of entry_points?

Overall I think there can be complexity with these ideas making them not worth going for, but even if these ideas doesn't turn out to lead somewhere I figure maybe we could benefit from thinking about this a bit together.

@minrk
Copy link
Member

minrk commented Aug 12, 2022

In general, I don't love using a discovery mechanism (entrypoints) to also trigger code execution, especially in an environment like JupyterHub, which often runs as root. Just like with most plugin systems (spawners, etc.) making something available still requires an explicit step to use it.

But it does potentially make sense as an avenue to simplify loading a plugin such as the idle-culler to shift more code over there, so a config file might just say services.append("jupyterhub-idle-culler") and a hook in jupyterhub_idle_culler takes care of the rest. Do you think that is enough? What do you think that example would look like compared to what's required now? How would configuration of the service be handled?

Maybe jupyterhub-singleuser or jupyter_server could use entry_points

jupyter-server already has an extension mechanism that works very well and handles discovery, loading, etc. I don't think we need anything new to add there, and don't think we should have a jupyterhub-specific extension mechanism for something that already exists. In fact, I'm trying to get jupyterhub-singleuser down to just a server extension in jupyterhub/jupyterhub#3888.

I think we could possibly implement both the root hooks and the log capture as standard server extensions (using os.dup2).

@minrk
Copy link
Member

minrk commented Aug 12, 2022

I forgot to mention - I'm absolutely 👍 on entrypoints as a discovery mechanism anywhere we find it's helpful, so anywhere we do find a discovery problem I think it's a good thing to start with.

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

No branches or pull requests

2 participants