pipeline-model-architecture

Explain BK-CI's Pipeline Model four-layer architecture and serialization.

2.5k|521|Updated May 29, 2019
One-click install
npx skills add https://github.com/TencentBlueKing/bk-ci --skill pipeline-model-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pipeline-model-architecture
Source: https://github.com/TencentBlueKing/bk-ci/tree/main/ai/skills/pipeline-model-architecture
Command: npx skills add https://github.com/TencentBlueKing/bk-ci --skill pipeline-model-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

BK-CI's Pipeline Model architecture defines the core data structure used across the platform, enabling consistent representation, versioning, and serialization of pipelines from design to execution.

Core Features & Use Cases

  • Four-layer nested model: Model -> Stage[] -> Container[] -> Element[] that capture the entire pipeline hierarchy.
  • Serialization and versioning: JSON-based persistence with per-version model snapshots for history and rollback.
  • Validation and compatibility: transformCompatibility routines to migrate legacy fields and maintain backward compatibility.
  • Cross-system integration: a single canonical model used by frontend, backend, and execution engines.
  • Extensibility: supports templates and descriptors to compose reusable pipeline patterns.

Quick Start

Inspect the core model classes under src/backend/ci/core/common/common-pipeline to understand the Model, Stage, Container, and Element definitions. Create a minimal model with Model.defaultModel(pipelineName, userId) and progressively add stages/containers/elements; persist and load versions via T_PIPELINE_RESOURCE_VERSION; merge with runtime data from T_PIPELINE_BUILD_RECORD_MODEL when resuming runs.

Frequently Asked Questions about pipeline-model-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the BK-CI pipeline model architecture?

The BK-CI pipeline model architecture defines the core data structure used across the platform, enabling consistent representation, versioning, and serialization of pipelines from design to execution.

How do I structure a pipeline model in BK-CI?

You structure the pipeline model using a four-layer nested hierarchy: Model, Stage, Container, and Element. You can create a minimal model using Model.defaultModel and progressively add stages, containers, and elements.

How does BK-CI handle pipeline versioning and serialization?

BK-CI handles pipeline versioning using JSON-based persistence with per-version model snapshots. You persist and load versions via T_PIPELINE_RESOURCE_VERSION to maintain history and enable rollback capabilities.

How do I validate and migrate legacy pipeline fields in BK-CI?

You validate and migrate legacy pipeline fields using transformCompatibility routines. This mechanism migrates legacy fields to maintain backward compatibility across different pipeline model versions.

Can I resume a BK-CI pipeline run using the execution model?

Yes, you can resume pipeline runs by merging the persisted pipeline model with runtime data. You retrieve runtime data from T_PIPELINE_BUILD_RECORD_MODEL to resume execution from the correct state.

Does the BK-CI pipeline model support reusable templates?

Yes, the pipeline model supports extensibility through templates and descriptors. This allows you to compose reusable pipeline patterns and integrate a single canonical model across frontend, backend, and execution engines.

Related Skills