jupyterhub / team-compass

A repository for team interaction, syncing, and handling meeting notes across the JupyterHub ecosystem.
http://jupyterhub-team-compass.readthedocs.io
62 stars 33 forks source link

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

Open consideRatio opened 2 years ago

consideRatio commented 2 years ago

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 commented 2 years ago

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 https://github.com/jupyterhub/jupyterhub/pull/3888.

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

minrk commented 2 years ago

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.