[jupyter] Re: Working on a Common Lisp Jupyter notebook server - and experiencing a crash in ipython code

2017-12-18 Thread Roland Weber
On Monday, December 18, 2017 at 3:00:23 PM UTC+1, Christian Schafmeister 
wrote:
>
> I fixed the problem last night - it turned out to be a threading issue.
> When I rapidly evaluated notebook cells (hitting shift-enter really fast) 
> the Python in Jupyter Notebook would crash as shown.
> Multiple processes were calling the pzmq:send function at the same time 
> and the messages were becoming interleaved and garbled.
> I wrapped a mutex around the function that calls pzmq:send multiple times 
> and the problem went away.
>

That sounds like a serious bug. Jupyter is supposed to handle simultaneous 
requests from multiple clients to the same kernel, afaik. This should not 
garble messages.

Are you sure that the problem is on the sending side? Or could it be that 
your kernel expects messages in sequence, although the messaging protocol 
makes no guarantees about that? It's not impossible that you found a 
problem in Jupyter. But it seems strange that something so fundamental 
would have gone unnoticed until now.

If you think that problem is in Jupyter, please open an issue and point us 
to the code where you had to implement the fix.

best regards,
  Roland

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/34f04b0e-8a6b-42f4-8f0e-754f4d9d66c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[jupyter] Re: Restart snippet numbering in the middle of a notebook?

2017-12-18 Thread Roland Weber
Restart the kernel before each section. That will clear all state in 
memory, and reset the execution count.

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/454c68ed-328a-45b6-9c13-c15eef7da8a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[jupyter] Restart snippet numbering in the middle of a notebook?

2017-12-18 Thread insearchofanswers87
If I am writing a book chapter with many sections, is there any way for me 
to start over with snippet #1 at the beginning of each section? Or do I 
need to use separate notebooks for each section to accomplish that?

So basically, I want to forget about the snippets earlier in the notebook 
and begin from scratch with each new section.

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/cf0835ff-0881-40f8-ae33-fb6641775419%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] What is the best tool for monitoring jupyter notebooks websockets communication?

2017-12-18 Thread Thomas Kluyver
Oh, I missed that it's related to widgets. Widgets won't work in the Qt
console, because they need an HTML frontend. You might need to insert some
debugging code.

On 18 December 2017 at 16:28, Christian Schafmeister <
drschafmeis...@gmail.com> wrote:

> Thank you!
>
> I'll give qtconsole a whirl.
>
> On Monday, December 18, 2017 at 9:31:48 AM UTC-5, takowl wrote:
>>
>> I'm not sure about monitoring websockets, but the websocket messages
>> should be directly translated from the ZMQ messages. If you run the Qt
>> console with the debug option (jupyter qtconsole --debug --kernel
>> mykernelname), it should show all the messages it sends and receives in the
>> terminal where you launched it.
>>
>> On 18 December 2017 at 14:16, Christian Schafmeister <
>> drschaf...@gmail.com> wrote:
>>
>>>
>>> Howdy,
>>>
>>> We are developing a jupyter notebook kernel in Common Lisp that supports
>>> jupyter widgets.
>>>
>>> What is the best tool for monitoring jupyter notebooks websockets
>>> communication?
>>> We primarily develop on OS X
>>>
>>> We have used Firefox 56.0.2 with the "Websocket monitor" extension - but
>>> that will stop working if I upgrade to Firefox quantum.
>>>
>>> I've installed wireshark but that doesn't seem to capture everything on
>>> the loopback interface.
>>> I'm new to wireshark and perhaps I'm not using it correctly.
>>> I see many more messages in "Firefox/Websocket monitor" than I see in
>>> the wireshark window with 'websocket' filter.
>>>
>>> A particular problem that we have is that the websockets frames going
>>> from the jupyter server to the browser are "Binary format" and not "Text
>>> format".
>>> This appears to work completely fine for jupyter notebook operation but
>>> it makes it more difficult to see the JSON messages in the messages because
>>> only OS X Safari, Firefox with the websocket monitor and wireshark with the
>>> websocket filter can be configured to present the JSON payload of a binary
>>> format frames.
>>> I'll post another question about "binary" vs "text" format websocket
>>> frame and how to control it.
>>>
>>> Best,
>>>
>>> Christian Schafmeister
>>> Professor
>>> Chemistry Department
>>> Temple University
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Project Jupyter" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jupyter+u...@googlegroups.com.
>>> To post to this group, send email to jup...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/jupyter/cd995831-cd04-45d8-ba81-cd8ee25d9253%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/e111dd1d-f72d-4018-bcab-3a30a0623a9a%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAOvn4qjBQY1mcDpDD9sfPs-TA3RYAJdz0T4dPQ2NfwR2EviP3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] Binary vs text websocket frames

