-
Notifications
You must be signed in to change notification settings - Fork 64
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
pkg asset loading in Jupyter assumes a single global Julia package install #124
Comments
Yes, we should definitely find an alternative solution to this problem.
Perhaps, but the problem will be SystemJS loads dependencies by making HTTP requests to the dependency files. This won't work well with the comms protocol. This is the reason I decided to do the Another awkward problem is that we can't have the server inside WebIO (for Blink, Mux and Atom) since we don't want WebIO to depend on Mux. This is why I put it in Mux.defaults itself. To add another angle to this problem, @ranjanan has been trying to deploy a statically compiled app written with WebIO and running into this issue. The best idea for a solution I have for now is:
If packages use To make this work with Jupyter we need to have the "register" function work even without Mux (maybe by updating a json file which stores the registry), the python server should be able to read this file and dynamically route requests to the right file/folders. What do you think? Are there any obvious problems? |
I guess we circled back to the original issue with this. Where does the .json file get written to given there is no global Julia package directory? How will the jupyter plugin pick it up? |
I see. That makes sense. I wonder if we could coerce SystemJS to load from a string instead? Kind of like systemjs/systemjs#1431 I think your registry idea can also be made to work, but as you say, with a global jupyter install all of the kernels will have to use the same registry somehow. I'll try to think about making that work, though. Another idea: just use full paths to asset files, so
That's similar to what we have now, but would allow arbitrarily many package directories to live in harmony, and you'd never get assets for the wrong package directory. One potential issue is that it wouldn't be obvious for users how to remove asset folders from the whitelist, but we kind of have that problem already. |
@ranjanan and I wrote some code today to do this. JuliaWeb/Mux.jl#55 I think we just need to get the Jupyter server to work for this to happen now.
This seems workable (although I think |
Cool! So is the idea that each asset is registered with the hash of its absolute path? That seems very reasonable. |
That's right. You can register either files or directories. |
Do you have any thoughts about how this can work with Jupyter? It looks like the registry lives in memory in the AssetRegistry module, so multiple Julia kernels will each have different registries, and none of those registries will be available to the Jupyter server. Or am I missing something? |
Ah, I see you mentioned that earlier. It seems like |
Update about this issue: there are branches ready on Mux and WebIO to fix this, with the right deprecation when older Two TODO items:
|
Hi, I'm sorry to butt in. I think this is a cool idea and I'd love to see something like this catch on! I am surely missing some context, but would you be able to clarify some of this for me? I'm curious about it, but I am not understanding some details. Why is it preferable to send the client these hashed URLs rather than simply sending the client the absolute path to the assets the kernel wants to load? That is, what is the benefit of storing these hashed urls and sending the hashed url to the client over simply using the original absolute path? Thanks! :) |
This is closed in the new release.
Great question. Well it's because the client (browser) cannot usually load any local JS/CSS file, unless you're on a page that's a |
Ah yeah that makes sense. Thanks shashi! :) |
This started out as #100 but it's a more general issue, and it's continued to be a problem in other cases. Fundamentally, by creating a single server plugin that tries to load
/pkg/
assets by looking them up in the Julia package directory and load path, we are assuming that there's a single, global, julia package directory. This fails in JuliaBox, for example, but it also fails any time a user defines a differentJULIA_PKGDIR
or modifies theirLOAD_PATH
after buliding WebIO. This results in a lot of confusing issues where Julia packages can be loaded but their assets cannot.I'm starting to wonder whether a global jupyter plugin is the right solution, since the only place where the information about what package should be loaded is available is inside the kernel itself, not the jupyter server.
Is there an alternative? Could we perhaps send the JS files over the Jupyter comms protocol instead?
The text was updated successfully, but these errors were encountered: