You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dolphinscheduler.apache.org by yongqing <59...@qq.com> on 2020/12/21 06:14:06 UTC

回复: [DISCUSS]Code solution for project/workflow/task

+1




------------------&nbsp;原始邮件&nbsp;------------------
发件人:                                                                                                                        "dev"                                                                                    <dailidong66@gmail.com&gt;;
发送时间:&nbsp;2020年12月15日(星期二) 下午3:53
收件人:&nbsp;"dev"<dev@dolphinscheduler.apache.org&gt;;

主题:&nbsp;Re: [DISCUSS]Code solution for project/workflow/task



hi developers,
&nbsp; 8 days have passed.&nbsp; we have reached a conclusion that Schema 3 will be
our final solution for the project/workflow/task.

thanks everybody


Best Regards
---------------
DolphinScheduler(Incubator) PPMC
Lidong Dai 代立冬
dailidong66@gmail.com
---------------


On Wed, Dec 9, 2020 at 7:18 PM 3656562 <3656562@qq.com&gt; wrote:

&gt; Schema 3 + 1
&gt;
&gt;
&gt; 原始邮件
&gt; 发件人:leon baoleonbao@apache.org
&gt; 收件人:devdev@dolphinscheduler.apache.org
&gt; 发送时间:2020年12月7日(周一) 23:56
&gt; 主题:[DISCUSS]Code solution for project/workflow/task
&gt;
&gt;
&gt; ##1. Background *It is suggested to take a look at the design scheme of
&gt; splitting workflow JSON* the mail link about json splitting:
&gt; https://lists.apache.org/thread.html/r84ed046de63899476f067dd207496428812a8687045bb4485072ee2d%40%3Cdev.dolphinscheduler.apache.org%3E
&gt; The current business coding is proposed to be designed on the basis of
&gt; splitting workflow JSON, with three purposes: -The references among
&gt; workflow, relationship and job, and the external reference of dependent job
&gt; and sub workflow job are described by project code, workflow code and
&gt; business code -It supports the version management of workflow, job and
&gt; resource, and provides a stable business code -Solve the problems of
&gt; workflow, job copy, migration, export and import scene ID auto increment,
&gt; conflict and so on ##2. Coding design ###2.1 scheme I Project table,
&gt; workflow table and job table introduce a new business code field User
&gt; manual input / automatically generated by the system. Here, the UI prompts
&gt; the user to input the code. Internal reference is established through the
&gt; code. Subsequent modification costs are high Project code is globally
&gt; unique; workflow code and job code are project level unique Because the
&gt; possibility of business code modification is very low, all codes in the
&gt; current design do not support modification. The purpose of code
&gt; modification can be achieved through the function of export and import When
&gt; the workflow and job are copied, the user needs to input the new business
&gt; code, and the system will check the conflict When the workflow and job are
&gt; exported and imported, the business code (which can be edited) is displayed
&gt; on the UI, and the user can choose whether to change the business code;
&gt; when exporting, the UI adds the option of whether to export dependent jobs
&gt; at the same time When the workflow and job are migrated, the business code
&gt; (which can be edited) is displayed on the UI, and the user can choose
&gt; whether to change the business code; the project code can be directly
&gt; updated after the migration ###2.2 scheme 2 On the basis of scheme 1, there
&gt; will be three description words: code, name, description. Code and name are
&gt; likely to be repeatedly entered in practical application, while description
&gt; is rarely used. Therefore, the current scheme is to replace code with name
&gt; without adding a code field. As for the input of English name or Chinese
&gt; name, it is up to the user to decide whether to input English name or
&gt; Chinese name, and whether to use description for specific function
&gt; description field ###2.3 scheme 3 Project code, workflow code and job code
&gt; are globally unique. They are only responsible for the uniqueness of
&gt; identification data and are not related to business. They are automatically
&gt; generated by the system and do not provide page modification methods. 1.
&gt; Workflow, job create new workflow (task) / copy workflow from template:
&gt; generate new definition_ code/task_ code 2. Export: export exports all the
&gt; contents of the current project / workflow / task as a JSON file 3. Import:
&gt; check the definition_code/task_code exist -If it is a duplicate of
&gt; definition_code/task_code in another project , you will be prompted and the
&gt; import failed. -If it is the same as the definition_code/task_code in this
&gt; project , you will be prompted to override -If there is no duplicate, all
&gt; codes remain unchanged ##Design relation 3 The project code field is
&gt; maintained in the workflow table to identify which project the workflow
&gt; belongs to The relation table maintains the item code and workflow code
&gt; fields, and identifies the workflow of which project the relationship
&gt; belongs The relation table maintains the project code and job code of the
&gt; reference node (supports jobs that reference other projects) The item code
&gt; is maintained in the operation table to identify which project the job
&gt; belongs to The referenced workflow / job is determined by project code,
&gt; workflow code and job code The referenced workflow is determined by item
&gt; code and workflow code in sub workflow--
&gt; ==================================================================== ##
&gt; 1.背景 *建议先看一下拆分工作流json的设计方案* 关联邮件地址:
&gt; https://lists.apache.org/thread.html/r84ed046de63899476f067dd207496428812a8687045bb4485072ee2d%40%3Cdev.dolphinscheduler.apache.org%3E
&gt; 当前业务编码是建议在拆分工作流json基础上设计的,目的有3个: -
&gt; 工作流、关系、作业之间的引用,以及依赖作业、子工作流作业对外部的引用通过项目编码、工作流编码、业务编码进行描述 -
&gt; 支持工作流、作业、资源的版本管理,提供一个稳定不变的业务编码 - 解决工作流、作业的复制、迁移、导出导入场景的ID自增、冲突等问题 ## 2.编码设计
&gt; ### 2.1 方案一 项目表、工作流表、作业表引入一个新的业务编码字段
&gt; 用户手工输入/系统自动生成,这里UI提示建议用户输入编码,内部通过编码建立引用,后续修改成本高 项目编码全局唯一;工作流编码、作业编码项目级唯一
&gt; 因为业务编码修改的可能性非常低,所以当前设计所有编码都不支持修改,可以通过导出导入功能达到修改编码的目的
&gt; 工作流、作业复制时,需要用户输入新业务编码,系统做冲突检查提醒
&gt; 工作流、作业导出导入时,UI上显示业务编码(可编辑),用户可以选择是否变更业务编码;导出时UI增加是否同时导出依赖作业选项
&gt; 工作流、作业迁移时,UI上显示业务编码(可编辑),用户可以选择是否变更业务编码;迁移直接更新项目编码就可以了 ### 2.2 方案二
&gt; 在方案一基础上,会有三个描述字:code、name、description,code和name在实际应用中很可能是重复输入的,而description又很少应用,所以当前方案是用name替换code,不需要新增code字段,至于输入英文name还是中文name由用户自己决定,段具体的功能描述还是用description字段
&gt; ### 2.3 方案三 项目编码、工作流编码、作业编码全局唯一,只负责标识数据的唯一,不和业务相关,由系统自动生成,不提供页面修改方式。 1.
&gt; 工作流、作业从模板创建新工作流(任务)/复制工作流: 生成新的definition_code/task_code 2. 导出:
&gt; 导出将当前项目/工作流/任务所有内容导出为json文件 3. 导入: 检查definition_code/task_code是否存在 -
&gt; 如果和别的项目的definition_code/task_code重复,则提示并导入失败。 -
&gt; 如果和本项目内definition_code/task_code重复,则提示覆盖 - 如果没有重复的,则所有code不变导入 ## 3.引用关系设计
&gt; 工作流表维护项目编码字段,标识工作流归属于哪个项目 关系表维护项目编码、工作流编码字段,标识关系归属于哪个项目的工作流
&gt; 关系表维护引用节点的项目编码、作业编码(支持引用其他项目的作业) 作业表维护项目编码,标识作业归属于哪个项目
&gt; 依赖作业内部通过项目编码、工作流编码、作业编码确定引用的工作流/作业 子工作流内部通过项目编码、工作流编码确定引用的工作流
&gt; DolphinScheduler(Incubator) PPMC BaoLiang 鲍亮 leonbao@apache.org