Skip to content

Commit 55cce7c

Browse files
ci(profiling): helper container resource limits (#3673)
The shared runner pool defaults leave helper container limits unset, causing pods to be Burstable QoS even when the build container has matching requests and limits. This adds explicit helper container resource limits (requests == limits) so the pod achieves Guaranteed QoS class, ensuring proper CPU cgroup enforcement. This fixes the issue where nproc reports the node's full CPU count (e.g. 66) instead of the requested 3 CPUs. Co-authored-by: Daniel Esponda <daniel.esponda@datadoghq.com>
1 parent 25893da commit 55cce7c

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.gitlab/generate-profiler.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@
1717
stage: test
1818
tags: [ "arch:${ARCH}" ]
1919
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:${IMAGE_PREFIX}${PHP_MAJOR_MINOR}${IMAGE_SUFFIX}
20+
# Setting the *_REQUEST and *_LIMIT variables to be the same, and setting
21+
# them for both the build and helper allows using Guaranteed QoS instead of
22+
# Burstable. This means nproc and similar tools will work as expected.
2023
variables:
2124
KUBERNETES_CPU_REQUEST: 3
2225
KUBERNETES_CPU_LIMIT: 3
2326
KUBERNETES_MEMORY_REQUEST: 6Gi
2427
KUBERNETES_MEMORY_LIMIT: 6Gi
28+
KUBERNETES_HELPER_CPU_REQUEST: 1
29+
KUBERNETES_HELPER_CPU_LIMIT: 1
30+
KUBERNETES_HELPER_MEMORY_REQUEST: 2Gi
31+
KUBERNETES_HELPER_MEMORY_LIMIT: 2Gi
2532
CARGO_TARGET_DIR: /mnt/ramdisk/cargo # ramdisk??
2633
libdir: /tmp/datadog-profiling
2734
parallel:
@@ -41,11 +48,6 @@
4148
- cd profiling
4249
- 'echo "nproc: $(nproc)"'
4350
- 'echo "KUBERNETES_CPU_REQUEST: ${KUBERNETES_CPU_REQUEST:-<unset>}"'
44-
- |
45-
if [ -n "${KUBERNETES_CPU_REQUEST:-}" ]; then
46-
export CARGO_BUILD_JOBS="${KUBERNETES_CPU_REQUEST}"
47-
fi
48-
echo "CARGO_BUILD_JOBS: ${CARGO_BUILD_JOBS}"
4951
- export TEST_PHP_EXECUTABLE=$(which php)
5052
- run_tests_php=$(find $(php-config --prefix) -name run-tests.php) # don't anticipate there being more than one
5153
- cp -v "${run_tests_php}" tests

0 commit comments

Comments
 (0)