Skip to content

Commit

Permalink
Merge pull request #11 from SeqWare/feature/test_environment
Browse files Browse the repository at this point in the history
Feature/test environment
  • Loading branch information
denis-yuen committed May 6, 2016
2 parents 06b4f9d + 3886cf7 commit 5fa2ded
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Created by .ignore support plugin (hsz.mobi)
28 changes: 28 additions & 0 deletions docker-test-start.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
# file: docker-start.yml
# This file is used for installing a seqware container

- hosts: all
sudo: True
tasks:
- name: Start all required services
service: name={{ item }} state=restarted
with_items:
- postgresql
- hadoop-hdfs-datanode
- hadoop-hdfs-namenode
- hadoop-0.20-mapreduce-jobtracker
- hadoop-0.20-mapreduce-tasktracker
- oozie
- gridengine-master
- gridengine-exec
- name: Bump up control node memory allocation for high-mem machines
lineinfile: dest=~seqware/.seqware/settings regexp='^SW_CONTROL_NODE_MEMORY.*' line='SW_CONTROL_NODE_MEMORY=4000' state=present
when: ansible_memtotal_mb > 100000
- name: Redirect oozie working directory so that workflow runs are persisted
lineinfile: dest=~seqware/.seqware/settings regexp='^OOZIE_WORK_DIR.*' line='OOZIE_WORK_DIR=/datastore' state=present

- hosts: all
sudo: True
roles:
- { role: grid-engine, single_node: True , grid_engine_master: True }
38 changes: 38 additions & 0 deletions roles/java/tasks/oracle8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,49 @@

- name: install java 8
apt: name=oracle-java8-installer state=latest update-cache=yes force=yes
register: apt_result
sudo: yes

- name: Java | Set up Java
command: 'update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-8-oracle/jre/bin/java 2000'
when: apt_result.changed

- name: Java | Set up Java
command: 'update-alternatives --set java /usr/lib/jvm/java-8-oracle/jre/bin/java'
when: apt_result.changed

- name: Java | Set up Jar
command: 'update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java-8-oracle/bin/jar 2000'
when: apt_result.changed

- name: Java | Set up Jar
command: 'update-alternatives --set jar /usr/lib/jvm/java-8-oracle/bin/jar'
when: apt_result.changed

- name: Java | Set JAVA_HOME
lineinfile:
line: 'JAVA_HOME=/usr/lib/jvm/java-8-oracle'
dest: /etc/environment
state: present
create: yes

- name: Java | Set JAVA_HOME
lineinfile:
line: 'export JAVA_HOME=/usr/lib/jvm/java-8-oracle'
dest: /etc/bash.bashrc
state: present
create: yes

- name: Java | Set JAVA_HOME for root?
lineinfile:
line: 'export JAVA_HOME=/usr/lib/jvm/java-8-oracle'
dest: /root/.bash_profile
state: present
create: yes

- name: Java | Really set JAVA_HOME for root?
lineinfile:
line: 'Defaults env_keep += "JAVA_HOME"'
dest: /etc/sudoers
state: present
create: yes
6 changes: 4 additions & 2 deletions roles/seqware-code/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,21 @@
owner: "{{ user_name }}"

- include: 'git.yml'
when: seqware_provider == "git"
when: seqware_provider == "git" and test_environment is undefined

- include: 'artifactory.yml'
when: seqware_provider == "artifactory"
when: seqware_provider == "artifactory" and test_environment is undefined

- name : Prime SeqWare script
sudo_user: "{{ user_name }}"
shell: "~{{ user_name }}/bin/seqware"
register: script_prime
when: test_environment is undefined
changed_when: "'Downloading' in script_prime.stdout"

- name: Setup script path in bash profile
sudo: yes
when: test_environment is undefined
lineinfile:
dest: ~{{ user_name }}/.bash_profile
create: yes
Expand Down
2 changes: 1 addition & 1 deletion roles/seqware-common-infrastructure/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
dependencies:
- { role: java, java_provider: Cloudera }
- { role: java, java_provider: Oracle8 }
2 changes: 1 addition & 1 deletion roles/seqware-master-infrastructure/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
- name: Setup HDFS Shared Storage
sudo: yes
sudo_user: hdfs
command: "{{ item }}"
shell: "{{ item }}"
when: "namenode_format.changed or 'No such file or directory' in hdfs_state.stderr"
with_items:
- hadoop fs -mkdir /tmp
Expand Down
6 changes: 3 additions & 3 deletions seqware-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
- { role: grid-engine, grid_engine_master: True }
- { role: seqware-master-infrastructure }
- { role: seqware-code }
- { role: seqware-webservice }
- { role: seqware-webservice, when: test_environment is undefined }

- hosts: worker
sudo: True
Expand All @@ -85,5 +85,5 @@
- hosts: master
sudo: True
roles:
- { role: seqware-cron }
- { role: seqware-helloworld }
- { role: seqware-cron, when: test_environment is undefined }
- { role: seqware-helloworld, when: test_environment is undefined }

0 comments on commit 5fa2ded

Please sign in to comment.