-
Notifications
You must be signed in to change notification settings - Fork 8
/
deploy-tis-by-compile.yml
360 lines (336 loc) · 11.1 KB
/
deploy-tis-by-compile.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
---
- name: init compile
vars_files:
- vars.yml
- vars-deploy.yml
hosts: localhost
tasks:
- name: init source code dir:'{{src_root}}'
file:
path: "{{src_root}}"
state: directory
- name: init release dir:'{{ tis_release_dir }}/{{tis_release_dir_name}}'
file:
path: "{{ tis_release_dir }}/{{item}}"
state: directory
with_items:
- '{{tis_release_dir_name}}'
- '{{tis_plugin_release_dir_name}}'
- name: download system dependencies
include_role:
name: download
vars:
- shall_download_plugins: no
- shall_download_release_assemble: no
tags: always
- name: "make ng-tis package"
vars_files:
- vars.yml
vars:
exec_deploy: True
hosts: localhost
roles:
- role: ng-tis
tags:
- ng-tis
- name: compile tis src tar package
vars_files:
- vars.yml
- vars-deploy.yml
hosts: localhost
tasks:
- include_role:
name: compile
- name: include install_console_dependencies.yml
# this is used for TestCase
import_tasks: roles/console/tasks/install_console_dependencies.yml
tags:
- pkg
- name: compile tis-zepplin component tar package
vars_files:
- vars.yml
vars:
exec_deploy: True
parallel_compile: False
app_local_dir_name: "zeppelin"
git_src: "[email protected]:qlangtech/zeppelin.git"
git_branch: "tis-v0.10.1"
maven_extra_params:
- "'-DskipRat -Denforcer.skip=true -DskipTests=true -Pbuild-distr -Dappname=all -pl jdbc-tis,elasticsearch-tis,zeppelin-server,zeppelin-client,zeppelin-package,tis-zeppelin,zeppelin-distribution,zeppelin-interpreter-shaded -am'"
hosts: localhost
tasks:
- include_role:
name: compile
tags:
- zeppelin
- name: compile tis-plugin component tar package
vars:
ansible_group_priority: 10
exec_deploy: True
app_local_dir_name: "{{tis_plugin_release_dir_name}}"
tis_release_dir_name: "{{tis_plugin_release_dir_name}}"
git_src: "[email protected]:qlangtech/plugins.git"
target_file_pattern: .*\.(tpi|tar\.gz)$
maven_extra_params:
- '"-Pcentos -Pdefault-emr"'
# 测试期间先只用一种classifier
# hudi 相关的也先去掉: tis-incr/tis-sink-hudi-plugin,tis-datax/tis-datax-hudi-common,tis-datax/tis-datax-hudi-plugin
- '"-Paliyun-emr -Pcentos -pl tis-datax/tis-aliyun-jindo-sdk-extends/tis-datax-hdfs-aliyun-emr-plugin,tis-datax/tis-hive-plugin,tis-datax/tis-datax-hdfs-plugin,tis-datax/tis-datax-hdfs-reader-writer-plugin,tis-datax/tis-hive-flat-table-builder-plugin"'
- '"-Pcdh -Pcentos -pl tis-datax/tis-aliyun-jindo-sdk-extends/tis-aliyun-jindo-sdk-extends-hadoop3x,tis-datax/tis-aliyun-jindo-sdk-extends/tis-datax-hdfs-aliyun-emr-plugin,tis-datax/tis-hive-plugin,tis-datax/tis-datax-hdfs-plugin,tis-datax/tis-datax-hdfs-reader-writer-plugin,tis-datax/tis-hive-flat-table-builder-plugin"'
vars_files:
- vars.yml
hosts: localhost
tasks:
- include_role:
name: compile
tags:
- pkg-plugin
- name: build Uber package
vars_files:
- vars.yml
vars:
app_dir: '/tmp/tis-uber'
zk_parent_dir: '{{app_dir}}'
zk_dir_name: 'zookeeper'
bin_dir_name: "bin"
tis_app_dir: "{{app_dir}}/{{bin_dir_name}}"
data_dir_name: 'data'
relative_root_dir: '../'
tis_data_dir: '{{app_dir}}/{{data_dir_name}}'
tisconsole_db_type: 'derby'
tisconsole_db_dbname: 'tis_console_db'
shall_exec_restart: no
uber_pkg: yes
#defile in vars.yml
# uber_attach_plugins:
# - "tis-k8s-plugin"
# - "tis-datax-common-plugin"
# - "tis-datax-local-executor"
# - "tis-powerjob-common-plugin"
# # - "tis-datax-local-embedded-executor"
zk_user: tis
zk_group: tis
zk_node_id: 1
tis_tar_dist_dir: "{{ tis_release_dir }}/{{tis_release_dir_name}}/{{tis_pkg_version}}/tis-uber"
hosts: localhost
tasks:
- name: 'clean the targetDir {{app_dir}}'
file:
path: '{{app_dir}}'
state: absent
- name: "make uber target dir:{{ tis_tar_dist_dir }}"
file:
path: "{{ tis_tar_dist_dir }}"
state: directory
# - include_role:
# name: zookeeper
# vars:
# relative_root_dir: '../../'
# - name: "start zookeeper in {{zk_parent_dir}}/{{zk_dir_name}}"
# command: "./bin/zkServer.sh start"
# ignore_errors: false
# args:
# chdir: "{{zk_parent_dir}}/{{zk_dir_name}}"
# - name: sleep 10 sec
# command: sleep 10
# ignore_errors: yes
- include_role:
name: console
- name: "copy zeppelin context package from: {{tis_release_dir}}/{{tis_release_dir_name}}/tis-zeppelin.tar.gz"
unarchive:
src: "{{tis_release_dir}}/{{tis_release_dir_name}}/tis-zeppelin.tar.gz"
dest: "{{app_dir}}/"
remote_src: yes
# - name: shutdown zookeeper
# command: "./bin/zkServer.sh stop"
# ignore_errors: yes
# args:
# chdir: "{{zk_parent_dir}}/{{zk_dir_name}}"
- include_role:
name: assemble
# - include_role:
# name: cluster-state-collector
# - include_role:
# name: solr-core
# - name: set launch script
# template:
# src: "template/{{item}}.j2"
# dest: "{{app_dir}}/bin/{{item}}"
# force: no
# mode: '766'
# with_items:
# - "tis.sh"
- name: "init logs dir '{{app_dir}}/logs'"
file:
path: "{{app_dir}}/logs/gc"
state: directory
- name: arrange jars
shell: 'java -classpath ../web-start/lib/*:./lib/*:./conf com.qlangtech.tis.runtime.module.action.SysInitializeArrangeJars {{app_dir}}'
run_once: true
args:
chdir: "{{app_dir}}/tjs"
- include: install_ng_tis.yml
- name: "copy SQL script from tis_console_mysql.sql to {{tis_data_dir}}/sql/"
copy:
src: "tis_console_mysql.sql"
dest: "{{tis_data_dir}}/sql/"
- name: "archive data package,from {{tis_data_dir}}, target dir:{{ tis_tar_dist_dir }}/.."
archive:
path: "{{tis_data_dir}}"
dest: "{{tis_tar_dist_dir}}/{{tis_data_tar_file_name}}"
remove: false
delegate_to: "{{ inventory_hostname }}"
- name: "archive uber package,target dir:{{ tis_tar_dist_dir }}"
archive:
path: "{{app_dir}}"
dest: "{{tis_tar_dist_dir}}/{{tis_uber_tar_file_name}}"
remove: yes
- name: "make a soft link from {{tis_tar_dist_dir}}/{{tis_uber_tar_file_name}} to {{ tis_release_dir }}/{{tis_uber_tar_file_name}}"
file:
src: "{{tis_tar_dist_dir}}/{{tis_uber_tar_file_name}}"
dest: "{{ tis_release_dir }}/{{tis_uber_tar_file_name}}"
state: link
force: yes
- name: "deploy all tar package from uber builder"
include_role:
name: deploy-tar
tags: deploy
tags:
- uber
- name: "make uber docker image"
# vars_prompt:
# - name: "docker_password"
# prompt: "docker repository password"
# private: yes
vars_files:
- vars.yml
# - vars-uber-docker.yml
vars:
tisconsole_db_type: 'derby'
tisconsole_db_dbname: 'tis_console_db'
tis_incr_name: 'tis-console'
app_dir: '{{tis_release_dir}}/{{tis_release_dir_name}}/{{tis_incr_name}}/tis-boot'
bin_dir_name: "bin"
tis_app_dir: "{{app_dir}}/{{bin_dir_name}}"
data_dir_name: 'data'
relative_root_dir: '/opt/app/tis-uber'
app_home: "{{relative_root_dir}}"
tis_data_dir: '/opt/{{data_dir_name}}'
uber_docker_pkg: yes
docker_file_template: "uber_Dockerfile.j2"
docker_context_plugin_dependencies_files: []
docker_context_dependencies_files:
- {app: "{{tis_incr_name}}" ,tar_name: "{{tis_pkg_version}}/tis-uber/{{tis_uber_tar_file_name}}"}
- {app: "{{tis_incr_name}}" ,tar_name: "{{tis_incr_name}}/tis-boot"}
hosts: localhost
tasks:
- include_role:
name: tis-boot
- include_role:
name: tis-incr
tags:
- uber-docker
- name: package flink component tar package and deploy docker image to hub
vars_files:
- vars.yml
vars:
exec_deploy: False
tis_flink_extend_artifact_name: "tis-flink-extends-dist"
flink_extends_dist_jar_path: "{{src_root}}/{{tis_plugin_release_dir_name}}/tis-incr/tis-flink-extends/target/{{tis_flink_extend_artifact_name}}-{{tis_pkg_version}}.jar"
app_local_dir_name: "flink"
script_prefix: "{{app_local_dir_name}}-"
git_src: "[email protected]:qlangtech/flink.git"
git_branch: "tis-1.18.1"
target_file_pattern: .*\.(tpi|tar\.gz)$
tis_incr_name: "{{app_local_dir_name}}"
tis_incr_tar_name: "{{app_local_dir_name}}-{{git_branch}}-bin.tar.gz"
docker_file_template: "{{app_local_dir_name}}_Dockerfile.j2"
entrypoint_shell_name: "docker-entrypoint.sh"
docker_context_dependencies_files:
- {app: "{{tis_incr_name}}" ,tar_name: "{{tis_incr_tar_name}}"}
- {app: "{{tis_incr_name}}" ,tar_name: "{{tis_pkg_version}}/tis-uber/{{tis_data_tar_file_name}}"}
hosts: localhost
tasks:
- name: "register '{{flink_extends_dist_jar_path}}' status"
stat:
path: "{{flink_extends_dist_jar_path}}"
register: extends_dist_file_status
- assert:
that: extends_dist_file_status.stat.exists
fail_msg: "file: '{{flink_extends_dist_jar_path}}' must exists"
# - include_role:
# name: compile
- include_role:
name: flink
- include_role:
name: deploy-tar
tags: deploy
# make flink docker image
- include_role:
name: tis-incr
tags:
- flink-docker
- name: build TIS plugins Meta and deploy
vars_files:
- vars.yml
vars:
# git_src: "[email protected]:qlangtech/update-center2.git"
git_src: "[email protected]:qlangtech/update-center2.git"
app_local_dir_name: "update-center2"
tis_release_dir_name: "{{app_local_dir_name}}"
exec_deploy: False
hosts: localhost
tasks:
- include_role:
name: compile
- include_role:
name: update-center
tags:
- update-center
- name: build TIS plugins Meta and deploy
vars_files:
- vars.yml
vars:
git_src: "[email protected]:qlangtech/update-center2.git"
app_local_dir_name: "update-center2"
tis_release_dir_name: "{{app_local_dir_name}}"
exec_deploy: False
hosts: localhost
tasks:
- include_role:
name: docs
tags:
- docs
#- name: make tis-incr docker image
# # vars_prompt:
# # - name: "docker_password"
# # prompt: "docker repository password"
# # private: yes
# vars_files:
# - vars.yml
# hosts: localhost
# roles:
# - role: tis-incr
# tags:
# - incr
# - deploy
- name: "make powerjob-worker docker image"
# vars_prompt:
# - name: "docker_password"
# prompt: "docker repository password"
# private: yes
vars_files:
- vars.yml
vars:
tis_incr_name: 'tis-datax-executor'
docker_context_dependencies_files:
- {app: "{{tis_incr_name}}" ,tar_name: "{{tis_pkg_version}}/tis-uber/{{tis_data_tar_file_name}}"}
docker_context_plugin_dependencies_files:
- {app: "{{tis_incr_name}}" ,tar_name: "{{tis_incr_tar_name}}"}
- {app: "{{tis_incr_name}}" ,tar_name: "{{powerjob_tar_file_name}}"}
hosts: localhost
roles:
- role: tis-incr
tags:
- datax-docker
- import_playbook: install_struct.yml