Skip to content

Commit

Permalink
feat:流水线并发运行时,支持限制并发个数和排队 #10718
Browse files Browse the repository at this point in the history
  • Loading branch information
yongyiduan committed Oct 10, 2024
1 parent f0db948 commit 25e52a7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class PipelineSettingVersionDao {
.set(CONCURRENCY_CANCEL_IN_PROGRESS, setting.concurrencyCancelInProgress)
.set(SUCCESS_SUBSCRIPTION, JsonUtil.toJson(successSubscriptionList, false))
.set(FAILURE_SUBSCRIPTION, JsonUtil.toJson(failSubscriptionList, false))
.set(MAX_CON_RUNNING_QUEUE_SIZE, setting.maxConRunningQueueSize)
.set(MAX_CON_RUNNING_QUEUE_SIZE, setting.maxConRunningQueueSize ?: -1)
.execute()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ class PipelineSettingVersionService @Autowired constructor(
?: settingInfo.concurrencyCancelInProgress
settingInfo.waitQueueTimeMinute = ve.waitQueueTimeMinute ?: settingInfo.waitQueueTimeMinute
settingInfo.maxQueueSize = ve.maxQueueSize ?: settingInfo.maxQueueSize
settingInfo.maxConRunningQueueSize = ve.maxConRunningQueueSize ?: settingInfo.maxConRunningQueueSize
settingInfo.maxConRunningQueueSize = if (ve.maxConRunningQueueSize != -1) {
ve.maxConRunningQueueSize ?: settingInfo.maxConRunningQueueSize
} else {
null
}
}
// 来自前端的请求中,版本中的可能还不是正式生效的,如果和正式配置中有差异则重新获取名称
if (settingInfo.labels.isNotEmpty() && settingInfo.labels != labels && userId != null) {
Expand Down
4 changes: 2 additions & 2 deletions support-files/sql/1001_ci_process_ddl_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ CREATE TABLE IF NOT EXISTS `T_PIPELINE_SETTING` (
`SUCCESS_WECHAT_GROUP_MARKDOWN_FLAG` bit(1) NOT NULL DEFAULT b'0' COMMENT '成功的企业微信群通知转为Markdown格式开关',
`FAIL_WECHAT_GROUP_MARKDOWN_FLAG` bit(1) NOT NULL DEFAULT b'0' COMMENT '失败的企业微信群通知转为Markdown格式开关',
`MAX_PIPELINE_RES_NUM` int(11) DEFAULT '500' COMMENT '保存流水线编排的最大个数',
`MAX_CON_RUNNING_QUEUE_SIZE` int(11) DEFAULT NULL COMMENT '并发构建数量限制',
`MAX_CON_RUNNING_QUEUE_SIZE` int(11) DEFAULT NULL COMMENT '并发构建数量限制,为null时表示取系统默认值',
`BUILD_NUM_RULE` varchar(512) DEFAULT NULL COMMENT '构建号生成规则',
`CONCURRENCY_GROUP` varchar(255) DEFAULT NULL COMMENT '并发时,设定的group',
`CONCURRENCY_CANCEL_IN_PROGRESS` bit(1) DEFAULT b'0' COMMENT '并发时,是否相同group取消正在执行的流水线',
Expand Down Expand Up @@ -954,7 +954,7 @@ CREATE TABLE IF NOT EXISTS `T_PIPELINE_SETTING_VERSION` (
`FAIL_CONTENT` longtext,
`SUCCESS_WECHAT_GROUP_MARKDOWN_FLAG` bit(1) NOT NULL DEFAULT b'0',
`FAIL_WECHAT_GROUP_MARKDOWN_FLAG` bit(1) DEFAULT b'0',
`MAX_CON_RUNNING_QUEUE_SIZE` int(11) DEFAULT NULL COMMENT '并发构建数量限制',
`MAX_CON_RUNNING_QUEUE_SIZE` int(11) DEFAULT NULL COMMENT '并发构建数量限制,值为-1时表示取系统默认值。',
PRIMARY KEY (`ID`),
UNIQUE KEY `UNI_INX_TPSV_PROJECT_PIPELINE_VERSION` (`PROJECT_ID`,`PIPELINE_ID`,`VERSION`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='流水线基础配置版本表';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ BEGIN
AND TABLE_NAME = 'T_PIPELINE_SETTING_VERSION'
AND COLUMN_NAME = 'MAX_CON_RUNNING_QUEUE_SIZE') THEN
ALTER TABLE T_PIPELINE_SETTING_VERSION
ADD COLUMN `MAX_CON_RUNNING_QUEUE_SIZE` int(11) DEFAULT NULL COMMENT '并发构建数量限制';
ADD COLUMN `MAX_CON_RUNNING_QUEUE_SIZE` int(11) DEFAULT NULL COMMENT '并发构建数量限制,值为-1时表示取系统默认值。';
END IF;

COMMIT;
Expand Down

0 comments on commit 25e52a7

Please sign in to comment.