datadog-agent icon indicating copy to clipboard operation
datadog-agent copied to clipboard

[EBPF-917] gpu: add initial CI job with GPUs

Open gjulianm opened this issue 3 months ago • 7 comments

What does this PR do?

This PR enables tests on GPU runners, for improved integration testing and as an intermediate step between mocked unit tests and full e2e tests.

The new job only runs tests in two packages, specific for integration tests that will only run when there is a GPU available. These tests will be ignored in the rest of the test jobs.

To avoid high cost and usage of GPU capacity, it's configured to not run in all main pipelines, only on scheduled ones. On PRs, it will only run if GPU-related code is changed.

This PR includes some basic tests that use real data from NVML, the test set will later be expanded.

Motivation

Improve testing capabilities for GPUm.

Describe how you validated your changes

CI passing.

Additional Notes

gjulianm avatar Nov 26 '25 17:11 gjulianm

Gitlab CI Configuration Changes

Added Jobs

.on_gpu_integration_tests
.on_gpu_integration_tests:
- if: $DDR_WORKFLOW_ID != null && $CI_COMMIT_BRANCH == "main"
  when: always
- if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
  when: never
- allow_failure: true
  when: manual
- changes:
    compare_to: $COMPARE_TO_BRANCH
    paths:
    - pkg/gpu/**/*
    - pkg/collector/corechecks/gpu/**/*
    - comp/core/workloadmeta/collectors/internal/nvml/**/*
    - .gitlab/source_test/linux.yml
  when: on_success
tests_gpu
tests_gpu:
  after_script:
  - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
  - CODECOV_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $CODECOV token) || exit
    $?; export CODECOV_TOKEN
  - dda inv -- -e coverage.upload-to-codecov $COVERAGE_CACHE_FLAG || true
  allow_failure: true
  artifacts:
    expire_in: 2 weeks
    paths:
    - $TEST_OUTPUT_FILE
    - junit-*.tgz
    reports:
      annotations:
      - $EXTERNAL_LINKS_PATH
      junit:
      - '**/junit-out-*.xml'
    when: always
  before_script:
  - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache.tar.xz -C $GOPATH/pkg/mod/cache
  - rm -f modcache.tar.xz
  cache:
  - key:
      files:
      - .bazelversion
      prefix: bazelversion-$CI_RUNNER_DESCRIPTION
    paths:
    - .cache/bazelisk
    - .cache/bazel/*/install
    policy: pull-push
    when: on_success
  - key: bazel-$CI_RUNNER_DESCRIPTION
    paths:
    - .cache/bazel/*/cache
    - .cache/bazel/*/*/external
    - .cache/pip
    policy: pull-push
    when: on_success
  image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
  needs:
  - go_deps
  - go_tools_deps
  rules:
  - if: $DDR_WORKFLOW_ID != null && $CI_COMMIT_BRANCH == "main"
    when: always
  - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
    when: never
  - allow_failure: true
    when: manual
  - changes:
      compare_to: $COMPARE_TO_BRANCH
      paths:
      - pkg/gpu/**/*
      - pkg/collector/corechecks/gpu/**/*
      - comp/core/workloadmeta/collectors/internal/nvml/**/*
      - .gitlab/source_test/linux.yml
    when: on_success
  - if: $RUN_UNIT_TESTS == "off"
    when: never
  script:
  - mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_tools.tar.xz -C $GOPATH/pkg/mod/cache
  - rm -f modcache_tools.tar.xz
  - dda inv -- -e install-tools
  - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
  - FAST_TESTS_FLAG=""
  - if [[ "$FAST_TESTS" == "true" ]]; then FAST_TESTS_FLAG="--only-impacted-packages";
    fi
  - dda inv -- -e agent.build
  - dda inv -- -e test $FLAVORS --race --profile --rerun-fails=2 --coverage --cpus
    $KUBERNETES_CPU_REQUEST $EXTRA_OPTS --result-json $TEST_OUTPUT_FILE --junit-tar
    "junit-${CI_JOB_NAME}.tgz" --build-stdlib $FAST_TESTS_FLAG --test-washer
  stage: source_test
  tags:
  - gpu:a10-amd64
  variables:
    BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
    EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
    EXTRA_OPTS: --targets=./pkg/gpu/integrationtests,./pkg/collector/corechecks/gpu/integrationtests
    FLAKY_PATTERNS_CONFIG: $CI_PROJECT_DIR/flaky-patterns-runtime.yaml
    FLAVORS: ''
    KUBERNETES_CPU_REQUEST: 4
    KUBERNETES_MEMORY_LIMIT: 8Gi
    KUBERNETES_MEMORY_REQUEST: 8Gi
    TEST_OUTPUT_FILE: test_output.json
    XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache

