Giter Site home page Giter Site logo

Comments (4)

rkdarst avatar rkdarst commented on June 10, 2024

Hi,

This seems like a good idea overall. I'll leave some comments in the diff, but note that I'm not actually a batchspawner developer but have done a lot of work in it. (There isn't any current way to do this, unless OS can control the default bind ports and thus affect the behavior of jupyterhub.utils.random_port).

My first thought was "this would be good to add to jupyterhub", but randomly checking two spawners show there isn't necessarily a lot of overlap. Plus it would require many jupyterhub releases before it could be relied on here anyway. Plus there's no default way for random_port to get info from the spawner options...

Have you seen #58? It is somewhat related in that it is about more clever port selection, but not limiting that selection. If we ever made progress on that, we should put these two together.

I'll highlight @minrk since it possibly relates to jupyterhub itself. (btw, abstractly I still want to integrate #58 with JH but it's been slow going)

from batchspawner.

mbmilligan avatar mbmilligan commented on June 10, 2024

I think the most general way to handle this would be for us to pull out the call to jupyterhub.utils.random_port() into a trait or class method that could be overridden during the configuration process. Off the top of my head, I'm thinking we could use a trait that accepts a callable (specified to return a port number), and we could have pre-made callables for common scenarios like "a range of ports" or, once #58 goes through, "use the port selection API."

from batchspawner.

rkdarst avatar rkdarst commented on June 10, 2024

I think @mbmilligan's solution is quite clearly the right one for now...

from batchspawner.

rkdarst avatar rkdarst commented on June 10, 2024

In #114 I implemented @mbmilligan's suggestion.

from batchspawner.

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.