Giter Site home page Giter Site logo

oschuett / appmode Goto Github PK

View Code? Open in Web Editor NEW
436.0 23.0 69.0 850 KB

A Jupyter extensions that turns notebooks into web applications.

License: MIT License

Python 36.21% CSS 4.76% JavaScript 36.92% HTML 4.16% Jupyter Notebook 9.10% Shell 0.75% Dockerfile 8.10%

appmode's Introduction

Appmode

A Jupyter extensions that turns notebooks into web applications.

screenshots

Try it live

Binder

Click the binder badge to try it live without installing anything. This will take you directly to the "app" version of the notebook.

Installation

Conda

If you use conda, you can install it as:

conda install --channel conda-forge appmode

PyPI

If you use pip, you can install it as:

pip install appmode
jupyter nbclassic-extension enable --py --sys-prefix appmode
jupyter server    extension enable --py --sys-prefix appmode

If you want to use mybinder add the following environment.yml file to your repository:

channels:
  - conda-forge
dependencies:
  - appmode

Description

Appmode consist of a server-side and a notebook extension for Jupyter. Together these two extensions provide the following features:

  • One can view any notebook in appmode by clicking on the Appmode button in the toolbar. Alternatively one can change the url from baseurl/notebooks/foo.ipynb to baseurl/apps/foo.ipynb. This also allows for direct links into appmode.

  • When a notebook is opened in appmode, all code cells are automatically executed. In order to present a clean UI, all code cells are hidden and the markdown cells are read-only.

  • A notebook can be opened multiple times in appmode without interference. This is achieved by creating temporary copies of the notebook for each active appmode view. Each appmode view has its dedicated ipython kernel. When an appmode page is closed the kernel is shutdown and the temporary copy gets removed.

  • To allow for passing information between notebooks via url parameters, the current url is injected into the variable jupyter_notebook_url.

Server Side Configuration

Appmode adds the following configuration options:

  • Appmode.trusted_path Run only notebooks below this path in Appmode. Default: No restrictions.
  • Appmode.show_edit_button Show Edit App button during Appmode. Default: True.
  • Appmode.show_other_buttons Show other buttons, e.g. Logout, during Appmode. Default: True.
  • Appmode.temp_dir Create temp notebooks under this directory. Default: Same directory as current notebook

Writing hidden files is by default disabled in newer versions of Jupyter. To allow Appmode to hide its temporary notebook copies the option ContentsManager.allow_hidden has to be set:

jupyter notebook --ContentsManager.allow_hidden=True

Client Side Customization

The UI elements of Appmode can be customized via the custom.js file. Some examples are:

$('#appmode-leave').hide();                          // Hides the edit app button.
$('#appmode-busy').hide();                           // Hides the kernel busy indicator.
$('#appmode-loader').append('<h2>Loading...</h2>');  // Adds a loading message.

Beware that hiding the edit button does not prevent users from leaving Appmode by changing the URL manually.

Development

With the included Dockerfile a development environment can be quickly created:

  1. Install Docker.
  2. git clone this repository
  3. docker build --tag appmode_dev ./
  4. docker run --init -ti -p127.0.0.1:8888:8888 appmode_dev
  5. Browse to http://localhost:8888/apps/example_app.ipynb

Acknowledgements

Appmode has been developed with the support of the NCCR MARVEL funded by the Swiss National Science Foundation.

appmode's People

Contributors

betatim avatar caleblf avatar giovannipizzi avatar linuxrider avatar oschuett avatar parente avatar pdstack avatar stes avatar volodymyrk avatar zhuoqiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appmode's Issues

Appmode error in Binder

Making this a new issue as I'm not sure of notifications for closed issue comments, apologies if you've seen my other message!
I'm having trouble using appmode in Binder! I'm using a test document here as an example - the non-appmode link works fine:
https://mybinder.org/v2/gh/joshwapiano/amrtool/master?filepath=pandas_df_testing_01.ipynb

However changing filepath to urlpath and adding %2Fapps%2F as follows leads to a '404 : Not Found' error.
https://mybinder.org/v2/gh/joshwapiano/amrtool/master?urlpath=%2Fapps%2Fpandas_df_testing_01.ipynb

