Remote Development and CI Equivalence with Cloud Native Build (CNB)
Remote development and CI share an identical Git‑based workflow, and CNB’s git‑clone‑yyds plugin plus declarative Dockerfile configuration enable rapid container startup, shared copy‑on‑write volume caching, and synchronized environment setup, making code preparation, dependency installation, and compile/test phases functionally equivalent across both contexts.
In software development, remote development and CI both rely on Git as the foundation for code management. Whether cloning code in CI or in a remote development environment, using VSCode for development, and then committing changes, the process is fundamentally the same.
CNB (Cloud Native Build) provides a git-clone-yyds plugin that enables second‑level code cloning in CI, and the same mechanism applies to remote development, giving it a rapid startup capability. This makes the code preparation phase equivalent between the two.
Beyond code retrieval, environment setup and dependency installation are also mirrored: remote development configures the environment and installs dependencies so code can run, while CI does the same for each build to ensure consistency. Using a Dockerfile to define the development environment in CNB guarantees that local and pipeline builds stay in sync.
The equivalence becomes most evident in the compile/test phase. For a large codebase such as AOSP (≈125 GB), local compilation may take ~46 minutes, whereas CI with CNB Volume caching reduces this to about 1 minute. The same Volume caching works in remote development, allowing incremental builds to hit the cache instantly and complete within a minute, even when many developers work concurrently.
CNB’s Volume caching is based on Copy‑on‑Write (CoW). A cached folder with CoW semantics is mounted into both remote development containers and CI containers; modifications inside the container do not affect the underlying cache, enabling safe, concurrent use by multiple developers without conflicts.
Remote development containers and CI containers start quickly because Docker images are cached on the host machine, further accelerating environment provisioning.
CNB remote development is declarative: the development environment is defined by a .ide/Dockerfile file, and the creation process is customized via a .cnb.yml configuration. Example configuration:
# .cnb.yml
$:
vscode:
- runner:
# 声明需要的开发资源
cpus: 64
docker:
# 自定义开发环境
build: .ide/Dockerfile
services:
- vscode
- docker
stages:
# 自定义创建流程
- name: ls
script: ls -alDeclarative configuration brings several benefits:
Version control and audit: pipeline‑as‑code lets the configuration live alongside source code, providing traceability and stability.
Reusability and sharing: common patterns, templates, and practices can be easily reused across projects or pipelines.
Maintainability and transparency: treating pipeline configuration as code makes it easier to understand, update, and maintain, fostering team communication.
Additional CNB remote development features include rapid startup (even for massive repositories), volume caching that supports concurrent hits, configuration roaming for VSCode settings, and on‑demand resource allocation where each branch becomes an environment that can be reclaimed when idle.
Overall, the tight coupling of Git, CI, and remote development means they are essentially the same workflow—remote development produces code changes, CI consumes them, and Git decouples the two. Viewing them as a unified product leads to more cohesive tooling and smoother developer experiences.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.