From 8c7573da4671e471b5088b0c214c3322b0600183 Mon Sep 17 00:00:00 2001 From: Matthias De Smet Date: Mon, 16 Nov 2015 14:20:33 +0100 Subject: [PATCH] Further added support for pre-configured pbs/torque clusters --- defaults/main.yml | 2 ++ local.yml | 2 ++ tasks/main.yml | 3 +++ tasks/pbs.yml | 22 +++++++++++++++++++ templates/job_conf.xml.j2 | 45 +++++++++++++++++++++++++++------------ 5 files changed, 60 insertions(+), 14 deletions(-) create mode 100644 tasks/pbs.yml diff --git a/defaults/main.yml b/defaults/main.yml index 267c98a8..dc954e05 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/local.yml b/local.yml index 26156897..4780536d 100644 --- a/local.yml +++ b/local.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index 6d456ec1..7eebf071 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 diff --git a/tasks/pbs.yml b/tasks/pbs.yml new file mode 100644 index 00000000..432b24f9 --- /dev/null +++ b/tasks/pbs.yml @@ -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" diff --git a/templates/job_conf.xml.j2 b/templates/job_conf.xml.j2 index 9463028e..1cf316ef 100644 --- a/templates/job_conf.xml.j2 +++ b/templates/job_conf.xml.j2 @@ -1,36 +1,53 @@ +{% if galaxy_extras_config_slurm == True %} /usr/lib/slurm-drmaa/lib/libdrmaa.so +{% endif %} +{% if galaxy_extras_config_pbs == True %} + + /usr/lib/pbs-drmaa/lib/libdrmaa.so.1 + +{% endif %} {% if galaxy_handler_processes == 0 %} {% else %} -{% for i in range(galaxy_handler_processes) %} + {% for i in range(galaxy_handler_processes) %} -{% endfor %} + {% endfor %} {% endif %} +{% if galaxy_extras_config_slurm == True %} -{% if galaxy_source_shellrc %} - + {% if galaxy_source_shellrc %} + + {% endif %} + {{ galaxy_docker_enabled }} + {{ galaxy_docker_sudo }} + + {{ galaxy_docker_volumes_from }} + + {{ galaxy_docker_volumes }} + {% endif %} - {{ galaxy_docker_enabled }} - {{ galaxy_docker_sudo }} - - {{ galaxy_docker_volumes_from }} - +{% if galaxy_extras_config_pbs == True %} + + {% if galaxy_source_shellrc %} + + {% endif %} + {{ galaxy_docker_enabled }} + {{ galaxy_docker_sudo }} + + {{ galaxy_docker_volumes_from }} + {{ galaxy_docker_volumes }} +{% endif %}