Changes Summary

Removed Modified Added Renamed
0 0 2 0

:information_source: Diff available in the job log.

Static quality checks

✅ Please find below the results from static quality gates Comparison made with ancestor 69a72e41601e3d22eba91dae728760800a69c38d

Successful checks

Info

Quality gate Delta On disk size (MiB) Delta On wire size (MiB)
agent_deb_amd64 $${0}$$ $${705.4}$$ < $${707.13}$$ $${-0.01}$$ $${172.97}$$ < $${174.16}$$
agent_deb_amd64_fips $${0}$$ $${701.63}$$ < $${702.86}$$ $${-0.01}$$ $${172.22}$$ < $${173.5}$$
agent_heroku_amd64 $${0}$$ $${327.71}$$ < $${327.92}$$ $${+0}$$ $${87.17}$$ < $${88.21}$$
agent_msi $${0}$$ $${571.1}$$ < $${982.08}$$ $${-0}$$ $${142.65}$$ < $${143.49}$$
agent_rpm_amd64 $${0}$$ $${705.39}$$ < $${707.12}$$ $${-0.03}$$ $${176.1}$$ < $${177.29}$$
agent_rpm_amd64_fips $${0}$$ $${701.61}$$ < $${702.85}$$ $${-0.02}$$ $${175.07}$$ < $${176.32}$$
agent_rpm_arm64 $${0}$$ $${687.26}$$ < $${691.67}$$ $${+0.01}$$ $${159.05}$$ < $${160.7}$$
agent_rpm_arm64_fips $${0}$$ $${684.32}$$ < $${687.54}$$ $${-0.01}$$ $${158.8}$$ < $${160.11}$$
agent_suse_amd64 $${0}$$ $${705.39}$$ < $${707.12}$$ $${-0.03}$$ $${176.1}$$ < $${177.29}$$
agent_suse_amd64_fips $${0}$$ $${701.61}$$ < $${702.85}$$ $${-0.02}$$ $${175.07}$$ < $${176.32}$$
agent_suse_arm64 $${0}$$ $${687.26}$$ < $${691.67}$$ $${+0.01}$$ $${159.05}$$ < $${160.7}$$
agent_suse_arm64_fips $${0}$$ $${684.32}$$ < $${687.54}$$ $${-0.01}$$ $${158.8}$$ < $${160.11}$$
docker_agent_amd64 $${-0}$$ $${767.19}$$ < $${769.38}$$ $${-0}$$ $${260.51}$$ < $${262.06}$$
docker_agent_arm64 $${+0}$$ $${773.63}$$ < $${778.35}$$ $${+0.01}$$ $${249.62}$$ < $${251.72}$$
docker_agent_jmx_amd64 $${+0}$$ $${958.06}$$ < $${960.26}$$ $${+0}$$ $${329.15}$$ < $${330.69}$$
docker_agent_jmx_arm64 $${+0}$$ $${953.22}$$ < $${957.95}$$ $${+0.01}$$ $${314.25}$$ < $${316.35}$$
docker_cluster_agent_amd64 $${+0}$$ $${180.33}$$ < $${181.08}$$ $${+0}$$ $${63.71}$$ < $${64.49}$$
docker_cluster_agent_arm64 $${0}$$ $${196.19}$$ < $${198.49}$$ $${+0}$$ $${60.0}$$ < $${61.17}$$
docker_cws_instrumentation_amd64 $${0}$$ $${7.13}$$ < $${7.18}$$ $${+0}$$ $${2.99}$$ < $${3.33}$$
docker_cws_instrumentation_arm64 $${0}$$ $${6.69}$$ < $${6.92}$$ $${+0}$$ $${2.73}$$ < $${3.09}$$
docker_dogstatsd_amd64 $${-0}$$ $${38.76}$$ < $${39.38}$$ $${+0}$$ $${15.0}$$ < $${15.82}$$
docker_dogstatsd_arm64 $${0}$$ $${37.06}$$ < $${37.94}$$ $${+0}$$ $${14.33}$$ < $${14.83}$$
dogstatsd_deb_amd64 $${0}$$ $${29.98}$$ < $${30.61}$$ $${+0}$$ $${7.93}$$ < $${8.79}$$
dogstatsd_deb_arm64 $${0}$$ $${28.14}$$ < $${29.11}$$ $${-0}$$ $${6.81}$$ < $${7.71}$$
dogstatsd_rpm_amd64 $${0}$$ $${29.98}$$ < $${30.61}$$ $${+0}$$ $${7.94}$$ < $${8.8}$$
dogstatsd_suse_amd64 $${0}$$ $${29.98}$$ < $${30.61}$$ $${+0}$$ $${7.94}$$ < $${8.8}$$
iot_agent_deb_amd64 $${0}$$ $${42.92}$$ < $${43.29}$$ $${+0}$$ $${11.23}$$ < $${12.04}$$
iot_agent_deb_arm64 $${0}$$ $${40.05}$$ < $${40.92}$$ $${+0}$$ $${9.61}$$ < $${10.45}$$
iot_agent_deb_armhf $${0}$$ $${40.63}$$ < $${41.03}$$ $${-0}$$ $${9.8}$$ < $${10.62}$$
iot_agent_rpm_amd64 $${0}$$ $${42.92}$$ < $${43.29}$$ $${-0}$$ $${11.25}$$ < $${12.06}$$
iot_agent_suse_amd64 $${0}$$ $${42.92}$$ < $${43.29}$$ $${-0}$$ $${11.25}$$ < $${12.06}$$

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 00d65071-2358-478d-b1f7-1d08aaf94f21

