Skip to content

Commit

Permalink
Merge pull request #42 from WeBankFinTech/dev-0.2.0
Browse files Browse the repository at this point in the history
update Streamis document
  • Loading branch information
Davidhua1996 authored Jul 5, 2022
2 parents 99a0cd5 + ff7e237 commit 0f3a750
Show file tree
Hide file tree
Showing 70 changed files with 868 additions and 570 deletions.
27 changes: 12 additions & 15 deletions README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,27 @@ Dimension节点、Transform节点、Sink节点 和 [Visualis](https://github.com

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

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

       流式应用运行情况:

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

       流式应用参数配置:

![流式应用配置](docs/images/流式应用配置.png)
![流式应用配置](docs/images/stream_job_config_1.png)
![流式应用配置](docs/images/stream_job_config_2.png)

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

----

## 依赖的生态组件

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

----

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

## 编译和安装部署

       请参照 [编译指引](docs/zh_CN/0.2.0/development/Streamis编译文档.md) ,用于编译 Streamis。

       在安装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)

       同时,请确保 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)

       最后,请参考 [Streamis 安装部署文档](docs/zh_CN/0.2.0/Streamis安装文档.md) ,用于安装部署 Streamis。
       请参考 [Streamis 安装部署文档](docs/zh_CN/0.2.0/Streamis安装文档.md) ,用于安装部署 Streamis 及其依赖环境。


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

----

## 架构
Expand Down
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ The Dimension node, Transform node, Sink node and [Visualis](https://github.com/

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

![prod center](docs/images/homePage_en.png)
![prod center](docs/images/stream_product_center_en.png)

       Running information page:

![Running information](docs/images/statusDetail_en.png)
![Running information](docs/images/stream_job_detail_en.png)

       Configurations page:

![Configurations](docs/images/config_en.png)
![Configurations](docs/images/stream_job_config_en_1.png)
![Configurations](docs/images/stream_job_config_en_2.png)

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

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

| Depended Component | Description | Streamis compatibility |
| -------------- | -------------------------------------------------------------- | --------------|
| [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) |
| [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) |
| [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) |
| [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 |

## Demo Trial environment

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

## Compile and install deployment

       Please refer to [Compilation guidelines](docs/en_US/0.1.0/StreamisCompiledDocument.md) used to compile Streamis.

       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)

       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)

       Finally, please refer to [Streamis Installation and Deployment Document](docs/en_US/0.1.0/StreamisDeployment.md) for installing and deploying Streamis.
please refer to [Streamis Installation and Deployment Document](docs/en_US/0.2.0/StreamisDeployment.md) for installing and deploying Streamis.

----

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

----

Expand Down
205 changes: 205 additions & 0 deletions bin/upgrade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
#!/usr/bin/env bash
#
# Copyright 2022 WeBank
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Use to upgrade from 0.1.0 to 0.2.0

if [ -f "~/.bashrc" ];then
echo "Warning! user bashrc file does not exist."
else
source ~/.bashrc
fi

shellDir=`dirname $0`
workDir=`cd ${shellDir}/..;pwd`

interact_echo(){
while [ 1 ]; do
read -p "$1 (Y/N)" yn
if [[ "${yn}x" == "Yx" ]] || [[ "${yn}x" == "yx" ]]; then
return 0
elif [[ "${yn}x" == "Nx" ]] || [[ "${yn}x" == "nx" ]]; then
return 1
else
echo "Unknown choose: [$yn], please choose again."
fi
done
}

