Design of a Code Deployment System
Discover the detailed System Design of a robust code deployment system. Outline the high-level architecture, define necessary APIs and storage schemas, and examine the build and deployment phases. Confirm how the final design satisfies all functional and non-functional requirements.
The previous lesson covered the fundamentals of the code deployment system, including requirements, resources, and key components. Now, we examine the high-level design.
High-level design
The high-level design integrates the components identified previously to meet functional and non-functional requirements.
The workflow operates as follows:
Users submit code to the
.version control system (VCS) Tool for managing and tracking code changes across versions The VCS triggers the
) service. The CI system integrates code changes from multiple developers into a shared repository.continuous integration (CI Platform that automatically builds and tests code changes after each commit The code is placed in the pub-sub system. The code build service retrieves it from the queue and converts it to a binary.
Generated artifacts (binaries) are stored in primary blob storage.
Deployment triggers the download and installation of artifacts on machines in each region.
The following API design details the system’s functional operations.
API design
Essential APIs for the code-building and deployment process include:
Code-build APIs
Key APIs for the code-build process:
Submit code: Submits code to a specified repository in the VCS.
submitCode(code, repository, branch, message)
submitCode() returns a commit hash that uniquely identifies the new commit within the repository. This hash references and later retrieves the commit. The API uses the following parameters:
Parameter | Description |
| The code submitted to the VCS. |
| This shows a path to a repository where the code is being submitted. |
| Within a VCS, a branch represents an independent instance of the primary code or repository, typically identified by a unique name. In our case, it shows the branch name where the code is submitted or edited. |
| An optional message during a commit. |
Trigger build: Triggers the build and preparation of the codebase for deployment.
triggerBuild(project_id, branch, commit_hash, configuration)
The triggerBuild() initiates the build process asynchronously ...