Configuring Pipeline Execution Plans
Pipeline Execution Plan
You can configure event triggers, scheduled tasks, webhooks, parallel execution policies, and preemption policies for pipelines. These policies automate executions, trigger executions through third parties, allocate granular resources, and forcibly stop all running instances triggered by the same event.
Notes and Constraints
- For an event trigger:
- The branch is matched first, and then the path is matched. If both branch and path matching is successful, the pipeline will be triggered.
- Path exclusion takes precedence over path inclusion. If any changed files are not excluded, and the included path is not configured, the pipeline will be triggered; if the included path is configured and any of the changed files are included, the pipeline will be triggered.
- Tag exclusion takes precedence over tag inclusion. If a tag is included and excluded at the same time, the pipeline will not be triggered.
- Path matching covers the first 300 changed files per commit. To match more than 300 files, split them.
- A maximum of 10 scheduled tasks can be configured for a pipeline.
Prerequisites
- You have enabled and authorized CodeArts Pipeline.
- Your role is a project administrator or pipeline creator. For details about how to configure permissions, see Authorizing CodeArts Pipeline.
Configuring Event Triggers
Event triggers include code commit, merge request, and tag creation.
- Access the CodeArts Pipeline homepage.
- On the pipeline list page, search for the target pipeline, click
in the Operation column, and select Edit.
- Switch to the Execution Plan page, and then configure event triggers.
- Triggered upon code commits (in CodeArts Repo)
You can filter branches and paths by including or excluding specific ones. Target branches and paths will be monitored for code commits.
- Branch filter: allows you to include or exclude branches.
- Path filter: allows you to include or exclude paths where changed files locate.
Figure 1 Configuring code commit trigger - Triggered upon merge requests (in CodeArts Repo)
You can filter branches and paths by including or excluding specific ones. Target branches and paths will be monitored for merge request events.
Events:
- Create: triggered upon MR creation.
- Merge: triggered when an MR is merged. A code commit event will also be triggered.
- Reopen: triggered upon MR reopening.
- Update: triggered upon MR content, setting, or source code update. If you also enable Code update, the pipeline will be triggered only upon source code update.
- Code update: triggered upon source code update.
Branch description:
- Branch filter: allows you to include or exclude branches.
- Path filter: allows you to include or exclude paths where changed files locate.
Figure 2 Configuring merge request trigger - Triggered upon tag creation (in CodeArts Repo)
You can filter tags by including or excluding specific ones. The associated code repository will be monitored for tag creation.
Figure 3 Configuring tag creation trigger
- Triggered upon code commits (in CodeArts Repo)
- After the configuration, click Save. A message is displayed, indicating that the pipeline is saved successfully.
Configuring Scheduled Tasks
Set scheduled tasks to execute a pipeline at a specified time.
- Access the CodeArts Pipeline homepage.
- On the pipeline list page, search for the target pipeline, click
in the Operation column, and select Edit.
- Switch to the Execution Plan page.
- Click Create Now to create a scheduled task. Turn on the Enable toggle, and set the execution time.
Figure 4 Configuring a scheduled task
Table 1 Scheduled task Parameter
Description
Enable
Whether to enable the scheduled task.
Run On
Select the execution date.
Time Period
Select the execution period and time zone.
Time Interval
Set the interval for triggering the pipeline.
Execution Plan
Select a plan to be executed at a scheduled time. You can also create an execution plan. For details, see Configuring an Execution Plan.
To delete a scheduled task, click
in the upper right corner. To clone a scheduled task, click
in the upper right corner.
- After the configuration, click Save. A message is displayed, indicating that the pipeline is saved successfully.
Configuring Webhooks
You can configure webhooks to automatically trigger a pipeline through a third-party system.
- Access the CodeArts Pipeline homepage.
- On the pipeline list page, search for the target pipeline, click
in the Operation column, and select Edit.
- Switch to the Execution Plan page.
- Enable Webhook and set parameters as shown in Table 2.
Figure 5 Configuring a webhook trigger
Table 2 Webhook parameters Parameter
Description
Webhook URL
Copy the address to the third-party system trigger and use the POST method to call the address to run the pipeline.
IAM Authentication
- If you need to enable IAM authentication, add the user IAM token to the API request header. The following is a calling example:
curl --header "Content-Type: application/json" --header 'x-auth-token: XXXX (IAM Token)' --request POST --data "{}" Webhook trigger source
- If you do not need to enable IAM authentication. The following is a calling example:
curl --header "Content-Type: application/json" --request POST --data "{}" Webhook trigger source
- If you need to enable IAM authentication, add the user IAM token to the API request header. The following is a calling example:
- After the configuration, click Save. A message is displayed, indicating that the pipeline is saved successfully.
Configuring Parallel Execution
By default, five parallel executions are allowed in a pipeline. Excess instances will not be executed. Alternatively, you can change the maximum number of parallel instances (running and paused).
- Access the CodeArts Pipeline homepage.
- On the pipeline list page, search for the target pipeline, click
in the Operation column, and select Edit.
- Switch to the Execution Plan page.
- Enable Parallel Execution, set the max parallel instances and execution policy for extras.
Figure 6 Configuring parallel execution
Table 3 Parallel execution parameters Parameter
Description
Parallel Instances
Maximum parallel instances, which vary by your purchases and packages. For details, see CodeArts Pipeline specifications.
For Excess Instances
You can choose:
- Wait: Excess instances will wait for execution. You can check the queuing instances on the pipeline details page.
- Max. 100 queuing instances per pipeline.
- Instances will not be executed after 24 hours of waiting.
- You can manually cancel the waiting.
- Instance configurations are fixed once they enter the queue.
- Ignore: Excess instances will not be executed.
- Wait: Excess instances will wait for execution. You can check the queuing instances on the pipeline details page.
- After the configuration, click Save. A message is displayed, indicating that the pipeline is saved successfully.
Configuring Preemption
If there are several running instances triggered by the same event, the most recent instance will proceed and others will stop.
- Access the CodeArts Pipeline homepage.
- On the pipeline list page, search for the target pipeline, click
in the Operation column, and select Edit.
- Switch to the Execution Plan page.
- Enable Preemption and select a preemption event.
Figure 7 Configuring a preemption policy
- Currently, this feature only applies to CodeArts Repo repositories.
- Only the MR ID event is available, that is, running instances triggered by the same MR will be preempted.
- After Preemption is enabled, all running instances that meet the preemption condition will be stopped.
- If there are excess instances, and no instances meet the preemption condition, the excess instances will either wait or not be executed, depending on the policy.
- After the configuration, click Save. A message is displayed, indicating that the pipeline is saved successfully.
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