Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Job 支持容器执行 - 脚本任务 #2631 #2753

Merged
merged 90 commits into from
Feb 29, 2024

Conversation

wangyu096
Copy link
Collaborator

@wangyu096 wangyu096 commented Jan 26, 2024

DB 设计

  1. 新增 gse_script_execute_obj_task、gse_file_execute_obj_task 两张表,用来替换 gse_script_agent_task、gse_file_agent_task (原始表使用 host_id 不适合现在的容器执行设计)
  2. 执行对象 id(execute_obj_id)使用 resource_type:resource_instance_id 的方式。比如主机,执行对象 ID= "1:1001"。使用 execute_obj_id 关联执行对象
  3. gse_script_execute_obj_task、gse_file_execute_obj_task加入 task_instance_id, 为后续的 DB 分库分表方案做好准备。当前版本暂未使用

服务层

  1. 抽象核心模型,ExecuteObjectTask、ExecuteObject、ExecuteObjectGseKey、ExecuteObjectCompositeKey
  2. AgentXX.. 相关的地方,对应改成 ExecuteObjectXX 。这部分改动较多,代码 review 的时候可以简单看下或者跳过
  3. ScriptExecuteObjectTaskService/FileExecuteObjectTaskService
  4. 灰度设计。通过执行目标的格式判断数据写入和读取是用老的方式还是新的方式。见代码 StepIntanceBaseDTO.isSupportExecuteObjectFeature
  5. 日志使用 execute_obj_id 替换 host_id
  6. 执行详情历史查询/执行详情执行日志查询删除对使用 ip 查询的支持(已经经过 3 个大版本,无需继续兼容)

(fileLog.getStatus().equals(FileDistStatusEnum.DOWNLOADING.getValue())
|| fileLog.getStatus().equals(FileDistStatusEnum.UPLOADING.getValue())
|| fileLog.getStatus().equals(FileDistStatusEnum.WAITING.getValue()))
|| fileLog.getStatus().equals(FileDistStatusEnum.PULLING.getValue())));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议将状态判断逻辑放到FileDistStatusEnum类中实现,以利于后续扩展修改

(fileLog.getStatus().equals(FileDistStatusEnum.DOWNLOADING.getValue())
|| fileLog.getStatus().equals(FileDistStatusEnum.UPLOADING.getValue())
|| fileLog.getStatus().equals(FileDistStatusEnum.WAITING.getValue()))
|| fileLog.getStatus().equals(FileDistStatusEnum.PULLING.getValue())));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议将状态判断逻辑放到FileDistStatusEnum类中实现,以利于后续扩展修改

Copy link
Collaborator

@jsonwan jsonwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2个小问题需处理

@wangyu096 wangyu096 merged commit a4ca9d7 into TencentBlueKing:master Feb 29, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants