Skip to content

Instantly share code, notes, and snippets.

@fonsp
Created December 31, 2020 08:56
Show Gist options
  • Save fonsp/a845d9b141a50f0ae51ca38b3301345a to your computer and use it in GitHub Desktop.
Save fonsp/a845d9b141a50f0ae51ca38b3301345a to your computer and use it in GitHub Desktop.

img

Max KöhlerDec 28th at 3:18 PM

I'm trying to use WGLMakie on a Pluto.jl server. Any news on this: MakieOrg/Makie.jl#489 ? The evaluation of the plotting cell never stops

59 replies


img

Simon Danisch3 days ago

Hm, that's likely because the port is already in use

img

Simon Danisch3 days ago

JSServe.JSSERVE_CONFIGURATION.listen_port[] = 8493 try something like that

img

Max Köhler3 days ago

sorry for the naive question but inside the pluto notebook one cell with your line of code?

img

Simon Danisch3 days ago

Yeah, must be run before displaying any plot to change the port of the server that serves the WGLMakie plots :wink:

img

Max Köhler3 days ago

Screenshot_20201228_154525.png

Screenshot_20201228_154525.png

img

Max Köhler3 days ago

not the desired output but at least progress! :smile:

img

Simon Danisch3 days ago

Ah yeah, if it's ssh I guess you'll need to forward that port :wink:

img

Max Köhler3 days ago

I'm not sure if its really ssh. I have a server with a static ip adress. On this server is jupyter hub installed which spawns a server for my users. In the jupyterlab environment they have a pluto.jl button which again spawns a pluto server by this: https://github.com/barche/pluto-on-binder/blob/logo/plutoserver/__init__.py#L7

img

Max Köhler3 days ago

sorry for the super niche question but I want to show students plots of finite element computations

img

Simon Danisch3 days ago

Ah, I think I know a fix

img

Simon Danisch3 days ago

image.png

image.png

img

Simon Danisch3 days ago

This works on the branch: SimonDanisch/Bonito.jl#82

img

Simon Danisch3 days ago

Maybe we can have one function to set this more easily?

img

Max Köhler3 days ago

wait a sec I'll give it a shot on my server

img

Max Köhler3 days ago

grafik.png

grafik.png

img

Max Köhler3 days ago

why is web like this :cry:

img

Max Köhler3 days ago

I have no idea about web but maybe this try wasn't that dumb: the server sits in the university network and only a few ports are accessible with a vpn connection, so I tried one where I'm sure that it's open, but same problem.

img

Simon Danisch3 days ago

Did you checkout that branch?

img

Max Köhler3 days ago

  [824d6782] JSServe v1.0.1 `https://github.com/SimonDanisch/JSServe.jl.git#sd/on_server`

img

Max Köhler3 days ago

before that external_url[] wasn't there to configure

img

Max Köhler3 days ago

so there should be an error if I'd use master

img

Simon Danisch3 days ago

Can you inspect the frame with the browser that shows no connection ?

img

Simon Danisch3 days ago

Btw, how is pluto setup?

img

Simon Danisch3 days ago

There doesn't seem to be a port in the URL you're using to browse to the Pluto site

img

Simon Danisch3 days ago

I'm guessing that may be the problem

img

Max Köhler3 days ago

Pluto is set up by this line: https://github.com/barche/pluto-on-binder/blob/logo/plutoserver/__init__.py#L7which gets magically the port of the jupyter server which is the default 80 such that it is invisible for the students

img

Max Köhler3 days ago

and this indeed coincides with the expected behavior of JSServe if I set the port to 80. With this I can reproduce the never ending cell evaluation

img

Max Köhler3 days ago

this is what I see in the inspector

Screenshot_20201228_201346.png

Screenshot_20201228_201346.png

img

Simon Danisch3 days ago

Ah that's the content of it, I want to see the url in the iframe

img

Max Köhler3 days ago

ah sorry!

img

Max Köhler3 days ago

grafik.png

grafik.png

img

Simon Danisch3 days ago

That looks good ;) I suppose, if you browse that same iframe url you get the same connection error?

img

Max Köhler3 days ago

yep

img

Simon Danisch3 days ago

Could it be that only port 80 is forwarded?

img

Simon Danisch3 days ago

and anything else will be blocked?

img

Max Köhler3 days ago

I thought that at least 3389 should be forwarded by default, but maybe that was last time just by chance, let me check if I can get a list of forwarded ports

img

Simon Danisch3 days ago

ah, but then you need to set the JSServe port to 3389 :wink:

img

Max Köhler3 days ago

ye, tried that already, but maybe 3389 was only by chance last time

img

Max Köhler3 days ago

anyhow: do I need for every user an own port?

img

Simon Danisch3 days ago

no

img

Max Köhler3 days ago

ok so just one for all users?

img

Simon Danisch3 days ago

oh wait... how does that even work with multiple users :smile:

img

Max Köhler3 days ago

Pluto or jupyter?

img

Simon Danisch3 days ago

Pfew, so Pluto is running on the server and starts julia processes on the server - which then start a JSServe Server ... So I guess every user does need to have it's own port -.- (edited)

img

Simon Danisch3 days ago

I guess to make this use case real nice, we do need a proper Pluto integration after all...

img

Simon Danisch3 days ago

Which uses the file server & websocket connection from the pluto server

img

Simon Danisch3 days ago

image.png

image.png

img

Max Köhler3 days ago

theres no emoji to react which laughs and cries at the same time

img

Simon Danisch3 days ago

I wonder if we could quickly hack a "server mode" where all users connect to a single instance of JSServe to get the graphics... So on the server you'd do:

using JSServe
JSServer.start_server()
using Pluto
Pluto.run()

And then all users would just use that one JSServe Server

img

Simon Danisch3 days ago

So on the client side it would be something like:

using JSServe
JSServe.use_existing_server(url)

Or so :smile:

img

Simon Danisch3 days ago

I'll think about it tomorrow

img

Max Köhler3 days ago

I also contacted my colleague, who is the sys admin of our chair and has a solid background in web dev

img

Simon Danisch3 days ago

Sweet! I hope we can make this work :wink:

img

Simon Danisch3 days ago

There is definitely some way to make this work :smile: The question is, how can we make it work with the limited time constraints^^

img

Max Köhler3 days ago

could be that I just fucked up something. I'd love to say: hey nice case to contribute FOSS but I'm simply to dumb :smile:

img

Max Köhler3 days ago

but the JSServe idea already before Pluto doesn't sound bad, for this I just have to reinstall the jupyter "plugin" which is the pluto button. I'm not certain how long the messages will be saved here since I'm only using slack for makie questions. Do you think we can continue to chat here the next days or will it disappear to fast? (edited)

img

Simon Danisch3 days ago

I think julia actually got upgraded recently :open_mouth:So they may not disappear anymore

img

Simon Danisch3 days ago

There isn't much in this thread anyways...So just DM me or open an issue :wink:

img

Max Köhler3 days ago

ok cool, then probably DM :100:

Join Channel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment