-
Notifications
You must be signed in to change notification settings - Fork 134
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
Select random port from a range (new implementation) #114
base: main
Are you sure you want to change the base?
Conversation
This fails on JH 0.7.2. |
- Allows selection of random ports within a certain range only as a first use case. - Closes: jupyterhub#102 via a different strategy. - Currently uses the traitlet Any, but should be Callable - but this is not in upstream traitlets, it is special to kubespawner. So leave Any for now and change later.
Hi, |
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? |
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:
How important is this to you still? (cc @pontiggi) Once someone accepts upcoming patches I'll be taking a look at this again. |
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. |
@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). |
Just to let you know that we would be happy (and the IT admins as well) if a port range can be specified. |
@rkdarst Is there any updates to this? |
Hi, any update on this? this is key feature missing in JH. |
I agree with @pelacables that this should be part of the main batch spawner release! |
I wrote a small patch , everything in singleuser.py. I ran some tests and seem to work, but I'll leave it running for some days. In any case, if you want to test it :
and you have to define the OS env var JUPYTERHUB_LOW_PORT / JUPYTERHUB_HIGH_PORT (otherwise it will use 28000 and 28100 as default) and also add those vars to c.Spawner.env_keep in /etc/jupyterhub/jupyterhub_config.py . batchspawner 1.2.0 |
is there a way to use this script in the edit: I now undestand why this needs to be set in |
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.