Skip to content

Commit

Permalink
fix singularity with cvmfs: only conditinally add /cvmfs to container…
Browse files Browse the repository at this point in the history
… mounts
  • Loading branch information
dometto committed Jan 14, 2025
1 parent 853aac1 commit f15c13a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
12 changes: 12 additions & 0 deletions tasks/set_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,15 @@
- name: Save _galaxy_config
ansible.builtin.set_fact:
_galaxy_config: "{{ galaxy_configuration }}"

- name: Set AppTainer volume mounts variable
ansible.builtin.set_fact:
apptainer_volumes: "{{ apptainer_volumes | default([]) | union([item]) }}"
when: item != omit
loop:
- "$galaxy_root:ro"
- "$tool_directory:ro"
- "$working_directory:rw"
- "$job_directory:rw"
- "{{ galaxy_mutable_data_dir }}:rw"
- "{% if _galaxy_enable_cvmfs %}/cvmfs{% else %}{{ omit }}{% endif %}" # Conditionally add the /cvmfs dir to volume mounts
2 changes: 1 addition & 1 deletion templates/galaxy/config/job_conf.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ execution:
{% endif %}

singularity:
singularity_volumes: "$galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$job_directory:rw,{{ galaxy_mutable_data_dir }}:rw"
singularity_volumes: {{ apptainer_volumes | join(',') }}
runner: local
singularity_enabled: true
container_resolvers:
Expand Down
9 changes: 0 additions & 9 deletions vars/galaxy_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ galaxy_client_use_prebuilt: true
galaxy_systemd_root: true
galaxy_backup_configfiles: false

# Defining volume mounts for AppTainer containers
apptainer_volumes:
- "$galaxy_root:ro"
- "$tool_directory:ro"
- "$working_directory:rw"
- "$job_directory:rw"
- "{{ galaxy_mutable_data_dir }}:rw"
- "{{ _galaxy_enable_cvmfs | ternary(',/cvmfs', omit) }}"

# Defining the variables for galaxy/config
user_preference_config_file: "{{ galaxy_config_dir }}/user_preferences_extra_conf.yml"
job_config_file: "{{ galaxy_config_dir }}/job_conf.yml"
Expand Down

0 comments on commit f15c13a

Please sign in to comment.