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

# ResponseInfo GET ignored for some Kernels #159

Closed
gavrand opened this issue May 11, 2016 · 12 comments
Closed

# ResponseInfo GET ignored for some Kernels #159

gavrand opened this issue May 11, 2016 · 12 comments
Assignees

Comments

@gavrand
Copy link

gavrand commented May 11, 2016

Hi

I am using Apache Toree as Jupyter Kernel and ResponseInfo is being ignored for it. It is working perfectly with standard Python2 Kernel. #Get does work perfectly !

I guess it is due to "shortcut" is being used to produce response_code in /services/notebooks/handlers.py (line 199)

response_future = self.execute_code(kernel_client, kernel_id, response_code)

instead of full packing for request_code (line 180)

request = json.dumps({
                'body' : parse_body(self.request),
                'args' : parse_args(self.request.query_arguments),
                'path' : self.path_kwargs,
                'headers' : headers_to_dict(self.request.headers)

and hence remote Apache Kernel (interacting via Jupyter protocol) might not be happy with it.
Again, it is from my limited knowledge and time spent. However Apache PySpark does not work:I

Thank you
Andrey

@parente
Copy link
Contributor

parente commented May 11, 2016

Thanks for the report, @gavrand . Can you confirm which mode you're running the kernel gateway in, with jupyter websockets or notebook http? Basically, what's your run command for starting the kernel gateway?

@gavrand
Copy link
Author

gavrand commented May 11, 2016

Hi Peter

Thank you for the prompt reply. It is indeed notebook-http.
The run cmd is below

jupyter kernelgateway --KernelGatewayApp.api=notebook-http --KernelGatewayApp.ip=0.0.0.0 --KernelGatewayApp.seed_uri=./notebook.ipynb

Thank you
Andrey

@parente
Copy link
Contributor

parente commented May 11, 2016

@Lull3rSkat3r mind taking a look at this?

@Lull3rSkat3r
Copy link
Collaborator

I'll check it out.

@Lull3rSkat3r Lull3rSkat3r self-assigned this May 11, 2016
@Lull3rSkat3r
Copy link
Collaborator

@gavrand, are you running Apache Toree with the scala or python interpreter?

@gavrand
Copy link
Author

gavrand commented May 11, 2016

Hi @Lull3rSkat3r. It is python interpreter.

Again, #Get is working perfectly. It is only ResponseInfo where I am struggling and hence could not dump application/json :(.
If you want I could try scala one also.

Thank you
Andrey

@Lull3rSkat3r
Copy link
Collaborator

@gavrand, would it be possible to attach your notebook?

@gavrand
Copy link
Author

gavrand commented May 11, 2016

Hi @Lull3rSkat3r

I am afraid, I am unable to send it from work by compliance reasons.
But the example from the github /kernel_gateway/tests/resources/responses_2.ipynb
does not work with Apache Toree Kernel also (the simplest one # GET /json)

Andrey

@Lull3rSkat3r
Copy link
Collaborator

@gavrand, no worries. I will use the example notebook. Will post my results soon.

@parente parente added the bug label May 12, 2016
@Lull3rSkat3r
Copy link
Collaborator

So investigating this in more detail exposed a bug in the Toree Kernel. Essentially the PySpark interpreter in Toree is returning print messages as an execute result. The KG code currently expects the code to output the response info via a stream message. You can see this by running a code cell in Toree PySpark:

pyspark bug

This might bring up the point of reading the text/plain value from an execute result, but is not directly the fault of KG. If we do not want to support this we can close. I have opened a bug on Toree for the real issue TOREE 318.

@gavrand
Copy link
Author

gavrand commented May 20, 2016

Thank you very much for investigation, Corey !
Will see what Toree say.

Andrey

@parente parente added dependency and removed bug labels May 21, 2016
@parente
Copy link
Contributor

parente commented Jun 17, 2016

Tracing through the issue @Lull3rSkat3r noted above, it appears this problem has been fixed by apache/incubator-toree#47.

Going to close here since the problem was in the dependency.

@parente parente closed this as completed Jun 17, 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

3 participants