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

主集群和子集群间构建制品网关与流量网关的配置优化 #8505

Closed
4 tasks done
irwinsun opened this issue Mar 16, 2023 · 0 comments
Closed
4 tasks done
Assignees
Labels
area/ci/agent 构建机Agent issue area/ci/dispatcher CI 构建机调度issue area/ci/frontend CI 前端特性issue done Production environment in tencent has been deploy for gray UAT environment in tencent has been deploy grayed uat环境测试通过/test passed for uat stage kind/enhancement 功能改进特性 kind/feat/tech 技术性特性 streams/done stream 生产部署成功 streams/for gray stream 灰度环境部署成功 streams/grayed stream 灰度环境测试通过

Comments

@irwinsun
Copy link
Member

irwinsun commented Mar 16, 2023

What would you like to be added:
对流量网关和制品网关配置重新梳理复用

Why is this needed:
现有配置不灵活,无法满足全球化多集群间的文件流传输。 目前改动尽量小,不影响现有用户体验的情况下,灵活满足全球化集群的文件流传输需求。

前端方案:

  • 环境管理-->节点--> (第三方构建机/导入节点)---> 导入界面
1、如果后端gateway接口数据返回data为空,没有出现地点选项,则保持现有的逻辑不变。

2、如果后端gateway接口数据返回data不为空,出现了地点选项,则将默认选中修改为由用户主动选择,
再触发后台generateLink接口来生成 下载连接或 复制命令。

后端方案:

  • 【环境管理】【goAgent】
1、表T_ENVIRONMENT_SLAVE_GATEWAY  负责统一管理agent、worker用到和通信有关gateway配置。 
后续这张表记录的区域信息除了被UserThirdPartyAgentResource.getGateway() 列表在导入构建机节点的UI界面上,
还会负责保管公共构建机/无编译环境部分(不便于展示到导入构建机UI)。 因此需要新增2个字段: 

FILE_GATEWAY varchar(127) DEFAULT NULL COMMENT '文件网关地址'
VISIBILITY  bit(1) DEFAULT b'0' COMMENT '是否在界面可见';

其中 VISIBILITY 为true的才能在界面UserThirdPartyAgentResource.getGateway() 态接口返回
2、 增加OP接口,用于运营期间维护T_ENVIRONMENT_SLAVE_GATEWAY表新增数据,
 比如以后 海外新增大区,像新加坡,美西,法国。。。。等等
调用方式
curl -X POST --header "Content-Type: application/json" "localhost:21919/api/op/thirdPartyAgent/gateways' -d 
'{
    "zoneName": "sg",
    "showName": "新加坡",
    "gateway": "devops-devnet.yourdomain.com",
    "fileGateway": "bkrepo-devnet.yourdomain.com",
    "visibility": true
}'
3、【前端】在用户点击选择地域后触发调用 user/environment/thirdPartyAgent/projects/{project}/os/{OS}/generateLink?zoneName={zoneName}
【环境管理后台】拿到zone后,从1点上拿要与当前agent记录一起复用保存进record(已有的逻辑,要注意梳理, 如果没有拿到zone对应的数据,则走现有默认的逻辑)

4、【goAgent】
启动构建runBuild时,对goEnv增加两个变量,值为.agent.properties中对应的变量
DEVOPS_FILE_GATEWAY
DEVOPS_GATEWAY
  • 【dispatch】
与上述第4点一样,需要告诉编译环境/非编译环境上述2个环境变量。 通过environment的service接口获得,并缓存1分钟。 
上线之后,需要用上述第2点接口,追加一个公共构建机和一个无编译环境的网关地址记录。

  • 【worker-agent】
MarketAtomTask 设置处优先从传入的上述2个环境变量获得网关地址,注意: 不用再里面写区分是IDC还是DEVNET的,启动构建时,【goAgent】【dispatch】已经能知道并获得正确的网关地址。
而如果没有获得到上述2个变量(旧版)则兜底用现有的artifactory的接口逻辑以保持兼容。
这里要注意梳理重构。
@irwinsun irwinsun added kind/enhancement 功能改进特性 kind/feat/tech 技术性特性 labels Mar 16, 2023
@irwinsun irwinsun changed the title 优化 主集群和子集群间构建制品网关与流量网关的配置优化 Mar 16, 2023
@irwinsun irwinsun added area/ci/agent 构建机Agent issue area/ci/dispatcher CI 构建机调度issue labels Mar 16, 2023
@irwinsun irwinsun added the area/ci/frontend CI 前端特性issue label Mar 16, 2023
@vhwweng vhwweng self-assigned this Mar 16, 2023
irwinsun added a commit that referenced this issue Mar 22, 2023
主集群和子集群间构建制品网关与流量网关的配置优化 #8505(Agent)
irwinsun added a commit that referenced this issue Mar 22, 2023
主集群和子集群间构建制品网关与流量网关的配置优化 #8505(前端)
irwinsun added a commit that referenced this issue Mar 22, 2023
feat: 主集群和子集群间构建制品网关与流量网关的配置优化 #8505
bkci-bot added a commit that referenced this issue May 24, 2023
feat: 主集群和子集群间构建制品网关与流量网关的配置优化 #8505
bkci-bot added a commit that referenced this issue May 24, 2023
feat: 主集群和子集群间构建制品网关与流量网关的配置优化 #8505
bkci-bot added a commit that referenced this issue May 24, 2023
主集群和子集群间构建制品网关与流量网关的配置优化 #8505
bkci-bot added a commit that referenced this issue May 24, 2023
主集群和子集群间构建制品网关与流量网关的配置优化 #8505
@bkci-bot bkci-bot added for gray UAT environment in tencent has been deploy streams/for gray stream 灰度环境部署成功 labels May 24, 2023
@tangruotian tangruotian added grayed uat环境测试通过/test passed for uat stage streams/grayed stream 灰度环境测试通过 labels May 25, 2023
@bkci-bot bkci-bot added streams/done stream 生产部署成功 done Production environment in tencent has been deploy labels Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci/agent 构建机Agent issue area/ci/dispatcher CI 构建机调度issue area/ci/frontend CI 前端特性issue done Production environment in tencent has been deploy for gray UAT environment in tencent has been deploy grayed uat环境测试通过/test passed for uat stage kind/enhancement 功能改进特性 kind/feat/tech 技术性特性 streams/done stream 生产部署成功 streams/for gray stream 灰度环境部署成功 streams/grayed stream 灰度环境测试通过
Projects
None yet
Development

No branches or pull requests

7 participants