process-module-architecture

4
2
Source

Process 流水线核心模块架构总览,涵盖流水线 CRUD、构建执行引擎、事件驱动机制、分层架构设计。当用户开发流水线核心功能、理解 Process 模块、修改构建逻辑或进行流水线相关开发时使用。

Install

mkdir -p .claude/skills/process-module-architecture && curl -L -o skill.zip "https://mcp.directory/api/skills/download/2687" && unzip -o skill.zip -d .claude/skills/process-module-architecture && rm skill.zip

Installs to .claude/skills/process-module-architecture

About this skill

Process 流水线核心模块架构指南

模块定位: Process 是 BK-CI 的核心模块,负责流水线的编排、调度与执行。

详细文档导航

本 Skill 提供 Process 模块的架构总览。如需深入了解各层实现细节,请查阅以下参考文档:

文档内容
1-api-layer.mdAPI 接口层详细分析(708 行)
2-service-layer.mdService 业务层详细分析(872 行)
3-engine-control.md构建引擎 Control 层分析(790 行)
4-dao-database.mdDAO 层与数据库表结构(901 行)
5-event-driven.md事件驱动机制详解(759 行)

使用建议: 先阅读本文档了解整体架构,再根据具体开发需求深入对应的参考文档。

一、模块整体结构

1.1 子模块划分

src/backend/ci/core/process/
├── api-process/          # API 接口定义层
│   └── src/main/kotlin/com/tencent/devops/process/api/
│       ├── user/         # 用户接口(20+文件)
│       ├── service/      # 服务间调用接口(25+文件)
│       ├── builds/       # 构建机接口(8文件)
│       ├── template/     # 模板接口(6文件)
│       └── op/           # 运维接口(12文件)
│
├── biz-base/             # 基础业务逻辑层(核心)
│   └── src/main/kotlin/com/tencent/devops/process/
│       ├── engine/
│       │   ├── dao/      # 数据访问层(20+文件)
│       │   ├── service/  # 核心服务(30+文件)
│       │   ├── pojo/     # 数据对象
│       │   │   └── event/# 事件定义(19文件)
│       │   └── control/  # 控制逻辑
│       └── service/      # 业务服务
│
├── biz-engine/           # 构建引擎层
│   └── src/main/kotlin/com/tencent/devops/process/engine/
│       ├── control/      # 调度控制器(9文件)
│       ├── atom/         # 插件执行
│       └── listener/     # 事件监听
│
├── biz-process/          # 业务处理层
│   └── src/main/kotlin/com/tencent/devops/process/
│       ├── api/          # API 实现(ResourceImpl)
│       ├── service/      # Facade 服务
│       ├── permission/   # 权限服务
│       └── trigger/      # 触发服务
│
├── boot-engine/          # 引擎启动模块
├── boot-process/         # 服务启动模块
└── model-process/        # 数据模型层(JOOQ 生成)

1.2 模块职责矩阵

模块职责核心类数量依赖关系
api-processREST API 接口定义91被 biz-process 实现
biz-process业务逻辑、API 实现100+依赖 biz-base
biz-base引擎核心服务、DAO185+依赖 model-process
biz-engine构建调度引擎25依赖 biz-base
model-processJOOQ 数据模型自动生成基础层

二、分层架构图

┌─────────────────────────────────────────────────────────────────────────┐
│                              请求入口                                    │
│                    HTTP Request / 服务间调用 / MQ 消息                    │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                         API 层 (api-process)                             │
│  ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐    │
│  │UserPipeline  │ │ServiceBuild  │ │BuildBuild    │ │UserTemplate  │    │
│  │Resource      │ │Resource      │ │Resource      │ │Resource      │    │
│  │(用户流水线)   │ │(服务间构建)   │ │(构建机调用)   │ │(模板管理)    │    │
│  └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘    │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                       业务层 (biz-process)                               │
│  ┌──────────────────────────────────────────────────────────────────┐   │
│  │                      ResourceImpl 实现层                          │   │
│  │  UserPipelineResourceImpl | ServiceBuildResourceImpl | ...       │   │
│  └──────────────────────────────────────────────────────────────────┘   │
│                                    │                                     │
│  ┌──────────────────────────────────────────────────────────────────┐   │
│  │                      Facade Service 层                            │   │
│  │  PipelineInfoFacadeService    - 流水线信息管理门面                  │   │
│  │  PipelineListFacadeService    - 流水线列表查询门面                  │   │
│  │  PipelineVersionFacadeService - 版本管理门面                       │   │
│  │  ParamFacadeService           - 参数管理门面                       │   │
│  └──────────────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                      基础业务层 (biz-base)                               │
│  ┌──────────────────────────────────────────────────────────────────┐   │
│  │                      Engine Service 层                            │   │
│  │  PipelineRepositoryService  - 流水线存储服务(110KB,核心)         │   │
│  │  PipelineRuntimeService     - 运行时服务(101KB,核心)            │   │
│  │  PipelineContainerService   - 容器管理服务                        │   │
│  │  PipelineStageService       - 阶段管理服务                        │   │
│  │  PipelineTaskService        - 任务管理服务                        │   │
│  └──────────────────────────────────────────────────────────────────┘   │
│                                    │                                     │
│  ┌──────────────────────────────────────────────────────────────────┐   │
│  │                      DAO 层                                       │   │
│  │  PipelineInfoDao | PipelineBuildDao | PipelineResourceDao        │   │
│  └──────────────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                      引擎层 (biz-engine)                                 │
│  ┌──────────────────────────────────────────────────────────────────┐   │
│  │                      Control 层 (核心调度)                         │   │
│  │  BuildStartControl | StageControl | ContainerControl | TaskControl│   │
│  │  BuildEndControl | BuildCancelControl | MutexControl             │   │
│  └──────────────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                      数据层 (model-process + MySQL)                      │
│  数据库:devops_process(共 92 张表)                                    │
└─────────────────────────────────────────────────────────────────────────┘

