-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsoftware.yml
136 lines (116 loc) · 3.66 KB
/
software.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
- name: Install NBIS software
hosts: hadoopnodes
vars:
nbis_prefix: "/usr/local"
nbis_configure_args: "--64 --without-X11"
nbis_version: "5.0.0"
nbis_src_url: "http://nigos.nist.gov:8080/nist/nbis/nbis_v{{ nbis_version | replace('.', '_') }}.zip"
nbis_src_zip: "{{ nbis_src_url | basename }}"
nbis_src_checksum: "sha256:0adf8ab0f6b0e4208de50ca00ba21d3d77112ecd66288757ddfed21f6bee92c3"
nbis_src_name: "{{ nbis_src_zip | splitext | first }}"
tasks:
##################################################
# Debian
##################################################
- name: add repository keys (Debian)
when: ansible_os_family == 'Debian'
become: yes
apt_key:
keyserver: "keyserver.ubuntu.com"
id: "642AC823"
state: present
- name: add repositories (Debian)
when: ansible_os_family == 'Debian'
become: yes
apt_repository:
repo: "deb https://dl.bintray.com/sbt/debian /"
state: present
update_cache: yes
- name: install dependencies (Debian)
when: ansible_os_family == 'Debian'
become: yes
apt:
name: "{{ item }}"
state: present
with_items:
- build-essential
- cmake
- unzip
- sbt=0.13.13 # >= 0.13.14 requires JDK 8, which is unavailable for Ubuntu 14.04
##################################################
# RedHat
##################################################
- name: add repository (RedHat)
when: ansible_os_family == 'RedHat'
become: yes
get_url:
url: "https://bintray.com/sbt/rpm/rpm"
dest: /etc/yum.repos.d/binary-sbt-rpm.repo
- name: install dependencies (RedHat)
when: ansible_os_family == 'RedHat'
become: yes
yum:
name: "{{ item }}"
state: present
with_items:
- cmake
- unzip
- name: install dependencies (unsigned packages) (RedHat)
when: ansible_os_family == 'RedHat'
become: yes
yum:
name: "{{ item }}"
state: present
disable_gpg_check: yes
with_items:
- sbt
##################################################
- name: download NBIS
get_url:
url: "{{ nbis_src_url }}"
dest: "/tmp"
checksum: "{{ nbis_src_checksum }}"
- name: extract
unarchive:
src: "/tmp/{{ nbis_src_zip }}"
dest: "{{ ansible_env.HOME }}"
creates: "{{ ansible_env.HOME }}/Rel_{{ nbis_version }}"
copy: no
- name: configure and build
shell: "{{ item.cmd }} && touch {{ item.creates }}"
args:
chdir: "{{ ansible_env.HOME }}/Rel_{{ nbis_version }}"
creates: "{{ item.creates }}"
with_items:
- cmd: "./setup.sh {{ nbis_prefix }} {{ nbis_configure_args }}"
creates: .ran-setup.sh
- cmd: "make config"
creates: .ran-make:config
- cmd: "make it"
creates: .ran-make:it
- name: install
become: yes
shell: "make install && touch .ran-make:install"
args:
chdir: "{{ ansible_env.HOME }}/Rel_{{ nbis_version }}"
creates: ".ran-make:install"
######################################################################
- name: Deploy analysis code
become: yes
become_user: hadoop
hosts: frontendnodes
tasks:
- name: send project
copy:
src: "{{ item }}"
dest: "{{ ansible_env.HOME }}"
with_items:
- project
- NBIS.sbt
- NBIS.scala
- name: compile
shell: sbt package && sbt assembly
args:
chdir: "{{ ansible_env.HOME }}"
creates: "target/scala-2.10/NBIS-assembly-1.0.jar"