Pathing fix #2
Workflow file for this run
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
name: 'setup-slurm-action' | |
description: 'Setup slurm cluster on GitHub Actions using https://github.com/galaxyproject/ansible-slurm' | |
branding: | |
icon: arrow-down-circle | |
color: blue | |
runs: | |
using: "composite" | |
steps: | |
# prior to slurm-setup we need the podmand-correct command | |
# see https://github.com/containers/podman/issues/13338 | |
- name: Download slurm ansible roles | |
shell: bash -e {0} | |
run: | | |
ansible-galaxy role install https://github.com/galaxyproject/ansible-slurm/archive/1.0.1.tar.gz | |
- name: Apt prerequisites | |
shell: bash -e {0} | |
run: | | |
sudo apt-get update | |
sudo apt-get install retry | |
- name: Define slurm playbook | |
uses: 1arp/[email protected] | |
with: | |
file: slurm-playbook.yml | |
content: | | |
- name: Slurm all in One | |
hosts: localhost | |
roles: | |
- role: 1.0.1 | |
become: true | |
vars: | |
slurm_upgrade: true | |
slurm_roles: ['controller', 'exec', 'dbd'] | |
slurm_config_dir: /etc/slurm | |
slurm_config: | |
ClusterName: githubactions | |
SlurmctldLogFile: /var/log/slurm/slurmctld.log | |
SlurmctldPidFile: /run/slurmctld.pid | |
SlurmdLogFile: /var/log/slurm/slurmd.log | |
SlurmdPidFile: /run/slurmd.pid | |
SlurmdSpoolDir: /tmp/slurmd # the default /var/lib/slurm/slurmd does not work because of noexec mounting in github actions | |
StateSaveLocation: /var/lib/slurm/slurmctld | |
AccountingStorageType: accounting_storage/slurmdbd | |
SelectType: select/cons_res | |
slurmdbd_config: | |
StorageType: accounting_storage/mysql | |
PidFile: /run/slurmdbd.pid | |
LogFile: /var/log/slurm/slurmdbd.log | |
StoragePass: root | |
StorageUser: root | |
StorageHost: 127.0.0.1 # see https://stackoverflow.com/questions/58222386/github-actions-using-mysql-service-throws-access-denied-for-user-rootlocalh | |
StoragePort: 8888 | |
DbdHost: localhost | |
slurm_create_user: yes | |
#slurm_munge_key: "../../../munge.key" | |
slurm_nodes: | |
- name: cpu1 | |
State: UNKNOWN | |
Sockets: 2 | |
CoresPerSocket: 4 | |
RealMemory: 5000 | |
slurm_user: | |
comment: "Slurm Workload Manager" | |
gid: 1002 | |
group: slurm | |
home: "/var/lib/slurm" | |
name: slurm | |
shell: "/bin/bash" | |
uid: 1002 | |
- name: Set XDG_RUNTIME_DIR | |
shell: bash -e {0} | |
run: | | |
mkdir -p /tmp/1002-runtime # work around podman issue (https://github.com/containers/podman/issues/13338) | |
echo XDG_RUNTIME_DIR=/tmp/1002-runtime >> $GITHUB_ENV | |
- name: Setup slurm | |
shell: bash -e {0} | |
run: | | |
ansible-playbook slurm-playbook.yml || (journalctl -xe && exit 1) | |
- name: Add Slurm Account | |
shell: bash -e {0} | |
run: | | |
sudo retry --until=success -- sacctmgr -i create account "Name=runner" | |
sudo sacctmgr -i create user "Name=runner" "Account=runner" | |
- name: Test srun submission | |
shell: bash -e {0} | |
run: | | |
srun -vvvv echo "hello world" | |
sudo cat /var/log/slurm/slurmd.log | |
- name: Show partition info | |
shell: bash -e {0} | |
run: | | |
scontrol show partition | |
- name: Test sbatch submission | |
shell: bash -e {0} | |
run: | | |
sbatch -vvvv -N 1 --mem 5 --wrap "echo 'hello world'" |