Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
SolomonShorser-OICR committed Apr 22, 2015
2 parents 9ba4d28 + b3e55e1 commit 09c9ac3
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 14 deletions.
28 changes: 19 additions & 9 deletions roles/grid-engine/tasks/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

- name: SGE | Template act_qmaster
template: src=act_qmaster.j2 dest=/var/lib/gridengine/default/common/act_qmaster
when: docker is not defined

- name: SGE | Ensure gridengine-master started
service: name=gridengine-master state=started
Expand All @@ -17,14 +18,17 @@
command: qconf -as {{ inventory_hostname }}
register: configure_master_as
changed_when: not 'already exists' in configure_master_as.stderr
when: docker is not defined

- name: SGE | Make a directory for our SGE templates
file: state=directory path=/etc/gridengine/templates mode=0744
when: docker is not defined

# setup memory as a consumable resource
- name: SGE | Template memory configuration file
template: src=sc.j2 dest=/etc/gridengine/templates/sge_sc
register: memory_template
when: docker is not defined

- name: SGE | Setup memory as consumable resource
command: qconf -Mc /etc/gridengine/templates/sge_sc
Expand All @@ -38,30 +42,31 @@
shell: qconf -su users | grep -E "^entries" | cut -f2 -d " "
register: sge_current_users
changed_when: false
when: docker is not defined

- name: SGE | Add the capsid user
command: qconf -au capsid users
when: not 'capsid' in sge_current_users.stdout.split(',')
when: docker is not defined and not 'capsid' in sge_current_users.stdout.split(',')

# loop through and template worker hosts
- name: SGE | Generate execution host templates
template: src=execution_host.j2 dest=/etc/gridengine/templates/sge_execution_host_{{ item }}.sh mode=0555
when: not single_node
when: not single_node and docker is not defined
with_items: groups.worker
register: execution_host_template

# loop through and setup worker hosts, if this was better it would modify existing hosts as well instead of ignoring errors
- name: SGE | Add worker hosts as execution hosts
shell: export EDITOR=/etc/gridengine/templates/sge_execution_host_{{ item }}.sh && qconf -ae ; qconf -me {{ item }}
with_items: groups.worker
when: execution_host_template.changed
when: execution_host_template.changed
ignore_errors: yes

# add the master as an execution host if we only have one node
- name: SGE | Single node execution host templates
template: src=execution_selfhost.j2 dest=/etc/gridengine/templates/sge_execution_host_master.sh mode=0555
register: execution_host_template
when: single_node
when: single_node and docker is not defined

- name: SGE | Single node host as execution host
shell: export EDITOR=/etc/gridengine/templates/sge_execution_host_master.sh && qconf -ae ; qconf -me master
Expand All @@ -74,35 +79,39 @@
ignore_errors: yes
register: sge_current_host_groups
changed_when: false
when: docker is not defined

# The template now handles the hostlist properly
- name: SGE | Template host group configuration
template: src=ahgrp.j2 dest=/etc/gridengine/templates/sge_ahgrp
when: not '@allhosts' in sge_current_host_groups.stdout_lines
when: docker is not defined and not '@allhosts' in sge_current_host_groups.stdout_lines

- name: SGE | Add the host group configuration
command: qconf -Ahgrp /etc/gridengine/templates/sge_ahgrp
when: not '@allhosts' in sge_current_host_groups.stdout_lines
when: docker is not defined and not '@allhosts' in sge_current_host_groups.stdout_lines

# Again, we don't want to do this if it already exists
- name: SGE | Check current queues
command: qconf -sql
ignore_errors: yes
register: sge_current_queues
changed_when: false
when: docker is not defined

# template handles hostlist, worker queue slots, target load average
- name: SGE | Template main queue
template: src=aq.j2 dest=/etc/gridengine/templates/sge_aq
register: main_queue_template
when: docker is not defined

- name: SGE | Add main queue
command: qconf -Aq /etc/gridengine/templates/sge_aq
when: not 'main.q' in sge_current_queues.stdout_lines
when: docker is not defined and not 'main.q' in sge_current_queues.stdout_lines

- name: SGE | Template modify queue
template: src=mq.j2 dest=/etc/gridengine/templates/sge_mq.sh mode=0555
register: modify_main_queue_template
when: docker is not defined

- name: SGE | Modify main queue
shell: export EDITOR=/etc/gridengine/templates/sge_mq.sh && qconf -mq main.q
Expand All @@ -111,20 +120,21 @@
- name: SGE | Check parallel environment status
command: qconf -sp serial
ignore_errors: yes
when: grid_engine_master == True
when: grid_engine_master == True and docker is not defined
register: sge_parallel_env
changed_when: false

- name: SGE | Template serial parallel environment file
template: src=serial_profile.j2 dest=/etc/gridengine/templates/sge_serial_profile
register: serial_profile
when: docker is not defined

# Again, if this was better, we would re-create the environment if there were changes in the template
- name: SGE | Setup serial profile environment
command: "{{ item }}"
with_items:
- qconf -Ap /etc/gridengine/templates/sge_serial_profile
- qconf -aattr queue pe_list serial main.q
when: "'serial is not a parallel environment' in sge_parallel_env.stderr or serial_profile.changed"
when: "docker is not defined and 'serial is not a parallel environment' in sge_parallel_env.stderr or docker is not defined and serial_profile.changed"

