Skip to content

Commit fc52b30

Browse files
committed
Merge branch 'pr141_update' into dev
2 parents be31234 + 581c9de commit fc52b30

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

batchspawner/batchspawner.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ def _req_keepvars_default(self):
159159
"Must include {cmd} which will be replaced with the jupyterhub-singleuser command line."
160160
).tag(config=True)
161161

162+
batchspawner_wrapper = Unicode('batchspawner-singleuser',
163+
help="A wrapper which is capable of special batchspawner setup: currently sets the port on "
164+
"the remote host. Not needed to be set under normal circumstances, unless path needs "
165+
"specification."
166+
).tag(config=True)
167+
162168
# Raw output of job submission command unless overridden
163169
job_id = Unicode()
164170

@@ -184,7 +190,8 @@ def parse_job_id(self, output):
184190
return output
185191

186192
def cmd_formatted_for_batch(self):
187-
return ' '.join(['batchspawner-singleuser'] + self.cmd + self.get_args())
193+
"""The command which is substituted inside of the batch script"""
194+
return ' '.join([self.batchspawner_wrapper] + self.cmd + self.get_args())
188195

189196
async def run_command(self, cmd, input=None, env=None):
190197
proc = await asyncio.create_subprocess_shell(cmd, env=env,
@@ -229,8 +236,11 @@ async def _get_batch_script(self, **subvars):
229236

230237
async def submit_batch_script(self):
231238
subvars = self.get_req_subvars()
239+
# `cmd` is submitted to the batch system
232240
cmd = ' '.join((format_template(self.exec_prefix, **subvars),
233241
format_template(self.batch_submit_cmd, **subvars)))
242+
# `subvars['cmd']` is what is run _inside_ the batch script,
243+
# put into the template.
234244
subvars['cmd'] = self.cmd_formatted_for_batch()
235245
if hasattr(self, 'user_options'):
236246
subvars.update(self.user_options)

0 commit comments

Comments
 (0)