I tried adding a binder/postBuild file to my repository as is in yours but that completely broke the first link! (I'm also not sure whether that is necessary or not)

could this be because I'm using python 3.7 instead of 3.6?

Server Side Config And Limiting Access

Hey,

I just found this project. Great work! I had two questions:

  • Is it possible to hide the Jupyter session from the user? That is, clicking the Jupyter logo in the top left would do nothing instead of leading back to the notebook file system. I did this from the UI by adding onclick="return false;" to the a tag. My attempt to make that the default behavior didn't work though. I tried that by adding document.querySelector('[title="a dashboard"]').setAttribute("onclick", "return false;"); to the custom.js file. My ultimate goal is to be able to present a simple quasi-web app to a user without them being able to access any of the Jupyter backend.

  • Can you elaborate on how to implement server side configurations? Which files to edit and how to pass these into the notebook, for example? The README wasn't very clear.

Replaceable gears?

For AiiDA lab we use different gears that are essentially the AiiDA lab logo. Wouldn't that be possible to have the possibility of replacing them in a slightly nicer way compared to what we do now:
https://github.com/aiidalab/aiidalab-docker-stack/blob/develop/Dockerfile#L93-L99

The first obvious possibility that comes to my mind is to read APPMODE_GEARS_PATH system variable that points to the gears.svg file.

@oschuett please let me know if you like the idea of replaceable gears and if yes what is the best way, in your opinion, to do that?

404 Error When Automatically Triggering Appmode

My apologies if this has already been answered, but I have dug through the closed issues of users having this same problem but none of the solutions have worked for me thus far.

I am receiving a 404 Page Not Found error when amending my URL to trigger appmode automatically in Binder. Using my notebook here works fine, and appmode can be triggered within the notebook and work as it should:

https://mybinder.org/v2/gh/edsto1/Covid19_Analysis_and_Insights/master?filepath=%2FDeep_Learning_ANN_Predictive_Model.ipynb

when add the "%2Fapps%2F to the path in the URL, i get a 404 error:

https://mybinder.org/v2/gh/edsto1/Covid19_Analysis_and_Insights/master?filepath=%2Fapps%2FDeep_Learning_ANN_Predictive_Model.ipynb

I've tried to update conda, and running jupyter serverextension enable --py --sys-prefix appmode before hand. Any ideas?

Deleting disconnected kernels fails

When disconnecting from an appmode app (e.g. by closing the browser window), the request to delete the kernel fails (500 DELETE) with TypeError: '_asyncio.Future' object is not subscriptable in server_extension.AppmodeHandler.delete, line 97.

As of notebook versions 4.2 and 5.7, respectively, SessionManager.get_session and SessionManager.delete_session are both coroutines and should be awaited.

This issue causes old kernels to keep running, consuming server resources.

I'm seeing this issue in appmode 0.6.0 with Python 3.6.7, notebook 6.0.0, ipython 7.7.0, tornado 6.0.3.

Hide the Jupyter logo/button

I am serving NBs via appmode with --Appmode.show_edit_button=False. However, users still see the "Jupyter" logo in the top left. If they click that, they are sent to the work tree out of the app. How would I hide this?

Appmode button not appearing

I installed using conda on Mac OSX 10.12.6 in a conda environment but after restarting the jupyter server the appmode button does not appear. I have the nbextensions configuration tool installed and appmode shows up in the list of nbextensions. I also have jupyter dashboard installed, does it conflict with that? I also tried on a Windows machine and it doesn't show up there either.

Temp notebook copies and kernels never removed

When I launch an apps link, the my notebook is correctly copied and a new kernel started; however, they are never deleted/shutdown, which leaves me with a large number of junk files and running kernels. Is there a config I should modify to ensure this happens?

Win 10 Pro 64bit
python 3.7.5
appmode 0.7.0
jupyter-core 4.6.1
jupyter-client 5.3.4

appmode does not work with ipywidgets.Tab

Thanks for creating a great Jupyter extension!

However, I do have a problem with ipywidgets.Tab structures. The problem can be reproduced with the following code:

import ipywidgets as ipw

class wid:
    def on_click(self,btn):
        self.txt1.value += "button clicked 1\n"
        self.txt2.value += "button clicked 2\n"
    def widget(self):
        self.txt1 = ipw.Textarea()
        self.txt2 = ipw.Textarea()
        tab = ipw.Tab([self.txt1, self.txt2])
        tab.set_title(0, 'txt 1')
        tab.set_title(1, 'txt 2')
        btn = ipw.Button(description='click me')
        btn.on_click(self.on_click)
        return ipw.VBox([tab, btn])    

wid().widget()

When this is run in notebook mode, clicking on the button causes text to appear in the textareas of the tabs. In appmode, nothing happens.

How can I pause the execution of the rest of the notebook until a form is completed?

The use case is the following.

First, the user has to fill out a "form" on the top the notebook. I am using ipywidgets for collecting the input from the user. The user can signal that the input is complete by clicking a button.

Then, the rest of the notebook should be executed. Without all the input data, the rest of the notebook cannot be executed.

How can I pause the execution of the rest of the notebook until the form is completed?

If the rest was plain Python code, I could invoke it in the event handler, and be done with it. I don't know how to execute "the rest of the notebook" in an event handler.

My apologizes if I overlooked something trivial. I greatly appreciate your help.

Is it possible to make code non-writable?

Hi,
I'm looking for a way to expose notebook output to non-developers, but would ideally like the view to be locked such that the underlying code can't be altered. I've looked into the retired jupyter-dashboards project, but I'm having trouble getting the Cloudfoundry server setup to work. Is it possible to use appmode in this way, i.e. so that the code can't be changed?

Javascript code does not work with AppMode

Hi,
I need to assign the port of the notebook server to a variable and make a function call with it to get Bokeh to work. The code below works in the normal notebook setting, but when I run it with AppMode the variable PORT is not assigned a value and the code breaks. Any idea why it is not working and how to work around it?

%%javascript
IPython.OutputArea.prototype._should_scroll = function(lines) {return false;}
var nb = Jupyter.notebook;
var port = window.location.port;
nb.kernel.execute("PORT = '" + port + "'");

Great app, by the way!!

I often have to reload the page for appmode to work

I'm not sure why, but many times when I click a Binder link that points to an appmode page, the page seems to load and then hangs. If I ctrl+r reload the page, then it loads just fine. Has anyone else experienced anything like this?

404 Page not found error - AWS Sagemaker

Hi,

I am trying to make Appmode work for AWS Sagemaker's Notebook instance but it throws the 404 Page not found error. Any help would be greatly appreciated. (Let me know what information is needed to debug this)

Appmode not showint in extensions

Hi,

I am new to Jupyter, so I am not sure what else to try. I've installed jupyter on a Mac (python 3.7.2). I've tried installing appmode with conda (all went well), but it does not show in the extensions, and I don't get the button.

Then I tried with pip:
pip install appmode
jupyter nbextension enable --py --sys-prefix appmode
jupyter serverextension enable --py --sys-prefix appmode

Everything is fine, I get:

Enabling notebook extension appmode/main...
- Validating: OK

  • Writing config: /../jupyter
    • Validating...
      appmode.server_extension OK

But still nothing. Any advice?

page not found

Dear Ole,
wonderful appmode, I saw it in myBinder.

Locally, in MacOS, clicking on the Appmode button I have the error:
1

My notebook infos are;
2

I'm running your example and as a plain notebook, it works.

Many thanks in advance, Pietro

Control dimensions

appmode is very nice piece of software!

I have a big Tab widget with height of 1000px. In appmode, only part of the widget is visible and is scrollable.
Would it be possible to make appmode expand to fit the widget or control the height of the appmode?

tmp copies deletion failed

When a notebook in appmode gets closed, the temporary copy will be deleted via DELTE request, however, I constantly saw errors on this regard

[E 21:58:52.525 NotebookApp] Uncaught exception DELETE /apps/.Welcome-5.ipynb (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='DELETE', uri='/apps/.Welcome-5.ipynb', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/.venv/xapp/lib/python3.7/site-packages/tornado/web.py", line 1697, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "
/.venv/xapp/lib/python3.7/site-packages/tornado/web.py", line 3174, in wrapper
return method(self, *args, **kwargs)
File "~/.venv/xapp/lib/python3.7/site-packages/appmode/server_extension.py", line 97, in delete
sm.delete_session(session_id=s['id'])
TypeError: '_asyncio.Future' object is not subscriptable

500 DELETE /apps/.Welcome-5.ipynb (::1) 5.01ms referer=http://localhost:8888/apps/Welcome.ipynb

Pass information from URL to AppMode Notebook

This isn't really an issue more an idea that @betatim and I were discussing. Right now we have a very cheap fork of appmode (https://github.com/chestrays/multiappmode) where we have added a handler for /muapps/useful_variable/notebook.ipynb which opens notebook in the root directory but sets os.envion['APPMODE_USER'] = useful_variable so whatever is running can take advantage of a piece of information in the URL. A concrete example is here: https://mybinder.org/v2/gh/chestrays/appmode/master?urlpath=%2Fmuapps%2Fmy_user_name%2Fexample_app.ipynb

Our idea would be to make this a bit more general and then upstream it into the main appmode. Rather than appending a path to the url, it might be more elegant to have a query string which gets parsed and put into environment variables (maybe with some prepended string to prevent overwriting something important). Does this seem like it might be useful?

Enable appmode at startup by default

How do I configure jupyter such that appmode is enable at startup?
I've installed the nb and server extensions (and appmode works), but by default a jupyter notebook will start in "regular" mode.
I'm sure there is an easy way to do it, but somehow it is escaping me so far...

Widget state not found, when page is reloaded

I get the following message sometimes, but consistently, when I reload the app page:

A Jupyter widget could not be displayed because the widget state could not be found. This could happen if the kernel storing the widget is no longer available, or if the widget state was not saved in the notebook. You may be able to create the widget by running the appropriate cells.

Centering output without generating scrollbars

I try to center the output of my cells (ipython widgets) with the following command:

display(HTML("""
<style>
.output {
    display: flex;
    align-items: center;
    text-align: center;
    overflow: hidden;
}
</style>
"""))

The output gets centered but now a unwanted horizontal scrollbar appears in appmode (does not appear in notebook mode).

Any idea what might be the reason for this? Does appmode use the same CSS settings as notebook mode?

Typing a number causes app mode to crash out

When running a Jupyter notebook (which happens to implement ipywidgets extensively, in case that matters), if I hit a number key on the keyboard while not over a text field, the appmode 'crashes out' in the sense that the source code suddenly appears and is rendered as markdown. It seems to be the last cell that gets re-rendered as markdown initially, but other cells can change as well.

Has been reproducible on two different jupyter notebooks on two different macs.

jupyter nbextension validating failed

Just tried to use appmode for jupyter notebook by following the readme.

Firstly I installed the appmode successfully for user:
pip install --user appmode
Secondly I tried to enable the extension
jupyter nbextension enable --py --user appmode
but it failed, showing like this
Enabling notebook extension appmode/main...
- Validating: problems found:
- require? X appmode/main
When I tried jupyter serverextension enable --py --user appmode, the validating was successful.

Thanks for looking at the problem.

Interest in server side options for trusted path, hiding buttons, etc.?

I'm currently working on adding some traitlets to appmode. My goal is to allow admins of jupyterhub instances the ability to configure features of appmode from the standard jupyter command line and config files (e.g., jupyter notebook --AppmodeManager.trusted_path='only/apps/here/can/launch/in/appmode').

Instead of sending a drive by PR that expands the project scope, I wanted to check to see if you have any interest. No worries if not--I can easily make do with my own fork.

PS - Thanks for creating appmode.

Non-linux packages missing in conda forge.

On new windows 10 machine, got this "Validating: problems found:" message:

(base) C:\Users\rsignell\Documents\GitHub\Tides_TriMesh_Datashader>jupyter nbextension enable --py --sys-prefix widgetsnbextension
Enabling notebook extension jupyter-js-widgets/extension...
      - Validating: ok

(base) C:\Users\rsignell\Documents\GitHub\Tides_TriMesh_Datashader>jupyter serverextension enable --py --sys-prefix appmode
Enabling: appmode.server_extension
- Writing config: C:\Users\rsignell\miniconda3\etc\jupyter
    - Validating...
      appmode.server_extension  ok

(base) C:\Users\rsignell\Documents\GitHub\Tides_TriMesh_Datashader>jupyter nbextension enable --py --sys-prefix appmode
Enabling notebook extension appmode/main...
      - Validating: problems found:
        - require?  X appmode/main

I don't see the appmode button on startup.

deploying customized appmode via pip

There are ways of automatically enabling/installing jupyter notebook/server extensions using pip.

I wonder: Is it possible to deploy a customized version of appmode this way?

In order to swap e.g. the logo of the loader, one can use the ~/.jupyter/custom/custom.js file with a content like this

$('#appmode-loader').replaceWith(`
<div id="appmode-loader">
<svg>
...
</svg>
</div>    
`);

but I don't think the custom.js file can be modified using the approach linked to above.
What would be the suggested approach to achieve this?

Can some markdown cells *not* be displayed?

I love appmode, but I would like to display only certain markdown cells (e.g. the heading and the markdown that describes my dashboard). I've been keeping two branches for this purpose (e.g. one with full markdown, one with reduced markdown), but I'm wondering whether there is a better way?

executing all cells leads to issues / configuration of run all

Hi,

I just discovered appmode and I am really glad it exists. With my current notebook I ran into the problem that appmode would not correctly display the UI. It would execute all cells after loading, step by step rendering all UI elements. But before it would finish the first elements would disappear again leaving only the last one.

I have no good explanation why that would be and I can also not share my notebook. In the notebook UI if I restart the kernel and run all cells it works just fine.

I also discovered that the init cell plugin still works within appmode and if I trigger run all from within the first cell via an nationalization cell things are just fine.

I would welcome it, if run all would indeed become an option to set in nbextension tab.

Use the JupyterLab output area

Rather than basing this on the classic notebook and hiding what we don't want, we could use the new JupyterLab output area component to make essentially a new notebook renderer, that has exactly just the things that we want (i.e., no code cells, etc.).

Basically, we could implement a very simple notebook renderer along the lines of the web3 example in the ipywidgets repo, which reads in a notebook, executes all cells, but only display the output of cells (or markdown cells) with a certain metadata tag. This lets you have a larger notebook with debugging stuff, stuff explaining the code, etc., but the 'app mode' is confined to specially-marked cells.

Kernel does not shut down after loosing internet connection

Recently I've noticed a behaviour that in my opinion should be corrected: if my laptop looses the internet connection and then I close the corresponding tab in the web browser - the kernel keeps running in the background.

To reproduce that behaviour one needs to do the following steps:

  1. run a notebook in the app-mode.
  2. disconnect the computer from the internet
  3. close the tab
  4. restore the internet connection
    ... After that the kernel keeps running "forever"

Similar thing happens if one often puts his computer into a "sleep" mode: once the python kernel gets detached from jupyter app - the only way to kill it is to go to the "taks" and shut it down manually.

I think there should be an automatic check that kills the kernel if it was not doing anything a certain amount of time. This will significantly reduce the use of computational resources.

Appmode.show_edit_button config in Jupyterhub

I have a jupyterhub instance and Appmode plugin is installed on it and it works fine. I want to change the config Appmode.show_edit_button but when I put that in jupyterhub_config.py it throws error
NameError: name 'Appmode' is not defined
How can I fix it, is there any other way to put the config?

Put appmode on conda forge?

If we had appmode as a conda package, I think folks could just do conda install appmod and wouldn't have to worry about the commands here: https://github.com/oschuett/appmode/blob/master/binder/postBuild
because you can handle those in the conda package.

@ocefpaf, please tell me if I'm off base here.

I failed to get appmod going with binder on my notebook appmode branch here:
https://github.com/reproducible-notebooks/ERDDAP_timeseries_explorer/tree/appmode
but if I could have just added - appmode to my environment.yml it would have been easy (I think).

My master branch works fine on binder:
https://github.com/reproducible-notebooks/ERDDAP_timeseries_explorer/tree/master

sys.stderr now shown in appmode, only notebook mode

It's a minor issue, but I'm not seeing the stderr output in appmode. It works fine in notebook mode. I'm using version 0.3.0 and firefox 58.

It seems that the HTML is generated, but the CSS is wrong (printing white letters on white background?) when in appmode. This happens both when just printing and when redirecting to a ipywidgets.Output

This will reproduce the problem:

import ipywidgets as ipw
import sys

class wid:
    def on_click(self,btn):
        print("normal print (stdout)")
        print("normal print (stderr)", file=sys.stderr)
        with self.txt1:
            print("redirected to txt1 (stdout)")
            print("redirected to txt1 (stderr)", file=sys.stderr)
    def widget(self):
        self.txt1 = ipw.Output()
        btn = ipw.Button(description='click me')
        btn.on_click(self.on_click)
        return ipw.VBox([btn, self.txt1])

wid().widget()

500 Internal Server Error in jupyter v1.0

The app renders a page saying "500 : Internal Server Error" in jupyter v1.0

It seems that template parameter get_frontend_exporters' is missing

Here's the error log

[E 07:11:23.089 NotebookApp] Uncaught exception GET /apps/Untitled.ipynb?appmode_scroll=0 (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/apps/Untitled.ipynb?appmode_scroll=0', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/site-packages/tornado/web.py", line 1697, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/site-packages/tornado/web.py", line 3174, in wrapper
        return method(self, *args, **kwargs)
      File "/site-packages/appmode/server_extension.py", line 86, in get
        self.write(self.render_template('appmode.html', **render_kwargs))
      File "/site-packages/notebook/base/handlers.py", line 519, in render_template
        return template.render(**ns)
      File "/site-packages/jinja2/asyncsupport.py", line 76, in render
        return original_render(self, *args, **kwargs)
      File "/site-packages/jinja2/environment.py", line 1008, in render
        return self.environment.handle_exception(exc_info, True)
      File "/site-packages/jinja2/environment.py", line 780, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "/site-packages/jinja2/_compat.py", line 37, in reraise
        raise value.with_traceback(tb)
      File "/site-packages/appmode/appmode.html", line 1, in top-level template code
        {% extends "notebook.html" %}
      File "/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "/site-packages/notebook/templates/page.html", line 154, in top-level template code
        {% block header %}
      File "/site-packages/notebook/templates/notebook.html", line 114, in block "header"
        {% for exporter in get_frontend_exporters() %}
    jinja2.exceptions.UndefinedError: 'get_frontend_exporters' is undefined

Display a code cell in appmode

Often it may be advantageous to "jump in" while viewing a notebook in app mode and do some debugging in a code cell. Do you maybe have a pointer to whether or not it would be feasible to exclude one or more code cells from being hidden when app mode launches?

`appmode` with pip installed extension

I'm trying to run notebooks in appmode but I hit the following error when I try to switch to app mode in the notebook user interface:

[I 03:30:31.695 NotebookApp] Kernel started: 59776d40-ee5f-4c1e-9467-20718c25b8f1
[I 03:30:32.771 NotebookApp] Adapting to protocol v5.1 for kernel 59776d40-ee5f-4c1e-9467-20718c25b8f1
[I 03:30:45.389 NotebookApp] Starting buffering for 59776d40-ee5f-4c1e-9467-20718c25b8f1:870d6b38c4d34de8ae9cfadd26fe146d
[I 03:30:45.897 NotebookApp] Kernel shutdown: 59776d40-ee5f-4c1e-9467-20718c25b8f1
[I 03:30:47.785 NotebookApp] Appmode get: bokeh.ipynb
[I 03:30:47.786 NotebookApp] Appmode creating tmp copy: /.bokeh-1.ipynb
[E 03:30:48.408 NotebookApp] Uncaught exception GET /apps/bokeh.ipynb?appmode_scroll=594 (73.159.130.83)
    HTTPServerRequest(protocol='http', host='epinux.com:8888', method='GET', uri='/apps/bokeh.ipynb?appmode_scroll=594', version='HTTP/1.1', remote_ip='73.159.130.83')
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1541, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 2949, in wrapper
        return method(self, *args, **kwargs)
      File "/usr/local/lib/python3.6/dist-packages/appmode/server_extension.py", line 46, in get
        mathjax_config=self.mathjax_config,
      File "/usr/local/lib/python3.6/dist-packages/notebook/base/handlers.py", line 424, in render_template
        return template.render(**ns)
      File "/usr/local/lib/python3.6/dist-packages/jinja2/asyncsupport.py", line 76, in render
        return original_render(self, *args, **kwargs)
      File "/usr/local/lib/python3.6/dist-packages/jinja2/environment.py", line 1008, in render
        return self.environment.handle_exception(exc_info, True)
      File "/usr/local/lib/python3.6/dist-packages/jinja2/environment.py", line 780, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "/usr/local/lib/python3.6/dist-packages/jinja2/_compat.py", line 37, in reraise
        raise value.with_traceback(tb)
      File "/usr/local/lib/python3.6/dist-packages/appmode/appmode.html", line 1, in top-level template code
        {% extends "notebook.html" %}
      File "/usr/local/lib/python3.6/dist-packages/notebook/templates/notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "/usr/local/lib/python3.6/dist-packages/notebook/templates/page.html", line 153, in top-level template code
        {% block header %}
      File "/usr/local/lib/python3.6/dist-packages/notebook/templates/notebook.html", line 117, in block "header"
        {% for exporter in get_custom_frontend_exporters() %}
    jinja2.exceptions.UndefinedError: 'get_custom_frontend_exporters' is undefined
[E 03:30:48.462 NotebookApp] {
      "Host": "epinux.com:8888",
      "Connection": "keep-alive",
      "Upgrade-Insecure-Requests": "1",
      "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
      "Referer": "http://epinux.com:8888/notebooks/bokeh.ipynb",
      "Accept-Encoding": "gzip, deflate",
      "Accept-Language": "en-US,en;q=0.9,it;q=0.8",
      "Cookie": "_ga=GA1.2.83393038.1521552015; _xsrf=2|e960f8e1|7ed49e6a98d1a1b482c3758a9494a6ce|1521757424; G_ENABLED_IDPS=google; username-epinux-com-8888=\"2|1:0|10:1522114195|24:username-epinux-com-8888|44:OTM0ZjJjZDNiMWY4NGVkYWFjMTc0MzJjNDRiMmRjMWU=|50a3de1b3bb279227518e327e3a506cfc62882cf860d0d0cc583b2b167d99ef2\""
    }
[E 03:30:48.462 NotebookApp] 500 GET /apps/bokeh.ipynb?appmode_scroll=594 (73.159.130.83) 677.95ms referer=http://epinux.com:8888/notebooks/bokeh.ipynb

Appmode temp files

Hello,

I'm running appmode 0.5.0 in jupyterhub, and I have some questions.

  • Is there a way to specify the temp directory for app mode. (where the temp notebooks and checkpoints are created)

    As expected, appmode fails if I don't have write permissions in the directory and checkpoint dir, where the notebook resides.
    Is there a way to execute read-only notebooks in a read-only directory.

  • How do you (/what) trigger the cleanup of the temporary notebooks created by appmode
    In my case, temp notebooks, and checkpoints aren't cleaned up.

    My usage pattern is, I directly access the appmode app via url and close the browser page, once I'm done.

Thanks for Appmode, its quite useful.

Appmode button doesn't show up in Jupyter notebook

I'm running into an apparently old issue that the appmode button is not showing in the Jupyter notebook. I was able to have the appmode button installed before and displaying correctly but at some point (not sure when) it disappeared.

I have tried this within a python venv (re-starting the Jupyter server after issuing those commands)

pip install appmode
jupyter nbextension     enable --py --sys-prefix appmode
jupyter serverextension enable --py --sys-prefix appmode

And also this:

pip install appmode
jupyter nbextension     enable --py --user appmode
jupyter serverextension enable --py --user appmode

I can see that the jupyter config files are been updated but the button still doesn't appear. Any ideas that can help?

Clearer instructions in automatically triggering appmode

I am having a problem in that I want a Jupyter notebook in a subdirectory of my repo to launch in appmode in Binder and I can NOT seem to find a way to do it. Placing "%2Fapp%2F" before the path to the Jupyter notebook in the urlpath doesn't seem to work. Can you clearly state how to automatically trigger app mode in a doc?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.