Baseline: 69a72e41601e3d22eba91dae728760800a69c38d Comparison: 7653d00c252d1de8e28f797792a610cef28e6ffb Diff

Optimization Goals: ✅ No significant changes detected

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

perf experiment goal Δ mean % Δ mean % CI trials links
docker_containers_cpu % cpu utilization +2.07 [-1.04, +5.19] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
docker_containers_cpu % cpu utilization +2.07 [-1.04, +5.19] 1 Logs
ddot_metrics memory utilization +0.57 [+0.36, +0.79] 1 Logs
file_tree memory utilization +0.47 [+0.42, +0.53] 1 Logs
ddot_logs memory utilization +0.28 [+0.22, +0.34] 1 Logs
docker_containers_memory memory utilization +0.27 [+0.20, +0.34] 1 Logs
otlp_ingest_metrics memory utilization +0.16 [+0.01, +0.31] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.10 [+0.02, +0.18] 1 Logs
file_to_blackhole_0ms_latency egress throughput +0.10 [-0.32, +0.51] 1 Logs
quality_gate_metrics_logs memory utilization +0.07 [-0.15, +0.28] 1 Logs bounds checks dashboard
uds_dogstatsd_to_api_v3 ingress throughput +0.02 [-0.11, +0.14] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.07, +0.08] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.00 [-0.05, +0.05] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.01 [-0.14, +0.12] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.04 [-0.42, +0.33] 1 Logs
uds_dogstatsd_20mb_12k_contexts_20_senders memory utilization -0.06 [-0.12, -0.00] 1 Logs
file_to_blackhole_1000ms_latency egress throughput -0.08 [-0.48, +0.33] 1 Logs
quality_gate_idle memory utilization -0.12 [-0.16, -0.07] 1 Logs bounds checks dashboard
otlp_ingest_logs memory utilization -0.13 [-0.23, -0.03] 1 Logs
quality_gate_idle_all_features memory utilization -0.31 [-0.35, -0.28] 1 Logs bounds checks dashboard
ddot_metrics_sum_delta memory utilization -0.33 [-0.53, -0.13] 1 Logs
ddot_metrics_sum_cumulativetodelta_exporter memory utilization -0.36 [-0.59, -0.14] 1 Logs
quality_gate_logs % cpu utilization -0.44 [-1.94, +1.05] 1 Logs bounds checks dashboard
ddot_metrics_sum_cumulative memory utilization -0.54 [-0.70, -0.38] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
docker_containers_cpu simple_check_run 10/10
docker_containers_memory memory_usage 10/10
docker_containers_memory simple_check_run 10/10
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency lost_bytes 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle intake_connections 10/10 bounds checks dashboard
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs intake_connections 10/10 bounds checks dashboard
quality_gate_logs lost_bytes 10/10 bounds checks dashboard
quality_gate_logs memory_usage 10/10 bounds checks dashboard
quality_gate_metrics_logs cpu_usage 10/10 bounds checks dashboard
quality_gate_metrics_logs intake_connections 10/10 bounds checks dashboard
quality_gate_metrics_logs lost_bytes 10/10 bounds checks dashboard
quality_gate_metrics_logs memory_usage 10/10 bounds checks dashboard