2017-12-18 Thread Jason Grout
The websocket frames are sent in either binary or text, depending on
whether there are binary buffers encoded in the message (it is a
per-message decision, not an overall decision). The decision logic is here:
https://github.com/jupyter/notebook/blob/ca50f1af5afb525fd95b98b2e61e69db28094467/notebook/base/zmqhandlers.py#L230

I think it would be very useful to have either something that can log the
messages in the kernel, right around that logic. Another interesting change
would be to have a debug switch in the notebook server that encodes any
binary message buffers with base64 so the websocket message can still be a
text websocket frame. Another place to put the logging logic is in the
frontend, after the message has been converted back into a native js object.

Jason


On Mon, Dec 18, 2017 at 6:23 AM Christian Schafmeister <
drschafmeis...@gmail.com> wrote:

> Hello,
>
> How can I control whether the jupyter server sends binary websocket frames
> vs text websocket frames to the browser?
>
> When monitoring websocket traffic between an ipython jupyter notebook
> kernel and the browser, all websocket frames, both to the browser and from
> the browser are in websocket text frames.  This makes it easy to read the
> JSON dictionaries using almost any browser.
> When monitoring websocket traffic between our Common Lisp kernel and a
> browser, the websocket frames to the browser are binary websocket frames
> and the frames from the browser are websocket text frames.
> I recently learned that it is the jupyter notebook server (written in
> python) that is interposed between our kernel and the browser that is
> carrying out this websocket communication.  Why is it using binary frames?
> Binary websocket frames are a lot harder to dig into and extract the JSON
> from.
>
> I'd like to monitor the websocket traffic between the jupyter server and
> the browser for debugging.
> It has been extremely helpful to do this in a painful/limited way to add
> jupyter widgets support to our kernel (based on cl-jupyter/Common Lisp).
>
> Best,
>
> Christian Schafmeister
> Professor
> Chemistry Department
> Temple University
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/9915a01a-5704-4671-86ce-5c33793504ee%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAPDWZHx0dQi0egPcJzzqmvcuqrc78tJQcnEcKKA3qjeBunh6vw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] What is the best tool for monitoring jupyter notebooks websockets communication?

2017-12-18 Thread Christian Schafmeister
Thank you!

I'll give qtconsole a whirl.

On Monday, December 18, 2017 at 9:31:48 AM UTC-5, takowl wrote:
>
> I'm not sure about monitoring websockets, but the websocket messages 
> should be directly translated from the ZMQ messages. If you run the Qt 
> console with the debug option (jupyter qtconsole --debug --kernel 
> mykernelname), it should show all the messages it sends and receives in the 
> terminal where you launched it.
>
> On 18 December 2017 at 14:16, Christian Schafmeister  > wrote:
>
>>
>> Howdy,
>>
>> We are developing a jupyter notebook kernel in Common Lisp that supports 
>> jupyter widgets.
>>
>> What is the best tool for monitoring jupyter notebooks websockets 
>> communication?
>> We primarily develop on OS X 
>>
>> We have used Firefox 56.0.2 with the "Websocket monitor" extension - but 
>> that will stop working if I upgrade to Firefox quantum.
>>
>> I've installed wireshark but that doesn't seem to capture everything on 
>> the loopback interface.
>> I'm new to wireshark and perhaps I'm not using it correctly.
>> I see many more messages in "Firefox/Websocket monitor" than I see in the 
>> wireshark window with 'websocket' filter.
>>
>> A particular problem that we have is that the websockets frames going 
>> from the jupyter server to the browser are "Binary format" and not "Text 
>> format".
>> This appears to work completely fine for jupyter notebook operation but 
>> it makes it more difficult to see the JSON messages in the messages because 
>> only OS X Safari, Firefox with the websocket monitor and wireshark with the 
>> websocket filter can be configured to present the JSON payload of a binary 
>> format frames.
>> I'll post another question about "binary" vs "text" format websocket 
>> frame and how to control it.
>>
>> Best,
>>
>> Christian Schafmeister
>> Professor
>> Chemistry Department
>> Temple University
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Project Jupyter" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jupyter+u...@googlegroups.com .
>> To post to this group, send email to jup...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jupyter/cd995831-cd04-45d8-ba81-cd8ee25d9253%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/e111dd1d-f72d-4018-bcab-3a30a0623a9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] What is the best tool for monitoring jupyter notebooks websockets communication?

