Skip to content

Commit

Permalink
Merge pull request #176 from IKIM-Essen/feat/add-snakemake-8-profile
Browse files Browse the repository at this point in the history
feat: add profile for the upcoming Snakemake 8
  • Loading branch information
enasca authored Oct 31, 2023
2 parents 72ad442 + 495bf39 commit 555e50a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ansible/roles/snakemake/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
snakemake_profile_name: ikim

# Inventory group names
slurm_worker_group_name: slurm_worker
24 changes: 19 additions & 5 deletions ansible/roles/snakemake/tasks/profiles.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
- name: Create the profile directory
ansible.builtin.file:
path: "/etc/xdg/snakemake/{{ (inventory_hostname in groups[slurm_worker_group_name]) | ternary('slurm', 'local') }}"
path: "/etc/xdg/snakemake/{{ snakemake_profile_name }}"
state: directory
owner: root
group: root
mode: "0755"
register: snakemake_profile_dir

- name: Add the profile
- name: Add the legacy profile
ansible.builtin.template:
src: profile.yaml.j2
dest: "{{ snakemake_profile_dir['path'] }}/config.yaml"
dest: "/etc/xdg/snakemake/{{ snakemake_profile_name }}/config.yaml"
owner: root
group: root
mode: "0644"
when: snakemake_profile_dir['path'] is defined

- name: Add the Snakemake >=8 profile
ansible.builtin.template:
src: profile.v8+.yaml.j2
dest: "/etc/xdg/snakemake/{{ snakemake_profile_name }}/config.v8+.yaml"
owner: root
group: root
mode: "0644"

- name: Set the profile name in the appropriate environment variable
ansible.builtin.template:
src: snakemake.sh.j2
dest: /etc/profile.d/snakemake.sh
owner: root
group: root
mode: "0755"
6 changes: 6 additions & 0 deletions ansible/roles/snakemake/templates/profile.v8+.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% if inventory_hostname in groups[slurm_worker_group_name] %}
executor: slurm
{% endif %}
software-deployment-method:
- conda
latency-wait: 60
1 change: 1 addition & 0 deletions ansible/roles/snakemake/templates/snakemake.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export SNAKEMAKE_PROFILE={{ snakemake_profile_name }}

0 comments on commit 555e50a

Please sign in to comment.