-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to use double quotes for
Code
and Computer
CLI argumen…
…ts (#5478) So far, the command line arguments of the code exeuction line in the submit script written by the `Scheduler` plugin, would be wrapped by single quotes to prevent special characters, such as spaces, from being interpreted incorrectly. However, for certain use cases, the quoting has an undesirable effect. For example, if an argument contains a bash variable, indicated by a `$` sign, the single quotes will prevent it from being dereferenced correctly. A concrete use-case is the requested feature of being able to define a Docker container as a `Code`, which needs certain arguments to be quoted in double quotes. This PR adds a new property `use_double_quotes` to the `Code` and `Computer` classes that determines whether arguments should be quoted using single or double quotes. The settings are communicated through the `cmdline_params` attribute of a `JobTemplateCodeInfo` instance to the scheduler plugin. The plugin is then responsible for respecting these booleans. To be able to distinguish between the command line arguments of the computer and the code, they are passed separately in `prepend_cmdline_params` and `cmdline_params`, respectively. Co-authored-by: Sebastiaan Huber <mail@sphuber.net>
- Loading branch information
Showing
19 changed files
with
204 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
tests/engine/processes/calcjobs/test_calc_job/test_code_double_quotes_False_.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
exec > _scheduler-stdout.txt | ||
exec 2> _scheduler-stderr.txt | ||
|
||
|
||
'mpirun' '-np' '1' '/bin/bash' '--version' '-c' < 'aiida.in' > 'aiida.out' 2> 'aiida.err' |
6 changes: 6 additions & 0 deletions
6
tests/engine/processes/calcjobs/test_calc_job/test_code_double_quotes_True_.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
exec > _scheduler-stdout.txt | ||
exec 2> _scheduler-stderr.txt | ||
|
||
|
||
'mpirun' '-np' '1' "/bin/bash" "--version" "-c" < 'aiida.in' > 'aiida.out' 2> 'aiida.err' |
6 changes: 6 additions & 0 deletions
6
tests/engine/processes/calcjobs/test_calc_job/test_computer_double_quotes_False_.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
exec > _scheduler-stdout.txt | ||
exec 2> _scheduler-stderr.txt | ||
|
||
|
||
'mpirun' '-np' '1' '/bin/bash' '--version' '-c' < 'aiida.in' > 'aiida.out' 2> 'aiida.err' |
6 changes: 6 additions & 0 deletions
6
tests/engine/processes/calcjobs/test_calc_job/test_computer_double_quotes_True_.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
exec > _scheduler-stdout.txt | ||
exec 2> _scheduler-stderr.txt | ||
|
||
|
||
"mpirun" "-np" "1" '/bin/bash' '--version' '-c' < "aiida.in" > "aiida.out" 2> "aiida.err" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters