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

thebe persitent kernel may not respect different kernels on different pages #217

Closed
moorepants opened this issue Jan 14, 2021 · 9 comments
Closed

Comments

@moorepants
Copy link
Member

Go to:

https://chem.libretexts.org/Courses/Remixer_University/LibreTexts_Construction_Guide/05%3A_Interactive_Elements/5.02%3A_Jupyter_Notebooks_(Executable_Programming_Code_and_Figures)/5.2.04%3A_How_to_Incorporate_Data_Files_in_Your_Code_Blocks-_For_Python

Run the cells

Navigate to the next page:

https://chem.libretexts.org/Courses/Remixer_University/LibreTexts_Construction_Guide/05%3A_Interactive_Elements/5.02%3A_Jupyter_Notebooks_(Executable_Programming_Code_and_Figures)/5.2.05%3A_How_to_Incorporate_Data_Files_in_Your_Code_Blocks-_For_R

Run the first cell and you get:

image

It loads the kernel form the prior page but doesn't switch it to R!

This is likley a bug in our plugin as well as thebe. The persistent kernel needs to be aware that different kernels on the same binder instance can be on each page, right?

@rkevin-arch
Copy link
Member

The kernel is not persisted at all, iirc. I can actually run the second page in incognito mode and still get the same error without the first page. The problem is the code cell identifies itself as a python code cell to thebe, so the problem is almost certainly with ckeditor-binder-plugin and not thebe's binder session persistence.

@moorepants
Copy link
Member Author

Thanks. I've ran all the pages in the past when Tannavee created them and the worked, so the persistency thing was the only thing I could think of that changed.

@sandertyu
Copy link
Contributor

I don't understand why the issue would be with CKEditor. I cannot get the code cells on that page to run properly at all, even after deleting my kubernetes pod which is serving my session. Looking at the HTML source, the code cell is marked as an r cell
r-cell

I'll probably try making some bare Thebe pages to see what works.

@sandertyu
Copy link
Contributor

sandertyu commented Jan 15, 2021

I made a barebone Thebe html page in the widget-testing repo in an attempt to replicate the setup on that page. We get the same error, even testing with Thebe version 0.5.0 and 0.5.1. This seems to imply the issue is with Thebe, or the code itself.
was an issue with the html page, it works there now

Further edits: running ckeditor with Thebe 0.5.1 locally the cell will run fine. Running it with 0.6.0 the cell will not run fine. The same thing happens on query.libretexts.org. Since the cell runs fine in bare HTML with Thebe 0.6.0 there must be a conflict between ckeditor binder plugin and Thebe 0.6.0.

@rkevin-arch
Copy link
Member

rkevin-arch commented Jan 15, 2021

bisected the commit that introduced the problem in thebe: 11ff270ab85d4b092c86f2e5ef16680bfdb072b2

@rkevin-arch
Copy link
Member

Found the issue, hotfix coming to ckeditor-binder-plugin

@rkevin-arch
Copy link
Member

The issue has been resolved in the master branch of ckeditor-binder-plugin and has been pushed, and it might take a while to show up in production. This issue is caused by jupyter-book/thebe#349.

@sandertyu
Copy link
Contributor

Everything works properly now. The issue was that the kernelName option in Thebe's binder configuration was outdated in Thebe 0.6.0, so all of those references needed to be changed to just name. Now Thebe will properly recognize the kernel specified in the HTML.

R cell and console message

@moorepants
Copy link
Member Author

Thanks guys. Thebe needs an enhanced test suite so things like this are caught.

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