GithubHelp home page GithubHelp logo

Comments (7)

giswqs avatar giswqs commented on July 28, 2024 1

@artttt Could your solution work on AWS SageMaker?

from localtileserver.

artttt avatar artttt commented on July 28, 2024

Hi Bane,
Am i right to assume that the idea here is to grab the url from a users browser window and parse it to set up licaltileserver?

If so have a look at my code here:
davidbrochart/ipyurl#2 (comment)

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

from localtileserver.

banesullivan avatar banesullivan commented on July 28, 2024

Am i right to assume that the idea here is to grab the url from a users browser window and parse it to set up licaltileserver?

That is one way to go about it if you can get it to work (I struggled to initially).

ive been using this in the jupyterhub environment i work on successfully to set up localtileserver with the following code

This is fantastic! Thank you for sharing! I will test this out when I have some time (localtileserver is hobby project so it can be tough for me to make proper time to address things 😄 )

from localtileserver.

banesullivan avatar banesullivan commented on July 28, 2024

Sorry for my delay looking into SageMaker, @giswqs 😄 ... tough to find time for this hobby project at the moment

(ref #128)

from localtileserver.

giswqs avatar giswqs commented on July 28, 2024

@banesullivan No worries. Let's explore this.

from localtileserver.

artttt avatar artttt commented on July 28, 2024

@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 localtileserver.

Note: i've updated the comment that i linked to above with an additional code sample.
davidbrochart/ipyurl#2 (comment)

from localtileserver.

giswqs avatar giswqs commented on July 28, 2024

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}}"

davidbrochart/ipyurl#2 (comment)
image

image

from localtileserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.