2017-12-18 Thread Christian Schafmeister
Hi - thank you.  

I've got an undergraduate working on adding jupyter widgets 7.0 level 
support. 
I'm going to point him at this group so that he can benefit from it.

I posted another question 
(https://groups.google.com/forum/#!topic/jupyter/CeFeG63Ckw8) on binary vs 
text websocket frames and jupyter notebooks.
I tried the network debug panel of every browser I could get my hands on 
and found only Firefox 56.x with the 'websocket monitor' and Safari could 
reveal the contents of the binary websocket frames that jupyter notebooks 
is using when our kernel communicates through it to the browser.
If we could get the server to stop using binary frames and use text frames 
(like we see with the ipython kernel) I think we would be able to use more 
tools to monitor the communication.

I'll try the qtconsole - thank you.

On Monday, December 18, 2017 at 11:00:00 AM UTC-5, sp...@draves.org wrote:
>
> awesome to hear someone is working on common lisp and widgets!
> we did similar work for the jvm and found chrome's network debug panel to 
> be adequate.
> it breaks the websocket traffic into frames and displays the json contents 
> nicely, including interactive unfolding of the contents.
>
> On Mon, Dec 18, 2017 at 9:31 AM, Thomas Kluyver  > wrote:
>
>> I'm not sure about monitoring websockets, but the websocket messages 
>> should be directly translated from the ZMQ messages. If you run the Qt 
>> console with the debug option (jupyter qtconsole --debug --kernel 
>> mykernelname), it should show all the messages it sends and receives in the 
>> terminal where you launched it.
>>
>> On 18 December 2017 at 14:16, Christian Schafmeister <
>> drschaf...@gmail.com > wrote:
>>
>>>
>>> Howdy,
>>>
>>> We are developing a jupyter notebook kernel in Common Lisp that supports 
>>> jupyter widgets.
>>>
>>> What is the best tool for monitoring jupyter notebooks websockets 
>>> communication?
>>> We primarily develop on OS X 
>>>
>>> We have used Firefox 56.0.2 with the "Websocket monitor" extension - but 
>>> that will stop working if I upgrade to Firefox quantum.
>>>
>>> I've installed wireshark but that doesn't seem to capture everything on 
>>> the loopback interface.
>>> I'm new to wireshark and perhaps I'm not using it correctly.
>>> I see many more messages in "Firefox/Websocket monitor" than I see in 
>>> the wireshark window with 'websocket' filter.
>>>
>>> A particular problem that we have is that the websockets frames going 
>>> from the jupyter server to the browser are "Binary format" and not "Text 
>>> format".
>>> This appears to work completely fine for jupyter notebook operation but 
>>> it makes it more difficult to see the JSON messages in the messages because 
>>> only OS X Safari, Firefox with the websocket monitor and wireshark with the 
>>> websocket filter can be configured to present the JSON payload of a binary 
>>> format frames.
>>> I'll post another question about "binary" vs "text" format websocket 
>>> frame and how to control it.
>>>
>>> Best,
>>>
>>> Christian Schafmeister
>>> Professor
>>> Chemistry Department
>>> Temple University
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Project Jupyter" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to jupyter+u...@googlegroups.com .
>>> To post to this group, send email to jup...@googlegroups.com 
>>> .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jupyter/cd995831-cd04-45d8-ba81-cd8ee25d9253%40googlegroups.com
>>>  
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Project Jupyter" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jupyter+u...@googlegroups.com .
>> To post to this group, send email to jup...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jupyter/CAOvn4qgHfyCwZ1qfmt3oTPTsNaXF0BxSXOrGRMk7qp3bsWQ%2B%2Bg%40mail.gmail.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> BeakerX.com
> ScottDraves.com 
> @Scott_Draves 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 

Re: [jupyter] What is the best tool for monitoring jupyter notebooks websockets communication?

2017-12-18 Thread s...@draves.org
awesome to hear someone is working on common lisp and widgets!
we did similar work for the jvm and found chrome's network debug panel to
be adequate.
it breaks the websocket traffic into frames and displays the json contents
nicely, including interactive unfolding of the contents.

On Mon, Dec 18, 2017 at 9:31 AM, Thomas Kluyver  wrote:

> I'm not sure about monitoring websockets, but the websocket messages
> should be directly translated from the ZMQ messages. If you run the Qt
> console with the debug option (jupyter qtconsole --debug --kernel
> mykernelname), it should show all the messages it sends and receives in the
> terminal where you launched it.
>
> On 18 December 2017 at 14:16, Christian Schafmeister <
> drschafmeis...@gmail.com> wrote:
>
>>
>> Howdy,
>>
>> We are developing a jupyter notebook kernel in Common Lisp that supports
>> jupyter widgets.
>>
>> What is the best tool for monitoring jupyter notebooks websockets
>> communication?
>> We primarily develop on OS X
>>
>> We have used Firefox 56.0.2 with the "Websocket monitor" extension - but
>> that will stop working if I upgrade to Firefox quantum.
>>
>> I've installed wireshark but that doesn't seem to capture everything on
>> the loopback interface.
>> I'm new to wireshark and perhaps I'm not using it correctly.
>> I see many more messages in "Firefox/Websocket monitor" than I see in the
>> wireshark window with 'websocket' filter.
>>
>> A particular problem that we have is that the websockets frames going
>> from the jupyter server to the browser are "Binary format" and not "Text
>> format".
>> This appears to work completely fine for jupyter notebook operation but
>> it makes it more difficult to see the JSON messages in the messages because
>> only OS X Safari, Firefox with the websocket monitor and wireshark with the
>> websocket filter can be configured to present the JSON payload of a binary
>> format frames.
>> I'll post another question about "binary" vs "text" format websocket
>> frame and how to control it.
>>
>> Best,
>>
>> Christian Schafmeister
>> Professor
>> Chemistry Department
>> Temple University
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Project Jupyter" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jupyter+unsubscr...@googlegroups.com.
>> To post to this group, send email to jupyter@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/jupyter/cd995831-cd04-45d8-ba81-cd8ee25d9253%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/CAOvn4qgHfyCwZ1qfmt3oTPTsNaXF0BxSXOrGRMk7qp3bsWQ%2B%2Bg%
> 40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
BeakerX.com
ScottDraves.com 
@Scott_Draves 

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAMaD%2Bf4Va-6k2Cjj35PbrRD4k%3DeRmqx7bBu-N8hMhyhyCnEQDA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] What is the best tool for monitoring jupyter notebooks websockets communication?

