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

DRAFT: build and use local copy of vizarr on mybinder #16

Closed
wants to merge 4 commits into from

Conversation

manics
Copy link
Contributor

@manics manics commented Aug 13, 2020

Currently example/imjoy_plugin.py relies on the externally hosted https://hms-dbmi.github.io/vizarr
I thought I'd have a go at getting the notebook to use build vizarr from the local source and to run it.

At the moment this is just a hack on top of #15
Let me know if you think it's worth investing time in attempting to do it properly.

@manics manics changed the title build and use local copy of vizarr on mybinder DRAFT: build and use local copy of vizarr on mybinder Aug 13, 2020
@oeway
Copy link
Contributor

oeway commented Aug 13, 2020

@manics Thanks for the work, I think it's a good idea to think use a local copy of the static files.

However, since mybinder itself relies on github, I wouldn't see relying on github pages as an issue. Are you thinking about supporting offline usage for local jupyter installation?

In both cases, I would suggest using serviceworker/PWA to cache and serve static files. We do this for other ImJoy plugins, e.g.: https://github.com/imjoy-team/kaibu/. It's easy to implement and support major browsers/OS.

Besides mybinder, since windows support is still an issue with jupyter-server-proxy, PWA is a better alternative way to support local jupyter installation including Windows.

Of course, that means the user need to load Viv from internet for the first time, but that shouldn't be an issue.

Independent of offline use, supporting PWA will also allow the viewer loads faster when using, e.g. Cache-First strategy.

@manics
Copy link
Contributor Author

manics commented Aug 14, 2020

My main motivation is to run development versions of vizarr on binder. For instance if you opened a vizarr PR you could demo the changes by giving a mybinder link to your branch. Otherwise you have to clone, build and run it locally.

Offline support, and for restricted networks which limit outgoing traffic, is an additional benefit though.

@oeway
Copy link
Contributor

oeway commented Aug 14, 2020

I see, for that we have been using Netlify, a few clicks setup and it will build sites for every PR, it can also post the preview url in the corresponding PR, example here: imjoy-team/kaibu#19 (comment)

In the ImJoy plugin in MyBinder, you can use the preview url instead of the GitHub pages version. Like that you don’t even need to include the build assets in the repo for your Binder demonstration.

@manzt
Copy link
Member

manzt commented Aug 14, 2020

Thanks for all the points made here. I'm definitely interested in both aspects of this PR: (1) offline caching via a service-worker, and (2) the ability to test builds of PRs.

Vizarr was originally under my account and I was deploying with netlify to do exactly what @oeway described. It worked really well for development, and I'll try to see if I can get permissions with the current org to do it again.

I'll look into making a service-worker for an offline mode. I've used a next.js plugin for this before next-pwa, but I might just write one myself to avoid adding another dependency.

@manics
Copy link
Contributor Author

manics commented Aug 18, 2020

Thanks both for your feedback. I'll close this for now.

@manics manics closed this Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants