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

Proof point: See if notebook-http mode can be made a "plugin" #103

Closed
5 tasks done
parente opened this issue Feb 17, 2016 · 10 comments
Closed
5 tasks done

Proof point: See if notebook-http mode can be made a "plugin" #103

parente opened this issue Feb 17, 2016 · 10 comments
Assignees
Milestone

Comments

@parente
Copy link
Contributor

parente commented Feb 17, 2016

Right now, the code for the Jupyter Notebook APIs (jupyter-websocket mode) is mixed in with the code for the notebook-defined REST API (notebook-http mode). This was done for convenience during incubation to prove that KG could support other means (transports, APIs, and protocols) for working with kernels. Interestingly enough, I had a conversation the other day that resulted in my thinking about how kernels might operate if hooked to a message queue (e.g., Rabbit MQ). Immediately, I wondered if such a setup could be made possible via the kernel gateway.

I certainly don't want to keep hacking support for additional kernel comm mechanisms into the KG code base. I wonder instead of an API could be defined to allow such things to be plugged-in easily. My hesitation is that not everything will so easily reuse the APIs and classes from the notebook server like the microservice approach did.

I'd like to take a pass at turning the notebook-http mode, the jupyter-websocket mode, and maybe even the message-queue idea into "plugins" (for lack of a better word) to the kernel gateway. If there's common ground, it'll improve the extensibility and maintainability of the project. If there's very little commonality beyond the boilerplate CLI, it may suggest each of these deserves to be in its own project.

Just writing this down. Not planning to jump on it right away.


From discussion with @nitind:

Clarifying the changes being implemented:

/cc @fperez @minrk

@minrk
Copy link
Contributor

minrk commented Feb 17, 2016

👍 thanks, @parente!

@fperez
Copy link

fperez commented Feb 17, 2016

+1, great writeup, thanks!

@parente
Copy link
Contributor Author

parente commented May 11, 2016

@nitind and I spoke about this face-to-face. I think it's worth taking a crack at this now since "all's quiet on the western front" at the moment. Basics we discussed:

  • try the plug-in approach first, don't worry about separate repos and so on
  • identify where we're doing if/else checks for mode and think about refactoring that into separate packages named after the mode (e.g., jupyter_websocket, notebook_http)
  • move mode specific command line parameters to classes in the subpackages (traitlets already supports namespaces like this, so shouldn't be hard)
  • implement a basic lifecycle API that the kernelgatewayapp.py invokes upon bring up (a refactoring of all the initialization methods in the main app class)
  • review and doc the API, along with a short tutorial on writing your own (notebook_http mode might serve as an example)

We can discuss design here as we go. Hopefully this can be done as a series of PRs instead of one massive fork merge.

IMHO, if we can come up with a well-defined API, we should call that release 1.0.

@nitind
Copy link
Collaborator

nitind commented May 23, 2016

The bulk of the branching is done in gatewayapp.py itself, one for choosing the kernel pool implementation, the other for populating the list of request handlers. Breaking them out into different modules to understand how much of the main app they need would be a start.

@nitind
Copy link
Collaborator

nitind commented Jun 13, 2016

Clarifying the changes being implemented:

  • changing "API" parameter from a string to a fully qualified module name
  • moving the current jupyter-websocket and notebook-http functionality into their own modules, not buried in services/
  • relocate functionality specific to either mode into their modules
  • relocate traitlets specific to one mode into its module (e.g. KG_LIST_KERNELS)

@parente
Copy link
Contributor Author

parente commented Jun 17, 2016

@nitind, I think you've got a clear path toward making "personalities" as you call them pluggable. I'd like to make a release of KG 0.6.0 now with the other fixes that have gone in, and start merging the PRs you stated in the prior comment into 1.0.0.dev in master, leading up to a 1.0 release where we declare the API stable and start semantic versioning.

@minrk, @fperez does that make sense to you?

@minrk
Copy link
Contributor

minrk commented Jun 17, 2016

Makes sense to me, thanks @parente and @nitind!

@parente parente modified the milestone: 1.0 Jun 17, 2016
@parente
Copy link
Contributor Author

parente commented Jun 17, 2016

@nitind, I added the list from your previous comment to the description and turned it into one of those checkbox todo lists so we don't lose track across the handful of PRs this is going to take to close.

@parente
Copy link
Contributor Author

parente commented Jun 28, 2016

With #177 in, I think we can close this. @nitind, you can do the honors if you agree. Thanks for all the work on this. It's great.

@nitind
Copy link
Collaborator

nitind commented Jun 28, 2016

Closing.
/me raises the roof

@nitind nitind closed this as completed Jun 28, 2016
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

4 participants