-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ACIX-470] Create a top-level invoke task for running all gitlabci linters #37690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ACIX-470] Create a top-level invoke task for running all gitlabci linters #37690
Conversation
Regression DetectorRegression Detector ResultsMetrics dashboard Baseline: 9218271 Optimization Goals: ✅ Improvement(s) detected
|
perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
---|---|---|---|---|---|---|
➖ | quality_gate_idle_all_features | memory utilization | +0.37 | [+0.30, +0.44] | 1 | Logs bounds checks dashboard |
➖ | ddot_metrics | memory utilization | +0.36 | [+0.24, +0.47] | 1 | Logs |
➖ | file_to_blackhole_0ms_latency | egress throughput | +0.07 | [-0.50, +0.63] | 1 | Logs |
➖ | file_to_blackhole_1000ms_latency | egress throughput | +0.07 | [-0.52, +0.65] | 1 | Logs |
➖ | file_to_blackhole_0ms_latency_http1 | egress throughput | +0.05 | [-0.52, +0.62] | 1 | Logs |
➖ | uds_dogstatsd_to_api | ingress throughput | +0.02 | [-0.26, +0.29] | 1 | Logs |
➖ | file_to_blackhole_500ms_latency | egress throughput | +0.02 | [-0.64, +0.67] | 1 | Logs |
➖ | otlp_ingest_metrics | memory utilization | +0.01 | [-0.15, +0.17] | 1 | Logs |
➖ | tcp_dd_logs_filter_exclude | ingress throughput | +0.00 | [-0.01, +0.02] | 1 | Logs |
➖ | file_to_blackhole_300ms_latency | egress throughput | -0.00 | [-0.60, +0.60] | 1 | Logs |
➖ | file_to_blackhole_100ms_latency | egress throughput | -0.03 | [-0.62, +0.57] | 1 | Logs |
➖ | file_to_blackhole_1000ms_latency_linear_load | egress throughput | -0.03 | [-0.26, +0.20] | 1 | Logs |
➖ | file_to_blackhole_0ms_latency_http2 | egress throughput | -0.08 | [-0.68, +0.53] | 1 | Logs |
➖ | docker_containers_memory | memory utilization | -0.13 | [-0.21, -0.05] | 1 | Logs |
➖ | otlp_ingest_logs | memory utilization | -0.25 | [-0.38, -0.12] | 1 | Logs |
➖ | uds_dogstatsd_20mb_12k_contexts_20_senders | memory utilization | -0.30 | [-0.34, -0.25] | 1 | Logs |
➖ | ddot_logs | memory utilization | -0.48 | [-0.62, -0.34] | 1 | Logs |
➖ | tcp_syslog_to_blackhole | ingress throughput | -0.60 | [-0.65, -0.55] | 1 | Logs |
➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | -0.64 | [-1.52, +0.23] | 1 | Logs |
➖ | quality_gate_idle | memory utilization | -0.76 | [-0.82, -0.69] | 1 | Logs bounds checks dashboard |
➖ | file_tree | memory utilization | -0.89 | [-1.03, -0.76] | 1 | Logs |
✅ | docker_containers_cpu | % cpu utilization | -6.01 | [-9.00, -3.02] | 1 | Logs |
✅ | quality_gate_logs | % cpu utilization | -7.34 | [-10.01, -4.67] | 1 | Logs bounds checks dashboard |
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_0ms_latency_http1 | lost_bytes | 10/10 | |
✅ | file_to_blackhole_0ms_latency_http1 | memory_usage | 10/10 | |
✅ | file_to_blackhole_0ms_latency_http2 | lost_bytes | 10/10 | |
✅ | file_to_blackhole_0ms_latency_http2 | memory_usage | 10/10 | |
✅ | file_to_blackhole_1000ms_latency | memory_usage | 10/10 | |
✅ | file_to_blackhole_1000ms_latency_linear_load | 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_300ms_latency | lost_bytes | 10/10 | |
✅ | file_to_blackhole_300ms_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 |
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:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
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.
-
Its configuration does not mark it "erratic".
CI Pass/Fail Decision
✅ Passed. All Quality Gates 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_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_idle, 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_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
Static quality checks✅ Please find below the results from static quality gates Successful checksInfo
|
Gitlab CI Configuration ChangesAdded Jobstest_and_lint_gitlab_configurationtest_and_lint_gitlab_configuration:
image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux-glibc-2-17-x64$CI_IMAGE_LINUX_GLIBC_2_17_X64_SUFFIX:$CI_IMAGE_LINUX_GLIBC_2_17_X64
needs:
- compute_gitlab_ci_config
rules:
- if: $CI_COMMIT_BRANCH == "main"
when: never
- if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
when: never
- if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
when: never
- if: $CI_COMMIT_TAG != null
when: never
- when: on_success
script:
- GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_TOKEN write_api)
|| exit $?; export GITLAB_TOKEN
- dda inv -- -e linter.full-gitlab-ci --configs-or-diff-file artifacts/after.gitlab-ci.yml
- dda inv -- -e linter.ssm-parameters
stage: .pre
tags:
- arch:amd64 Removed Jobs
Changes Summary
ℹ️ Diff available in the job log. |
e943537
to
8ca3a96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gg! Minor suggestions
cdf7ace
to
0b1b239
Compare
d635800
to
80faed4
Compare
…ct_gitlab_ci_jobs` We remove all the file loading functionality from this method and move it into the tasks themselves. This allows for better separation of concerns and also allows the new method to have a more clear purpose.
…full config Since we will end up precomputing the diff anyway, this will make this check faster (less jobs to look through)
This also allows use to use non-task functions to accomplish linting on already-loaded config objects, which will be useful for creating the top-level linting task.
…if needed fix(gitlab): Properly check for `diff is None`
…ists This simplifies the logic of this function and also brings its interface in line with the rest of the linting methods, which take in lists of jobs instead of full config objects. refactor(linter): Rename `check_change_paths_gitlab_ci_jobs` and `check_change_paths_gitlab_ci_config` Make it clearer what the difference between the two is, and correctly say the second one handles jobs, not a full config
…ailures The idea is to use Exceptions to make linting failures go back to top-level, that way each top-level task can customize how it handles/displays linting errors, instead of having `print` statements buried in "plumbing" functions (like the ones in `libs/` feat(linter): Use new exception-based failure reporting mechanism for all linting tasks
When using the individual linting tasks we'll probably want to check all the jobs and not have to worry about the diff (it wouldn't really save much time anyway, generating the config or diff is what takes long)
…ure printing) to its own function
…i` + fix unit tests
…th to `check_owners_gitlab_ci_jobs`
…or code at the end of `full_gitlab_ci`
This allows us to centralize config options for linters near the actual method definition, and automatically register those linters for usage in `full_gitlab_ci`
…ellcheck` and `full_gitlab_ci`
…bci_sublinter` decorator
- Minor code changes - Remove CRITICAL failure level - Add `--pre-push-linters` flag - Run pre-push linters with `--fail-fast`
The tool is not installed on our runners yet, so it always fails
Co-authored-by: Célian Raimbault <161456554+CelianR@users.noreply.github.com>
80faed4
to
1e9bb89
Compare
/merge |
View all feedbacks in Devflow UI.
The expected merge time in
|
What does this PR do?
Building upon the work of #37417, continue refactoring the set of invoke tasks used for linting gitlabci-related in files in the agent repo. Notable refactoring changes include:
tasks/libs/linter
from the mainlinter.py
file, leaving only the absolutely necessary parts inlinter.py
This PR also adds a new top-level task,
full-gitlab-ci
, that runs all the gitlabci-related linters together, sharing a preconfigured configuration object which takes a while to compute.This new task is now run both in CI and as a pre-push hook, which increases the safety of gitlabci modifications.
Motivation
We had a few linters for gitlabci that were only run manually, which is wasteful - we should run them in CI and/or as a pre-push. The issue is that a couple of these require a "fully-resolved" gitlabci configuration file as input, and computing that takes a while. Therefore it is critical that we do not compute this configuration file multiple times, which is easier if we use one single task grouping all the "sublinters".
Describe how you validated your changes
Running all linters, also with failing examples + unit tests and in CI.
Possible Drawbacks / Trade-offs
Performance: we are now running more linters, especially as a pre-push, which makes it quite a bit slower. This might make changes to gitlabci files more frustrating to make as the pre-push hook that is run when modifying them is quite a bit slower than it was before.
Additional Notes