interact_echo "Are you sure the current version of Streamis is 0.1.0 and need to upgrade to 0.2.0 ?"
if [[ $? == 0 ]]; then
source ${workDir}/conf/db.sh
echo "<------ Will connect to [${MYSQL_HOST}:${MYSQL_PORT}] to upgrade the tables in database... ------>"
mysql -h$MYSQL_HOST -P$MYSQL_PORT -u$MYSQL_USER -p$MYSQL_PASSWORD -D$MYSQL_DB --default-character-set=utf8 << EOF 1>/dev/null
/*Modify the table column*/
ALTER TABLE \`linkis_stream_job\` MODIFY COLUMN \`project_name\` varchar(100) DEFAULT NULL;
ALTER TABLE \`linkis_stream_job\` MODIFY COLUMN \`name\` varchar(200) DEFAULT NULL;
ALTER TABLE \`linkis_stream_project\` MODIFY COLUMN \`name\` varchar(100) DEFAULT NULL;
ALTER TABLE \`linkis_stream_task\` MODIFY COLUMN \`job_id\` varchar(200) DEFAULT NULL;
ALTER TABLE \`linkis_stream_task\` MODIFY COLUMN \`linkis_job_id\` varchar(200) DEFAULT NULL;
ALTER TABLE \`linkis_stream_project\` ADD create_time datetime DEFAULT NULL;
ALTER TABLE \`linkis_stream_project\` ADD last_update_by varchar(50) DEFAULT NULL;
ALTER TABLE \`linkis_stream_project\` ADD last_update_time datetime DEFAULT NULL;
ALTER TABLE \`linkis_stream_project\` ADD is_deleted tinyint unsigned DEFAULT 0;
/*Add indexes into the tables*/
ALTER TABLE \`linkis_stream_job\` ADD UNIQUE KEY(\`project_name\`, \`name\`);
ALTER TABLE \`linkis_stream_job_version\` ADD UNIQUE KEY(\`job_id\`, \`version\`);
/*Add new tables*/
DROP TABLE IF EXISTS \`linkis_stream_project_privilege\`;
CREATE TABLE \`linkis_stream_project_privilege\` (
\`id\` bigint(20) NOT NULL AUTO_INCREMENT,
\`project_id\` bigint(20) NOT NULL,
\`user_name\` varchar(100) NOT NULL,
\`privilege\` tinyint(1) DEFAULT '0' NOT NULL COMMENT '1:发布权限 ,2:编辑权限 ,3:查看权限',
PRIMARY KEY (\`id\`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='项目权限表';
DROP TABLE IF EXISTS \`linkis_stream_job_config_def\`;
CREATE TABLE \`linkis_stream_job_config_def\` (
\`id\` bigint(20) NOT NULL AUTO_INCREMENT,
\`key\` varchar(100) COLLATE utf8_bin NOT NULL,
\`name\` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT 'Equals option',
\`type\` varchar(50) COLLATE utf8_bin NOT NULL DEFAULT 'NONE' COMMENT 'def type, NONE: 0, INPUT: 1, SELECT: 2',
\`sort\` int(10) DEFAULT '0' COMMENT 'In order to sort the configurations that have the same level',
\`description\` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT 'Description of configuration',
\`validate_type\` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT 'Method the validate the configuration',
\`validate_rule\` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT 'Value of validation rule',
\`style\` varchar(200) COLLATE utf8_bin DEFAULT '' COMMENT 'Display style',
\`visiable\` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0: hidden, 1: display',
\`level\` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0: root, 1: leaf',
\`unit\` varchar(25) COLLATE utf8_bin DEFAULT NULL COMMENT 'Unit symbol',
\`default_value\` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT 'Default value',
\`ref_values\` varchar(200) COLLATE utf8_bin DEFAULT '',
\`parent_ref\` bigint(20) DEFAULT NULL COMMENT 'Parent key of configuration def',
\`required\` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'If the value of configuration is necessary',
\`is_temp\` tinyint(1) DEFAULT '0' COMMENT 'Temp configuration',
PRIMARY KEY (\`id\`),
UNIQUE KEY \`config_def_key\` (\`key\`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP TABLE IF EXISTS \`linkis_stream_job_config\`;
CREATE TABLE \`linkis_stream_job_config\` (
\`job_id\` bigint(20) NOT NULL,
\`job_name\` varchar(200) COLLATE utf8_bin NOT NULL COMMENT 'Just store the job name',
\`key\` varchar(100) COLLATE utf8_bin NOT NULL,
\`value\` varchar(500) COLLATE utf8_bin NOT NULL,
\`ref_def_id\` bigint(20) DEFAULT NULL COMMENT 'Refer to id in config_def table',
PRIMARY KEY (\`job_id\`,\`key\`),
KEY \`config_def_id\` (\`ref_def_id\`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*Execute dml*/
source ${workDir}/db/streamis_dml.sql
/*Data migration*/
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;
UPDATE linkis_stream_job_config SET \`key\` = "wds.linkis.flink.taskmanager.memory" WHERE \`key\` = "flink.taskmanager.memory";
UPDATE linkis_stream_job_config SET \`key\` = "wds.linkis.flink.taskmanager.cpus" WHERE \`key\` = "flink.taskmanager.cpu.cores";
UPDATE linkis_stream_job_config SET \`key\` = "wds.linkis.flink.taskmanager.cpus" WHERE \`key\` = "wds.linkis.flink.taskManager.cpus";
UPDATE linkis_stream_job_config SET \`key\` = "wds.linkis.flink.taskmanager.numberOfTaskSlots" WHERE \`key\` = "flink.taskmanager.numberOfTaskSlots";
UPDATE linkis_stream_job_config SET \`key\` = "wds.linkis.flink.app.parallelism" WHERE \`key\` = "wds.linkis.engineconn.flink.app.parallelism";
UPDATE linkis_stream_job_config SET \`key\` = "wds.linkis.flink.jobmanager.memory" WHERE \`key\` = "flink.jobmanager.memory";
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;
SELECT @flink_extra_param_id:=id FROM linkis_stream_job_config_def WHERE \`key\` = "wds.linkis.flink.custom";
UPDATE linkis_stream_job_config SET ref_def_id = @flink_extra_param_id WHERE ref_def_id IS NULL;
/*Drop tables*/
/*DROP TABLE \`linkis_stream_configuration_config_key\`*/
/*DROP TABLE \`linkis_stream_configuration_config_value\`*/
/*update tables data*/
delimiter %%
create procedure update_project()
BEGIN
-- 声明变量
DECLARE projectname varchar(50);
DECLARE done INT default 0;
-- 创建游标,并设置游标所指的数据
DECLARE cur CURSOR for
SELECT distinct j.project_name from linkis_stream_job j;
-- 游标执行完,即遍历结束。设置done的值为1
DECLARE CONTINUE HANDLER for not FOUND set done = 1;
-- 开启游标
open cur;
-- 执行循环
posLoop:
LOOP
-- 从游标中取出projectname
FETCH cur INTO projectname ;
-- 如果done的值为1,即遍历结束,结束循环
IF done = 1 THEN
LEAVE posLoop;
-- 注意,if语句需要添加END IF结束IF
END IF;
insert into linkis_stream_project(\`name\`,\`create_by\`,\`create_time\`) values (projectname,\'system\',now());
-- 关闭循环
END LOOP posLoop;
-- 关闭游标
CLOSE cur;
-- 关闭分隔标记
END %%
create procedure update_project_privilege()
BEGIN
-- 声明变量
DECLARE projectid bigint(20);
DECLARE create_by varchar(50);
DECLARE done INT default 0;
-- 创建游标,并设置游标所指的数据
DECLARE cur CURSOR for
SELECT distinct p.id,j.create_by from linkis_stream_project p,linkis_stream_job j where p.name =j.project_name ;
-- 游标执行完,即遍历结束。设置done的值为1
DECLARE CONTINUE HANDLER for not FOUND set done = 1;
-- 开启游标
open cur;
-- 执行循环
posLoop:
LOOP
-- 从游标中取出id
FETCH cur INTO projectid ,create_by;
-- 如果done的值为1,即遍历结束,结束循环
IF done = 1 THEN
LEAVE posLoop;
-- 注意,if语句需要添加END IF结束IF
END IF;
insert into linkis_stream_project_privilege (project_id ,user_name ,privilege) values (projectid,create_by,2);
-- 关闭循环
END LOOP posLoop;
-- 关闭游标
CLOSE cur;
-- 关闭分隔标记
END %%
delimiter ;
call update_project;
call update_project_privilege;
drop PROCEDURE update_project;
drop PROCEDURE update_project_privilege;
EOF
echo "<------ End to upgrade ------>"
fi



Loading

0 comments on commit 0f3a750

Please sign in to comment.