Skip to content

Instantly share code, notes, and snippets.

@mastbaum
Created November 1, 2015 18:26
Show Gist options
  • Save mastbaum/2538bdea1ffe242beeac to your computer and use it in GitHub Desktop.
Save mastbaum/2538bdea1ffe242beeac to your computer and use it in GitHub Desktop.
Docker SLURM node Resume and Suspend scripts
#!/bin/bash
echo "`date` Resume invoked $0 $*" >> /var/log/slurm-llnl/power_save.log
hosts=`scontrol show hostnames $1`
for host in $hosts
do
docker run --rm \
--name $host \
-h $host \
-v /home:/home \
-v /etc/slurm-llnl/slurm.conf:/etc/slurm-llnl/slurm.conf \
-v /etc/munge/munge.key:/etc/munge/munge.key \
slurm-ubuntu
done
#!/bin/bash
echo "`date` Suspend invoked $0 $*" >> /var/log/slurm-llnl/power_save.log
hosts=`scontrol show hostnames $1`
for host in $hosts
do
docker stop $host
docker rm $host
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment