|
37 | 37 |
|
38 | 38 |
|
39 | 39 | def _create_cr(volcengine_settings: dict[str, str], cr_settings: dict[str, str]): |
| 40 | + """Create Container Registry (CR) resources including instance, namespace, and repository. |
| 41 | +
|
| 42 | + This helper function creates the necessary Container Registry infrastructure |
| 43 | + on Volcengine cloud platform for storing Docker images used in the CI/CD pipeline. |
| 44 | +
|
| 45 | + Args: |
| 46 | + volcengine_settings: Dictionary containing Volcengine credentials and region |
| 47 | + cr_settings: Dictionary containing CR instance, namespace, and repo configuration |
| 48 | +
|
| 49 | + Raises: |
| 50 | + Exception: If any of the CR resource creation operations fail |
| 51 | + """ |
40 | 52 | vecr = VeCR( |
41 | 53 | access_key=volcengine_settings["volcengine_access_key"], |
42 | 54 | secret_key=volcengine_settings["volcengine_secret_key"], |
@@ -137,7 +149,60 @@ def pipeline( |
137 | 149 | cr_repo_name: str, |
138 | 150 | vefaas_function_id: str, |
139 | 151 | ) -> None: |
140 | | - """Integrate a veadk project to volcengine pipeline for CI/CD""" |
| 152 | + """Integrate a VeADK project with Volcengine pipeline for automated CI/CD deployment. |
| 153 | +
|
| 154 | + This command sets up a complete CI/CD pipeline that automatically builds, containerizes, |
| 155 | + and deploys your VeADK agent project whenever changes are pushed to the specified GitHub |
| 156 | + repository. It creates all necessary cloud infrastructure including Container Registry |
| 157 | + resources, FaaS functions, and pipeline configurations. |
| 158 | +
|
| 159 | + The pipeline integration process includes: |
| 160 | + 1. Creating Container Registry (CR) infrastructure (instance, namespace, repository) |
| 161 | + 2. Setting up or using existing VeFaaS function for deployment target |
| 162 | + 3. Configuring Volcengine Code Pipeline with GitHub integration |
| 163 | + 4. Establishing automated build and deployment workflows |
| 164 | + 5. Linking all components for seamless CI/CD operation |
| 165 | +
|
| 166 | + Pipeline Workflow: |
| 167 | + - Code changes pushed to GitHub trigger the pipeline |
| 168 | + - Source code is automatically pulled from the specified branch |
| 169 | + - Docker image is built using the specified VeADK base image |
| 170 | + - Built image is pushed to Volcengine Container Registry |
| 171 | + - VeFaaS function is updated with the new container image |
| 172 | + - Deployment completion notifications are provided |
| 173 | +
|
| 174 | + Args: |
| 175 | + veadk_version: Base VeADK image version for containerization. Can be: |
| 176 | + - 'preview': Latest preview/development version |
| 177 | + - 'latest': Latest stable release |
| 178 | + - Specific version (e.g., '1.0.0'): Pinned version for consistency |
| 179 | + github_url: Complete GitHub repository URL containing your VeADK project. |
| 180 | + Must be accessible with the provided GitHub token |
| 181 | + github_branch: Target branch to monitor for changes and deploy from. |
| 182 | + Typically 'main', 'master', or your preferred deployment branch |
| 183 | + github_token: GitHub personal access token with repository access permissions. |
| 184 | + Required for pipeline to access and monitor your repository |
| 185 | + volcengine_access_key: Volcengine cloud platform access key for authentication. |
| 186 | + If not provided, uses VOLCENGINE_ACCESS_KEY environment variable |
| 187 | + volcengine_secret_key: Volcengine cloud platform secret key for authentication. |
| 188 | + If not provided, uses VOLCENGINE_SECRET_KEY environment variable |
| 189 | + region: Volcengine cloud region for all resources (VeFaaS, CR, Pipeline). |
| 190 | + Defaults to 'cn-beijing'. Choose region closest to your users |
| 191 | + cr_instance_name: Name for the Container Registry instance that will store |
| 192 | + your Docker images. Defaults to 'veadk-user-instance' |
| 193 | + cr_namespace_name: Namespace within the Container Registry for organizing |
| 194 | + repositories. Defaults to 'veadk-user-namespace' |
| 195 | + cr_repo_name: Repository name within the Container Registry namespace |
| 196 | + for storing your project images. Defaults to 'veadk-user-repo' |
| 197 | + vefaas_function_id: Existing VeFaaS function ID to update with new deployments. |
| 198 | + If not provided, a new function will be created automatically |
| 199 | +
|
| 200 | + Note: |
| 201 | + - GitHub token must have appropriate permissions for repository access |
| 202 | + - All Volcengine resources will be created in the specified region |
| 203 | + - The pipeline will be triggered immediately upon creation for initial deployment |
| 204 | + - Subsequent deployments occur automatically when code is pushed to the monitored branch |
| 205 | + """ |
141 | 206 |
|
142 | 207 | click.echo( |
143 | 208 | "Welcome use VeADK to integrate your project to volcengine pipeline for CI/CD." |
|
0 commit comments