Repository navigation
Conversation
The IPython startup script built PipMagicOverrides with its older constructor. On serverless environment 5 the constructor requires a logger, and on environment 6 there is no Py4J entry point, so the call failed and notebooks fell back to IPython's stock %pip. When the constructor takes a logger, build it from the driver connection the same way dbruntime's own kernel does, passing only the keyword arguments the installed runtime accepts. Older runtimes keep the existing path. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
Integration test reportCommit: 327738a
Top 10 slowest tests (at least 2 minutes):
|
Co-authored-by: Isaac <no-reply@databricks.com>
This branch has not been deployed
This file contains hidden or 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
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.
Changes
On runtimes whose
PipMagicOverridestakes alogger(serverless environment 5+),jupyter-init.pynow builds the magic the way dbruntime's own kernel does. The driver conf, logger and environment resource client come from the driver connection, and the Py4J entry point is passed only where it exists. The constructor gained keyword arguments across runtime releases, so only the ones the installed runtime accepts are passed. Older runtimes keep the existing path.Why
On serverless environments 5 and 6, the IPython startup script failed to register the Databricks
%pipmagic:client.5.12):PipMagicOverrides.__init__() missing 1 required positional argument: 'logger'client.6.5):'NoneType' object has no attribute 'getDriverConf', because Py4J is off and there is no entry pointNotebooks opened over the tunnel then fell back to IPython's stock
%pip. This blocks moving the tunnel's default environment off 4 (DECO-28307).Tests
Tested on prod AWS us-west-2 CPU serverless, with this
jupyter-init.pyas the session's IPython startup script, through a real Jupyter kernel:%pipregistered byPipMagicOverrides(unchanged)PipMagicOverrides(was stock)PipMagicOverrides(was stock)%pip install humanizespark.range(3).count()On v4 a kernel started from the session can't be reached (loopback is blocked there), so v4 was checked with terminal IPython only. I did not test dedicated clusters; their code path is unchanged.
This pull request and its description were written by Isaac.