2017-12-18 Thread Thomas Kluyver
I'm not sure about monitoring websockets, but the websocket messages should
be directly translated from the ZMQ messages. If you run the Qt console
with the debug option (jupyter qtconsole --debug --kernel mykernelname), it
should show all the messages it sends and receives in the terminal where
you launched it.

On 18 December 2017 at 14:16, Christian Schafmeister <
drschafmeis...@gmail.com> wrote:

>
> Howdy,
>
> We are developing a jupyter notebook kernel in Common Lisp that supports
> jupyter widgets.
>
> What is the best tool for monitoring jupyter notebooks websockets
> communication?
> We primarily develop on OS X
>
> We have used Firefox 56.0.2 with the "Websocket monitor" extension - but
> that will stop working if I upgrade to Firefox quantum.
>
> I've installed wireshark but that doesn't seem to capture everything on
> the loopback interface.
> I'm new to wireshark and perhaps I'm not using it correctly.
> I see many more messages in "Firefox/Websocket monitor" than I see in the
> wireshark window with 'websocket' filter.
>
> A particular problem that we have is that the websockets frames going from
> the jupyter server to the browser are "Binary format" and not "Text format".
> This appears to work completely fine for jupyter notebook operation but it
> makes it more difficult to see the JSON messages in the messages because
> only OS X Safari, Firefox with the websocket monitor and wireshark with the
> websocket filter can be configured to present the JSON payload of a binary
> format frames.
> I'll post another question about "binary" vs "text" format websocket frame
> and how to control it.
>
> Best,
>
> Christian Schafmeister
> Professor
> Chemistry Department
> Temple University
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/cd995831-cd04-45d8-ba81-cd8ee25d9253%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAOvn4qgHfyCwZ1qfmt3oTPTsNaXF0BxSXOrGRMk7qp3bsWQ%2B%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[jupyter] Binary vs text websocket frames

