Skip to content

Commit

Permalink
Further added support for pre-configured pbs/torque clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias De Smet authored and Matthias De Smet committed Nov 16, 2015
1 parent dc137f0 commit 8c7573d
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 14 deletions.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
galaxy_extras_config_nginx: true
galaxy_extras_config_proftpd: true
galaxy_extras_config_slurm: true
galaxy_extras_config_pbs: false
pbs_server_name: pbsqueue
galaxy_extras_config_supervisor: true
galaxy_extras_config_galaxy_root: true
galaxy_extras_config_galaxy_job_metrics: true
Expand Down
2 changes: 2 additions & 0 deletions local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
tasks:
- include: tasks/slurm.yml
tags: slurm
- include: tasks/pbs.yml
tags: pbs
- include: tasks/nginx.yml
tags: nginx
- include: tasks/proftpd.yml
Expand Down
3 changes: 3 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
- include: slurm.yml
when: galaxy_extras_config_slurm

- include: pbs.yml
when: galaxy_extras_config_pbs

- include: supervisor.yml
when: galaxy_extras_config_supervisor

Expand Down
22 changes: 22 additions & 0 deletions tasks/pbs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- name: Install pip
apt: pkg={{ item }} state={{ galaxy_extras_apt_package_state }}
with_items:
- python-pip
when: galaxy_extras_install_packages

- name: Install PBS/torque system packages
apt: pkg={{ item }} state={{ galaxy_extras_apt_package_state }}
with_items:
- torque-client
- pbs-drmaa-dev
- python-psutil
when: galaxy_extras_install_packages

- name: "Fetch DRMAA egg for Galaxy"
shell: "{{ galaxy_venv_dir }}/bin/python {{ galaxy_root }}/scripts/fetch_eggs.py -e drmaa -c {{ galaxy_config_file }}"

- name: "Install Galaxy job conf"
template: src=job_conf.xml.j2 dest={{galaxy_job_conf_path}}

- name: "Set PBS/torque server name"
shell: "echo {{ pbs_server_name }} >> /etc/torque/server_name"
45 changes: 31 additions & 14 deletions templates/job_conf.xml.j2
Original file line number Diff line number Diff line change
@@ -1,36 +1,53 @@
<?xml version="1.0"?>
<job_conf>
<plugins workers="2">
{% if galaxy_extras_config_slurm == True %}
<plugin id="slurm" type="runner" load="galaxy.jobs.runners.slurm:SlurmJobRunner">
<param id="drmaa_library_path">/usr/lib/slurm-drmaa/lib/libdrmaa.so</param>
</plugin>
{% endif %}
{% if galaxy_extras_config_pbs == True %}
<plugin id="pbs" type="runner" load="galaxy.jobs.runners.pbs:PBSJobRunner">
<param id="drmaa_library_path">/usr/lib/pbs-drmaa/lib/libdrmaa.so.1</param>
</plugin>
{% endif %}
</plugins>
<handlers default="handlers">
{% if galaxy_handler_processes == 0 %}
<handler id="web0" tags="handlers"/>
{% else %}
{% for i in range(galaxy_handler_processes) %}
{% for i in range(galaxy_handler_processes) %}
<handler id="handler{{ i }}" tags="handlers"/>
{% endfor %}
{% endfor %}
{% endif %}
</handlers>
<destinations default="cluster">
{% if galaxy_extras_config_slurm == True %}
<destination id="cluster" runner="slurm">
{% if galaxy_source_shellrc %}
<env file="{{ galaxy_user_shellrc }}" />
{% if galaxy_source_shellrc %}
<env file="{{ galaxy_user_shellrc }}" />
{% endif %}
<param id="docker_enabled" from_environ="GALAXY_DOCKER_ENABLED">{{ galaxy_docker_enabled }}</param>
<param id="docker_sudo" from_environ="GALAXY_DOCKER_SUDO">{{ galaxy_docker_sudo }}</param>
<!-- The empty volumes from shouldn't affect Galaxy, set GALAXY_DOCKER_VOLUMES_FROM to use. -->
<param id="docker_volumes_from" from_environ="GALAXY_DOCKER_VOLUMES_FROM">{{ galaxy_docker_volumes_from }}</param>
<!-- For a stock Galaxy instance and traditional job runner $defaults will expand out as: $galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$default_file_path:rw -->
<param id="docker_volumes" from_environ="GALAXY_DOCKER_VOLUMES">{{ galaxy_docker_volumes }}</param>
</destination>
{% endif %}
<param id="docker_enabled" from_environ="GALAXY_DOCKER_ENABLED">{{ galaxy_docker_enabled }}</param>
<param id="docker_sudo" from_environ="GALAXY_DOCKER_SUDO">{{ galaxy_docker_sudo }}</param>
<!-- The empty volumes from shouldn't affect
Galaxy, set GALAXY_DOCKER_VOLUMES_FROM to use.
-->
<param id="docker_volumes_from" from_environ="GALAXY_DOCKER_VOLUMES_FROM">{{ galaxy_docker_volumes_from }}</param>
<!-- For a stock Galaxy instance and traditional job runner $defaults will
expand out as:
$galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$default_file_path:rw
-->
{% if galaxy_extras_config_pbs == True %}
<destination id="cluster" runner="pbs">
{% if galaxy_source_shellrc %}
<env file="{{ galaxy_user_shellrc }}" />
{% endif %}
<param id="docker_enabled" from_environ="GALAXY_DOCKER_ENABLED">{{ galaxy_docker_enabled }}</param>
<param id="docker_sudo" from_environ="GALAXY_DOCKER_SUDO">{{ galaxy_docker_sudo }}</param>
<!-- The empty volumes from shouldn't affect Galaxy, set GALAXY_DOCKER_VOLUMES_FROM to use. -->
<param id="docker_volumes_from" from_environ="GALAXY_DOCKER_VOLUMES_FROM">{{ galaxy_docker_volumes_from }}</param>
<!-- For a stock Galaxy instance and traditional job runner $defaults will expand out as: $galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$default_file_path:rw -->
<param id="docker_volumes" from_environ="GALAXY_DOCKER_VOLUMES">{{ galaxy_docker_volumes }}</param>
</destination>
{% endif %}
</destinations>
<limits>
</limits>
Expand Down

0 comments on commit 8c7573d

Please sign in to comment.