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

Support for Amazon SageMaker Studio Lab #128

Closed
giswqs opened this issue Nov 16, 2022 · 14 comments
Closed

Support for Amazon SageMaker Studio Lab #128

giswqs opened this issue Nov 16, 2022 · 14 comments

Comments

@giswqs
Copy link
Contributor

giswqs commented Nov 16, 2022

Amazon SageMaker Studio is a free cloud computing platform, similar to Binder but users can install packages and save files permanently. It seems localtileserver is not working on SageMaker, even after running the following code. Any advice?

import os
os.environ["LOCALTILESERVER_CLIENT_PREFIX"] = "proxy/{port}"

image

image

image

image

@banesullivan
Copy link
Owner

I haven't used sage maker yet but it seems to be gaining a lot of traction... I'll see what I can do to get this to work.

@banesullivan
Copy link
Owner

banesullivan commented Jan 30, 2023

I have no idea where to begin with this... I signed up for a handful of different "SageMaker" things and could not figure out how to launch a notebook environment anywhere... this whole thing has left me quite confused.

Anywho, I think "SageMaker Studio Lab" is the platform? right? If so, I'm waitlisted:

Screen Shot 2023-01-29 at 8 04 03 PM

@giswqs
Copy link
Contributor Author

giswqs commented Jan 30, 2023

@banesullivan Yes, SageMaker Studio Lab is the free version, something similar to Google Colab. It might take a few hours /days to get the account approved. Other SageMaker products are not free.

@banesullivan
Copy link
Owner

banesullivan commented Feb 6, 2023

I finally have an account, but I'm having trouble getting ipywidgets to work at all... tried restarting JupyterLab from the sagemaker menu but no luck...

Error displaying widget: model not found

@banesullivan
Copy link
Owner

However, from the looks of it. SageMaker truly is just JupyterLab (unlike Google Colab) so setting up Jupyter-server-proxy to get this working should be all the same

@giswqs
Copy link
Contributor Author

giswqs commented Feb 6, 2023

Yes, ipyleaflet might not work with SageMaker Studio. Try folium

@banesullivan
Copy link
Owner

It should work... the JupyterLab just needs to be relaunched/rebuilt after ipywidgets are installed... just not sure how to trigger that with SageMaker.

Will try folium in the meantime

@banesullivan
Copy link
Owner

banesullivan commented Feb 6, 2023

Indeed, same set up with Jupyter-server-proxy, just need the right prefix. This works as:

import os
os.environ['LOCALTILESERVER_CLIENT_PREFIX'] = f"studiolab/default/jupyter/proxy/{{port}}"

Screen Shot 2023-02-06 at 2 18 33 PM


On MyBinder, this prefix is easy to get with the JUPYTERHUB_SERVICE_PREFIX environment variable. Unfortunately, I do not see anything like this in the environment on sagemaker.... though studiolab/default/jupyter/ seems standard enough that this is probably the prefix in any environment -- @giswqs, you might know better than I

@banesullivan
Copy link
Owner

Really IMO, we should raise issues like this upstream in jupyter-server-proxy and see if they can make this easier to do in Colab, SageMaker, MyBinder, etc.

@banesullivan
Copy link
Owner

I'll add it to my to do list to open an issue upstream outlining the need clearly

@giswqs
Copy link
Contributor Author

giswqs commented Feb 6, 2023

That's fantastic! How did you figure out the prefix?

@banesullivan
Copy link
Owner

Just looking at the URL in the browser 😉

@giswqs
Copy link
Contributor Author

giswqs commented Feb 7, 2023

Is it possible to get the browser URL programmatically and extract the prefix from the URL?

@banesullivan
Copy link
Owner

banesullivan commented Feb 7, 2023

I think @artttt was able to do this. See #101 (comment)

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

No branches or pull requests

2 participants