diff --git a/ansible/roles/compiled/files/nextflow.config b/ansible/roles/compiled/files/nextflow.config new file mode 100644 index 00000000..f47cdb17 --- /dev/null +++ b/ansible/roles/compiled/files/nextflow.config @@ -0,0 +1,67 @@ +// Nextflow configuration file + +profiles { + standard { + process.executor = 'local' + } + + main_small { + process.executor = 'slurm' + process.queue = 'Main' + singularity.enabled = true + process.cpus = 1 + process.memory = 4.GB + } + + main_medium { + process.executor = 'slurm' + process.queue = 'Main' + singularity.enabled = true + process.cpus = 8 + process.memory = 64.GB + } + + main_large { + process.executor = 'slurm' + process.queue = 'Main' + singularity.enabled = true + process.cpus = 32 + process.memory = 232.GB + } + + highmem { + process.executor = 'slurm' + process.queue = 'HighMem' + singularity.enabled = true + process.cpus = 32 + process.memory = 500.GB + } + + veryhighmem { + process.executor = 'slurm' + process.queue = 'HighMem' + singularity.enabled = true + process.cpus = 96 + process.memory = 1500.GB + } + + gpu_1gpu { + process.executor = 'slurm' + process.queue = 'GPU' + singularity.enabled = true + singularity.runOptions = '--nv' + process.cpus = 1 + process.memory = 4.GB + process.clusterOptions = '--gres=gpu:1' + } + + gpu_2gpu { + process.executor = 'slurm' + process.queue = 'GPU' + singularity.enabled = true + singularity.runOptions = '--nv' + process.cpus = 1 + process.memory = 4.GB + process.clusterOptions = '--gres=gpu:2' + } +} diff --git a/ansible/roles/compiled/tasks/common/main.yml b/ansible/roles/compiled/tasks/common/main.yml index 55d8e9b7..7d8cab62 100644 --- a/ansible/roles/compiled/tasks/common/main.yml +++ b/ansible/roles/compiled/tasks/common/main.yml @@ -971,20 +971,35 @@ - name: Install NextFlow vars: - java_module: "java/openjdk-18.0.2" + # Each release supports a bounded Java range (22.10 tops out at 18, 25.04+ + # needs 17 to 26), so the JDK module is chosen per version. versions: - version_number: "22.10.7" + java_module: "java/openjdk-18.0.2" url: "https://github.com/nextflow-io/nextflow/releases/download/v22.10.7/nextflow-22.10.7-all" checksum: "sha512:478f215e233de41bb68b22c4dab58eaa7c574f8ec26f6b74b82e583928bbf0d3679972c1f4bc09fadc64deeac9e00615178581dd8c698d062d43e69dc56971c3" - version_number: "23.04.4" + java_module: "java/openjdk-18.0.2" url: "https://github.com/nextflow-io/nextflow/releases/download/v23.04.4/nextflow-23.04.4-all" checksum: "sha512:90712d34ddedc9fae5fe75bc78bb333b6b3da864a089489df380ee313fbf312dd28d3094bc2ac67472f9fafb854d2bba2ff8f8dbafc01b6ef176ad8ea469b4f3" - version_number: "24.04.4" + java_module: "java/openjdk-18.0.2" url: "https://github.com/nextflow-io/nextflow/releases/download/v24.04.4/nextflow-24.04.4-all" checksum: "sha512:2ce7cb79516a0342e2d1499d9aacf3e4516f760aa49411e58145e1ddef7f2f0a76314207999a39658a1edd1360eace17a4d42393ae1c5b841ba34b1c65431ff9" - version_number: "25.04.6" + java_module: "java/openjdk-22.0.1" url: "https://github.com/nextflow-io/nextflow/releases/download/v25.04.6/nextflow" checksum: "sha256:a94f8bd1db9c0271ad58ec40b9c71f812d081a66f782396928b9b1f740f0be5f" + # The -dist asset is the self-contained build; the bare `nextflow` asset is a + # launcher that fetches the runtime into each user's ~/.nextflow on first run. + - version_number: "25.10.7" + java_module: "java/openjdk-22.0.1" + url: "https://github.com/nextflow-io/nextflow/releases/download/v25.10.7/nextflow-25.10.7-dist" + checksum: "sha256:00c0fa276c87e4f6cec6d4c256fc556abbc9340aa84c31230d594c07658d0a52" + - version_number: "26.04.6" + java_module: "java/openjdk-22.0.1" + url: "https://github.com/nextflow-io/nextflow/releases/download/v26.04.6/nextflow-26.04.6-dist" + checksum: "sha256:182a63c74074e2dc7956ffa3c8cd59de952ed2c44394e21faf5e1736b945444c" ansible.builtin.include_tasks: file: "nextflow.yaml" loop: "{{ versions }}" diff --git a/ansible/roles/compiled/tasks/common/nextflow.yaml b/ansible/roles/compiled/tasks/common/nextflow.yaml index ce3a3b5b..95485d89 100644 --- a/ansible/roles/compiled/tasks/common/nextflow.yaml +++ b/ansible/roles/compiled/tasks/common/nextflow.yaml @@ -6,7 +6,6 @@ checksum: "{{ item.checksum }}" install_dir: "{{ nextflow_dir }}/{{ item.version_number }}" java_module: "{{ item.java_module }}" - java_location: "{{ item.java_location }}" version_number: "{{ item.version_number }}" tags: - never @@ -26,6 +25,19 @@ checksum: "{{ checksum }}" mode: u=rwx,g=rx,o=rx + - name: Deploy NextFlow cluster configuration and wrapper {{ version_number }} + block: + - name: Copy NextFlow cluster configuration + ansible.builtin.copy: + src: nextflow.config + dest: "{{ install_dir }}/nextflow.config" + mode: u=rw,g=r,o=r + - name: Install nf-ilifu wrapper script + ansible.builtin.template: + src: nf-ilifu.sh + dest: "{{ install_dir }}/nf-ilifu" + mode: u=rwx,g=rx,o=rx + - name: Install NextFlow module {{ version_number }} block: - name: Check module dir diff --git a/ansible/roles/compiled/templates/nextflow.lua b/ansible/roles/compiled/templates/nextflow.lua index da541a11..f8c77f12 100644 --- a/ansible/roles/compiled/templates/nextflow.lua +++ b/ansible/roles/compiled/templates/nextflow.lua @@ -7,5 +7,8 @@ whatis("Keywords: nextflow") whatis("Description: NextFlow {{ version_number }}") load("{{ java_module }}") +-- The shared nextflow.config enables Singularity in every SLURM profile; +-- the unversioned module is deliberate so nextflow follows the cluster default. +load("singularity") prepend_path('PATH', '{{ install_dir }}') diff --git a/ansible/roles/compiled/templates/nf-ilifu.sh b/ansible/roles/compiled/templates/nf-ilifu.sh new file mode 100644 index 00000000..12acf50c --- /dev/null +++ b/ansible/roles/compiled/templates/nf-ilifu.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Nextflow wrapper for ilifu: runs this version's nextflow with the shared +# cluster configuration (SLURM profiles for the Main, HighMem and GPU queues, +# Singularity enabled). Pass -profile ; see nextflow.config alongside. +exec {{ install_dir }}/nextflow -c {{ install_dir }}/nextflow.config "$@"