Last active
May 23, 2019 11:50
-
-
Save tdudgeon/1536fff79aa16a4112034f2172fd199f to your computer and use it in GitHub Desktop.
Slurm setup scripts
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
#!/bin/bash | |
# head-setup.sh | |
# | |
# Copies the configuration files and enables, but does not start the services. | |
# Use the services-start/stop.sh scripts to start and stop the munge and slurmd services. | |
set -e | |
echo "Copying munge key" | |
cp ~/slurm/munge.key /tmp/ | |
sudo chown munge: /tmp/munge.key | |
sudo mv /tmp/munge.key /etc/munge | |
echo "Enabling munge service" | |
sudo systemctl enable munge.service | |
echo "Copying SLURM config" | |
if [ ! -d /etc/slurm ]; then | |
sudo mkdir /etc/slurm | |
fi | |
sudo chown slurm: /etc/slurm | |
cp ~/slurm/slurm.conf /tmp/ | |
sudo chown slurm: /tmp/slurm.conf | |
sudo mv /tmp/slurm.conf /etc/slurm/ | |
cp ~/slurm/cgroup.conf /tmp/ | |
sudo chown slurm: /tmp/cgroup.conf | |
sudo mv /tmp/cgroup.conf /etc/slurm/ | |
cp ~/slurm/cgroup_allowed_devices_file.conf /tmp/ | |
sudo chown slurm: /tmp/cgroup_allowed_devices_file.conf | |
sudo mv /tmp/cgroup_allowed_devices_file.conf /etc/slurm/ | |
echo "Enabling SLURM service" | |
sudo systemctl enable slurmctld.service | |
echo "Done" |
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
#!/bin/bash | |
# head-start.sh | |
# | |
# Start the munge and slurmctld services | |
set -e | |
echo "Starting munge" | |
sudo systemctl start munge.service | |
echo "Starting SLURM" | |
sudo systemctl start slurmctld.service | |
echo "Done" |
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
#!/bin/bash | |
# head-stop.sh | |
# | |
# Stop the munge and slurmctld services | |
set -e | |
echo "Stoppinging munge" | |
sudo systemctl stop munge.service | |
echo "Stopping SLURM" | |
sudo systemctl stop slurmctld.service | |
echo "Done" |
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
#!/bin/bash | |
# | |
# basic install for pulsar allowing slurm-drmaa support | |
mkdir /root/pulsar | |
cd /root/pulsar/ | |
virtualenv venv | |
. venv/bin/activate | |
pip install --upgrade pip | |
pip install drmaa pulsar-app |
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
#!/bin/bash | |
# services-setup.sh | |
# | |
# Copies the configuration files and enables, but does not start the services. | |
# Use the services-start/stop.sh scripts to start and stop the munge and slurmd services. | |
set -e | |
echo "Copying munge key" | |
cp ~/slurm/munge.key /tmp/ | |
sudo chown munge: /tmp/munge.key | |
sudo mv /tmp/munge.key /etc/munge | |
echo "Starting munge" | |
sudo systemctl enable munge.service | |
echo "Copying SLURM config" | |
if [ ! -d /etc/slurm ]; then | |
sudo mkdir /etc/slurm | |
fi | |
sudo chown slurm: /etc/slurm | |
cp ~/slurm/slurm.conf /tmp/ | |
sudo chown slurm: /tmp/slurm.conf | |
sudo mv /tmp/slurm.conf /etc/slurm/ | |
cp ~/slurm/cgroup.conf /tmp/ | |
sudo chown slurm: /tmp/cgroup.conf | |
sudo mv /tmp/cgroup.conf /etc/slurm/ | |
cp ~/slurm/cgroup_allowed_devices_file.conf /tmp/ | |
sudo chown slurm: /tmp/cgroup_allowed_devices_file.conf | |
sudo mv /tmp/cgroup_allowed_devices_file.conf /etc/slurm/ | |
echo "Starting SLURM" | |
sudo systemctl enable slurmd.service | |
echo "Done" |
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
#!/bin/bash | |
# services-start.sh | |
# | |
# Start the munge and slurmd services | |
set -e | |
echo "Starting munge" | |
sudo systemctl start munge.service | |
echo "Starting SLURM" | |
sudo systemctl start slurmd.service | |
echo "Done" |
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
#!/bin/bash | |
# services-stop.sh | |
# | |
# Stop the munge and slurmd services | |
set -e | |
echo "Stoppinging munge" | |
sudo systemctl stop munge.service | |
echo "Stopping SLURM" | |
sudo systemctl stop slurmd.service | |
echo "Done" |
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
#!/bin/bash | |
# | |
# builds slurm and slurm-drmaa from source. | |
# both packges are installed. | |
# currently don't know how to build slurm-drmaa RPMs. see https://github.com/natefoo/slurm-drmaa/issues/25 | |
cd /root | |
# install required packages | |
yum -y install epel-release | |
yum -y install wget gcc rpmbuild perl-ExtUtils-MakeMaker mariadb-server mariadb-devel rpm-build munge-devel munge-libs readline-devel openssl pam-devel python-pip python-virtualenv | |
# download slurm and slurm-drmaa | |
wget https://download.schedmd.com/slurm/slurm-18.08.5-2.tar.bz2 | |
wget https://github.com/natefoo/slurm-drmaa/releases/download/1.1.0/slurm-drmaa-1.1.0.tar.gz | |
# build slurm | |
rpmbuild -ta slurm-18.08.5-2.tar.bz2 | |
# install slurm | |
yum --nogpgcheck localinstall -y rpmbuild/RPMS/x86_64/slurm-*.rpm | |
# build slurm-drmaa | |
tar xvfz slurm-drmaa-1.1.0.tar.gz | |
cd slurm-drmaa-1.1.0 | |
./configure | |
make | |
# install slurm-drmaa | |
make install |
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
#!/bin/bash | |
# slurm-setup.sh | |
# | |
# This script sets up a base image for a slurm node by installing munge and slurm. | |
# | |
# It assumes you are using a base image that already has /home mounted from an nfs export from node nextflow-head-1. | |
# | |
# When the instance is fired up munge and slurm need configuring and starting. See the slurm-start.sh script for this. | |
# setup nextflow if not already done | |
#sudo yum -y install java-1.8.0-openjdk-headless procps | |
# setup users | |
export MUNGEUSER=991 | |
sudo groupadd -g $MUNGEUSER munge | |
sudo useradd -m -c "MUNGE user" -d /var/lib/munge -u $MUNGEUSER -g munge -s /sbin/nologin munge | |
export SLURMUSER=992 | |
sudo groupadd -g $SLURMUSER slurm | |
sudo useradd -m -c "SLURM workload manager" -d /var/lib/slurm -u $SLURMUSER -g slurm -s /bin/bash slurm | |
# setup munge | |
sudo yum -y install epel-release | |
sudo yum -y install munge | |
sudo chown -R munge: /etc/munge/ /var/log/munge/ | |
sudo chmod 0700 /etc/munge/ /var/log/munge/ | |
# setup slurm | |
sudo yum -y install openssl numactl hwloc lua libibmad libibumad -y | |
cd ~/rpmbuild/RPMS/x86_64/ | |
SLURM_VERSION=18.08.5-2 | |
sudo yum --nogpgcheck localinstall -y slurm-$SLURM_VERSION.el7.x86_64.rpm slurm-perlapi-$SLURM_VERSION.el7.x86_64.rpm slurm-slurmd-$SLURM_VERSION.el7.x86_64.rpm | |
sudo mkdir /var/spool/slurmd | |
sudo chown slurm: /var/spool/slurmd | |
sudo chmod 755 /var/spool/slurmd | |
sudo touch /var/log/slurmd.log | |
sudo chown slurm: /var/log/slurmd.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment