00 Bkci Global Architecture

Free Design

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

Install this skill

npx quanta-skills install 00-bkci-global-architecture

BK-CI 全局架构指南

BK-CI (BlueKing Continuous Integration) 是以流水线为核心的一站式 DevOps 平台,采用分层架构设计实现模块化协作。本文档提供系统全景视图,指导跨模块开发与架构设计。

Workflow

用户触发流水线 → 网关层认证路由 → 微服务层编排 → 构建机层执行 → 资源层存储
Progress:
  • [ ] Step 1: 理解系统分层架构
  • [ ] Step 2: 掌握核心模块协作
  • [ ] Step 3: 分析流水线执行流程
  • [ ] Step 4: 学习场景化开发路径
  • [ ] Step 5: 验证架构理解

Step 1: 理解系统分层架构

BK-CI 采用五层架构设计,各层职责明确且松耦合:

用户层 → 网关层 → 微服务层 → 构建机层 → 资源层

分层架构详解

| 层级 | 组件 | 职责 |

|------|------|------|

| 用户层 | Web 前端/OpenAPI/Webhook | 提供用户交互入口 |

| 网关层 | OpenResty(Nginx+Lua) | 路由转发、身份认证、限流 |

| 微服务层 | Process/Auth/Store等 | 核心业务逻辑处理 |

| 构建机层 | Agent/Worker | 任务执行与日志上报 |

| 资源层 | MySQL/Redis/ES | 数据持久化与检索 |

关键代码示例

// Process模块流水线触发接口

@RestController

@RequestMapping("/pipeline")

public class PipelineBuildController {

@PostMapping("/build")

public ResponseEntity<String> triggerBuild(@RequestBody BuildParam param) {

// 调用PipelineBuildFacadeService处理构建请求

return ResponseEntity.ok("Build triggered");

}

}

Step 2: 掌握核心模块协作

核心模块矩阵

| 模块 | 职责 | 依赖关系 |

|------|------|----------|

| Process | 流水线编排引擎 | 依赖 Auth 权限校验 |

| Auth | RBAC 权限系统 | 依赖 Ticket 凭证管理 |

| Dispatch | 构建机调度 | 依赖 Environment 环境配置 |

| Worker | 任务执行器 | 依赖 Store 插件管理 |

模块交互流程

Process → Dispatch (分配构建机) → Agent (领取任务) → Worker (执行插件) → Store (加载插件)

Step 3: 分析流水线执行流程

核心执行流程

触发构建 → 引擎调度 → 任务分发 → 构建执行 → 状态回传 → 通知处理

阶段详解

阶段一:触发构建

  • 支持手动/定时/代码变更/远程触发
  • 入口类:PipelineBuildFacadeService.buildManualStartup()

阶段二:引擎调度

// Stage责任链示例

public class StageControl {

private List<StageCommand> commands = Arrays.asList(

new CheckInterruptStageCmd(),

new CheckConditionalSkipStageCmd(),

new StartContainerStageCmd()

);

}

Step 4: 学习场景化开发路径

新手入门路径

1. 全局架构 → 2. 流水线模型 → 3. Process模块 → 4. 微服务开发

场景化技能组合

| 场景 | 技能组合 |

|------|----------|

| 插件开发 | store-module + worker-module + pipeline-plugin |

| 权限改造 | auth-module + common-technical-practices |

Step 5: 验证架构理解

验证步骤:

  • 通过 /api/pipeline/trigger 接口触发构建
  • 检查 Dispatch 模块日志确认构建机分配
  • 查看 Worker 执行日志验证任务完成
  • 验证 MySQL 中 pipeline_build 表状态更新
  • 成功标准:

    • 能准确描述各模块协作时序
    • 可独立完成跨模块功能开发
    • 能定位并解决模块间调用异常

    Frequently Asked Questions

    How do I install 00-bkci-global-architecture?

    Run `npx quanta-skills install 00-bkci-global-architecture` in your terminal. The skill will be installed to ~/.claude/skills/00-bkci-global-architecture/ and automatically available in Claude Code, Cursor, Copilot, and other AI coding agents.

    Is 00-bkci-global-architecture free?

    00-bkci-global-architecture is a Free skill — free — no account needed. You can install and use it immediately with no signup.

    What AI coding agents work with 00-bkci-global-architecture?

    00-bkci-global-architecture works with Claude Code, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Warp, and any AI coding agent that reads skill files. Once installed, the agent automatically gains the expertise defined in the skill.

    Last updated: 2026-03-01