@@ -159,6 +159,12 @@ def _req_keepvars_default(self):
159
159
"Must include {cmd} which will be replaced with the jupyterhub-singleuser command line."
160
160
).tag (config = True )
161
161
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
+
162
168
# Raw output of job submission command unless overridden
163
169
job_id = Unicode ()
164
170
@@ -184,7 +190,8 @@ def parse_job_id(self, output):
184
190
return output
185
191
186
192
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 ())
188
195
189
196
async def run_command (self , cmd , input = None , env = None ):
190
197
proc = await asyncio .create_subprocess_shell (cmd , env = env ,
@@ -229,8 +236,11 @@ async def _get_batch_script(self, **subvars):
229
236
230
237
async def submit_batch_script (self ):
231
238
subvars = self .get_req_subvars ()
239
+ # `cmd` is submitted to the batch system
232
240
cmd = ' ' .join ((format_template (self .exec_prefix , ** subvars ),
233
241
format_template (self .batch_submit_cmd , ** subvars )))
242
+ # `subvars['cmd']` is what is run _inside_ the batch script,
243
+ # put into the template.
234
244
subvars ['cmd' ] = self .cmd_formatted_for_batch ()
235
245
if hasattr (self , 'user_options' ):
236
246
subvars .update (self .user_options )
0 commit comments