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

[ASCII-1498] add dependency list test for the serverless binary #24770

Merged

Conversation

GustavoCaso
Copy link
Member

@GustavoCaso GustavoCaso commented Apr 17, 2024

What does this PR do?

This PR modify the pkg/serverless/binarysize/binary_size_test.go test for the serverless binary to use a include list rather than a block list to check for the dependencies that are part of the serverless binary.

As part of the work we are doing this quarter we are going to focus on reducing the number of dependencies the serveless binary gets ship with 😄

The test aims to add friction to developers when they add new dependencies to the serverless binary, but not block them. They can update the list and the test would be green.

Having the commit log, would make easier the investigation of why certain dependency were added or remove into the serverless binary.

When a new dependency is added or remove the test fails. The error messages explains what the developer should do:

The linux_dependencies_arm64.txt file is out of date. 
Update the file locally with this content: 
archive/zip
bufio
bytes
cmp
compress/flate
compress/gzip
compress/zlib
container/list
context
crypto
crypto/aes
crypto/cipher
crypto/des
crypto/dsa
crypto/ecdh
crypto/ecdsa
...

Motivation

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

@GustavoCaso GustavoCaso requested a review from a team as a code owner April 17, 2024 10:24
@GustavoCaso GustavoCaso added this to the 7.54.0 milestone Apr 17, 2024
@GustavoCaso GustavoCaso added changelog/no-changelog qa/no-code-change No code change in Agent code requiring validation labels Apr 17, 2024
@GustavoCaso GustavoCaso force-pushed the add-dependency-list-test-for-the-serverless-binary branch from 83be9f9 to 80f0e7f Compare April 17, 2024 10:40
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Apr 17, 2024

[Fast Unit Tests Report]

On pipeline 34883460 (CI Visibility). The following jobs did not run any unit tests:

Jobs:
  • tests_windows-x64

If you modified Go files and expected unit tests to run in these jobs, please double check the job logs. If you think tests should have been executed reach out to #agent-developer-experience

@pr-commenter
Copy link

pr-commenter bot commented Apr 17, 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=34883460 --os-family=ubuntu

@pr-commenter
Copy link

pr-commenter bot commented Apr 17, 2024

Regression Detector

Regression Detector Results

Run ID: 7565a67f-a84f-48d8-9b11-f1e67152c31c
Baseline: 71ab04e
Comparison: bdb5ff3

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
file_tree memory utilization +0.37 [+0.27, +0.46]
uds_dogstatsd_to_api_cpu % cpu utilization +0.10 [-2.77, +2.96]
trace_agent_json ingress throughput +0.01 [-0.01, +0.04]
tcp_dd_logs_filter_exclude ingress throughput +0.01 [-0.03, +0.04]
uds_dogstatsd_to_api ingress throughput -0.01 [-0.21, +0.19]
trace_agent_msgpack ingress throughput -0.02 [-0.03, +0.00]
otel_to_otel_logs ingress throughput -0.06 [-0.44, +0.31]
idle memory utilization -0.36 [-0.39, -0.32]
pycheck_1000_100byte_tags % cpu utilization -0.43 [-5.10, +4.24]
basic_py_check % cpu utilization -0.50 [-2.92, +1.92]
tcp_syslog_to_blackhole ingress throughput -8.13 [-28.12, +11.86]

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

