process-module-architecture

4
0
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.*

store-module-architecture

TencentBlueKing

Store 研发商店模块架构指南,涵盖插件/模板/镜像管理、版本发布、审核流程、商店市场、扩展点机制。当用户开发研发商店功能、发布插件、管理模板或实现扩展点时使用。

00

00-bkci-global-architecture

TencentBlueKing

BK-CI 全局架构指南,以流水线为核心的模块协作全景图,涵盖完整执行流程、模块依赖关系、数据流向、核心概念。当用户需要理解系统架构、进行跨模块开发、了解模块间协作或规划架构设计时优先阅读。

10

auth-module-architecture

TencentBlueKing

Auth 权限认证模块架构指南,涵盖 IAM 集成、RBAC 权限模型、资源权限校验、权限迁移、OAuth 认证。当用户开发权限功能、配置 IAM 资源、实现权限校验或处理认证流程时使用。

10

go-agent-development

TencentBlueKing

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

00

supporting-modules-architecture

TencentBlueKing

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

100

git-commit-specification

TencentBlueKing

Git 提交规范,涵盖 commit message 格式(feat/fix/refactor)、Issue 关联、分支命名、PR 提交准备、rebase 使用。当用户提交代码、编写 commit message、创建分支或准备 PR 时使用。

00

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.

643969

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.

591705

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."

318399

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.

340397

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.

452339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.