Skip to content

Commit 16ef44b

Browse files
committed
Singularity/docker: change argument order in run stage
- Related: #4 - Closes: #4 - Put the image image argument first in the kernel argv, so that there is less chance of mixing up the options and arguments. During the docker/singularity exec phase, the image should still be at the very end (where I *think* it is normally expected). - This is not yet tested for real functionality, but the tests pass. I will delay merging until I do more testing.
1 parent f114617 commit 16ef44b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

envkernel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ def setup(self):
388388
'docker',
389389
'run',
390390
'--connection-file', '{connection_file}',
391-
*unknown_args,
392391
args.image,
392+
*unknown_args,
393393
'--',
394394
*kernel['argv'],
395395
]
@@ -523,8 +523,8 @@ def setup(self):
523523
'singularity', 'run',
524524
'--connection-file', '{connection_file}',
525525
#*[ '--mount={}'.format(x) for x in args.mount],
526-
*unknown_args,
527526
args.image,
527+
*unknown_args,
528528
'--',
529529
*kernel['argv'],
530530
]

test_envkernel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,14 @@ def test_docker(d):
262262
kern = install(d, "docker --some-arg=AAA IMAGE1")
263263
#assert kern['argv'][0] == 'envkernel' # defined above
264264
assert kern['ek'][1:3] == ['docker', 'run']
265-
assert kern['ek'][-1] == 'IMAGE1'
265+
assert kern['ek'][-2] == 'IMAGE1'
266266
assert '--some-arg=AAA' in kern['ek']
267267

268268
def test_singularity(d):
269269
kern = install(d, "singularity --some-arg=AAA /PATH/TO/IMAGE2")
270270
#assert kern['argv'][0] == 'envkernel' # defined above
271271
assert kern['ek'][1:3] == ['singularity', 'run']
272-
assert kern['ek'][-1] == '/PATH/TO/IMAGE2'
272+
assert kern['ek'][-2] == '/PATH/TO/IMAGE2'
273273
assert '--some-arg=AAA' in kern['ek']
274274

275275

0 commit comments

Comments
 (0)