Explanation

Confidence level: 90.00% Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.

cit-pr-commenter[bot] avatar Nov 26 '25 18:11 cit-pr-commenter[bot]

/trigger-ci

gjulianm avatar Dec 01 '25 10:12 gjulianm

View all feedbacks in Devflow UI.

2025-12-01 10:15:28 UTC :information_source: Start processing command /trigger-ci If you need support, contact us on Slack #devflow!


2025-12-01 10:15:45 UTC :information_source: Branch synced on Gitlab

Branch guillermo.julian/gpu-ci-tests was out-of-sync on Gitlab - it has been resynced

If you need support, contact us on Slack #devflow!


2025-12-01 10:17:26 UTC :rotating_light: Devflow

POST https://gitlab.ddbuild.io/api/v4/projects/DataDog/datadog-agent/pipeline: 400 {message: {base: [jobs:tests_gpu config contains unknown keys: vars]}}

Details
child workflow execution error (type: devtools.Devtools_TriggerCiFromPr, workflowID: ef11e0ec-3b2e-4473-9982-53de1283db31_36, runID: a0513b8e-2583-41ff-9834-75de66b44a62, initiatedEventID: 36, startedEventID: 37): child workflow execution error (type: devtools.Devtools_TriggerCi, workflowID: a0513b8e-2583-41ff-9834-75de66b44a62_14, runID: 4cd4a309-6a45-4496-a1c5-f1a567d07c78, initiatedEventID: 14, startedEventID: 15): activity error (type: gitlab.GitlabService_CreatePipeline, scheduledEventID: 55, startedEventID: 56, identity: 1@gitlab-worker-8d9795d5-57fks@): POST https://gitlab.ddbuild.io/api/v4/projects/DataDog/datadog-agent/pipeline: 400 {message: {base: [jobs:tests_gpu config contains unknown keys: vars]}} (type: ErrorResponse, retryable: true)

If you need support, contact us on Slack #devflow with those details!

@codex review

chouetz avatar Dec 12 '25 14:12 chouetz

/merge

gjulianm avatar Dec 18 '25 14:12 gjulianm

View all feedbacks in Devflow UI.

2025-12-18 14:07:21 UTC :information_source: Start processing command /merge


2025-12-18 14:07:29 UTC :information_source: MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings. It will be added to the queue as soon as checks pass and/or get approvals. Note: if you pushed new commits since the last approval, you may need additional approval. You can remove it from the waiting list with /remove command.


2025-12-18 15:03:16 UTC :information_source: MergeQueue: merge request added to the queue

The expected merge time in main is approximately 1h (p90).


2025-12-18 15:44:06 UTC :information_source: MergeQueue: This merge request was merged