Introduction to Cloud Native Build
About 327 wordsAbout 1 min
Cloud Native Build is based on the Docker ecosystem, with abstractions for environments, caches, and plugins. Its declarative syntax helps developers build software more efficiently.
- Declarative: Programmable, easy-to-share configuration syntax.
- Easy to manage: Source-controlled alongside code, version-tracked.
- Cloud Native: Resource pooling that reduces infrastructure operational overhead.
Build Environment Declaration
.cnb.yml
main:
push:
- docker:
image: node:20
stages:
- node -v
- npm install
- npm testBuild Cache Declaration
.cnb.yml
main:
push:
- docker:
image: node:20
volumes:
- /root/.npm:copy-on-write
stages:
- node -v
- npm install
- npm testDocker as Task Execution Environment
.cnb.yml
main:
push:
- stages:
- name: run with node 20
image: node:20
script: node -v
- name: run with node 21
image: node:21
script: node -vDocker Ecosystem Based Plugins
.cnb.yml
main:
push:
- stages:
- name: hello world
image: cnbcool/hello-worldOn-demand Computing Resources
.cnb.yml
main:
push:
- runner:
cpus: 64
docker:
image: node:20
stages:
- node -v
- npm install
- npm testWorkspaces
.cnb.yml
$:
vscode:
- runner:
cpus: 64
services:
- vscode
docker:
image: node:20
volumes:
- node_modules:copy-on-write
stages:
- npm installHigh Performance
Elastic CPU Scaling
Through runner.cpus, you can request CPU resources on demand, up to 64 cores.
Second-level Cloning
Based on OverlayFS, git-clone-yyds can complete code preparation in seconds, easily supporting 100GB+ super-large repositories.
Concurrent Caching
copy-on-write enables copy-on-write for caches, eliminating cache read-write conflicts in concurrent scenarios.
.cnb.yml
main:
push:
- runner:
cpus: 64
docker:
image: node:20
volumes:
- /root/.npm:copy-on-write
stages:
- node -v
- npm install
- npm test