Configuring the Build Environment
Configure a global runtime environment for the build task. There are two types of servers available: x86 and Arm (Kunpeng). For software running on different chip architectures, you need to select the corresponding hosts. For example, if your software is designed for Arm (Kunpeng) servers, select Arm (Kunpeng).
|
Executor Type |
Description |
|---|---|
|
LINUX |
|
|
LINUX_DOCKER |
|
|
WINDOWS |
|
|
MAC |
|
Constraints
When building with YAML, you have an available environment with custom executors.
Build on GUI
- Access the CodeArts Build homepage from the project page.
- On the CodeArts Build homepage, search for the target task and click its name. The build task configuration page is displayed.
CodeArts Build presets the Configure Build Environment action. Set the parameters according to Table 2.
Table 2 Build environment parameters Parameter
Description
Environment
x86/Arm (Kunpeng) server
NOTE:Select the appropriate type of host you intend to use for software running on different chipset architecture. For example, if your software is designed for Arm (Kunpeng) servers, select Arm (Kunpeng).
Execution Host
Select the compute resource used to run your build task. In CodeArts Build, virtual machines (VMs) are used. Execution hosts can be built-in or custom executors.
- Default pools include execution hosts provided by CodeArts Build with out-of-the-box availability. The default executor specifications are 2 vCPUs and 8 GB memory.
- Custom pools include compute resources provided by users. (For details, see Table 1.) They can be hosted in CodeArts Build after registration. CodeArts Build schedules these executors to execute build tasks.
Select your desired pool. Custom agent pools include agents added by yourselves. For details, see Agent Pools.
Mapping Between Host and Container Directories
Set up the directory mapping between the custom executor and the container, and then you can mount files like dependencies from the custom executor to the container for your builds. (This parameter is mandatory when the execution host is set to Custom Pools.)
If the Host Directory is set to /home and the Container Directory is set to /opt, then the content in the executor's local /home directory will be mounted to the /opt directory in the container.
Build with Code
Modify env settings in the YAML file by referring to the following sample code of build environment configurations.
1 2 3 4 5 6 7 |
version: 2.0 # The version number is required and must be set to 2.0. env: # Optional. It defines the build environment. x86 is used by default if neither env or envs is set. resource: type: docker # Agent pool type. The value can be docker or custom. Set this value to docker to run your build on a default executor, or choose custom when using a custom executor. arch: X86 # The host type of the build environment can be x86 or Arm. class: 8U16G # Define the specification, which can be 2U8G (2 vCPUs | 8 GB), 4U8G (4 vCPUs | 8 GB), 8U16G (8 vCPUs | 16 GB), 16U32G (16 vCPUs | 32 GB), or 16U64G (16 vCPUs | 64 GB). This parameter is not required when type is set to custom. pool: Mydocker #Set the agent pool name. This parameter is required when type is set to custom. |
Add the following code information to the YAML file for your code-based build by referring to the following sample code of BuildSpace.
You have an available environment with custom executors.
version: 2.0
buildspace: # BuildSpace is used.
fixed: true
path: kk
clean: true
clean_exclude:
- cache # Excluded path
- aa # Excluded path
- bb # Excluded path
|
Parameter |
Type |
Description |
|---|---|---|
|
fixed |
String |
Optional. Set this parameter when you need a fixed directory for build executions. In CodeArts Build, an empty path (for example, /devcloud/ws/sMMM/workspace/j_X/) is randomly assigned to a build task as the root directory by default. This directory is called a "BuildSpace". Even for build tasks in the same project, BuildSpaces are randomly assigned to them. However, a fixed BuildSpace path is necessary in some scenarios. CodeArts Build allows users to configure BuildSpace to specify a fixed directory for a build.
The default value is false. |
|
path |
String |
Optional. Set this parameter when you use a fixed directory for build executions. The fixed path is in the following format: /devcloud/slavespace/usr1/+"${domainId}"+/. You can set the path parameter to add a path after the fixed path. For example, if the path is set to kk, the fixed path is /devcloud/slavespace/usr1/+"${domainId}"+/kk. |
|
clean |
String |
Optional. Set this parameter when you require the fixed path to be cleared.
The default value is true. |
|
clean_exclude |
String |
Optional. Set this parameter when you want to exclude a few paths from the cleanup of the fixed path. Specify paths to exclude from the cleanup. Only level-1 folders in a fixed path can be specified. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot