Configuring the Build Environment
Configure a global runtime environment for a build task.
CodeArts Build also allows you to use custom executors, such as LINUX, LINUX_DOCKER, WINDOWS, and MAC (Linux, Linux Docker, Windows, and macOS executors). For build scenarios supported by these executors, see Table 1.
Executor Type |
Description |
---|---|
LINUX |
|
LINUX_DOCKER |
|
WINDOWS |
|
MAC |
|
Build on GUI
CodeArts Build presets the Configure Build Environment action. Set the parameters according to Table 2.
Parameter |
Description |
---|---|
Environment |
x86/Kunpeng (Arm) server
NOTE:
Select the appropriate type of host you intend to use for software running on different chipset architecture. Your software will run better on a server using the same architecture. Kunpeng servers are Arm-based. |
Execution Host |
Select the compute resource used to run your build task. In CodeArts Build, virtual machines (VMs) are used. Executors can be built-in or custom executors.
You can select a built-in or custom executor. A custom executor is the agent executor added to the agent pool. For details about how to customize an executor, 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 mapping needs to be set when Execution Host is set to Custom executor.) 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 a mandatory and unique parameter that 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. docker indicates that the default executor is used, and custom indicates that a custom executor is used. arch:X86 # The host type of the build environment can be x86 or Arm. class:8 vCPUs | 16 GB # The specification can be: 2 vCPUs | 8 GB, 4 vCPUs | 8 GB, 8 vCPUs | 16 GB, 16 vCPUs | 32 GB, or 16 vCPUs | 64 GB. This parameter is not required when the agent pool type is set to a custom one. pool:Mydocker #Agent pool name. This parameter is required when the agent pool type is set to a custom one. |
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. 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. The fixed path is in the following format: /opt/cloud/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 /opt/cloud/slavespace/usr1/+"${domainId}"+/kk. |
clean |
String |
Optional.
The default value is true. |
clean_exclude |
String |
Optional. 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