Hi all .

In this feature we need update the database schema. Because it is not yet
sure which version of this feature will go online, so I will temporarily
put the table schema change sql in the
incubator-dolphinscheduler/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
file, after determining the version number later Then modify the version
number

Thank you!

JUN GAO <gaojun2...@gmail.com> 于2020年7月15日周三 下午1:37写道:

> Hi @YiChao Yang .
> That`s  great !
>
>
> Yichao Yang <1048262...@qq.com> 于2020年7月15日周三 下午1:03写道:
>
>> Hi,
>> I am interested in 2, I will create an issue about this subtask.
>> &nbsp;Thx a lot.
>>
>>
>> Best,
>> Yichao Yang
>>
>>
>> ------------------ Original ------------------
>> From: JUN GAO <gaojun2...@gmail.com&gt;
>> Date: Wed,Jul 15,2020 0:58 PM
>> To: dev <dev@dolphinscheduler.apache.org&gt;, 向偲彪 <xiangcaib...@qq.com
>> &gt;
>> Subject: Re: [Proposal] Alert Plugin Design
>>
>>
>>
>> Hi all.
>>
>> I created a branch
>>
>> https://github.com/apache/incubator-dolphinscheduler/tree/alert_plugin_design
>> for
>> this feature.
>>
>> The issue about this feature is
>> https://github.com/apache/incubator-dolphinscheduler/issues/3049
>>
>>
>> *The todo list that I currently think of is as follows:*
>>
>> - [ 1] https://github.com/apache/incubator-dolphinscheduler/issues/3189
>> Add
>> DolphinScheduler SPI module, Plugin database schema, PluginLoader. Alert
>> SPI and Alert Plugin basic code development. Improvement of mail Alert
>> Plugin.&nbsp; @gaojun2048
>>
>> - [ 2] Improvement of the alert group function, in the alert group, an
>> alert instance can be created based on the existing alert plug-in.
>>
>> - [ 3] Delete recipients and CCs in the process definition and select the
>> associated alert group instead.
>>
>> - [ 4] Implement WeChat Alert Plugin.
>>
>> - [5 ] Implement Dingtalk Alert Plugin
>>
>> - [ 6] Upgrade tool development from the old version.
>>
>> Does anyone interested in this feature want to participate in this
>> feature?
>> You can reply to the email to pick up the tasks you are interested in.
>>
>>
>>
>> JUN GAO <gaojun2...@gmail.com&gt; 于2020年7月9日周四 下午7:32写道:
>>
>> &gt; @qiao zhanwei
>> &gt;
>> &gt; Can you help me create a branch for this proposal ?
>> &gt;
>> &gt; JUN GAO <gaojun2...@gmail.com&gt; 于2020年7月9日周四 下午7:24写道:
>> &gt;
>> &gt;&gt; @向偲彪 <xiangcaib...@qq.com&gt;&nbsp; I finished update the web
>> ui to form-create.
>> &gt;&gt;
>> &gt;&gt; JUN GAO <gaojun2...@gmail.com&gt; 于2020年6月30日周二 下午1:44写道:
>> &gt;&gt;
>> &gt;&gt;&gt; @向偲彪 <xiangcaib...@qq.com&gt;&nbsp; I read the document of
>> &gt;&gt;&gt; http://www.form-create.com/ , It`s a good web ui tool for
>> DS Plugin-in
>> &gt;&gt;&gt; . I will update the code in package
>> &gt;&gt;&gt; org.apache.dolphinscheduler.spi.params
>> &gt;&gt;&gt;
>> &gt;&gt;&gt; I noticed that the license of form-create is MIT, so don’t
>> forget to add
>> &gt;&gt;&gt; the reference of the license.
>> &gt;&gt;&gt;
>> &gt;&gt;&gt; JUN GAO <gaojun2...@gmail.com&gt; 于2020年6月29日周一 上午11:54写道:
>> &gt;&gt;&gt;
>> &gt;&gt;&gt;&gt; Ok, I will read the document about
>> http://form-create.com/ . And then
>> &gt;&gt;&gt;&gt; I will update the code of the PluginParams.
>> &gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt; 向偲彪 <xiangcaib...@qq.com&gt; 于2020年6月28日周日 上午9:30写道:
>> &gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; Regarding plug-inization, the front-end can use
>> form-create, which
>> &gt;&gt;&gt;&gt;&gt; supports json format data, but the UI only supports
>> iview and element-ui,
>> &gt;&gt;&gt;&gt;&gt; and the existing ans-ui needs to be replaced. The
>> form-create that
>> &gt;&gt;&gt;&gt;&gt; personally feels is better compatible with the page
>> style, and the document
>> &gt;&gt;&gt;&gt;&gt; details Wait, form-create link address:
>> http://form-create.com/
>> &gt;&gt;&gt;&gt;&gt <http://form-create.com/&gt;&gt;&gt;&gt;&gt>;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; DolphinScheduler(Incubator) committer
>> &gt;&gt;&gt;&gt;&gt; Caibiao Xiang 向偲彪
>> &gt;&gt;&gt;&gt;&gt; 790061...@qq.com
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> ------------------&amp;nbsp;原始邮件&amp;nbsp;------------------
>> &gt;&gt;&gt;&gt;&gt; 发件人:&amp;nbsp;"JUN GAO"<gaojun2...@gmail.com
>> &amp;gt;;
>> &gt;&gt;&gt;&gt;&gt; 发送时间:&amp;nbsp;2020年6月24日(星期三) 下午4:33
>> &gt;&gt;&gt;&gt;&gt; 收件人:&amp;nbsp;"dev"<dev@dolphinscheduler.apache.org
>> &amp;gt;;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; 主题:&amp;nbsp;[Proposal] Alert Plugin Design
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; Hi All, This is a part of the [Proposal]
>> DolphinScheduler Plugin Design
>> &gt;&gt;&gt;&gt;&gt;
>> https://github.com/apache/incubator-dolphinscheduler/issues/2869
>> &gt;&gt;&gt;&gt;&gt
>> <https://github.com/apache/incubator-dolphinscheduler/issues/2869&gt;&gt;&gt;&gt;&gt>
>> ;
>> &gt;&gt;&gt;&gt;&gt; Welcome all partners who are interested in this
>> issue to participate
>> &gt;&gt;&gt;&gt;&gt; in the
>> &gt;&gt;&gt;&gt;&gt; discussion and development contribution
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; Summary designPlugin definition &amp;amp; plugin
>> instances
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; The core of the plug-in design is that the upper
>> layer logic and the
>> &gt;&gt;&gt;&gt;&gt; specific implementation are decoupled by SPI. When
>> the system uses the
>> &gt;&gt;&gt;&gt;&gt; plug-in, it should create a plug-in instance based
>> on the plug-in
>> &gt;&gt;&gt;&gt;&gt; supported
>> &gt;&gt;&gt;&gt;&gt; by the current system. For example, the mail alert
>> plug-in will
>> &gt;&gt;&gt;&gt;&gt; provide the
>> &gt;&gt;&gt;&gt;&gt; required parameter list. When used in the system, an
>> instance of the
>> &gt;&gt;&gt;&gt;&gt; plug-in needs to be created based on the parameter
>> list. Another
>> &gt;&gt;&gt;&gt;&gt; example is
>> &gt;&gt;&gt;&gt;&gt; the Job of MR task, the Job plug-in will define the
>> required
>> &gt;&gt;&gt;&gt;&gt; parameters,
>> &gt;&gt;&gt;&gt;&gt; and then in the DAG we create the Job and generate
>> an instance of the
>> &gt;&gt;&gt;&gt;&gt; Job
>> &gt;&gt;&gt;&gt;&gt; plug-in.
>> &gt;&gt;&gt;&gt;&gt; Configuration parameters &amp;amp; configuration
>> files
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; In addition, there are some problems in configuring
>> the alert through
>> &gt;&gt;&gt;&gt;&gt; the
>> &gt;&gt;&gt;&gt;&gt; alert.properties method. For example, in some
>> enterprises, multiple
>> &gt;&gt;&gt;&gt;&gt; departments work on the DS, and different
>> departments need to configure
>> &gt;&gt;&gt;&gt;&gt; different WeChat alert and e-mail alert stmp
>> services. This scenario
>> &gt;&gt;&gt;&gt;&gt; cannot
>> &gt;&gt;&gt;&gt;&gt; be met by alert.properties. Therefore, we need to
>> support the function
>> &gt;&gt;&gt;&gt;&gt; of
>> &gt;&gt;&gt;&gt;&gt; creating multiple alert mode instances under one
>> alert mode plug-in. In
>> &gt;&gt;&gt;&gt;&gt; order to instantiate this capability and reduce the
>> configuration
>> &gt;&gt;&gt;&gt;&gt; files to
>> &gt;&gt;&gt;&gt;&gt; simplify installation and deployment, I provide all
>> the parameters
>> &gt;&gt;&gt;&gt;&gt; required
>> &gt;&gt;&gt;&gt;&gt; by the plug-in to the front end as a parameter
>> template for the
>> &gt;&gt;&gt;&gt;&gt; plug-in,
>> &gt;&gt;&gt;&gt;&gt; fill in when creating an instance of the plug-in on
>> the front-end
>> &gt;&gt;&gt;&gt;&gt; page, you
>> &gt;&gt;&gt;&gt;&gt; can achieve more An email alert function, and no
>> longer need to modify
>> &gt;&gt;&gt;&gt;&gt; the
>> &gt;&gt;&gt;&gt;&gt; alert.properties file through the background.
>> &gt;&gt;&gt;&gt;&gt; alert group &amp;amp; DS user
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; In the current DS version, the alert group is a
>> collection of users.
>> &gt;&gt;&gt;&gt;&gt; The
>> &gt;&gt;&gt;&gt;&gt; alert service finds the user list through the alert
>> group when sending
>> &gt;&gt;&gt;&gt;&gt; an
>> &gt;&gt;&gt;&gt;&gt; alert, and then obtains the email address of each
>> user and adds it to
>> &gt;&gt;&gt;&gt;&gt; the
>> &gt;&gt;&gt;&gt;&gt; recipient of the email alert. However, we found that
>> we can't manage
>> &gt;&gt;&gt;&gt;&gt; WeChat
>> &gt;&gt;&gt;&gt;&gt; alert and DingTalk alert through alert groups.
>> WeChat and nail alert
>> &gt;&gt;&gt;&gt;&gt; can
>> &gt;&gt;&gt;&gt;&gt; only be configured and used through the backend
>> alert.properties
>> &gt;&gt;&gt;&gt;&gt; configuration file. All we intend to redefine the
>> alert group, the
>> &gt;&gt;&gt;&gt;&gt; alert
>> &gt;&gt;&gt;&gt;&gt; group is defined as a collection of alert plug-in
>> instances, rather
>> &gt;&gt;&gt;&gt;&gt; than
>> &gt;&gt;&gt;&gt;&gt; just a collection of users.
>> &gt;&gt;&gt;&gt;&gt; workflow define &amp;amp; alert group
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; There are two fields in the current process
>> schedule, e-mail recipient
>> &gt;&gt;&gt;&gt;&gt; and
>> &gt;&gt;&gt;&gt;&gt; cc sender, which binds the process definition to
>> e-mail alerts to a
>> &gt;&gt;&gt;&gt;&gt; certain
>> &gt;&gt;&gt;&gt;&gt; extent. The actual situation is that when the
>> process is defined, the
>> &gt;&gt;&gt;&gt;&gt; alert
>> &gt;&gt;&gt;&gt;&gt; may not be used, or an alert method other than email
>> may be used. So we
>> &gt;&gt;&gt;&gt;&gt; need to redefine the relationship between the
>> process definition and
>> &gt;&gt;&gt;&gt;&gt; the
>> &gt;&gt;&gt;&gt;&gt; alert and alert group.
>> &gt;&gt;&gt;&gt;&gt; Front-end UI plug-in
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; http://www.alpacajs.org/docs/api/forms.html The
>> front-end architecture
>> &gt;&gt;&gt;&gt;&gt; supports the generation of front-end UI components
>> based on json. In
>> &gt;&gt;&gt;&gt;&gt; SPI, I
>> &gt;&gt;&gt;&gt;&gt; encapsulated the parameters of the plug-in, and all
>> the plug-in
>> &gt;&gt;&gt;&gt;&gt; parameters
>> &gt;&gt;&gt;&gt;&gt; will be automatically converted into json supported
>> by alpacajs.
>> &gt;&gt;&gt;&gt;&gt; User path
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; Based on the above design considerations, we have
>> redefined the user
>> &gt;&gt;&gt;&gt;&gt; path
>> &gt;&gt;&gt;&gt;&gt; of the alert function to make it more scalable and
>> easier to
>> &gt;&gt;&gt;&gt;&gt; understand and
>> &gt;&gt;&gt;&gt;&gt; use.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; The modified user path is as follows:
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; If the user needs to use the alert function, the
>> user can choose to
>> &gt;&gt;&gt;&gt;&gt; create
>> &gt;&gt;&gt;&gt;&gt; an alert instance based on the existing alert
>> plug-in in the alert
>> &gt;&gt;&gt;&gt;&gt; group
>> &gt;&gt;&gt;&gt;&gt; creation and management page. For example, the user
>> creates an alert
>> &gt;&gt;&gt;&gt;&gt; group
>> &gt;&gt;&gt;&gt;&gt; AlertGroupA, and then on the management page of
>> AlertGroupA, you can
>> &gt;&gt;&gt;&gt;&gt; choose
>> &gt;&gt;&gt;&gt;&gt; to create a specific alert method through the "Add
>> Alert Method"
>> &gt;&gt;&gt;&gt;&gt; operation.
>> &gt;&gt;&gt;&gt;&gt; When "Add Alert Method" is displayed, the existing
>> alert plug-in
>> &gt;&gt;&gt;&gt;&gt; (plug-in
>> &gt;&gt;&gt;&gt;&gt; The information can be put into plugin_define in the
>> plug-in definition
>> &gt;&gt;&gt;&gt;&gt; table in db). The user selects the corresponding
>> plug-in, and opens the
>> &gt;&gt;&gt;&gt;&gt; creation page, which displays all the required
>> parameters of the alert
>> &gt;&gt;&gt;&gt;&gt; plug-in. After the user completes, an alert method
>> instance is created.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; Multiple instances of multiple alert methods can be
>> created in an alert
>> &gt;&gt;&gt;&gt;&gt; group.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; The process definition is associated with an alert
>> group ID. The
>> &gt;&gt;&gt;&gt;&gt; process
>> &gt;&gt;&gt;&gt;&gt; definition is no longer associated with a specific
>> alert method, but is
>> &gt;&gt;&gt;&gt;&gt; instead associated with an alert group. In this way,
>> even if you need
>> &gt;&gt;&gt;&gt;&gt; to
>> &gt;&gt;&gt;&gt;&gt; modify the alert method in the future, you only need
>> to modify the
>> &gt;&gt;&gt;&gt;&gt; alert
>> &gt;&gt;&gt;&gt;&gt; method instance in the alert group management, and
>> no longer need to
>> &gt;&gt;&gt;&gt;&gt; modify
>> &gt;&gt;&gt;&gt;&gt; the process definition.
>> &gt;&gt;&gt;&gt;&gt; detailed designDatabase table designPlugin
>> definition table
>> &gt;&gt;&gt;&gt;&gt; plugin_define
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; id,
>> &gt;&gt;&gt;&gt;&gt; plugin_name,
>> &gt;&gt;&gt;&gt;&gt; plugin_params
>> &gt;&gt;&gt;&gt;&gt; Plugin instance table plugin_instance
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; id
>> &gt;&gt;&gt;&gt;&gt; plugin_define_id,
>> &gt;&gt;&gt;&gt;&gt; plugin_instance_params
>> &gt;&gt;&gt;&gt;&gt; Interface
>> designincubator-dolphinscheduler-maven-plugin
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> https://github.com/gaojun2048/incubator-dolphinscheduler-maven-plugin
>> &gt;&gt;&gt;&gt;&gt
>> <https://github.com/gaojun2048/incubator-dolphinscheduler-maven-plugin&gt;&gt;&gt;&gt;&gt>
>> ;
>> &gt;&gt;&gt;&gt;&gt; A custom maven plug-in, its role is to automatically
>> check the spi and
>> &gt;&gt;&gt;&gt;&gt; plug-in related dependencies, and can support adding
>> &gt;&gt;&gt;&gt;&gt; dolphinscheduler-plugin logo in the pom file to
>> allow DS to
>> &gt;&gt;&gt;&gt;&gt; automatically
>> &gt;&gt;&gt;&gt;&gt; generate related META-INF/services files at compile
>> time. For detailed
>> &gt;&gt;&gt;&gt;&gt; information, please refer to:
>> &gt;&gt;&gt;&gt;&gt;
>> https://github.com/gaojun2048/incubator-dolphinscheduler-maven-plugin
>> &gt;&gt;&gt;&gt;&gt
>> <https://github.com/gaojun2048/incubator-dolphinscheduler-maven-plugin&gt;&gt;&gt;&gt;&gt>;
>> SPIDolphinSchedulerPlugin
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; DS plug-in top-level interface, all DS plug-ins must
>> implement this
>> &gt;&gt;&gt;&gt;&gt; interface
>> &gt;&gt;&gt;&gt;&gt; AlertChannelFactory
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; Alert plug-in factory interface. All alert plug-ins
>> need to implement
>> &gt;&gt;&gt;&gt;&gt; this
>> &gt;&gt;&gt;&gt;&gt; interface. This interface is used to define the name
>> of the alert
>> &gt;&gt;&gt;&gt;&gt; plug-in
>> &gt;&gt;&gt;&gt;&gt; and the required parameters. The create method is
>> used to create a
>> &gt;&gt;&gt;&gt;&gt; specific
>> &gt;&gt;&gt;&gt;&gt; alert plug-in instance.
>> &gt;&gt;&gt;&gt;&gt; AlertChannel
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; The interface of the alert plug-in. The alert
>> plug-in needs to
>> &gt;&gt;&gt;&gt;&gt; implement
>> &gt;&gt;&gt;&gt;&gt; this interface. There is only one method process in
>> the interface. The
>> &gt;&gt;&gt;&gt;&gt; upper alert system will use this method and obtain
>> the return
>> &gt;&gt;&gt;&gt;&gt; information
>> &gt;&gt;&gt;&gt;&gt; of the alert through the AlertResult returned by the
>> method.
>> &gt;&gt;&gt;&gt;&gt; AlertData
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; alert content information, including id, title,
>> content, log.
>> &gt;&gt;&gt;&gt;&gt; AlertInfo
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; For alert-related information, when an upper-layer
>> system calls an
>> &gt;&gt;&gt;&gt;&gt; alert
>> &gt;&gt;&gt;&gt;&gt; plug-in instance, the instance of this type is
>> passed into the specific
>> &gt;&gt;&gt;&gt;&gt; alert plug-in through the process method. It
>> contains the alert content
>> &gt;&gt;&gt;&gt;&gt; AlertData and the parameter information filled in by
>> the front end of
>> &gt;&gt;&gt;&gt;&gt; the
>> &gt;&gt;&gt;&gt;&gt; alert plug-in instance called.
>> &gt;&gt;&gt;&gt;&gt; AlertResult
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; The alert plugin sends alert return information.
>> &gt;&gt;&gt;&gt;&gt; org.apache.dolphinscheduler.spi.params
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; Under this package is the plug-in parameter
>> definition. Our front-end
>> &gt;&gt;&gt;&gt;&gt; uses
>> &gt;&gt;&gt;&gt;&gt; the front-end library alpacajs
>> &gt;&gt;&gt;&gt;&gt; http://www.alpacajs.org/docs/api/forms.html,
>> &gt;&gt;&gt;&gt;&gt; which can dynamically generate the front-end based
>> on the parameter
>> &gt;&gt;&gt;&gt;&gt; list
>> &gt;&gt;&gt;&gt;&gt; json returned by the plug-in definition Ui.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; Under this package, we currently only encapsulate
>> RadioParam,
>> &gt;&gt;&gt;&gt;&gt; TextParam,
>> &gt;&gt;&gt;&gt;&gt; and PasswordParam, which are used to define text
>> type parameters, radio
>> &gt;&gt;&gt;&gt;&gt; parameters, and password type parameters,
>> respectively.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; AbsPluginParams This class is the base class for all
>> parameters, and
>> &gt;&gt;&gt;&gt;&gt; these
>> &gt;&gt;&gt;&gt;&gt; classes inherit from RadioParam. Each DS alert
>> plugin will return a
>> &gt;&gt;&gt;&gt;&gt; list of
>> &gt;&gt;&gt;&gt;&gt; AbsPluginParams in the implementation of
>> AlertChannelFactory.
>> &gt;&gt;&gt;&gt;&gt; org.apache.dolphinscheduler.alert.plugin
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; Under this package is the relevant code for the DS
>> Alert module to
>> &gt;&gt;&gt;&gt;&gt; load the
>> &gt;&gt;&gt;&gt;&gt; Alert plug-in. In the AlertChannelManager class, we
>> also need to save
>> &gt;&gt;&gt;&gt;&gt; the
>> &gt;&gt;&gt;&gt;&gt; loaded plugin to the database's plugin_define table.
>> &gt;&gt;&gt;&gt;&gt; some code of this issue
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; gaojun2048#1
>> &gt;&gt;&gt;&gt;&gt; <
>> https://github.com/gaojun2048/incubator-dolphinscheduler/pull/1&amp;gt;
>> &gt;&gt;&gt;&gt;&gt; todo list
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 1.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; Improvement of the alert group
>> function, in the alert
>> &gt;&gt;&gt;&gt;&gt; group, an alert
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; instance can be created based
>> on the existing alert
>> &gt;&gt;&gt;&gt;&gt; plug-in.
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 2.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; Delete recipients and CCs in
>> the process definition and
>> &gt;&gt;&gt;&gt;&gt; select the
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; associated alert group instead.
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 3.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; Submit the
>> dolphinscheduler-maven-plugin to the community.
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 4.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; Pull a separate branch from dev
>> for development.
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 5.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; Transformation of WeChat alert
>> function.
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 6.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; Renovation of the nail warning
>> function.
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 7.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; Improvement of mail alert
>> function.
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 8.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; Upgrade related tool
>> development from the old version.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; 概要设计插件定义与插件实例
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> 插件化设计的核心是上层逻辑和具体实现以SPI的方式解耦,系统在使用插件时,应该基于当前系统支持的插件创建插件实例。比如邮件告警插件,该插件会提供需要的参数列表,在系统中使用时需要基于参数列表来创建该插件的实例。再比如MR任务的Job,该Job插件会定义好需要的参数,然后在DAG中我们创建该Job并生成一个该Job插件的实例。
>> &gt;&gt;&gt;&gt;&gt; 配置参数&amp;amp;配置文件
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> 并且之前通过alert.properties的方式配置告警会有一些问题。比如在有些企业,多个部门都在DS上工作,不同的部门需要配置不同的微信告警和邮件告警stmp服务,这种场景是alert.properties这种方式无法满足的。所以我们需要支持在一个告警方式插件下创建多个告警方式实例的功能。为了实例这个能力并且能够减少配置文件简化安装部署,我把插件需要的所有参数都提供给前端,做为该插件的参数模板,在前端页面上创建该插件的实例时填写,即可实现创建多个邮件告警的功能,同时不再需要通过后台修改alert.properties文件。
>> &gt;&gt;&gt;&gt;&gt; 告警组和DS用户的关系
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> 在目前的DS版本中,告警组是用户的集合,告警服务在发送告警中通过告警组找到用户列表,然后获取每个用户的邮箱地址并添加到邮件告警的接收人中。但是,我们发现我们无法将微信告警和钉钉告警通过告警组来管理,微信和钉钉告警也只能通过后端的alert.properties配置文件来配置使用。所有我们打算重新定义告警组,将告警组定义为告警插件实例的集合,而不再只是用户的集合。
>> &gt;&gt;&gt;&gt;&gt; 流程定义与告警的关系
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> 当前流程定表中有邮件接收人和抄送人这两个字段,这在一定程度上将流程定义与邮件告警绑定了。实际情况是,流程定义时可能不使用告警,也可能使用除了邮件之外的告警方式。所以我们需要重新定义流程定义与告警和告警组三者之间的关系。
>> &gt;&gt;&gt;&gt;&gt; 前端UI插件化
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; http://www.alpacajs.org/docs/api/forms.html
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &amp;nbsp;该前端架构支持基于json生成前端ui组件。SPI里我对插件的参数做了封装,所有的插件参数最终会自动转换成alpacajs支持的json。
>> &gt;&gt;&gt;&gt;&gt; 用户路径
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; 基于以上设计考虑,我们重新定义了告警功能的用户路径,使其使用起来有更好的扩展性,更容易被理解和使用。
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; 修改后的用户路径如下:
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> 如果用户需要使用告警功能,用户可以在告警组创建和管理页面中选择基于已有的告警插件来创建告警实例。比如用户创建了告警组AlertGroupA,然后在AlertGroupA的管理页面可以通过“添加告警方式”操作来选择创建具体的告警方式,“添加告警方式”时通过下拉菜单展示目前系统中已有的告警插件(插件信息可以放到db里的插件定义表中plugin_define),用户选择对应的插件,会打开创建页面,该页面会展示该告警插件所有需要的参数,用户填写完成后即创建了一个告警方式的实例。
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; 一个告警组中可以创建多种告警方式的多个实例。
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> 流程定义关联告警组ID,流程定义不再关联具体的告警方式,而是改为关联一个告警组。这样即使以后需要修改告警方式,也只需要在告警组管理中修改告警方式实例即可,不再需要修改流程定义。
>> &gt;&gt;&gt;&gt;&gt; 详细设计数据库表设计插件定义表 plugin_define
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; id,
>> &gt;&gt;&gt;&gt;&gt; plugin_name,
>> &gt;&gt;&gt;&gt;&gt; plugin_params
>> &gt;&gt;&gt;&gt;&gt; 插件实例表 plugin_instance
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; id
>> &gt;&gt;&gt;&gt;&gt; plugin_define_id,
>> &gt;&gt;&gt;&gt;&gt; plugin_instance_params
>> &gt;&gt;&gt;&gt;&gt; 接口设计incubator-dolphinscheduler-maven-plugin
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> https://github.com/gaojun2048/incubator-dolphinscheduler-maven-plugin
>> &gt;&gt;&gt;&gt;&gt
>> <https://github.com/gaojun2048/incubator-dolphinscheduler-maven-plugin&gt;&gt;&gt;&gt;&gt>
>> ;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> 一个自定义maven插件,它的作用是可以自动检查spi和插件相关的依赖,并且可以支持在pom文件中添加dolphinscheduler-plugin标识从而让DS在编译时自动生成相关的META-INF/services文件。详细的信息可以参考
>> &gt;&gt;&gt;&gt;&gt; :
>> &gt;&gt;&gt;&gt;&gt;
>> https://github.com/gaojun2048/incubator-dolphinscheduler-maven-plugin
>> &gt;&gt;&gt;&gt;&gt
>> <https://github.com/gaojun2048/incubator-dolphinscheduler-maven-plugin&gt;&gt;&gt;&gt;&gt>;
>> SPIDolphinSchedulerPlugin
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; DS插件顶层接口,所有DS的插件都必须实现该接口
>> &gt;&gt;&gt;&gt;&gt; AlertChannelFactory
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> 告警插件工厂接口,所有告警插件需要实现该接口,该接口用来定义告警插件的名称,需要的参数,create方法用来创建具体的告警插件实例.
>> &gt;&gt;&gt;&gt;&gt; AlertChannel
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; 告警插件的接口,告警插件需要实现该接口,该接口中只有一个方法process
>> &gt;&gt;&gt;&gt;&gt; ,上层告警系统会该用该方法并通过该方法返回的AlertResult来获取告警的返回信息。
>> &gt;&gt;&gt;&gt;&gt; AlertData
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; 告警内容信息,包括id,标题,内容,日志。
>> &gt;&gt;&gt;&gt;&gt; AlertInfo
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> 告警相关信息,上层系统调用告警插件实例时,将该类的实例通过process方法传入具体的告警插件。内部包含告警内容AlertData和调用的告警插件实例的前端填写的参数信息。
>> &gt;&gt;&gt;&gt;&gt; AlertResult
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; 告警插件发送告警返回信息。
>> &gt;&gt;&gt;&gt;&gt; org.apache.dolphinscheduler.spi.params
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; 该包下是插件化的参数定义,我们前端使用alpacajs这个前端库
>> &gt;&gt;&gt;&gt;&gt; http://www.alpacajs.org/docs/api/forms.html
>> &gt;&gt;&gt;&gt;&gt; ,该库可以基于插件定义返回的参数列表json来动态生成前端的ui。
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> 该package下我们目前只封装了RadioParam,TextParam,PasswordParam,分别用来定义text类型的参数,radio参数和
>> &gt;&gt;&gt;&gt;&gt; password类型的参数。
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; AbsPluginParams
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> 该类是所有参数的基类,RadioParam这些类都继承了该类。每个DS的告警插件都会在AlertChannelFactory的实现中返回一个AbsPluginParams的list。
>> &gt;&gt;&gt;&gt;&gt; org.apache.dolphinscheduler.alert.plugin
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; 该包下是DS
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> Alert模块加载Alert插件的相关代码,已经大部分。AlertChannelManager类中我们还需要将加载到的插件保存到数据库的plugin_define表中。
>> &gt;&gt;&gt;&gt;&gt; 关于该Issue的一些代码
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; gaojun2048#1
>> &gt;&gt;&gt;&gt;&gt; <
>> https://github.com/gaojun2048/incubator-dolphinscheduler/pull/1&amp;gt;
>> &gt;&gt;&gt;&gt;&gt; todo list
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 1.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 告警组功能改造,在告警组中可以基于已有的告警插件创建告警实例。
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 2.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 流程定义中删除收件人,抄送人,改为选择关联告警组。
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 3.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp;
>> 将dolphinscheduler-maven-plugin提交到社区。
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 4.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 从dev拉单独分支,用于开发。
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 5.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 微信告警功能改造。
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 6.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 钉钉告警功能的改造。
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 7.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 邮件告警功能的完善。
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 8.
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; &amp;nbsp;&amp;nbsp; 从老版本升级相关的工具开发。
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; 欢迎对这个issue感兴趣的小伙伴参与讨论和开发贡献。
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; --
>> &gt;&gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;&gt; DolphinScheduler(Incubator)&amp;nbsp; PPMC
>> &gt;&gt;&gt;&gt;&gt; Jun Gao 高俊
>> &gt;&gt;&gt;&gt;&gt; gaojun2...@gmail.com
>> &gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt; --
>> &gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt; DolphinScheduler(Incubator)&nbsp; PPMC
>> &gt;&gt;&gt;&gt; Jun Gao 高俊
>> &gt;&gt;&gt;&gt; gaojun2...@gmail.com
>> &gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;&gt;
>> &gt;&gt;&gt;
>> &gt;&gt;&gt; --
>> &gt;&gt;&gt;
>> &gt;&gt;&gt; DolphinScheduler(Incubator)&nbsp; PPMC
>> &gt;&gt;&gt; Jun Gao 高俊
>> &gt;&gt;&gt; gaojun2...@gmail.com
>> &gt;&gt;&gt;
>> &gt;&gt;&gt;
>> &gt;&gt;
>> &gt;&gt; --
>> &gt;&gt;
>> &gt;&gt; DolphinScheduler(Incubator)&nbsp; PPMC
>> &gt;&gt; Jun Gao 高俊
>> &gt;&gt; gaojun2...@gmail.com
>> &gt;&gt;
>> &gt;&gt;
>> &gt;
>> &gt; --
>> &gt;
>> &gt; DolphinScheduler(Incubator)&nbsp; PPMC
>> &gt; Jun Gao 高俊
>> &gt; gaojun2...@gmail.com
>> &gt;
>> &gt;
>>
>> --
>>
>> DolphinScheduler(Incubator)&nbsp; PPMC
>> Jun Gao 高俊
>> gaojun2...@gmail.com
>
>
>
> --
>
> DolphinScheduler(Incubator)  PPMC
> Jun Gao 高俊
> gaojun2...@gmail.com
>
>

-- 

DolphinScheduler(Incubator)  PPMC
Jun Gao 高俊
gaojun2...@gmail.com

Reply via email to