Skip to content
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

[workloadmeta] Refactor to avoid requiring fx in "impl" dir #28309

Merged

Conversation

davidor
Copy link
Member

@davidor davidor commented Aug 8, 2024

What does this PR do?

Refactors the workloadmeta code so that the impl does not depend on fx.
This is done to follow the new conventions of the component framework.

/cc @dustmop

Describe how to test/QA your changes

Skip. Should be covered by e2e tests.

@davidor davidor added changelog/no-changelog qa/done QA done before merge and regressions are covered by tests team/container-platform The Container Platform Team labels Aug 8, 2024
@davidor davidor added this to the 7.57.0 milestone Aug 8, 2024
@davidor davidor requested a review from a team as a code owner August 8, 2024 10:13
@davidor davidor force-pushed the davidor/contp-250-workloadmeta-remove-fx-from-impl branch from 2ebdfec to 86f5ac3 Compare August 8, 2024 10:26
@davidor davidor requested a review from a team as a code owner August 8, 2024 10:26
@@ -1,26 +0,0 @@
// Unless explicitly stated otherwise all files in this repository are licensed
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the purpose of this file.
MockBundle() is not used anywhere, and Bundle() is only used in the test file below.
It's the only test that failed after the refactor.

deps := fxutil.Test[dependencies](t, fx.Options(
fx.Provide(func() log.Component { return logmock.New(t) }),
func newWorkloadmetaObject(t *testing.T) *workloadmeta {
testDeps := fxutil.Test[testDependencies](t, fx.Options(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you are still use fxutil.Test, fx is still used in impl folder.
I am not sure removing fxutil.Test is a great idea for now, so you can probably keep it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. I noticed it but thought it was fine in test files.
Any suggestion about how to remove this fx dependency here? It's only used in the line that you mentioned and the testDependencies struct defined above.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can keep your code as it is.

@@ -280,6 +279,7 @@
/comp/trace/etwtracer @DataDog/windows-agent
/comp/autoscaling/datadogclient @DataDog/container-integrations
/comp/etw @DataDog/windows-agent
/comp/languagedetection/client @DataDog/container-platform
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is needed by the linter. It's introduced by inv components.lint-components --fix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for the comp/README.md changes below.

@pr-commenter
Copy link

pr-commenter bot commented Aug 8, 2024

Test changes on VM

Use this command from test-infra-definitions to manually test this PR changes on a VM:

inv create-vm --pipeline-id=41309987 --os-family=ubuntu

Note: This applies to commit 95c8d66

@pr-commenter
Copy link

pr-commenter bot commented Aug 8, 2024

Regression Detector

Regression Detector Results

Run ID: 563c5602-f2e4-46e0-974f-fa6bd650c679 Metrics dashboard Target profiles

Baseline: 8af60b0
Comparison: 86f5ac3

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

No significant changes in experiment optimization goals

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

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI links
tcp_syslog_to_blackhole ingress throughput +1.38 [-11.17, +13.93] Logs
idle memory utilization +0.07 [+0.03, +0.11] Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.01, +0.01] Logs
uds_dogstatsd_to_api ingress throughput -0.00 [-0.00, +0.00] Logs
file_tree memory utilization -0.55 [-0.62, -0.47] Logs
uds_dogstatsd_to_api_cpu % cpu utilization -0.56 [-1.45, +0.32] Logs
otel_to_otel_logs ingress throughput -0.74 [-1.55, +0.06] Logs
pycheck_1000_100byte_tags % cpu utilization -1.68 [-6.38, +3.03] Logs
basic_py_check % cpu utilization -2.18 [-4.70, +0.35] Logs

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

@davidor
Copy link
Member Author

davidor commented Aug 8, 2024

/merge

@dd-devflow
Copy link

dd-devflow bot commented Aug 8, 2024

🚂 MergeQueue: pull request added to the queue

The median merge time in main is 22m.

Use /merge -c to cancel this operation!

@dd-devflow
Copy link

dd-devflow bot commented Aug 8, 2024

MergeQueue: The build pipeline contains failing jobs for this merge request

Build pipeline has failing jobs for f88a15b
Failed jobs:

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • Any question, go check the FAQ.
Details

Since those jobs are not marked as being allowed to fail, the pipeline will most likely fail.
Therefore, and to allow other builds to be processed, this merge request has been rejected and the pipeline got canceled.
Failed jobs:

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

@davidor davidor force-pushed the davidor/contp-250-workloadmeta-remove-fx-from-impl branch from 86f5ac3 to 95c8d66 Compare August 9, 2024 08:55
@davidor
Copy link
Member Author

davidor commented Aug 9, 2024

Rebased on top of main to fix a conflict.

@davidor
Copy link
Member Author

davidor commented Aug 9, 2024

/merge

@dd-devflow
Copy link

dd-devflow bot commented Aug 9, 2024

🚂 MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. 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.

Use /merge -c to cancel this operation!

@dd-devflow
Copy link

dd-devflow bot commented Aug 9, 2024

🚂 MergeQueue: pull request added to the queue

The median merge time in main is 22m.

Use /merge -c to cancel this operation!

@dd-mergequeue dd-mergequeue bot merged commit f190956 into main Aug 9, 2024
196 of 216 checks passed
@dd-mergequeue dd-mergequeue bot deleted the davidor/contp-250-workloadmeta-remove-fx-from-impl branch August 9, 2024 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog qa/done QA done before merge and regressions are covered by tests team/container-platform The Container Platform Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants