Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Could not deploy successfully with static/css/js assets along with ipynb. #47

Closed
UTH opened this issue Jul 26, 2016 · 5 comments
Closed

Comments

@UTH
Copy link

UTH commented Jul 26, 2016

Hi, I was trying the dashboard test-drive in my local Ubuntu,
and found that if deploy as "Local Dashboard" and "Dashboard on Jupyter Dashboard Server",
it did not work
and when I download the notebook as
Jupyter Dashboard Server bundle (.zip)
it download *.ipynb file only
However, the downloading for PHP Dashboard bundle (.zip) works well with .zip downloaded
and with static/css/js file in it.

Any help is appreciated, :)

@jhpedemonte
Copy link
Collaborator

How did you install the dashboard bundler extension?

cc @nitind

@parente
Copy link
Member

parente commented Aug 2, 2016

@UTH, the .ipynb is all you'll get with the "Jupyter Dashboard Server bundle .zip" unless you're using static frontend assets in your notebook like declarative widgets. You can drop a .ipynb into the dashboard server and it'll work assuming it has no external frontend dependencies. (If it does, see: https://github.com/jupyter-incubator/contentmanagement/blob/master/etc/notebooks/associations_demo/associations_demo.ipynb on how to get them bundled into the zip).

For Deploy as -> Dashboard on Jupyter Dashboard Server, you need to have a jupyter dashboard server running and you need to configure the environment variable in the README.md here to tell the extension where it resides. The https://github.com/jupyter-incubator/dashboards_setup repository has a bunch of recipes for setting a notebook server + dashboard server in tandem so that this option will work.

As for "Local Dashboard", that option is deprecated and will very likely not work anymore with modern versions of ipywidgets. The same goes for the PHP option. The deprecations are documented in the README.

@UTH
Copy link
Author

UTH commented Aug 4, 2016

Thanks @parente
am looking for some solutions for which the dashboard could be published alone with its css/js files related automatically instead of declaim the static file each time, so the user could focus on his/her algorithm code only, at least not looking for the js files in hard way.
For now, our team use it by sharing http://*.ipynb?dashboard directly to release the data products as a solution.
Don't know if it would be a feature in dashboard. :-)

@parente
Copy link
Member

parente commented Aug 4, 2016

am looking for some solutions for which the dashboard could be published alone with its css/js files related automatically instead of declaim the static file each time

If you have a specific set of CSS/JS files that you want packaged with every notebook for deployment to the dashboard server, you could:

  1. Put the CSS/JS on a static web server somewhere (e.g., a CDN) and just reference them from the notebook-dashboard
  2. Have all your users start from the same notebook template with the associations pre-declared
  3. Write your own bundler that always includes the JS/CSS you want instead of using the reference implementations here

If you take approach (3), the doc on writing your own bundler is here today: https://github.com/jupyter-incubator/contentmanagement#write-bundlers

There is an open PR to make the bundler API a part of notebook proper, but it's waiting for review for notebook 5.0 at the moment: jupyter/notebook#1579

@UTH
Copy link
Author

UTH commented Aug 4, 2016

Thanks very much @parente
I will go test your solutions out.
PS. For the CDN solution I considered before, but find the most hard thing is package the CSS/JS files which are depended on the chart lib users using in their code. They range in various.

@UTH UTH closed this as completed Aug 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants