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

Datadog Internal Artifact Registry Setup

Open robayu opened this issue 4 months ago • 7 comments

What does this PR do?

Adds Datadog Internal Artifact Registry config setup to have CI (which runs internally within Datadog Datacenter) pull from internal mirrors rather than going upstream (where possible, for python, go, java, npm)

Motivation

Remove reliance on upstream during dependency resolution where possible

Describe how you validated your changes

  • [ ] CI Jobs pass
  • [ ] Test that this setup won't impact external contributors with no access to the Datadog internal artifact registries

Additional Notes

  • The .adms/bazel/adms.mirror.cfg file blocks all URLs (except the whitelisted ones) in CI during bazel build commands, if these prove to be too blocking we will need to add more exceptions to the whitelist or remove these blocks and just leave the rewrites (to use the internal registries when pulling bazel dependencies)

  • The env vars set in the different .adms/<ecosystem>/gitlab.yaml files will make CI jobs use the internal artifact registries as well as set the same env vars in the .adms/<ecosystem>/<ecosystem>.bazelrc files when running in CI, but will leave these blank when running locally

  • External contributors should not be affected by this configuration and only Datadog CI builds should be affected

  • Internal Datadog employees can choose to set the same environment variables within an .envrc file if desired so their local package manager pulls and bazel commands also use the internal artifact registries

robayu avatar Nov 12 '25 11:11 robayu

Static quality checks

✅ Please find below the results from static quality gates Comparison made with ancestor 554c6a65cc05005def54529b107f16615f42602c

Successful checks

Info

Quality gate Delta On disk size (MiB) Delta On wire size (MiB)
agent_deb_amd64 $${+0}$$ $${706.33}$$ < $${707.13}$$ $${-0.01}$$ $${173.26}$$ < $${174.16}$$
agent_deb_amd64_fips $${+0}$$ $${702.56}$$ < $${702.86}$$ $${-0.02}$$ $${172.59}$$ < $${173.5}$$
agent_heroku_amd64 $${0}$$ $${327.51}$$ < $${327.92}$$ $${-0}$$ $${87.23}$$ < $${88.21}$$
agent_msi $${+0.01}$$ $${570.42}$$ < $${982.08}$$ $${+0}$$ $${142.5}$$ < $${143.49}$$
agent_rpm_amd64 $${+0}$$ $${706.32}$$ < $${707.12}$$ $${-0.02}$$ $${176.37}$$ < $${177.29}$$
agent_rpm_amd64_fips $${+0}$$ $${702.55}$$ < $${702.85}$$ $${-0.06}$$ $${175.36}$$ < $${176.32}$$
agent_rpm_arm64 $${+0.01}$$ $${688.03}$$ < $${691.67}$$ $${-0}$$ $${159.41}$$ < $${160.7}$$
agent_rpm_arm64_fips $${+0.01}$$ $${685.07}$$ < $${687.54}$$ $${+0}$$ $${159.19}$$ < $${160.11}$$
agent_suse_amd64 $${+0}$$ $${706.32}$$ < $${707.12}$$ $${-0.02}$$ $${176.37}$$ < $${177.29}$$
agent_suse_amd64_fips $${+0}$$ $${702.55}$$ < $${702.85}$$ $${-0.06}$$ $${175.36}$$ < $${176.32}$$
agent_suse_arm64 $${+0.01}$$ $${688.03}$$ < $${691.67}$$ $${-0}$$ $${159.41}$$ < $${160.7}$$
agent_suse_arm64_fips $${+0.01}$$ $${685.07}$$ < $${687.54}$$ $${+0}$$ $${159.19}$$ < $${160.11}$$
docker_agent_amd64 $${+0}$$ $${768.57}$$ < $${769.38}$$ $${-0.01}$$ $${261.18}$$ < $${262.06}$$
docker_agent_arm64 $${+0.01}$$ $${774.82}$$ < $${778.35}$$ $${-0.01}$$ $${250.27}$$ < $${251.72}$$
docker_agent_jmx_amd64 $${+0}$$ $${959.45}$$ < $${960.26}$$ $${-0}$$ $${329.81}$$ < $${330.69}$$
docker_agent_jmx_arm64 $${+0.01}$$ $${954.42}$$ < $${957.95}$$ $${-0.01}$$ $${314.89}$$ < $${316.35}$$
docker_cluster_agent_amd64 $${-0}$$ $${179.41}$$ < $${179.56}$$ $${+0}$$ $${63.43}$$ < $${64.14}$$
docker_cluster_agent_arm64 $${0}$$ $${195.36}$$ < $${196.79}$$ $${+0}$$ $${59.74}$$ < $${60.69}$$
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.75}$$ < $${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.97}$$ < $${30.61}$$ $${-0}$$ $${7.93}$$ < $${8.79}$$
dogstatsd_deb_arm64 $${0}$$ $${28.13}$$ < $${29.11}$$ $${-0}$$ $${6.81}$$ < $${7.71}$$
dogstatsd_rpm_amd64 $${0}$$ $${29.97}$$ < $${30.61}$$ $${-0}$$ $${7.94}$$ < $${8.8}$$
dogstatsd_suse_amd64 $${0}$$ $${29.97}$$ < $${30.61}$$ $${-0}$$ $${7.94}$$ < $${8.8}$$
iot_agent_deb_amd64 $${0}$$ $${42.73}$$ < $${43.29}$$ $${-0}$$ $${11.19}$$ < $${12.04}$$
iot_agent_deb_arm64 $${0}$$ $${39.87}$$ < $${40.92}$$ $${-0}$$ $${9.57}$$ < $${10.45}$$
iot_agent_deb_armhf $${0}$$ $${40.44}$$ < $${41.03}$$ $${-0}$$ $${9.76}$$ < $${10.62}$$
iot_agent_rpm_amd64 $${0}$$ $${42.73}$$ < $${43.29}$$ $${+0}$$ $${11.21}$$ < $${12.06}$$
iot_agent_suse_amd64 $${0}$$ $${42.73}$$ < $${43.29}$$ $${+0}$$ $${11.21}$$ < $${12.06}$$

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 0c740b71-4a42-4823-b2fb-a22cfe7f8f05

Baseline: 8e4d1d4a00b3517c4137ede303a0e5e0403ae497 Comparison: d50efb8301ebf5b8e8908248e0255bb3b8b13ce1 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 +3.12 [+0.01, +6.22] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
docker_containers_cpu % cpu utilization +3.12 [+0.01, +6.22] 1 Logs
ddot_metrics_sum_delta memory utilization +0.79 [+0.59, +1.00] 1 Logs
ddot_logs memory utilization +0.64 [+0.57, +0.70] 1 Logs
quality_gate_logs % cpu utilization +0.38 [-1.12, +1.87] 1 Logs bounds checks dashboard
ddot_metrics memory utilization +0.37 [+0.15, +0.60] 1 Logs
quality_gate_idle memory utilization +0.35 [+0.30, +0.40] 1 Logs bounds checks dashboard
file_tree memory utilization +0.18 [+0.12, +0.25] 1 Logs
uds_dogstatsd_to_api ingress throughput +0.01 [-0.11, +0.12] 1 Logs
uds_dogstatsd_to_api_v3 ingress throughput -0.00 [-0.13, +0.12] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.08, +0.08] 1 Logs
file_to_blackhole_1000ms_latency egress throughput -0.00 [-0.42, +0.41] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.00 [-0.38, +0.37] 1 Logs
otlp_ingest_logs memory utilization -0.01 [-0.10, +0.08] 1 Logs
file_to_blackhole_0ms_latency egress throughput -0.02 [-0.42, +0.38] 1 Logs
file_to_blackhole_100ms_latency egress throughput -0.04 [-0.10, +0.01] 1 Logs
uds_dogstatsd_20mb_12k_contexts_20_senders memory utilization -0.09 [-0.15, -0.03] 1 Logs
quality_gate_idle_all_features memory utilization -0.23 [-0.26, -0.19] 1 Logs bounds checks dashboard
otlp_ingest_metrics memory utilization -0.24 [-0.40, -0.09] 1 Logs
ddot_metrics_sum_cumulativetodelta_exporter memory utilization -0.28 [-0.50, -0.05] 1 Logs
ddot_metrics_sum_cumulative memory utilization -0.30 [-0.46, -0.15] 1 Logs
quality_gate_metrics_logs memory utilization -0.55 [-0.76, -0.34] 1 Logs bounds checks dashboard
tcp_syslog_to_blackhole ingress throughput -0.81 [-0.89, -0.73] 1 Logs
docker_containers_memory memory utilization -2.07 [-2.25, -1.90] 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_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.
  • 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_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 memory_usage: 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 cpu_usage: 10/10 replicas passed. Gate passed.

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

