Skip to content

Commit

Permalink
ci: configure static CPUs for CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
chagui committed Nov 5, 2024
1 parent 08167d9 commit 27fcfdb
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,26 @@ stages:
- test
- release

.jobs-resource-allocation:
variables:
# Sized resources using https://app.datadoghq.com/dashboard/xff-wqx-4a2/ci-reliability-kubernetes-runner-sizing-and-diagnotic
KUBERNETES_CPU_REQUEST: "6"
KUBERNETES_CPU_LIMIT: "6"
KUBERNETES_MEMORY_REQUEST: "12Gi"
KUBERNETES_MEMORY_LIMIT: "12Gi"
# Using non-integer CPU requests/limits to avoid the static CPU policy to be set on the helper container.
# Static CPU policy reserves full CPU cores for containers with integer requests. It is used to isolate
# CI job containers from each other and prevent noisy ones to starve resources on a CI node.
# By using non-integer CPU request and limits for the helper container, responsible for cloning,
# we can leverage multi-cores to speed-up git clones while preserving isolation for the build container.
KUBERNETES_HELPER_CPU_REQUEST: "200m"
KUBERNETES_HELPER_CPU_LIMIT: "200m"
KUBERNETES_HELPER_MEMORY_REQUEST: "1Gi"
KUBERNETES_HELPER_MEMORY_LIMIT: "1Gi"

test-and-build-arm64:
extends:
- .jobs-resource-allocation
stage: test
script:
- apt-get update
Expand All @@ -22,13 +41,13 @@ test-and-build-arm64:
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l csharp
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l python
variables:
KUBERNETES_MEMORY_REQUEST: 6Gi
KUBERNETES_MEMORY_LIMIT: 12Gi
DD_SITE: datadoghq.com
tags:
- arch:arm64

test-and-build-amd64:
extends:
- .jobs-resource-allocation
stage: test
script:
- apt-get update
Expand All @@ -46,8 +65,6 @@ test-and-build-amd64:
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l csharp
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l python
variables:
KUBERNETES_MEMORY_REQUEST: 6Gi
KUBERNETES_MEMORY_LIMIT: 12Gi
DD_SITE: datadoghq.com
tags:
- arch:amd64
Expand Down

0 comments on commit 27fcfdb

Please sign in to comment.