Skip to content

Commit

Permalink
Run a self test on slurm (#2)
Browse files Browse the repository at this point in the history
* Run a self test on slurm

* Use apt to install ansible

* Fix lint error

* Fix slurm install issues

* Enable debugging options

* Better debugging

* Try set StorageType

* Type in config variable

* Fix pid file

* Add basic miniwdl config for slurm

* Install singularity too

* Use different singularity role

* Correct position for config flag

* Fix typo in path name

* Simpler playbook

* Include a partition

* Correct accounting storage

* Add testing configuration in vagrant

* Update CI playbook

* remove directory

* Run on latest ubuntu

* Increase verbosity

* Check slurm logs

* Remove verbosity flags

* Set downloads to 1 core to enable scheduling

* Update memory and cpus

* Don't fail on slurm logs

* Configure realnode

* Use a number for realmemory

* Check slurm logs after miniwdl run

* Check on failure

* Fix broken or

* Adapt real memory to be correct

* Add QC test and test coverage

* Add missing command

* Use correct module name

* Pin version for SLURM role

* Install aptainer via deb package to avoid costly compile of singularity

* Update name to reflect task
  • Loading branch information
rhpvorderman authored Aug 24, 2022
1 parent 06c2c62 commit f446998
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,38 @@ jobs:
run: pip install tox
- name: Lint
run: tox -e lint

test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2.3.4
with:
submodules: recursive
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install miniwdl-slurm
run: pip install . coverage
- name: install ansible
run: sudo apt-get install ansible
- name: download slurm role
run: sudo ansible-galaxy install galaxyproject.slurm,1.0.1
- name: install slurm and singularity on this node
run: sudo ansible-playbook tests/slurm_playbook.yml -vv
- name: Check slurm logs
run: "sudo bash -c 'cat /var/log/slurm/* || true'"
- name: run miniwdl self test
run: miniwdl run-self-test --cfg tests/miniwdl.cfg
timeout-minutes: 3
- name: Check slurm logs
run: "sudo bash -c 'cat /var/log/slurm/* || true'"
if: ${{ failure() }}
- name: Run QC workflow
run: >-
coverage run --source=miniwdl_slurm -m WDL run
-i tests/integration/single_end.json
--cfg ../miniwdl.cfg
QC.wdl Cutadapt.cores=1 Cutadapt.timeMinutes=10
working-directory: "tests/QC"
- uses: codecov/codecov-action@v3
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tests/QC"]
path = tests/QC
url = https://github.com/biowdl/QC.git
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"slurm_singularity=miniwdl_slurm:SlurmSingularity"
],
},
classifiers= [
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
Expand Down
1 change: 1 addition & 0 deletions tests/QC
Submodule QC added at 5de2b6
16 changes: 16 additions & 0 deletions tests/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.vm.box = "debian/bullseye64"

config.vm.hostname = "vagrantslurm"
config.vm.provider "libvirt" do |lv|
lv.memory = 8192
lv.cpus = 4
end

config.vm.provision "ansible" do |ansible|
ansible.playbook = "vagrant_playbook.yml"
end
end
19 changes: 19 additions & 0 deletions tests/miniwdl.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[scheduler]
container_backend=slurm_singularity
task_concurrency=200

[singularity]
exe = ["apptainer"]

run_options = [
"--containall"
]

image_cache = "$PWD/miniwdl_singularity_cache"

[task_runtime]
# Set downloads to 1 core to make sure github actions can schedule the job.
download_defaults = {
"cpu": 1,
"memory": "1G"
}
40 changes: 40 additions & 0 deletions tests/slurm_playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
- name: Slurm all in One
hosts: localhost
become: true
vars:
slurm_config_dir: "/etc/slurm"
slurm_roles: ['controller', 'exec', 'dbd']
slurmdbd_config:
StorageType: "accounting_storage/none"
DbdHost: "localhost"
PidFile: "run/slurmdbd.pid"
slurm_config:
AccountingStorageType: "accounting_storage/none"
SlurmctldLogFile: "/var/log/slurm/slurmctld.log"
SlurmdLogFile: "/var/log/slurm/slurmd.log"
SlurmctldPidFile: "/run/slurmctld.pid"
SlurmdPidFile: "/run/slurmd.pid"
StateSaveLocation: "/var/lib/slurm/slurmctld"
SlurmdSpoolDir: "/var/spool/slurm/slurmd"
slurm_nodes:
- name: "localhost"
CPUs: 1
RealMemory: 6144 # in MB. CI nodes have about 7 GB on Github CI.
slurm_partitions:
- name: local
Default: YES
MaxTime: UNLIMITED
Nodes: "localhost"
pre_tasks:
- name: Install apptainer
apt:
update_cache: true
cache_valid_time: 36000
install_recommends: false
deb: https://github.com/apptainer/apptainer/releases/download/v1.0.3/apptainer_1.0.3_amd64.deb
- name: create spool directory
file:
state: directory
path: "/var/spool/slurm/slurmd"
roles:
- role: galaxyproject.slurm
40 changes: 40 additions & 0 deletions tests/vagrant_playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
- name: Slurm all in One
# Vagrant playbook for testing before updating CI playbook.
hosts: all
become: true
vars:
slurm_roles: ['controller', 'exec', 'dbd']
slurmdbd_config:
StorageType: "accounting_storage/none"
DbdHost: "localhost"
slurm_config:
AccountingStorageType: "accounting_storage/none"
SlurmctldLogFile: "/var/log/slurm/slurmctld.log"
SlurmdLogFile: "/var/log/slurm/slurmd.log"
SlurmctldPidFile: "/run/slurmctld.pid"
SlurmdPidFile: "/run/slurmd.pid"
StateSaveLocation: "/var/lib/slurm/slurmctld"
SlurmdSpoolDir: "/var/spool/slurm/slurmd"
slurm_nodes:
- name: "localhost"
CPUs: 1
RealMemory: 6144
slurm_partitions:
- name: local
Default: YES
MaxTime: UNLIMITED
Nodes: "localhost"
slurm_config_dir: /etc/slurm
pre_tasks:
- name: Install apptainer
apt:
update_cache: true
cache_valid_time: 36000
install_recommends: false
deb: https://github.com/apptainer/apptainer/releases/download/v1.0.3/apptainer_1.0.3_amd64.deb
- name: create spool directory
file:
state: directory
path: "/var/spool/slurm/slurmd"
roles:
- role: galaxyproject.slurm

0 comments on commit f446998

Please sign in to comment.