Also something went wrong when pulling bazel_dep from BCR:

  /private/var/tmp/_bazel_joseph.gette/d8e9195c7180b82e81d7a40033183593/external/bazel_tools/tools/build_defs/repo/http.bzl:431:31: in <toplevel>
INFO: repository @@sqlite3+' used the following cache hits instead of downloading the corresponding file.
 * Hash '77823cb110929c2bcb0f5d48e4833b5c59a8a6e40cdea3936b99e199dbbe5784' for http://nonexistent.example.org/cacheprobe
If the definition of 'repository @@sqlite3+' was updated, verify that the hashes were also updated.
INFO: repository @@lua+' used the following cache hits instead of downloading the corresponding file.
 * Hash '7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88' for http://nonexistent.example.org/cacheprobe
If the definition of 'repository @@lua+' was updated, verify that the hashes were also updated.
ERROR: /private/var/tmp/_bazel_joseph.gette/d8e9195c7180b82e81d7a40033183593/external/bazel_tools/tools/build_defs/repo/http.bzl:155:45: An error occurred during the fetch of repository 'sqlite3+':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_joseph.gette/d8e9195c7180b82e81d7a40033183593/external/bazel_tools/tools/build_defs/repo/http.bzl", line 155, column 45, in _http_archive_impl
                download_info = ctx.download_and_extract(
Error in download_and_extract: Expected a file with a .zip, .jar, .war, .aar, .nupkg, .whl, .tar, .tar.gz, .tgz, .tar.xz, , .tar.zst, .tzst, .tar.bz2, .tbz, .ar or .deb suffix (got /private/var/tmp/_bazel_joseph.gette/d8e9195c7180b82e81d7a40033183593/external/sqlite3+/temp2725112259506299422/cacheprobe)
ERROR: no such package '@@sqlite3+//': Expected a file with a .zip, .jar, .war, .aar, .nupkg, .whl, .tar, .tar.gz, .tgz, .tar.xz, , .tar.zst, .tzst, .tar.bz2, .tbz, .ar or .deb suffix (got /private/var/tmp/_bazel_joseph.gette/d8e9195c7180b82e81d7a40033183593/external/sqlite3+/temp2725112259506299422/cacheprobe)
ERROR: /Users/joseph.gette/REPOS/datadog-agent/deps/BUILD.bazel:8:10: //deps:all_deps depends on @@sqlite3+//:sqlite3 in repository @@sqlite3+ which failed to fetch. no such package '@@sqlite3+//': Expected a file with a .zip, .jar, .war, .aar, .nupkg, .whl, .tar, .tar.gz, .tgz, .tar.xz, , .tar.zst, .tzst, .tar.bz2, .tbz, .ar or .deb suffix (got /private/var/tmp/_bazel_joseph.gette/d8e9195c7180b82e81d7a40033183593/external/sqlite3+/temp2725112259506299422/cacheprobe)
ERROR: Analysis of target '//deps:all_deps' failed; build aborted: Analysis failed
INFO: Elapsed time: 2.795s, Critical Path: 0.01s

JSGette avatar Nov 27 '25 08:11 JSGette

Also something went wrong when pulling bazel_dep from BCR:

  /private/var/tmp/_bazel_joseph.gette/d8e9195c7180b82e81d7a40033183593/external/bazel_tools/tools/build_defs/repo/http.bzl:431:31: in <toplevel>
INFO: repository @@sqlite3+' used the following cache hits instead of downloading the corresponding file.
 * Hash '77823cb110929c2bcb0f5d48e4833b5c59a8a6e40cdea3936b99e199dbbe5784' for http://nonexistent.example.org/cacheprobe
If the definition of 'repository @@sqlite3+' was updated, verify that the hashes were also updated.
INFO: repository @@lua+' used the following cache hits instead of downloading the corresponding file.
 * Hash '7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88' for http://nonexistent.example.org/cacheprobe
If the definition of 'repository @@lua+' was updated, verify that the hashes were also updated.
ERROR: /private/var/tmp/_bazel_joseph.gette/d8e9195c7180b82e81d7a40033183593/external/bazel_tools/tools/build_defs/repo/http.bzl:155:45: An error occurred during the fetch of repository 'sqlite3+':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_joseph.gette/d8e9195c7180b82e81d7a40033183593/external/bazel_tools/tools/build_defs/repo/http.bzl", line 155, column 45, in _http_archive_impl
                download_info = ctx.download_and_extract(
Error in download_and_extract: Expected a file with a .zip, .jar, .war, .aar, .nupkg, .whl, .tar, .tar.gz, .tgz, .tar.xz, , .tar.zst, .tzst, .tar.bz2, .tbz, .ar or .deb suffix (got /private/var/tmp/_bazel_joseph.gette/d8e9195c7180b82e81d7a40033183593/external/sqlite3+/temp2725112259506299422/cacheprobe)
ERROR: no such package '@@sqlite3+//': Expected a file with a .zip, .jar, .war, .aar, .nupkg, .whl, .tar, .tar.gz, .tgz, .tar.xz, , .tar.zst, .tzst, .tar.bz2, .tbz, .ar or .deb suffix (got /private/var/tmp/_bazel_joseph.gette/d8e9195c7180b82e81d7a40033183593/external/sqlite3+/temp2725112259506299422/cacheprobe)
ERROR: /Users/joseph.gette/REPOS/datadog-agent/deps/BUILD.bazel:8:10: //deps:all_deps depends on @@sqlite3+//:sqlite3 in repository @@sqlite3+ which failed to fetch. no such package '@@sqlite3+//': Expected a file with a .zip, .jar, .war, .aar, .nupkg, .whl, .tar, .tar.gz, .tgz, .tar.xz, , .tar.zst, .tzst, .tar.bz2, .tbz, .ar or .deb suffix (got /private/var/tmp/_bazel_joseph.gette/d8e9195c7180b82e81d7a40033183593/external/sqlite3+/temp2725112259506299422/cacheprobe)
ERROR: Analysis of target '//deps:all_deps' failed; build aborted: Analysis failed
INFO: Elapsed time: 2.795s, Critical Path: 0.01s

I've noticed this error too, unsure what this caching / file extension error is coming from, is there some cache that is built locally that is failing in CI?

robayu avatar Dec 01 '25 13:12 robayu

If we can not figure out the bazel_dep issue for lua and sqlite3, is there any way we can split this in more parts so we can get most things and come back for http fetches for bazel later?

It seems to be for lua and sqlite. Do we need rewrite rules for https://www.lua.org/ftp/lua-5.4.6.tar.gz https://sqlite.org/2025/sqlite-amalgamation-3500400.zip

aiuto avatar Dec 04 '25 06:12 aiuto

If we can not figure out the bazel_dep issue for lua and sqlite3, is there any way we can split this in more parts so we can get most things and come back for http fetches for bazel later?

It seems to be for lua and sqlite. Do we need rewrite rules for https://www.lua.org/ftp/lua-5.4.6.tar.gz https://sqlite.org/2025/sqlite-amalgamation-3500400.zip

Added both URLs to the allow list

robayu avatar Dec 05 '25 09:12 robayu

@robayu can you consider rebasing your PR on top of a fresh main and mark it as ready for review?

rdesgroppes avatar Dec 15 '25 15:12 rdesgroppes