-
Notifications
You must be signed in to change notification settings - Fork 208
WIP: Migrate to jupyter-js-services #127
WIP: Migrate to jupyter-js-services #127
Conversation
* Adopt jupyter project versioning scheme * Bump to 0.2.0.dev * Introduce make build target for dev image including bower * Update dev automation for 4.x config, path changes (c) Copyright IBM Corp. 2015
(c) Copyright IBM Corp. 2015
* Remove cell selection border color * Handle new image double click overflow behavior (css not js) (c) Copyright IBM Corp. 2015
* Remove test_converter_layout, precursor to local deploy (c) Copyright IBM Corp. 2015
* No host npm * make build before test * No need to prefetch docker image (c) Copyright IBM Corp. 2015
// IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm) | ||
|
||
var options = { | ||
baseUrl: 'http://192.168.99.100:9500', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder for later: read Urth options instead of hardcoding. Also, need to mimic spawn call for container that thebe does ahead of requesting a kernel. (jupyter-js-services assumes the kernel provider container is pre-running, i.e., the notebook server.)
OK, was finally able to test against both old and new tmpnb impls. Note the added |
I worry that killing when leaving the page is too hard to get right. Can you ensure an XHR is sent and processed with confidence on page unload? The state of XHR available at that point is always questionable in my experience. Thebe also has some fancy logic for writing a cookie to reuse a spawned container if it still exists, to avoid eating up the pool of containers available for other users. I'm open to ideas different from the the Thebe approach or to just mimicking what Thebe does. But we need to do something for lifecycle management for sure. |
While we can do page unload actions, not sure about XHR. That might be too much to do at that point, but we could try. But this won't take care of issues where page/browser crashes or immediately quits/closes and doesn't allow unload actions. Yes, the Thebe cookie logic is what I wrote in the Here's my proposal:
I think that combination would work well for (1) cases where user refreshes page (kernel is reused); and (2) user leaves page for extended period of time (kernel is killed; new one started next time user returns). |
@parente: Regarding previous comment, we implemented proposal item 1 (storing container URL if one is created and re-using when reloading page). But we're wondering about how this should work with different notebooks/dashboards. Let's say we have 2 different dashboards, both using tmpnb.org. We start first dashboard, notices there isn't a stored container URL so it spawns a new container, before starting a new kernel (the container URL is stored). Later, we start the 2nd dashboard. It finds a stored container URL and therefore uses that one, so it does not spawn before creating a new kernel. Is this OK, to have 2 different dashboards using same container (but different kernels)? Thebe recently added a check to see if the set URL is same as stored URL. This won't really work with tmpnb.org, since it redirects to a different subdomain (i.e. https://tmp35.tmpnb.org/user/...) -- seems like that check will always fail and so it will always call spawn. |
For now, yes, since we're just trying to implement a lighter-weight Thebe, compatible with tmpnb. But down the line, each dashboard might have different requirements on the container environment (e..g, libs are available, max memory is allocated, ...) That's where the proposal like jupyter/enhancement-proposals#5 come into play for standardizing an API for requesting kernel environments that a variety of providers can implement. |
This works with simple notebooks which don't contain widgets. Add tmpnb support. Tested against new and old tmpnb. Store container URL to reuse in future. :cow: (c) Copyright IBM Corp. 2015
When deploying a dashboard, use the Notebook REST API to create a new Notebook Session. This allows the dashboard kernel to show in the list of currently running notebooks. (ref jupyter#117) :chicken: (c) Copyright IBM Corp. 2015
If in tmpnb mode, create a new kernel rather than using session API. ref jupyter#117 (c) Copyright IBM Corp. 2015
e633716
to
0b05e9e
Compare
Extract bundlers into their own repos
(c) Copyright IBM Corp. 2015
* Adopt jupyter project versioning scheme * Bump to 0.2.0.dev * Introduce make build target for dev image including bower * Update dev automation for 4.x config, path changes (c) Copyright IBM Corp. 2015
This works with simple notebooks which don't contain widgets. Add tmpnb support. Tested against new and old tmpnb. Store container URL to reuse in future. :cow: (c) Copyright IBM Corp. 2015
(c) Copyright IBM Corp. 2015
🐷 (c) Copyright IBM Corp. 2015
…emonte/dashboards into migrate-to-jupyter-js-services-105
I think we can safely close this. |
Based on 4.x branch.
This works for simple notebooks which don't contain widgets.
Ref #105