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

WGLMakie on remote Jupyterlab via Jupyterhub #2464

Open
marius311 opened this issue Dec 3, 2022 · 4 comments
Open

WGLMakie on remote Jupyterlab via Jupyterhub #2464

marius311 opened this issue Dec 3, 2022 · 4 comments
Labels
WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie.

Comments

@marius311
Copy link

WGLMakie runs great locally, but when trying it on a remote Jupyterlab launched via the cluster's Jupyterhub instance, I get this:

Screenshot from 2022-12-03 00-52-57

JuliaPlots/WGLMakie.jl#90 seems related but couldn't figure out what I'm supposed to do.

Is there a way to make this set up work?

julia 1.8.3 / WGLMakie v0.7.4 / Jupyterlab 3.4.7

@marius311 marius311 changed the title WGLMakie on remote Jupyterlab WGLMakie on remote Jupyterlab via Jupyterhub Dec 3, 2022
@SimonDanisch
Copy link
Member

You need something like this:

JSServe.configure_server!(listen_url="0.0.0.0", listen_port=9284, forwarded_port=80, external_url=ENV["JH_APP_URL"] * "proxy/9284")

from: #2358 (comment)

See:

help?> JSServe.configure_server!
  configure_server!(;
          listen_url::String=JSSERVE_CONFIGURATION.listen_url[],
          listen_port::Integer=JSSERVE_CONFIGURATION.listen_port[],
          forwarded_port::Integer=listen_port,
          external_url=nothing,
          content_delivery_url=nothing
      )

  Configures the parameters for the automatically started server.

  Parameters:

  * listen_url=JSSERVE_CONFIGURATION.listen_url[]
      The address the server listens to.
      must be 0.0.0.0, 127.0.0.1, ::, ::1, or localhost.
      If not set differently by an ENV variable, will default to 127.0.0.1

  * listen_port::Integer=JSSERVE_CONFIGURATION.listen_port[],
      The Port to which the default server listens to
      If not set differently by an ENV variable, will default to 9284

  * forwarded_port::Integer=listen_port,
      if port gets forwarded to some other port, set it here!

  * external_url=nothing
      The url from which the server is reachable.
      If served on "127.0.0.1", this will default to http://localhost:forwarded_port
      if listen_url is "0.0.0.0", this will default to http://$(Sockets.getipaddr()):forwarded_port
      so that the server is reachable inside the local network.
      If the server should be reachable from some external dns server,
      this needs to be set here.

  * content_delivery_url=nothing
      You can server files from another server.
      Make sure any file referenced from Julia is reachable at
      content_delivery_url * "/the_file"

This may improve quite a bit with #2428 and SimonDanisch/Bonito.jl#118

@SimonDanisch
Copy link
Member

@marius311
Copy link
Author

Many thanks for the info. However I think its possible you misread? Those instructions seem to be for JuliaHub, whereas here I'm talking about JupyterHub (or maybe the former uses the latter?)

In any case, I don't have a JH_APP_URL to try the above suggestion directly.

I can offer this, from a notebook in the remote Jupyterlab, here's the environment variables I have involving Jupyter or URL that seem relevant:

"JUPYTERHUB_ACTIVITY_URL" => "https://jupyter.nersc.gov/hub/api/users/marius/activity"
"JUPYTERHUB_API_URL" => "https://jupyter.nersc.gov/hub/api"
"JUPYTERHUB_BASE_URL" => "/"
"JUPYTERHUB_CLIENT_ID" => "jupyterhub-user-marius-perlmutter-shared-node-cpu"
"JUPYTERHUB_DEFAULT_URL" => "/lab/tree/global/homes/m/marius"
"JUPYTERHUB_OAUTH_CALLBACK_URL" => "/user/marius/perlmutter-shared-node-cpu/oauth_callback"
"JUPYTERHUB_SERVICE_PREFIX" => "/user/marius/perlmutter-shared-node-cpu/"
"JUPYTERHUB_SERVICE_URL" => "http://0.0.0.0:45149/user/marius/perlmutter-shared-node-cpu/"
"JUPYTERHUB_SINGLEUSER_APP" => "jupyter_server.serverapp.ServerApp"

Any of these potentially should be used? I tied substituting JH_APP_URL with the ones that might make sense and none work as is. Thanks for any advice.

@frankier
Copy link

You can use jupyter_server_proxy if only certain ports are allowed to your University's cluster instance #2405

Obviously it would be nice to streamline this at least a little bit, but for now we're holding out until the rehaul of JSServe makes its way into Makie.

@SimonDanisch SimonDanisch added the WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie. label Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie.
Projects
Status: No status
Development

No branches or pull requests

3 participants