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对接GSE1.0/2.0支持灰度 #1602 #1621

Merged
merged 19 commits into from Dec 19, 2022

Conversation

wangyu096
Copy link
Collaborator

  1. 按照与GSE讨论的灰度方案结果,简化调用GSE场景。第一种,如果走GSE1.0, 全部使用云区域+ipv4的方式,调用thrift;第二种,如果走GSE 2.0, 那么统一使用GSE 2.0 HTTP API, 传入真实的从cmdb拿到的bk_agent_id。
  2. Job支持按照业务灰度对接GSE1.0/2.0(按任务权重对接影响范围较大,咱不提供)
  3. 考虑到agent状态查询、任务下发、结果查询之间的关联性,对于同一个任务来说,需要调用同一个GSE。处理如下: 在TaskExecuteServiceImpl中就根据特性开关确定使用GSE1.0/2.0。如果用GSE1.0,那么设置agentId为{云区域ID:IPv4}这种兼容模式;如果用GSE2.0,那么设置agentId为真实的从cmdb获取到的bk_agent_id属性。后续的Agent状态查询/任务下发,根据agentId的版本选择下发的GSE.
  4. 查询GSE任务结果使用GSE_TASK_ID判定版本(跟GSE预定,他们2.0的TASK_ID以GSE:V2:开头)
  5. 重构特性开关能力,并支持通过/actuator/refresh endpoint 动态刷新配置并处理配置刷新事件(EnvironmentChangeEvent)
  6. 支持动态刷新配置的能力,见 perf: Job 支持配置实时刷新 #1620 ,开发中

/**
* 特性开关配置
*/
@ConfigurationProperties(prefix = "job")
Copy link
Collaborator

Choose a reason for hiding this comment

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

记得修改所有环境的对应配置文件

Copy link
Collaborator Author

@wangyu096 wangyu096 Dec 15, 2022

Choose a reason for hiding this comment

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

ok,后续统一修改

@@ -57,14 +57,19 @@ public static ResourceScopeTypeEnum from(String type) {
return scopeType;
}
}
return null;
throw new IllegalArgumentException("No ResourceScopeTypeEnum constant: " + type);
Copy link
Collaborator

Choose a reason for hiding this comment

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

会破坏判断==null的代码,务必仔细检查调用该方法的逻辑

Copy link
Collaborator Author

@wangyu096 wangyu096 Dec 15, 2022

Choose a reason for hiding this comment

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

已排查,之前代码也没有对 == null 这种返回进行处理,反而会出现空指针。后续咱们这种枚举,如果值不合法可以统下,抛出IllegalArgumentException

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok

# 是否兼容bk_biz_id参数
enabled: true
features:
file_manage:
Copy link
Collaborator

Choose a reason for hiding this comment

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

不符合蓝鲸Chart规范,请修改为驼峰命名

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

已修改

enabled: {{ .Values.job.feature.toggle.esbApiParamBkBizId.enabled }}
features:
- id: file_manage
enabled: {{ .Values.job.features.file_manage.enabled }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

values字段不符合蓝鲸Chart规范,请修改为驼峰命名

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

已修改

@jsonwan
Copy link
Collaborator

jsonwan commented Dec 14, 2022

请补充容器化values变更日志:support-files\kubernetes\charts\bk-job\VALUES_LOG.md
请补充周边系统依赖关系声明文件:support-files\requirements.txt

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.

几个问题需要看下

@wangyu096
Copy link
Collaborator Author

请补充容器化values变更日志:support-files\kubernetes\charts\bk-job\VALUES_LOG.md 请补充周边系统依赖关系声明文件:support-files\requirements.txt

  1. VALUES_LOG.md 已补充
  2. GSE 当前暂无稳定的2.0版本,后续更新;当前的GSE 1.0 版本Job也能兼容,所以依赖上其实也是正确的

id: ResourceScopeToggleStrategy
# 特性策略初始化参数,kv结构,具体传入参数根据不同的StrategyId变化
params: {}
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

建议把去除的配置也声明下,否则会导致一直往配置文件中加项但不删除旧的项,日积月累后分不清哪些是有用的哪些是未用到的

feature:
file-manage:
features:
file_manage:
Copy link
Collaborator

Choose a reason for hiding this comment

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

spring的配置项风格一直都是用的中划线/驼峰形式,建议参考其他配置项/文件统一下标准

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok, 后续统一使用驼峰

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 66dddaa into TencentBlueKing:master Dec 19, 2022
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.

None yet

2 participants