Automating Common Image Tasks#

The scyld-modimg --run command allows cluster administrators to collect command line arguments into a file and execute those commands as a very simple script. Any step listed in the “image mutations” section of scyld-modimg can be included in a run script using the full step name, minus the leading dashes, with any necessary arguments included on the same line.

Although the command and script does not allow for flow control statements including conditionals and loops, this functionality can be useful in automating repetitive steps in image creation. For example, the file below could be used to copy in a more complicated script, execute it, and copy the results out of the image into the local directory.

copyin test-script.sh /tmp
execute /tmp/test-script.sh
copyout /tmp/results.log .

Use the following command to run the script:

scyld-modimg -i SlurmImage --run @commands.modimg --discard

The command is a shorter equivalent of the following command:

scyld-modimg -i SlurmImage --copyin test-script.sh /tmp --exec /tmp/test-script.sh --copyout /tmp/results.log . --discard