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

[invoke] Refactor build_tags.py

Open KSerrania opened this issue 1 year ago • 1 comments

What does this PR do?

Creates a single get_build_tags function used by all tasks to compute which go build tags to use. Updates all places where builds tags were computed to use get_build_tags. Adds unit tests for get_build_tags.

Motivation

Reduce code repetition: multiple tasks had the same exact following code:

       build_include = (
            get_default_build_tags(build=<build_name>, arch=arch, flavor=flavor)
            if build_include is None
            else filter_incompatible_tags(build_include.split(","), arch=arch)
        )
        build_exclude = [] if build_exclude is None else build_exclude.split(",")
        build_tags = get_build_tags(build_include, build_exclude)

Improve test coverage of the build tags functions.

Additional Notes

n/a

Possible Drawbacks / Trade-offs

n/a

Describe how to test/QA your changes

Ran a full pipeline against this change, and verify that all builds pass. Ran temporary regression tests on CI to verify that the default behavior didn't change: https://gitlab.ddbuild.io/DataDog/datadog-agent/-/pipelines/24087796

Reviewer's Checklist

  • [x] If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • [x] Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
  • [x] A release note has been added or the changelog/no-changelog label has been applied.
  • [x] Changed code has automated tests for its functionality.
  • [x] Adequate QA/testing plan information is provided if the qa/skip-qa label is not applied.
  • [x] At least one team/.. label has been applied, indicating the team(s) that should QA this change.
  • [x] If applicable, docs team has been notified or an issue has been opened on the documentation repo.
  • [x] If applicable, the need-change/operator and need-change/helm labels have been applied.
  • [x] If applicable, the k8s/<min-version> label, indicating the lowest Kubernetes version compatible with this feature.
  • [x] If applicable, the config template has been updated.

KSerrania avatar Dec 04 '23 13:12 KSerrania

Bloop Bleep... Dogbot Here

Regression Detector Results

Run ID: afe852e6-5b65-4e01-8ba4-3427a92475c7 Baseline: 4f4d2130550826dc22b7c28b460b613907460054 Comparison: ee16d4824fa3833a027917b13519c092ae2ae2c1 Total CPUs: 7

Explanation

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".

No interesting changes in experiment optimization goals with confidence ≥ 90.00% and |Δ mean %| ≥ 5.00%.

Experiments that were not declared erratic but were detected as being so, coefficient of variation cutoff 0.10:

experiment goal Δ mean % Δ mean % CI confidence
otel_to_otel_logs ingress throughput -0.31 [-1.92, +1.30] 25.00%

Fine details of change detection per experiment.

experiment goal Δ mean % Δ mean % CI confidence
file_tree egress throughput +0.30 [-1.51, +2.11] 21.42%
idle egress throughput +0.26 [-2.12, +2.65] 14.46%
uds_dogstatsd_to_api ingress throughput +0.08 [-0.09, +0.26] 55.45%
trace_agent_msgpack ingress throughput +0.02 [-0.10, +0.14] 18.74%
dogstatsd_string_interner_8MiB_1k ingress throughput +0.01 [-0.09, +0.10] 12.66%
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.14, +0.14] 2.39%
dogstatsd_string_interner_64MiB_1k ingress throughput +0.00 [-0.13, +0.13] 0.62%
dogstatsd_string_interner_64MiB_100 ingress throughput +0.00 [-0.14, +0.14] 0.58%
dogstatsd_string_interner_8MiB_100 ingress throughput +0.00 [-0.13, +0.13] 0.22%
dogstatsd_string_interner_128MiB_100 ingress throughput -0.00 [-0.14, +0.14] 0.26%
dogstatsd_string_interner_128MiB_1k ingress throughput -0.00 [-0.14, +0.14] 0.35%
dogstatsd_string_interner_8MiB_100k ingress throughput -0.01 [-0.05, +0.04] 23.71%
dogstatsd_string_interner_8MiB_50k ingress throughput -0.01 [-0.07, +0.05] 20.25%
dogstatsd_string_interner_8MiB_10k ingress throughput -0.01 [-0.07, +0.05] 26.61%
trace_agent_json ingress throughput -0.02 [-0.15, +0.11] 16.65%
file_to_blackhole egress throughput -0.05 [-1.08, +0.97] 6.97%
tcp_syslog_to_blackhole ingress throughput -0.26 [-0.39, -0.13] 99.91%
otel_to_otel_logs ingress throughput -0.31 [-1.92, +1.30] 25.00%

pr-commenter[bot] avatar Dec 04 '23 13:12 pr-commenter[bot]