-
Notifications
You must be signed in to change notification settings - Fork 315
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
Port gateway from notebook #92
Merged
Zsailer
merged 17 commits into
jupyter-server:master
from
kevin-bates:port-gateway-from-notebook
Sep 27, 2019
Merged
Port gateway from notebook #92
Zsailer
merged 17 commits into
jupyter-server:master
from
kevin-bates:port-gateway-from-notebook
Sep 27, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 tasks
@kevin-bates, is this ready for review or are you still cherry-picking commits? |
This change alleviates a significant pain-point for consumers of Jupyter Kernel and Enterprise Gateway projects by embedding the few classes defined in the NB2KG server extension directly into the Notebook server. All code resides in a separate gateway directory and the 'extension' is enabled via a new configuration option `--gateway-url`. Renamed classes from those used in standard NB2KG code so that Jupyter servers using the existing NB2KG extension will still work. Added test_gateway.py to exercise overridden methods. It does this by mocking the call that issues requests to the gateway server. Updated the _Running a notebook server_ topic to include a description of this feature.
Created a singleton class `Gateway` to store all configuration options for a Gateway. This class also holds some help methods to make it easier to use the options and determine if the gateway option is enabled. Updated the NotebookTestBase class to allow for subclasses to infuence the patched environment as well as command line options via argv. Added a test to ensure various gateway configuration items can be set via the environment or command-line.
Eliminated the Kernel and Kernelspec handlers. The Websocket (ZMQ) channels handler still remains. This required turning a few methods into coroutines in the Notebook server. Renamed the Gateway config object to GatewayClient in case we want to extend NB server (probably jupyter_server at that point) with Gateway server functionality - so an NB server could be a Gateway client or a server depending on launch settings. Add code to _replace_ the channels handler rather than rely on position within the handlers lists. Updated mock-gateway to return the appropriate form of results. Updated the session manager tests to use a sync ioloop to call the now async manager methods.
Convey notebook working directory to the gateway (nb2kg pr-21) Support retrieval of kernelspec resources from the gateway (nb2kg pr-23)
The connect and request timeout defaults have been updated from 20 to 60 seconds and a default value of 40 has been added for KERNEL_LAUNCH_TIMEOUT. The code ensures that KERNEL_LAUNCH_TIMEOUT is in the env and that the value of the request timeout is at least 2 greather than KERNEL_LAUNCH_TIMEOUT. This PR is port of the NB2KG PRs 35 and 38.
We were missing a yield statement in the deferral of `get()` to the superclass. This issue was occurring only when Tornado 6+ was deployed. Also removed a debug message producing way too much information.
I removed the mirroring 'Receiving' debug statement previously and didn't realize there's a 'Sending' statement. This change removes that statement. This should be part of the 6.0 release, just not signficant enough to warrant include in rc1.
If the message is bytes, we should set binary=True This is a port from NB2KG PR jupyter/nb2kg#33
When notebook (with `--gateway-url` option) lost the connection to Gateway, notebook didn't connect to Gateway again although the websocket connection from the client was still alive. This change recovers the connection to Gateway to prevent this anomaly. Signed-off-by: Eunsoo Park <[email protected]>
kevin-bates
force-pushed
the
port-gateway-from-notebook
branch
from
September 26, 2019 00:22
90f22e5
to
898ac31
Compare
LGTM! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ported (cherry-picked) the following Notebook commits to incorporate gateway support into server (Note: commit ids are relative to Notebook [newest to oldest] for cross-referencing):
Along with the following local commits to complete the integration: