-
Notifications
You must be signed in to change notification settings - Fork 28.2k
/
install_spark_build_packages.yml
183 lines (157 loc) · 4.82 KB
/
install_spark_build_packages.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
---
# install spark build packages
- name: install pypy3
apt:
pkg:
- pypy3
state: present
update_cache: yes
- name: download pip module for pypy
get_url:
url: '{{ pypy_pip_mirror }}/{{ pypy_pip_module }}'
dest: '/tmp/{{ pypy_pip_module }}'
mode: 0644
- name: install pip module for pypy
command: 'pypy3 /tmp/{{ pypy_pip_module }}'
changed_when: False
- name: remove temporary pip module for pypy
file:
path: '/tmp/{{ pypy_pip_module }}'
state: absent
- name: install test coverage package for pypy
command: 'pypy3 -m pip install coverage==4.5.2'
changed_when: False
- name: check for spark py3k env
command: "conda env list"
environment:
PATH: "{{ anaconda_home }}/bin:{{ ansible_env.PATH }}"
changed_when: False
check_mode: no
register: py3k_check
- block:
- name: copy python 3.6 conda environment for spark testing (2.4)
copy:
src: "python_environments/{{ spark_py3k_environment }}"
dest: "/tmp/{{ spark_py3k_environment }}"
owner: jenkins
group: jenkins
mode: 0660
- name: create py3k conda environment for spark
command: "conda create -y --name py3k --file /tmp/{{ spark_py3k_environment }}"
environment:
PATH: "{{ anaconda_home }}/bin:{{ ansible_env.PATH }}"
become: yes
become_user: jenkins
- name: delete py3k conda environment file
file:
path: "/tmp/{{ spark_py3k_environment }}"
state: absent
when: "'py3k' not in py3k_check.stdout"
- block:
- name: copy python 3.6 conda environment for spark testing (master, 3.x+)
copy:
src: "python_environments/{{ spark_py36_environment }}"
dest: "/tmp/{{ spark_py36_environment }}"
owner: jenkins
group: jenkins
mode: 0660
- name: create py36 conda environment for spark
command: "conda create -y --name py36 --file /tmp/{{ spark_py36_environment }}"
environment:
PATH: "{{ anaconda_home }}/bin:{{ ansible_env.PATH }}"
become: yes
become_user: jenkins
- name: delete py36 conda environment file
file:
path: "/tmp/{{ spark_py36_environment }}"
state: absent
when: "'py36' not in py3k_check.stdout"
- name: create symlink for anaconda homedir
file:
src: "{{ anaconda_home }}"
dest: "/home/anaconda"
state: link
- name: copy python2 pip requirements file
copy:
src: "python_environments/{{ spark_py2_pip_requirements }}"
dest: "/tmp/{{ spark_py2_pip_requirements }}"
owner: jenkins
group: jenkins
mode: 0660
- name: install python2 doc and test packages for spark
pip:
requirements: "/tmp/{{ spark_py2_pip_requirements }}"
extra_args: --ignore-installed
environment:
PATH: "{{ anaconda_home }}/bin:{{ ansible_env.PATH }}"
become: yes
become_user: jenkins
- name: delete python2 pip requirements file
file:
path: "/tmp/{{ spark_py2_pip_requirements }}"
state: absent
- name: add cran apt repo key
apt_key:
keyserver: keyserver.ubuntu.com
id: "{{ r_cran_repo_key }}"
state: present
- name: add cran apt repo
apt_repository:
repo: "{{ r_cran_repo }}"
update_cache: yes
- name: install sparkR system deps
apt:
pkg:
- default-jre
- default-jre-headless # both for r-cran-rjava
- libcurl4-openssl-dev # devtools package dep
- libxml2-dev # lintr dep
- qpdf
- libssh2-1-dev # devtools dep
- libssl-dev # git2r dep
- libodbc1
state: present
- name: install base R packages
apt:
pkg:
- r-base-core
- r-base-dev
state: present
- name: ensure R java environment is properly set up
command: "/usr/bin/R CMD javareconf"
environment:
JAVA_HOME: "/usr/java/latest"
register: r_result
changed_when: False
failed_when: "r_result.rc != 0 or 'had non-zero exit status' in r_result.stderr"
- name: install rJava
apt:
name: r-cran-rjava
state: present
- name: install next set java R packages
apt:
pkg:
- r-cran-rodbc
- r-mathlib
- name: install required R packages via Rscript (default version)
command: /usr/bin/Rscript --slave --no-save --no-restore-history -e "if (! ('{{ item }}' %in% installed.packages()[,'Package'])) { install.packages(pkgs='{{ item }}'); print('Added'); } else { print('Already installed'); }"
register: r_result
failed_when: "r_result.rc != 0 or 'had non-zero exit status' in r_result.stderr"
changed_when: "'Added' in r_result.stdout"
loop:
- digest
- knitr
- devtools
- plyr
- roxygen2
- rmarkdown
- e1071
- testthat
- name: get list of installed packages
command: /usr/bin/Rscript -e "installed.packages()[,'Package']"
changed_when: False
check_mode: no
register: r_check
- name: install lintr v2.0.0
command: /usr/bin/Rscript --slave --no-save --no-restore-history -e "devtools::install_github('jimhester/lintr@v2.0.0')"
when: "'lintr' not in r_check.stdout"