2017-12-18 Thread Christian Schafmeister
Hello,

How can I control whether the jupyter server sends binary websocket frames 
vs text websocket frames to the browser?

When monitoring websocket traffic between an ipython jupyter notebook 
kernel and the browser, all websocket frames, both to the browser and from 
the browser are in websocket text frames.  This makes it easy to read the 
JSON dictionaries using almost any browser.
When monitoring websocket traffic between our Common Lisp kernel and a 
browser, the websocket frames to the browser are binary websocket frames 
and the frames from the browser are websocket text frames. 
I recently learned that it is the jupyter notebook server (written in 
python) that is interposed between our kernel and the browser that is 
carrying out this websocket communication.  Why is it using binary frames? 
 Binary websocket frames are a lot harder to dig into and extract the JSON 
from.

I'd like to monitor the websocket traffic between the jupyter server and 
the browser for debugging.
It has been extremely helpful to do this in a painful/limited way to add 
jupyter widgets support to our kernel (based on cl-jupyter/Common Lisp).

Best,

Christian Schafmeister
Professor
Chemistry Department
Temple University

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/9915a01a-5704-4671-86ce-5c33793504ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[jupyter] What is the best tool for monitoring jupyter notebooks websockets communication?

2017-12-18 Thread Christian Schafmeister

Howdy,

We are developing a jupyter notebook kernel in Common Lisp that supports 
jupyter widgets.

What is the best tool for monitoring jupyter notebooks websockets 
communication?
We primarily develop on OS X 

We have used Firefox 56.0.2 with the "Websocket monitor" extension - but 
that will stop working if I upgrade to Firefox quantum.

I've installed wireshark but that doesn't seem to capture everything on the 
loopback interface.
I'm new to wireshark and perhaps I'm not using it correctly.
I see many more messages in "Firefox/Websocket monitor" than I see in the 
wireshark window with 'websocket' filter.

A particular problem that we have is that the websockets frames going from 
the jupyter server to the browser are "Binary format" and not "Text format".
This appears to work completely fine for jupyter notebook operation but it 
makes it more difficult to see the JSON messages in the messages because 
only OS X Safari, Firefox with the websocket monitor and wireshark with the 
websocket filter can be configured to present the JSON payload of a binary 
format frames.
I'll post another question about "binary" vs "text" format websocket frame 
and how to control it.

Best,

Christian Schafmeister
Professor
Chemistry Department
Temple University

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/cd995831-cd04-45d8-ba81-cd8ee25d9253%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[jupyter] Re: Working on a Common Lisp Jupyter notebook server - and experiencing a crash in ipython code

2017-12-18 Thread Christian Schafmeister
Thank you so much for your reply!  
Beyond the ZMQ connection I had a very fuzzy idea of what was going on. 
Your explanation has started to fill in a lot of gaps.

I fixed the problem last night - it turned out to be a threading issue.
When I rapidly evaluated notebook cells (hitting shift-enter really fast) 
the Python in Jupyter Notebook would crash as shown.
Multiple processes were calling the pzmq:send function at the same time and 
the messages were becoming interleaved and garbled.
I wrapped a mutex around the function that calls pzmq:send multiple times 
and the problem went away.

On Monday, December 18, 2017 at 2:58:08 AM UTC-5, Roland Weber wrote:
>
> Hello Christian,
>
> the architecture looks like this:
>
> Browser <-> Jupyter Notebook <-> Kernel
>
> The browser communicates with the Jupyter Notebook server using HTTP and 
> Websockets.
> The notebook server communicates with your kernel using ZMQ connections.
> In other words, the notebook server translates between websocket 
> connections and ZMQ connections.
> It's written in python, and that's where the Jupyter Client is being used.
>
> With Jupyter Kernel Gateway, which plays a similar role as Notebook for 
> non-browser clients, we've encountered invalid signatures when a kernel 
> used the wrong character encoding. Are you using utf-8 consistently when 
> processing messages?
> https://github.com/jupyter/kernel_gateway/issues/241
>
> hope this helps,
>   Roland
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/9c9c5fd2-4f88-4715-8b98-ccc2a2ec50c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.