# TODO: bindle 1.2.1 re-runs the sge setup script on reboot. Determine whether this is really needed
18 changes: 17 additions & 1 deletion roles/postgres/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,27 @@
regexp="LC_ALL"
line="LC_ALL=\"en_US.utf8\""

# from https://github.com/zenoamaro/ansible-postgresql
- name: Adding APT repository key
when: ansible_os_family == 'Debian'
sudo: yes
register: _repo_key
apt_key:
id: ACCC4CF8
url: https://www.postgresql.org/media/keys/ACCC4CF8.asc

- name: Add PostgreSQL official APT repository
when: ansible_os_family == 'Debian'
sudo: yes
register: _repo
apt_repository:
repo: "deb http://apt.postgresql.org/pub/repos/apt/ {{ansible_distribution_release}}-pgdg main"

- name: install postgres pkgs
apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=3600
with_items:
- libpq-dev
- postgresql
- postgresql-9.1
- python-psycopg2

- name: setup pg_hba file
Expand Down
6 changes: 4 additions & 2 deletions roles/seqware-common-infrastructure/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@
- name: Set up Hadoop HDFS Local Storage
file: path={{ item.path }} state={{ item.state }} owner={{ item.owner }} recurse={{ item.recurse }} mode={{ item.mode}}
with_items:
- { state: 'directory', path: '/data', owner: 'hdfs', group: 'hdfs', recurse: 'yes', mode: '0777' }
- { state: 'directory', path: '/data/1', owner: 'hdfs', group: 'hdfs', recurse: 'yes', mode: '0777' }
- { state: 'directory', path: '/data/1/dfs/nn', owner: 'hdfs', group: 'hdfs', recurse: 'yes', mode: '0700' }
- { state: 'directory', path: '/data/1/dfs/dn', owner: 'hdfs', group: 'hdfs', recurse: 'yes', mode: '0700' }
- { state: 'directory', path: '/data/1/mapred', owner: 'mapred', group: 'mapred', recurse: 'yes', mode: '0700' }
- { state: 'directory', path: '/data/1/mapred/local', owner: 'mapred', group: 'mapred', recurse: 'yes', mode: '0700' }
- { state: 'directory', path: '/data/1/mapred', owner: 'mapred', group: 'mapred', recurse: 'yes', mode: '0754' }
- { state: 'directory', path: '/data/1/mapred/local', owner: 'mapred', group: 'mapred', recurse: 'yes', mode: '0754' }
- { state: 'directory', path: '/tmp/hadoop-mapred', owner: 'mapred', group: 'mapred', recurse: 'yes', mode: '0777' }

- name: Set up SeqWare directories
Expand Down
2 changes: 1 addition & 1 deletion roles/seqware-helloworld/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# not sure about the best way of making sure both have the same defaults
# however, a command-line variable overrides both at the same time
seqware_provider: "artifactory"
seqware_version: "1.0.14"
seqware_version: "1.1.0"

# variable specific to this role
helloworld_s3_location: "https://s3.amazonaws.com/oicr.workflow.bundles/released-bundles/Workflow_Bundle_HelloWorld_1.0-SNAPSHOT_SeqWare_{{ seqware_version }}.zip"
Expand Down
3 changes: 3 additions & 0 deletions roles/seqware-master-infrastructure/files/cloudera.pref
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Package: *
Pin: release o=Cloudera, l=Cloudera
Pin-Priority: 501
16 changes: 15 additions & 1 deletion roles/seqware-master-infrastructure/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
# file: roles/seqware-master-infrastructure/tasks/main.yml

- name: Setup cloudera preference
copy:
src: cloudera.pref
dest: /etc/apt/preferences.d/cloudera.pref

- name: Install Hadoop for a master
apt: name={{ item }} state=present update_cache=yes cache_valid_time=3600
register: oozie_installed
Expand Down Expand Up @@ -156,6 +161,7 @@
service: name=hadoop-0.20-mapreduce-jobtracker state=started

- name: Start TaskTracker
sudo: True
service: name=hadoop-0.20-mapreduce-tasktracker state=started
when: single_node

Expand All @@ -173,7 +179,7 @@
notify: restart oozie
command: "{{ item }}"
with_items:
- wget -q http://extjs.com/deploy/ext-2.2.zip
- wget -q http://archive.cloudera.com/gplextras/misc/ext-2.2.zip
- unzip ext-2.2.zip
- mv ext-2.2 /var/lib/oozie/

Expand Down Expand Up @@ -289,9 +295,17 @@
command: exportfs -ra
when: nfs_setup.changed

- name: NFS Restart
service: name=rpcbind state=restarted
when: nfs_setup.changed
ignore_errors: yes
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty'

- name: NFS Restart
service: name=portmap state=restarted
when: nfs_setup.changed
ignore_errors: yes
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'precise'

- name: NFS Restart
service: name=nfs-kernel-server state=restarted
Expand Down

0 comments on commit 09c9ac3

Please sign in to comment.