Skip to content

Commit ea8d3d2

Browse files
author
v_xiangbiaowu
committed
init upgrade document and update English pictures
1 parent 3751197 commit ea8d3d2

18 files changed

+313
-15
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ The Dimension node, Transform node, Sink node and [Visualis](https://github.com/
3535

3636
       Supports multi-version management, full life cycle management, monitoring alarm, checkpoint and savepoint management capabilities of streaming jobs.
3737

38-
![prod center](docs/images/stream_product_center.png)
38+
![prod center](docs/images/stream_product_center_en.png)
3939

4040
       Running information page:
4141

42-
![Running information](docs/images/stream_job_detail.png)
42+
![Running information](docs/images/stream_job_detail_en.png)
4343

4444
       Configurations page:
4545

46-
![Configurations](docs/images/stream_job_config_1.png)
47-
![Configurations](docs/images/stream_job_config_2.png)
46+
![Configurations](docs/images/stream_job_config_en_1.png)
47+
![Configurations](docs/images/stream_job_config_en_2.png)
4848

4949
       For more features, please refer to: [User Manual](docs/en_US/userManual/StreamisUserManual.md).
5050

bin/upgrade.sh

+205
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2022 WeBank
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
# Use to upgrade from 0.1.0 to 0.2.0
19+
20+
if [ -f "~/.bashrc" ];then
21+
echo "Warning! user bashrc file does not exist."
22+
else
23+
source ~/.bashrc
24+
fi
25+
26+
shellDir=`dirname $0`
27+
workDir=`cd ${shellDir}/..;pwd`
28+
29+
interact_echo(){
30+
while [ 1 ]; do
31+
read -p "$1 (Y/N)" yn
32+
if [[ "${yn}x" == "Yx" ]] || [[ "${yn}x" == "yx" ]]; then
33+
return 0
34+
elif [[ "${yn}x" == "Nx" ]] || [[ "${yn}x" == "nx" ]]; then
35+
return 1
36+
else
37+
echo "Unknown choose: [$yn], please choose again."
38+
fi
39+
done
40+
}
41+
42+
interact_echo "Are you sure the current version of Streamis is 0.1.0 and need to upgrade to 0.2.0 ?"
43+
if [[ $? == 0 ]]; then
44+
source ${workDir}/conf/db.sh
45+
echo "<------ Will connect to [${MYSQL_HOST}:${MYSQL_PORT}] to upgrade the tables in database... ------>"
46+
mysql -h$MYSQL_HOST -P$MYSQL_PORT -u$MYSQL_USER -p$MYSQL_PASSWORD -D$MYSQL_DB --default-character-set=utf8 << EOF 1>/dev/null
47+
/*Modify the table column*/
48+
ALTER TABLE \`linkis_stream_job\` MODIFY COLUMN \`project_name\` varchar(100) DEFAULT NULL;
49+
ALTER TABLE \`linkis_stream_job\` MODIFY COLUMN \`name\` varchar(200) DEFAULT NULL;
50+
ALTER TABLE \`linkis_stream_project\` MODIFY COLUMN \`name\` varchar(100) DEFAULT NULL;
51+
ALTER TABLE \`linkis_stream_task\` MODIFY COLUMN \`job_id\` varchar(200) DEFAULT NULL;
52+
ALTER TABLE \`linkis_stream_task\` MODIFY COLUMN \`linkis_job_id\` varchar(200) DEFAULT NULL;
53+
54+
ALTER TABLE \`linkis_stream_project\` ADD create_time datetime DEFAULT NULL;
55+
ALTER TABLE \`linkis_stream_project\` ADD last_update_by varchar(50) DEFAULT NULL;
56+
ALTER TABLE \`linkis_stream_project\` ADD last_update_time datetime DEFAULT NULL;
57+
ALTER TABLE \`linkis_stream_project\` ADD is_deleted tinyint unsigned DEFAULT 0;
58+
59+
/*Add indexes into the tables*/
60+
ALTER TABLE \`linkis_stream_job\` ADD UNIQUE KEY(\`project_name\`, \`name\`);
61+
ALTER TABLE \`linkis_stream_job_version\` ADD UNIQUE KEY(\`job_id\`, \`version\`);
62+
63+
/*Add new tables*/
64+
DROP TABLE IF EXISTS \`linkis_stream_project_privilege\`;
65+
CREATE TABLE \`linkis_stream_project_privilege\` (
66+
\`id\` bigint(20) NOT NULL AUTO_INCREMENT,
67+
\`project_id\` bigint(20) NOT NULL,
68+
\`user_name\` varchar(100) NOT NULL,
69+
\`privilege\` tinyint(1) DEFAULT '0' NOT NULL COMMENT '1:发布权限 ,2:编辑权限 ,3:查看权限',
70+
PRIMARY KEY (\`id\`) USING BTREE
71+
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='项目权限表';
72+
73+
DROP TABLE IF EXISTS \`linkis_stream_job_config_def\`;
74+
CREATE TABLE \`linkis_stream_job_config_def\` (
75+
\`id\` bigint(20) NOT NULL AUTO_INCREMENT,
76+
\`key\` varchar(100) COLLATE utf8_bin NOT NULL,
77+
\`name\` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT 'Equals option',
78+
\`type\` varchar(50) COLLATE utf8_bin NOT NULL DEFAULT 'NONE' COMMENT 'def type, NONE: 0, INPUT: 1, SELECT: 2',
79+
\`sort\` int(10) DEFAULT '0' COMMENT 'In order to sort the configurations that have the same level',
80+
\`description\` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT 'Description of configuration',
81+
\`validate_type\` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT 'Method the validate the configuration',
82+
\`validate_rule\` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT 'Value of validation rule',
83+
\`style\` varchar(200) COLLATE utf8_bin DEFAULT '' COMMENT 'Display style',
84+
\`visiable\` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0: hidden, 1: display',
85+
\`level\` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0: root, 1: leaf',
86+
\`unit\` varchar(25) COLLATE utf8_bin DEFAULT NULL COMMENT 'Unit symbol',
87+
\`default_value\` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT 'Default value',
88+
\`ref_values\` varchar(200) COLLATE utf8_bin DEFAULT '',
89+
\`parent_ref\` bigint(20) DEFAULT NULL COMMENT 'Parent key of configuration def',
90+
\`required\` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'If the value of configuration is necessary',
91+
\`is_temp\` tinyint(1) DEFAULT '0' COMMENT 'Temp configuration',
92+
PRIMARY KEY (\`id\`),
93+
UNIQUE KEY \`config_def_key\` (\`key\`)
94+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
95+
96+
DROP TABLE IF EXISTS \`linkis_stream_job_config\`;
97+
CREATE TABLE \`linkis_stream_job_config\` (
98+
\`job_id\` bigint(20) NOT NULL,
99+
\`job_name\` varchar(200) COLLATE utf8_bin NOT NULL COMMENT 'Just store the job name',
100+
\`key\` varchar(100) COLLATE utf8_bin NOT NULL,
101+
\`value\` varchar(500) COLLATE utf8_bin NOT NULL,
102+
\`ref_def_id\` bigint(20) DEFAULT NULL COMMENT 'Refer to id in config_def table',
103+
PRIMARY KEY (\`job_id\`,\`key\`),
104+
KEY \`config_def_id\` (\`ref_def_id\`)
105+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
106+
107+
/*Execute dml*/
108+
source ${workDir}/db/streamis_dml.sql
109+
110+
/*Data migration*/
111+
INSERT INTO \`linkis_stream_job_config\`(\`key\`, \`value\`, \`job_id\`, \`job_name\`, \`ref_def_id\`) SELECT ov.config_key, ov.config_value, ov.job_id, ov.job_name, d.id as refer_id from linkis_stream_configuration_config_value ov left join linkis_stream_job_config_def d on ov.config_key = d.key WHERE ov.config_value IS NOT NULL AND ov.job_name IS NOT NULL GROUP BY ov.job_id,ov.config_key;
112+
UPDATE linkis_stream_job_config SET \`key\` = "wds.linkis.flink.taskmanager.memory" WHERE \`key\` = "flink.taskmanager.memory";
113+
UPDATE linkis_stream_job_config SET \`key\` = "wds.linkis.flink.taskmanager.cpus" WHERE \`key\` = "flink.taskmanager.cpu.cores";
114+
UPDATE linkis_stream_job_config SET \`key\` = "wds.linkis.flink.taskmanager.cpus" WHERE \`key\` = "wds.linkis.flink.taskManager.cpus";
115+
UPDATE linkis_stream_job_config SET \`key\` = "wds.linkis.flink.taskmanager.numberOfTaskSlots" WHERE \`key\` = "flink.taskmanager.numberOfTaskSlots";
116+
UPDATE linkis_stream_job_config SET \`key\` = "wds.linkis.flink.app.parallelism" WHERE \`key\` = "wds.linkis.engineconn.flink.app.parallelism";
117+
UPDATE linkis_stream_job_config SET \`key\` = "wds.linkis.flink.jobmanager.memory" WHERE \`key\` = "flink.jobmanager.memory";
118+
UPDATE linkis_stream_job_config c SET \`ref_def_id\` = (SELECT d.id FROM linkis_stream_job_config_def d WHERE d.\`key\` = c.\`key\`) WHERE c.ref_def_id IS NULL;
119+
SELECT @flink_extra_param_id:=id FROM linkis_stream_job_config_def WHERE \`key\` = "wds.linkis.flink.custom";
120+
UPDATE linkis_stream_job_config SET ref_def_id = @flink_extra_param_id WHERE ref_def_id IS NULL;
121+
122+
/*Drop tables*/
123+
/*DROP TABLE \`linkis_stream_configuration_config_key\`*/
124+
/*DROP TABLE \`linkis_stream_configuration_config_value\`*/
125+
126+
/*update tables data*/
127+
delimiter %%
128+
129+
create procedure update_project()
130+
BEGIN
131+
-- 声明变量
132+
DECLARE projectname varchar(50);
133+
DECLARE done INT default 0;
134+
135+
-- 创建游标,并设置游标所指的数据
136+
DECLARE cur CURSOR for
137+
SELECT distinct j.project_name from linkis_stream_job j;
138+
-- 游标执行完,即遍历结束。设置done的值为1
139+
DECLARE CONTINUE HANDLER for not FOUND set done = 1;
140+
-- 开启游标
141+
open cur;
142+
-- 执行循环
143+
posLoop:
144+
LOOP
145+
-- 从游标中取出projectname
146+
FETCH cur INTO projectname ;
147+
-- 如果done的值为1,即遍历结束,结束循环
148+
IF done = 1 THEN
149+
LEAVE posLoop;
150+
-- 注意,if语句需要添加END IF结束IF
151+
END IF;
152+
insert into linkis_stream_project(\`name\`,\`create_by\`,\`create_time\`) values (projectname,\'system\',now());
153+
-- 关闭循环
154+
END LOOP posLoop;
155+
-- 关闭游标
156+
CLOSE cur;
157+
-- 关闭分隔标记
158+
END %%
159+
160+
create procedure update_project_privilege()
161+
BEGIN
162+
-- 声明变量
163+
DECLARE projectid bigint(20);
164+
DECLARE create_by varchar(50);
165+
DECLARE done INT default 0;
166+
167+
-- 创建游标,并设置游标所指的数据
168+
DECLARE cur CURSOR for
169+
SELECT distinct p.id,j.create_by from linkis_stream_project p,linkis_stream_job j where p.name =j.project_name ;
170+
-- 游标执行完,即遍历结束。设置done的值为1
171+
DECLARE CONTINUE HANDLER for not FOUND set done = 1;
172+
-- 开启游标
173+
open cur;
174+
-- 执行循环
175+
posLoop:
176+
LOOP
177+
-- 从游标中取出id
178+
FETCH cur INTO projectid ,create_by;
179+
-- 如果done的值为1,即遍历结束,结束循环
180+
IF done = 1 THEN
181+
LEAVE posLoop;
182+
-- 注意,if语句需要添加END IF结束IF
183+
END IF;
184+
185+
insert into linkis_stream_project_privilege (project_id ,user_name ,privilege) values (projectid,create_by,2);
186+
-- 关闭循环
187+
END LOOP posLoop;
188+
-- 关闭游标
189+
CLOSE cur;
190+
-- 关闭分隔标记
191+
END %%
192+
delimiter ;
193+
194+
call update_project;
195+
call update_project_privilege;
196+
197+
drop PROCEDURE update_project;
198+
drop PROCEDURE update_project_privilege;
199+
200+
EOF
201+
echo "<------ End to upgrade ------>"
202+
fi
203+
204+
205+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Streamis upgrade document. This article mainly introduces the upgrade steps of adapting DSS1.1.0 and linkis1.1.1 based on the original installation of Streamis service. The biggest difference between Streamis 0.2.0 and Streamis 0.1.0 is that it accesses DSS appconn and optimizes the start and stop of jobs.
2+
3+
# 1. Work before upgrading streamis
4+
Before upgrading Streamis, please install linkis1.1.1 and DSS1.1.0 or above, and ensure that the linkis Flink engine and DSS can be used normally. For the installation of DSS and linkis, please refer to [dss & linkis one click installation and deployment document](https://github.com/WeBankFinTech/DataSphereStudio-Doc/blob/main/zh_CN/%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2/DSS%E5%8D%95%E6%9C%BA%E9%83%A8%E7%BD%B2%E6%96%87%E6%A1%A3.md).
5+
6+
# 2. Streamis upgrade steps
7+
8+
## Install streamisappconn
9+
1) Delete the old version of StreamisAppconn package
10+
11+
Enter the following directory, find the appconn folder of streamis and delete it, if any:
12+
```shell script
13+
{DSS_Install_HOME}/dss/dss-appconns
14+
```
15+
16+
2) StreamisAppconn installation deployment
17+
18+
To install the DSS StreamisAppConn plug-in. Please refer to: [StreamisAppConn plug-in installation document](development/StreamisAppConnInstallationDocument.md)
19+
20+
## Installing the Streamis backend
21+
Update Lib in the obtained installation package to the path 'streamis-server/lib' under the streamis installation directory, and the file contents under 'streamis-server/conf' can be updated as needed.
22+
23+
Enter the installation directory and execute the update script to complete the update of database table structure and data:
24+
```shell script
25+
cd {Streamis_Install_HOME}
26+
sh bin/upgrade.sh
27+
```
28+
29+
Then complete the update and restart of the Streamis server through the following command:
30+
```shell script
31+
cd {Streamis_Install_HOME}/streamis-server
32+
sh bin/stop-streamis-server.sh
33+
sh bin/start-streamis-server.sh
34+
```
35+
36+
##Installing the Streamis front end
37+
First delete the front-end directory folder of the old version, and then replace it with the new front-end installation package.
38+
```
39+
mkdir ${STREAMIS_FRONT_PATH}
40+
cd ${STREAMIS_FRONT_PATH}
41+
#1.Delete front-end directory folder
42+
#2.Place the front-end package
43+
unzip streamis-${streamis-version}.zip
44+
```

docs/en_US/userManual/StreamisUserManual.md

+15-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
The entry path is **Home-DSS component application-Enter Streamis**
1212

13-
![Streamis entrance](../../images/create_stream_product_center.png)
13+
![Streamis entrance](../../images/create_stream_product_center_en.png)
1414
<center>Picture 2.1 Streamis entrance]</center>
1515

1616
## 3. Core indicators
@@ -19,7 +19,7 @@ The entry path is **Home-DSS component application-Enter Streamis**
1919

2020
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The core indicator shows the status summary of the Flink tasks uploaded to the project for execution. There are temporarily 7 states, showing the state name and the number of tasks in that state. The specific content is as shown in the figure below.
2121

22-
![Core indicators](../../images/home_page.png)
22+
![Core indicators](../../images/home_page_en.png)
2323
<center>Picture 3.1 Core indicators</center>
2424

2525
# 4. Job management
@@ -94,7 +94,7 @@ The entry path is **Home-DSS component application-Enter Streamis**
9494

9595
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Click **"job name"** of a task in the task list to provide the function of managing the task, or click **"three dots"** to the left of the name to call up the specific function configuration entry, as shown below:
9696

97-
![Configuration job](../../images/job_list.png)
97+
![Configuration job](../../images/job_list_en.png)
9898
<center>Picture4.3 Configuration job</center>
9999

100100
<br/>
@@ -109,9 +109,13 @@ The entry path is **Home-DSS component application-Enter Streamis**
109109

110110
<br/>
111111

112+
Click batch operation, and multiple job tasks can be restarted. Restart and snapshot will generate a snapshot and then restart. Restart directly will not generate a snapshot.
113+
114+
![jobbulk_operate](../../images/jobbulk_operate_en.png)
115+
112116
### 4.3.1. Job summary:
113117

114-
![Operating condition](../../images/stream_job_detail.png)
118+
![Operating condition](../../images/stream_job_detail_en.png)
115119
<center> Picture 4.4 Job summary</center>
116120

117121
<br/>
@@ -122,7 +126,7 @@ The entry path is **Home-DSS component application-Enter Streamis**
122126

123127
### 4.3.2. Job history:
124128

125-
![Execution history](../../images/stream_job_history.png)
129+
![Execution history](../../images/stream_job_history_en.png)
126130
<center>Picture 4.5 Job history</center>
127131

128132
<br/>
@@ -134,8 +138,8 @@ The entry path is **Home-DSS component application-Enter Streamis**
134138

135139
### 4.3.3. Job config:
136140

137-
![Configuration](../../images/stream_job_config_1.png)
138-
![Configuration](../../images/stream_job_config_2.png)
141+
![Configuration](../../images/stream_job_config_en_1.png)
142+
![Configuration](../../images/stream_job_config_en_2.png)
139143
<center>Picture 4.6 Job config</center>
140144

141145
<br/>
@@ -159,7 +163,7 @@ The entry path is **Home-DSS component application-Enter Streamis**
159163

160164
**Flink Jar Job details**
161165

162-
![Job details](../../images/stream_job_flinkjar_jobcontent.png)
166+
![Job details](../../images/stream_job_flinkjar_jobcontent_en.png)
163167
<center>Picture 4.7 Flink Jar Job details</center>
164168

165169
<br/>
@@ -171,7 +175,7 @@ The entry path is **Home-DSS component application-Enter Streamis**
171175

172176
**Flink SQL job details**
173177

174-
![Job details](../../images/stream_job_flinksql_jobcontent.png)
178+
![Job details](../../images/stream_job_flinksql_jobcontent_en.png)
175179
<center>Picture 4.8 Flink SQL job details</center>
176180

177181
<br/>
@@ -192,10 +196,10 @@ The entry path is **Home-DSS component application-Enter Streamis**
192196

193197
<br/>
194198

195-
![Engineering Documents Home Page](../../images/project_source_file_list.png)
199+
![Engineering Documents Home Page](../../images/project_source_file_list_en.png)
196200
<center>Picture 5.1 Engineering Documents Home Page</center>
197201

198202
<br/>
199203

200-
![Upload project file](../../images/project_source_file_import.png)
204+
![Upload project file](../../images/project_source_file_import_en.png)
201205
<center>Picture 5.2 Upload project file</center>
Loading

docs/images/home_page_en.png

77.7 KB
Loading

docs/images/job_list_en.png

90.3 KB
Loading

docs/images/jobbulk_operate_en.png

70.4 KB
Loading
23.4 KB
Loading
59.3 KB
Loading
67 KB
Loading
62.5 KB
Loading

docs/images/stream_job_detail_en.png

58.7 KB
Loading
Loading
Loading

docs/images/stream_job_history_en.png

50.5 KB
Loading
124 KB
Loading

0 commit comments

Comments
 (0)