三、核心数据流

3.1 流水线创建流程

用户请求
    │
    ▼
UserPipelineResource.create()          # API 层
    │
    ▼
UserPipelineResourceImpl.create()      # 实现层
    │
    ▼
PipelineInfoFacadeService.createPipeline()  # Facade 层
    │
    ├─► 权限校验 (PipelinePermissionService)
    ├─► 模型校验 (ModelCheckPlugin)
    │
    ▼
PipelineRepositoryService.deployPipeline()  # Engine Service 层
    │
    ├─► PipelineInfoDao.create()        # 保存流水线信息
    ├─► PipelineResourceDao.create()    # 保存流水线模型
    └─► PipelineSettingDao.create()     # 保存流水线配置

3.2 构建执行完整流程(对应流程图)

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                        触发层                                                     │
├──────────────────────────────────────────────────────────────────────────────────────────────────┤
│  ┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐                             │
│  │ Quartz定时调度   │     │ API接口触发      │     │ Webhook触发     │                             │
│  │ PipelineQuartz  │     │ UserBuild       │     │ PipelineBuild   │                             │
│  │ Service         │     │ Resource        │     │ WebhookService  │                             │
│  └────────┬────────┘     └────────┬────────┘     └────────┬────────┘                             │
│           │                       │                       │                                       │
│           └───────────────────────┼───────────────────────┘                                       │
│                                   ▼                                                               │
│                    ┌──────────────────────────────┐                                               │
│                    │ PipelineTimerService         │  ← 定时触发服务                                │
│                    │ PipelineBuildFacadeService   │  ← 构建门面服务                                │
│                    └──────────────┬───────────────┘                                               │
└───────────────────────────────────┼───────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                     拦截器链层                                                    │
├──────────────────────────────────────────────────────────────────────────────────────────────────┤
│  ┌─────────────────────────────────────────────────────────────────────────────────────────────┐ │
│  │                         PipelineInterceptorChain                                             │ │
│  │  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────────────────┐                  │ │
│  │  │ RunLock         │→ │ Queue           │→ │ TimerTriggerScmChange       │                  │ │
│  │  │ Interceptor     │  │ Interceptor     │  │ Interceptor                 │                  │ │
│  │  │ (运行锁检查)     │  │ (队列/并发控制)  │  │ (定时触发源码变更检查)        │                  │ │
│  │  └─────────────────┘  └─────────────────┘  └─────────────────────────────┘                  │ │
│  └──────────────────────────────────────────────────────────────────────────────────────────

---

*Content truncated.*

project-module-architecture

TencentBlueKing

Project 项目管理模块架构指南,涵盖项目 CRUD、成员管理、项目配置、标签管理、项目迁移。当用户开发项目管理功能、处理项目成员、配置项目属性或实现项目相关逻辑时使用。

126

microservice-infrastructure

TencentBlueKing

微服务基础设施指南,涵盖条件配置、事件驱动架构、服务间通信、国际化与日志等微服务架构的核心基础设施。当用户实现服务间调用、配置多环境、实现异步通信、处理国际化或规范日志输出时使用。

114

artifactory-module-architecture

TencentBlueKing

Artifactory 制品库模块架构指南,涵盖制品上传下载、存储后端适配、制品元数据、清理策略、权限控制。当用户开发制品库功能、处理制品存储、配置清理策略或实现制品管理时使用。

193

supporting-modules-architecture

TencentBlueKing

BK-CI 支撑模块架构指南,涵盖凭证管理(Ticket)、构建机环境(Environment)、通知服务(Notify)、构建日志(Log)、质量红线(Quality)、开放接口(OpenAPI)等支撑性服务模块。当用户开发这些模块功能或需要理解支撑服务架构时使用。

132

managing-devops-pipeline

TencentBlueKing

管理蓝盾流水线的构建操作,包括查询构建历史、获取启动参数、查看构建状态、启动构建。当用户提及流水线、构建、部署、CI/CD、蓝盾或需要触发构建任务时使用。

102

go-agent-development

TencentBlueKing

Go Agent 开发指南,涵盖 Agent 架构设计、心跳机制、任务执行、日志上报、升级流程、与 Dispatch 模块交互。当用户开发构建机 Agent、实现任务执行逻辑、处理 Agent 通信或进行 Go 语言开发时使用。

12

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

1,6871,430

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

1,2711,336

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

1,5441,153

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

1,359809

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

1,266728

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

1,495685