batchspawner icon indicating copy to clipboard operation
batchspawner copied to clipboard

Select random port from a range (new implementation)

Open rkdarst opened this issue 7 years ago • 12 comments

This implements the random_port selection from #102 in the method suggested by @mbmilligan in that issues.

Unfortunately I had to use testing machinery from #99, which is not pulled yet. So I am basing this on my dev branch, which has a lot of extra junk. The file diffs will not work, but just look at the last commit to see what changed.

  • Closes: #102.

rkdarst avatar Aug 07 '18 22:08 rkdarst

This fails on JH 0.7.2.

rkdarst avatar Aug 08 '18 07:08 rkdarst

Hi, any news on this merge request and/or the new batchspawner release? I'm currently working on a Jupyterhub instance which needs open ports to the worker nodes. If any help is needed I can assist if it's possible...

belfhi avatar Nov 06 '18 09:11 belfhi

I still need to work on an integration branch. But really we should skip that step and work directly on this master, but I am not maintainer so I can't really do much useful...

Maybe I should just use my repo as current master?

rkdarst avatar Nov 06 '18 11:11 rkdarst

With the introduction of "select port on remote side", #58 and #141, this no longer works as easily, because the port is chosen remotely where there is no guarantee of any type of config files. Remote port selection also isn't easily configurable. All of these can be fixed, but we need other stuff to be reviewed in order to have a base to develop against.

I see two options, which could be done together:

  • Add a option to select on hub side, which has options "random_port", "remote side", or "port range"
  • Be able to serialize the options, e.g. "--range=40000-50000" Pass the option to the remote side, where it is used.
  • (add configuration to remote sides: I don't like this idea)

How important is this to you still? (cc @pontiggi)

Once someone accepts upcoming patches I'll be taking a look at this again.

rkdarst avatar Jun 18 '19 08:06 rkdarst

I imagine being able to configure a range will be important in fairly short order (HPC admins tend to like restrictive firewall rules), but I'm unclear on the level of expressiveness that would be desirable. My initial inclination is for the wrapper script to look for the range in an environment variable that can then be optionally set in the batch script. Merits further discussion though.

mbmilligan avatar Jun 18 '19 20:06 mbmilligan

@rkdarst For me this is a very important feature, it makes requests to the firewall people much easier to be able to give them a range (Jupyterhub and Batch nodes are not in the same subnet). I still like the hub side option best, with a spawner option to specify the port range.

belfhi avatar Jun 21 '19 10:06 belfhi

Just to let you know that we would be happy (and the IT admins as well) if a port range can be specified.

mdehollander avatar Aug 27 '19 13:08 mdehollander

@rkdarst Is there any updates to this? I found no possibility at all to select port ranges for the SingleUserNotebookApp s.t. the Jupyterhub can still connect to it.

Hoeze avatar Mar 14 '21 23:03 Hoeze