cmd/serverless/dependency_list_test.go Outdated Show resolved Hide resolved
cmd/serverless/dependency_list_test.go Outdated Show resolved Hide resolved
cmd/serverless/dependency_list_test.go Show resolved Hide resolved
@GustavoCaso GustavoCaso force-pushed the add-dependency-list-test-for-the-serverless-binary branch from 289b74b to 452fcd0 Compare May 21, 2024 10:50
Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 4.56%. Comparing base (71ab04e) to head (bdb5ff3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main   #24770       +/-   ##
===========================================
- Coverage   45.03%    4.56%   -40.48%     
===========================================
  Files        2314        1     -2313     
  Lines      266535      241   -266294     
===========================================
- Hits       120036       11   -120025     
+ Misses     136952      229   -136723     
+ Partials     9547        1     -9546     
Flag Coverage Δ
amzn_aarch64 4.56% <ø> (-41.27%) ⬇️
centos_x86_64 4.56% <ø> (-41.18%) ⬇️
ubuntu_aarch64 4.56% <ø> (-41.27%) ⬇️
ubuntu_x86_64 4.56% <ø> (-41.26%) ⬇️
windows_amd64 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@GustavoCaso GustavoCaso force-pushed the add-dependency-list-test-for-the-serverless-binary branch from 60f3182 to 6374613 Compare May 21, 2024 13:26
@GustavoCaso GustavoCaso force-pushed the add-dependency-list-test-for-the-serverless-binary branch from 6374613 to a56269c Compare May 22, 2024 16:39
@GustavoCaso
Copy link
Member Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented May 22, 2024

🚂 MergeQueue

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 May 22, 2024

🚂 MergeQueue

Pull request added to the queue.

There are 3 builds ahead! (estimated merge in less than 2h)

Use /merge -c to cancel this operation!

@dd-devflow
Copy link

dd-devflow bot commented May 22, 2024

❌ MergeQueue

Build pipeline has failing jobs for c9f6c2d

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 before the end of the pipeline.

You should have a look at the pipeline, wait for the build to finish and investigate the failures.
When you are ready, re-add your pull request to the queue!

⚠️ Do NOT retry failed jobs directly.

They were executed on a temporary branch created by the merge queue. If you retry them, they are going to fail because the branch no longer exists.

Details

List of failed jobs:

Go to failed Gitlab pipeline.

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

@GustavoCaso GustavoCaso force-pushed the add-dependency-list-test-for-the-serverless-binary branch from a56269c to b5f7907 Compare May 22, 2024 20:50
Copy link
Contributor

Serverless Benchmark Results

BenchmarkStartEndInvocation comparison between 71ab04e and e39bbe3.

tl;dr

Use these benchmarks as an insight tool during development.

  1. Skim down the vs base column in each chart. If there is a ~, then there was no statistically significant change to the benchmark. Otherwise, ensure the estimated percent change is either negative or very small.

  2. The last row of each chart is the geomean. Ensure this percentage is either negative or very small.

What is this benchmarking?

The BenchmarkStartEndInvocation compares the amount of time it takes to call the start-invocation and end-invocation endpoints. For universal instrumentation languages (Dotnet, Golang, Java, Ruby), this represents the majority of the duration overhead added by our tracing layer.

The benchmark is run using a large variety of lambda request payloads. In the charts below, there is one row for each event payload type.

How do I interpret these charts?

The charts below comes from benchstat. They represent the statistical change in duration (sec/op), memory overhead (B/op), and allocations (allocs/op).

The benchstat docs explain how to interpret these charts.

Before the comparison table, we see common file-level configuration. If there are benchmarks with different configuration (for example, from different packages), benchstat will print separate tables for each configuration.

The table then compares the two input files for each benchmark. It shows the median and 95% confidence interval summaries for each benchmark before and after the change, and an A/B comparison under "vs base". ... The p-value measures how likely it is that any differences were due to random chance (i.e., noise). The "~" means benchstat did not detect a statistically significant difference between the two inputs. ...

Note that "statistically significant" is not the same as "large": with enough low-noise data, even very small changes can be distinguished from noise and considered statistically significant. It is, of course, generally easier to distinguish large changes from noise.

Finally, the last row of the table shows the geometric mean of each column, giving an overall picture of how the benchmarks changed. Proportional changes in the geomean reflect proportional changes in the benchmarks. For example, given n benchmarks, if sec/op for one of them increases by a factor of 2, then the sec/op geomean will increase by a factor of ⁿ√2.

I need more help

First off, do not worry if the benchmarks are failing. They are not tests. The intention is for them to be a tool for you to use during development.

If you would like a hand interpreting the results come chat with us in #serverless-agent in the internal DataDog slack or in #serverless in the public DataDog slack. We're happy to help!

Benchmark stats
goos: linux
goarch: amd64
pkg: github.com/DataDog/datadog-agent/pkg/serverless/daemon
cpu: AMD EPYC 7763 64-Core Processor                
                                      │ baseline/benchmark.log │       current/benchmark.log        │
                                      │         sec/op         │   sec/op     vs base               │
api-gateway-appsec.json                            91.12µ ± 5%   86.97µ ± 3%  -4.56% (p=0.000 n=10)
api-gateway-kong-appsec.json                       72.87µ ± 3%   66.77µ ± 1%  -8.37% (p=0.000 n=10)
api-gateway-kong.json                              69.95µ ± 1%   64.83µ ± 3%  -7.32% (p=0.000 n=10)
api-gateway-non-proxy-async.json                   109.3µ ± 1%   101.1µ ± 2%  -7.49% (p=0.000 n=10)
api-gateway-non-proxy.json                         109.0µ ± 1%   101.5µ ± 2%  -6.90% (p=0.000 n=10)
api-gateway-websocket-connect.json                 71.85µ ± 1%   67.26µ ± 4%  -6.38% (p=0.000 n=10)
api-gateway-websocket-default.json                 64.40µ ± 2%   60.05µ ± 1%  -6.76% (p=0.000 n=10)
api-gateway-websocket-disconnect.json              64.37µ ± 0%   60.19µ ± 2%  -6.49% (p=0.000 n=10)
api-gateway.json                                   118.0µ ± 1%   113.2µ ± 3%  -4.01% (p=0.002 n=10)
application-load-balancer.json                     65.14µ ± 1%   61.06µ ± 1%  -6.26% (p=0.000 n=10)
cloudfront.json                                    49.13µ ± 2%   47.30µ ± 2%  -3.73% (p=0.000 n=10)
cloudwatch-events.json                             39.49µ ± 1%   38.17µ ± 4%  -3.34% (p=0.005 n=10)
cloudwatch-logs.json                               68.22µ ± 2%   66.54µ ± 1%  -2.47% (p=0.000 n=10)
custom.json                                        32.07µ ± 4%   30.73µ ± 3%  -4.19% (p=0.000 n=10)
dynamodb.json                                      96.27µ ± 1%   93.64µ ± 2%  -2.73% (p=0.000 n=10)
empty.json                                         30.27µ ± 4%   28.63µ ± 3%  -5.43% (p=0.000 n=10)
eventbridge-custom.json                            43.71µ ± 2%   41.42µ ± 2%  -5.24% (p=0.000 n=10)
http-api.json                                      76.32µ ± 3%   72.96µ ± 1%  -4.41% (p=0.000 n=10)
kinesis-batch.json                                 72.77µ ± 1%   70.19µ ± 1%  -3.54% (p=0.000 n=10)
kinesis.json                                       56.15µ ± 2%   53.36µ ± 2%  -4.97% (p=0.000 n=10)
s3.json                                            62.71µ ± 2%   58.39µ ± 1%  -6.88% (p=0.000 n=10)
sns-batch.json                                     96.07µ ± 2%   89.10µ ± 2%  -7.25% (p=0.000 n=10)
sns.json                                           68.13µ ± 4%   64.45µ ± 2%  -5.40% (p=0.000 n=10)
snssqs.json                                        116.1µ ± 2%   110.0µ ± 2%  -5.26% (p=0.000 n=10)
snssqs_no_dd_context.json                         102.84µ ± 1%   97.83µ ± 2%  -4.87% (p=0.000 n=10)
sqs-aws-header.json                                58.45µ ± 2%   54.79µ ± 1%  -6.25% (p=0.000 n=10)
sqs-batch.json                                     99.64µ ± 2%   92.82µ ± 2%  -6.84% (p=0.000 n=10)
sqs.json                                           72.63µ ± 2%   67.91µ ± 2%  -6.49% (p=0.000 n=10)
sqs_no_dd_context.json                             64.68µ ± 2%   61.36µ ± 2%  -5.13% (p=0.000 n=10)
geomean                                            69.72µ        65.89µ       -5.49%

                                      │ baseline/benchmark.log │        current/benchmark.log        │
                                      │          B/op          │     B/op      vs base               │
api-gateway-appsec.json                           37.14Ki ± 0%   37.13Ki ± 0%       ~ (p=0.986 n=10)
api-gateway-kong-appsec.json                      26.80Ki ± 0%   26.80Ki ± 0%       ~ (p=0.392 n=10)
api-gateway-kong.json                             24.29Ki ± 0%   24.28Ki ± 0%       ~ (p=0.225 n=10)
api-gateway-non-proxy-async.json                  47.94Ki ± 0%   47.93Ki ± 0%       ~ (p=0.305 n=10)
api-gateway-non-proxy.json                        47.15Ki ± 0%   47.14Ki ± 0%       ~ (p=0.566 n=10)
api-gateway-websocket-connect.json                25.37Ki ± 0%   25.37Ki ± 0%  -0.03% (p=0.034 n=10)
api-gateway-websocket-default.json                21.27Ki ± 0%   21.27Ki ± 0%       ~ (p=0.340 n=10)
api-gateway-websocket-disconnect.json             21.05Ki ± 0%   21.05Ki ± 0%       ~ (p=0.446 n=10)
api-gateway.json                                  49.45Ki ± 0%   49.45Ki ± 0%       ~ (p=0.183 n=10)
application-load-balancer.json                    22.24Ki ± 0%   22.22Ki ± 0%  -0.10% (p=0.024 n=10)
cloudfront.json                                   17.56Ki ± 0%   17.57Ki ± 0%       ~ (p=0.985 n=10)
cloudwatch-events.json                            11.62Ki ± 0%   11.61Ki ± 0%  -0.07% (p=0.026 n=10)
cloudwatch-logs.json                              53.29Ki ± 0%   53.28Ki ± 0%       ~ (p=0.183 n=10)
custom.json                                       9.645Ki ± 0%   9.645Ki ± 0%       ~ (p=0.838 n=10)
dynamodb.json                                     40.59Ki ± 0%   40.59Ki ± 0%       ~ (p=0.987 n=10)
empty.json                                        9.217Ki ± 0%   9.191Ki ± 0%  -0.28% (p=0.041 n=10)
eventbridge-custom.json                           13.35Ki ± 0%   13.32Ki ± 0%       ~ (p=0.210 n=10)
http-api.json                                     23.64Ki ± 0%   23.63Ki ± 0%       ~ (p=0.280 n=10)
kinesis-batch.json                                26.94Ki ± 0%   26.92Ki ± 0%  -0.07% (p=0.014 n=10)
kinesis.json                                      17.72Ki ± 0%   17.72Ki ± 0%       ~ (p=0.565 n=10)
s3.json                                           20.26Ki ± 0%   20.23Ki ± 0%       ~ (p=0.271 n=10)
sns-batch.json                                    38.57Ki ± 0%   38.55Ki ± 0%       ~ (p=0.109 n=10)
sns.json                                          23.94Ki ± 0%   23.87Ki ± 0%  -0.32% (p=0.015 n=10)
snssqs.json                                       50.52Ki ± 0%   50.51Ki ± 0%       ~ (p=0.754 n=10)
snssqs_no_dd_context.json                         44.70Ki ± 0%   44.68Ki ± 0%       ~ (p=0.684 n=10)
sqs-aws-header.json                               18.83Ki ± 0%   18.79Ki ± 0%       ~ (p=0.105 n=10)
sqs-batch.json                                    41.59Ki ± 0%   41.52Ki ± 0%  -0.17% (p=0.011 n=10)
sqs.json                                          25.52Ki ± 0%   25.49Ki ± 1%       ~ (p=0.256 n=10)
sqs_no_dd_context.json                            20.64Ki ± 1%   20.64Ki ± 0%       ~ (p=0.566 n=10)
geomean                                           25.62Ki        25.60Ki       -0.07%

                                      │ baseline/benchmark.log │        current/benchmark.log        │
                                      │       allocs/op        │ allocs/op   vs base                 │
api-gateway-appsec.json                             629.5 ± 0%   629.5 ± 0%       ~ (p=1.000 n=10)
api-gateway-kong-appsec.json                        488.0 ± 0%   488.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-kong.json                               466.0 ± 0%   466.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-non-proxy-async.json                    725.0 ± 0%   725.0 ± 0%       ~ (p=0.087 n=10)
api-gateway-non-proxy.json                          716.0 ± 0%   716.0 ± 0%       ~ (p=1.000 n=10)
api-gateway-websocket-connect.json                  453.0 ± 0%   453.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-websocket-default.json                  379.0 ± 0%   379.0 ± 0%       ~ (p=1.000 n=10) ¹
api-gateway-websocket-disconnect.json               369.0 ± 0%   369.0 ± 0%       ~ (p=1.000 n=10)
api-gateway.json                                    790.0 ± 0%   790.0 ± 0%       ~ (p=0.628 n=10)
application-load-balancer.json                      352.0 ± 0%   351.0 ± 0%       ~ (p=0.070 n=10)
cloudfront.json                                     283.0 ± 0%   283.5 ± 0%       ~ (p=0.650 n=10)
cloudwatch-events.json                              220.0 ± 0%   220.0 ± 0%       ~ (p=1.000 n=10) ¹
cloudwatch-logs.json                                215.0 ± 0%   215.0 ± 0%       ~ (p=1.000 n=10)
custom.json                                         168.0 ± 0%   168.0 ± 0%       ~ (p=1.000 n=10)
dynamodb.json                                       588.5 ± 0%   589.0 ± 0%       ~ (p=0.350 n=10)
empty.json                                          160.0 ± 1%   159.0 ± 1%       ~ (p=0.170 n=10)
eventbridge-custom.json                             254.0 ± 0%   253.0 ± 0%       ~ (p=0.261 n=10)
http-api.json                                       432.0 ± 0%   432.0 ± 0%       ~ (p=1.000 n=10)
kinesis-batch.json                                  390.0 ± 0%   390.0 ± 0%       ~ (p=0.054 n=10)
kinesis.json                                        285.0 ± 0%   285.0 ± 0%       ~ (p=0.582 n=10)
s3.json                                             357.5 ± 0%   357.0 ± 0%       ~ (p=1.000 n=10)
sns-batch.json                                      455.0 ± 0%   454.0 ± 0%       ~ (p=0.173 n=10)
sns.json                                            323.0 ± 0%   322.0 ± 0%       ~ (p=0.073 n=10)
snssqs.json                                         445.5 ± 0%   445.0 ± 0%       ~ (p=0.518 n=10)
snssqs_no_dd_context.json                           399.0 ± 0%   398.5 ± 0%       ~ (p=0.722 n=10)
sqs-aws-header.json                                 274.0 ± 0%   273.5 ± 1%       ~ (p=0.154 n=10)
sqs-batch.json                                      503.5 ± 0%   502.5 ± 0%  -0.20% (p=0.037 n=10)
sqs.json                                            351.5 ± 0%   351.0 ± 1%       ~ (p=0.175 n=10)
sqs_no_dd_context.json                              325.0 ± 1%   325.0 ± 0%       ~ (p=0.863 n=10)
geomean                                             376.5        376.2       -0.09%
¹ all samples are equal

@GustavoCaso
Copy link
Member Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented May 23, 2024

🚂 MergeQueue

Pull request added to the queue.

This build is going to start soon! (estimated merge in less than 28m)

Use /merge -c to cancel this operation!

@dd-mergequeue dd-mergequeue bot merged commit 1442356 into main May 23, 2024
212 checks passed
@dd-mergequeue dd-mergequeue bot deleted the add-dependency-list-test-for-the-serverless-binary branch May 23, 2024 06:09
@github-actions github-actions bot modified the milestones: 7.54.0, 7.55.0 May 23, 2024
purple4reina added a commit that referenced this pull request Nov 15, 2024
purple4reina added a commit that referenced this pull request Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog qa/no-code-change No code change in Agent code requiring validation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants