Skip to content

Commit

Permalink
batchspawner/CondorSpawner: Make use of connect_to_job rport feature.
Browse files Browse the repository at this point in the history
This uses the functionality to use a random local port on the hub
to forward the notebook port to. It ensures no port collisions
appear between different, forwarded notebooks.
  • Loading branch information
olifre committed Mar 9, 2021
1 parent cf13419 commit 3a6e57e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion batchspawner/batchspawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ class CondorSpawner(UserEnvMixin,BatchSpawnerRegexStates):
# outputs job data XML string
batch_query_cmd = Unicode('condor_q {job_id} -format "%s, " JobStatus -format "%s" RemoteHost -format "\n" True').tag(config=True)
batch_cancel_cmd = Unicode('condor_rm {job_id}').tag(config=True)
connect_to_job_cmd = Unicode("condor_ssh_to_job -ssh \"ssh -L {port}:localhost:{port} -oExitOnForwardFailure=yes\" {job_id}").tag(config=True)
connect_to_job_cmd = Unicode("condor_ssh_to_job -ssh \"ssh -L {port}:localhost:{rport} -oExitOnForwardFailure=yes\" {job_id}").tag(config=True)
# job status: 1 = pending, 2 = running
state_pending_re = Unicode(r'^1,').tag(config=True)
state_running_re = Unicode(r'^2,').tag(config=True)
Expand Down

0 comments on commit 3a6e57e

Please sign in to comment.