-
Notifications
You must be signed in to change notification settings - Fork 29
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
Configure jupyter server extension #101
Comments
Hi Bane, If so have a look at my code here: ive been using this in the jupyterhub environment i work on successfully to set up localtileserver with the following code import os
import urllib
def init_hub():
'''
initialises environment variables needed to make localtileserver work on jupyter hub
'''
url = window_url()
os.environ["LOCALTILESERVER_CLIENT_PREFIX"] = f"{os.environ['JUPYTERHUB_SERVICE_PREFIX'].lstrip('/')}proxy/{{port}}"
up = urllib.parse.urlparse(url)
os.environ["LOCALTILESERVER_CLIENT_HOST"] = url[: -(len(up.path))].rstrip("/") + "/" I hope that helps |
That is one way to go about it if you can get it to work (I struggled to initially).
This is fantastic! Thank you for sharing! I will test this out when I have some time ( |
@artttt Could your solution work on AWS SageMaker? |
@banesullivan No worries. Let's explore this. |
@giswqs ive not tried AWS SageMaker so im not sure but as long as you can install the required package/s then it is worth a try. You may have to modify the parsing of the url to suit. Hopefully @banesullivan gets a chance to incorporate a generic solution into Note: i've updated the comment that i linked to above with an additional code sample. |
I just tried the method @artttt provided on SageMaker Studio, it does not work. Any other method for getting the URL prefix? Note that it is SageMaker Studio, not Studio Lab. They are different products. The method that works for Studio Lab does not work for SageMaker Studio import os
os.environ['LOCALTILESERVER_CLIENT_PREFIX'] = f"studiolab/default/jupyter/proxy/{{port}}" |
I'd like to see if we could use a jupyter-server extension to improve using
localtileserver
in remote jupyter environments to resolve issues like #95cc @12rambau
reference: https://jupyter-server.readthedocs.io/en/latest/developers/extensions.html#server-extensions
when I get some free time, I will look into this and hopefully implement a solution that will "just work"
The text was updated successfully, but these errors were encountered: