Skip to content

Commit 5916e63

Browse files
authored
Merge pull request #42 from WeBankFinTech/dev-0.2.0
update Streamis document
2 parents baf4f54 + fbe4da0 commit 5916e63

File tree

70 files changed

+868
-570
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+868
-570
lines changed

README-ZH.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,27 @@ Dimension节点、Transform节点、Sink节点 和 [Visualis](https://github.com
3535

3636
       支持流式作业的多版本管理、全生命周期管理、监控告警、checkpoint 和 savepoint 管理能力。
3737

38-
![流式应用生产](docs/images/生产中心.png)
38+
![流式应用生产](docs/images/stream_product_center.png)
3939

4040
       流式应用运行情况:
4141

42-
![流式应用运行情况](docs/images/流式作业运行情况.png)
42+
![流式应用运行情况](docs/images/stream_job_detail.png)
4343

4444
       流式应用参数配置:
4545

46-
![流式应用配置](docs/images/流式应用配置.png)
46+
![流式应用配置](docs/images/stream_job_config_1.png)
47+
![流式应用配置](docs/images/stream_job_config_2.png)
4748

4849
       更多功能,请参考:[Streamis 用户手册](docs/zh_CN/0.2.0/使用文档/Streamis用户手册.md)
4950

5051
----
5152

5253
## 依赖的生态组件
5354

54-
| 依赖的应用工具 | 描述 | Streamis 兼容版本 |
55-
| -------------- | -------------------------------------------------------------- | --------------|
56-
| [DataSphereStudio](https://github.com/WeBankFinTech/DataSphereStudio) | 数据应用开发管理集成框架。以工作流式的图形化拖拽开发体验,将满足从数据交换、脱敏清洗、分析挖掘、质量检测、可视化展现、定时调度到数据输出应用等,数据应用开发全流程场景需求。 | >= DSS1.0.1(已发布)|
57-
| [Linkis](https://github.com/apache/incubator-linkis) | 计算中间件 Apache Linkis,通过提供 REST/WebSocket/JDBC/SDK 等标准接口,上层应用可以方便地连接访问 MySQL/Spark/Hive/Presto/Flink 等底层引擎。 | >= Linkis1.0.3(已发布) |
55+
| 依赖的应用工具 | 描述 | Streamis 兼容版本 |
56+
|--------------|---------------------------------------------------------------|--------------|
57+
| [DataSphereStudio](https://github.com/WeBankFinTech/DataSphereStudio) | 数据应用开发管理集成框架。以工作流式的图形化拖拽开发体验,将满足从数据交换、脱敏清洗、分析挖掘、质量检测、可视化展现、定时调度到数据输出应用等,数据应用开发全流程场景需求。 | >= DSS1.1.0(已发布)|
58+
| [Linkis](https://github.com/apache/incubator-linkis) | 计算中间件 Apache Linkis,通过提供 REST/WebSocket/JDBC/SDK 等标准接口,上层应用可以方便地连接访问 MySQL/Spark/Hive/Presto/Flink 等底层引擎。 | >= Linkis1.1.1(已发布),部分功能需要Linkis 1.1.2支持 |
5859

5960
----
6061

@@ -72,13 +73,7 @@ Dimension节点、Transform节点、Sink节点 和 [Visualis](https://github.com
7273

7374
## 编译和安装部署
7475

75-
       请参照 [编译指引](docs/zh_CN/0.2.0/development/Streamis编译文档.md) ,用于编译 Streamis。
76-
77-
       在安装Streamis之前,请先安装 Linkis1.0.3 和 DSS1.0.1,可参照:[DSS + Linkis 安装部署文档](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)
78-
79-
       同时,请确保 Linkis Flink 引擎已可正常使用,可参照:[Linkis Flink 引擎插件安装文档](https://github.com/WeBankFinTech/Linkis-Doc/blob/master/zh_CN/Deployment_Documents/EngineConnPlugin%E5%BC%95%E6%93%8E%E6%8F%92%E4%BB%B6%E5%AE%89%E8%A3%85%E6%96%87%E6%A1%A3.md)
80-
81-
       最后,请参考 [Streamis 安装部署文档](docs/zh_CN/0.2.0/Streamis安装文档.md) ,用于安装部署 Streamis。
76+
       请参考 [Streamis 安装部署文档](docs/zh_CN/0.2.0/Streamis安装文档.md) ,用于安装部署 Streamis 及其依赖环境。
8277

8378

8479
----
@@ -100,8 +95,10 @@ Dimension节点、Transform节点、Sink节点 和 [Visualis](https://github.com
10095
| | 支持 FlinkSQL 和 FlinkJar 包等方式发布 | 支持 |
10196
| | 流式应用的多版本管理能力 | 支持 |
10297
| | 流式应用的参数配置和告警能力 | 支持 |
103-
| 服务高可用 | 应用高可用,服务多点,故障不影响使用 | 支持 |
98+
| 服务高可用 | 应用高可用,服务多点,状态快照实现容错处理,故障不影响使用 | 支持 |
10499
| 系统管理 | 节点、资源管理 | 支持 |
100+
|权限管理 |任务的操作权限控制 |支持 |
101+
105102
----
106103

107104
## 架构

README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +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/homePage_en.png)
38+
![prod center](docs/images/stream_product_center_en.png)
3939

4040
       Running information page:
4141

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

4444
       Configurations page:
4545

46-
![Configurations](docs/images/config_en.png)
46+
![Configurations](docs/images/stream_job_config_en_1.png)
47+
![Configurations](docs/images/stream_job_config_en_2.png)
4748

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

@@ -53,8 +54,8 @@ The Dimension node, Transform node, Sink node and [Visualis](https://github.com/
5354

5455
| Depended Component | Description | Streamis compatibility |
5556
| -------------- | -------------------------------------------------------------- | --------------|
56-
| [DataSphereStudio](https://github.com/WeBankFinTech/DataSphereStudio) | Data application development management framework. With a unified UI, the workflow-like graphical drag-and-drop development experience meets the entire lifecycle of data application development from data import, desensitization cleaning, data analysis, data mining, quality inspection, visualization, scheduling to data output applications, etc. | >= DSS1.0.1 (Released) |
57-
| [Linkis](https://github.com/apache/incubator-linkis) | Apache Linkis, builds a layer of computation middleware, by using standard interfaces such as REST/WS/JDBC provided by Linkis, the upper applications can easily access the underlying engines such as MySQL/Spark/Hive/Presto/Flink, etc. | >= Linkis1.0.3 (Released) |
57+
| [DataSphereStudio](https://github.com/WeBankFinTech/DataSphereStudio) | Data application development management framework. With a unified UI, the workflow-like graphical drag-and-drop development experience meets the entire lifecycle of data application development from data import, desensitization cleaning, data analysis, data mining, quality inspection, visualization, scheduling to data output applications, etc. | >= DSS1.1.0 (Released) |
58+
| [Linkis](https://github.com/apache/incubator-linkis) | Apache Linkis, builds a layer of computation middleware, by using standard interfaces such as REST/WS/JDBC provided by Linkis, the upper applications can easily access the underlying engines such as MySQL/Spark/Hive/Presto/Flink, etc. | >= Linkis1.1.1 (Released),some functions need to be supported by linkis 1.1.2 |
5859

5960
## Demo Trial environment
6061

@@ -70,13 +71,7 @@ The Dimension node, Transform node, Sink node and [Visualis](https://github.com/
7071

7172
## Compile and install deployment
7273

73-
       Please refer to [Compilation guidelines](docs/en_US/0.1.0/StreamisCompiledDocument.md) used to compile Streamis.
74-
75-
       Before installing Streamis, please install Linkis1.0.3 and DSS1.0.1 first, please refer to: [DSS deployment documents](https://github.com/WeBankFinTech/DataSphereStudio/blob/master/docs/en_US/ch1/DataSphereStudio_Compile_Manual.md) and [Linkis deployment documents](https://github.com/WeBankFinTech/Linkis-Doc/blob/master/en_US/Deployment_Documents/Quick_Deploy_Linkis1.0.md)
76-
77-
       At the same time, please make sure that the Linkis Flink engine can be used normally, please refer to: [Linkis Flink Engine Plug-in Installation Document](https://github.com/WeBankFinTech/Linkis-Doc/blob/master/en_US/Deployment_Documents/EngineConnPlugin_installation_document.md)
78-
79-
       Finally, please refer to [Streamis Installation and Deployment Document](docs/en_US/0.1.0/StreamisDeployment.md) for installing and deploying Streamis.
74+
please refer to [Streamis Installation and Deployment Document](docs/en_US/0.2.0/StreamisDeployment.md) for installing and deploying Streamis.
8075

8176
----
8277

@@ -98,8 +93,9 @@ The Dimension node, Transform node, Sink node and [Visualis](https://github.com/
9893
| | Support FlinkSQL and FlinkJar package release | Support |
9994
| | Multi-version management capabilities | Support |
10095
| | Configuration and alert management capabilities | Support |
101-
| Service high availability | Multiple services, failure does not affect the use | Application high availability |
96+
| Service high availability | Multiple services,State snapshot for fault tolerance, failure does not affect the use | Application high availability |
10297
| System Management | Node and Resource Management | Support |
98+
| Permission management | Task operation permission control | Support |
10399

104100
----
105101

bin/upgrade.sh

Lines changed: 205 additions & 0 deletions
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+

0 commit comments

Comments
 (0)