Skip to content

Try to head off future build issues#5770

Merged
andrewlock merged 5 commits into
masterfrom
andrew/ci/try-fix-builds
Aug 28, 2024
Merged

Try to head off future build issues#5770
andrewlock merged 5 commits into
masterfrom
andrew/ci/try-fix-builds

Conversation

@andrewlock

@andrewlock andrewlock commented Jul 3, 2024

Copy link
Copy Markdown
Member

Summary of changes

  • Vendor the dotnet-install.sh and dotnet-install.ps1 scripts into the repo
  • Replace the centos7 repo references with vault based ones

Reason for change

Implementation details

  • Vendor the scripts
  • Replace downloading of the script with direct reference
  • do some sed to replace the centos7 repo

Test coverage

Largely, this is the test, if it all works, I think we're good

Other details

Supersedes #5759
Requires updating the VMs

@andrewlock andrewlock added the area:builds project files, build scripts, pipelines, versioning, releases, packages label Jul 3, 2024
@andrewlock
andrewlock requested a review from a team as a code owner July 3, 2024 13:33
@lucaspimentel
lucaspimentel requested a review from a team July 3, 2024 13:55
@datadog-ddstaging

datadog-ddstaging Bot commented Jul 3, 2024

Copy link
Copy Markdown

Datadog Report

Branch report: andrew/ci/try-fix-builds
Commit report: 9001630
Test service: dd-trace-dotnet

✅ 0 Failed, 298881 Passed, 1587 Skipped, 12h 23m 48.78s Total Time

@andrewlock

andrewlock commented Jul 3, 2024

Copy link
Copy Markdown
Member Author

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

@andrewlock

andrewlock commented Jul 3, 2024

Copy link
Copy Markdown
Member Author

Benchmarks Report for tracer 🐌

Benchmarks for #5770 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.115
  • All benchmarks have the same allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 7.78μs 44.1ns 330ns 0.0154 0.00768 0 5.43 KB
master StartStopWithChild netcoreapp3.1 9.99μs 55.4ns 355ns 0.0255 0.0153 0.0051 5.62 KB
master StartStopWithChild net472 16μs 51ns 191ns 1.04 0.334 0.111 6.06 KB
#5770 StartStopWithChild net6.0 7.78μs 43.4ns 301ns 0.0159 0.00795 0 5.42 KB
#5770 StartStopWithChild netcoreapp3.1 9.98μs 56.1ns 355ns 0.0147 0.00489 0 5.62 KB
#5770 StartStopWithChild net472 15.9μs 53.4ns 200ns 1.02 0.303 0.0957 6.07 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 468μs 362ns 1.4μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 633μs 477ns 1.79μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 842μs 582ns 2.26μs 0.419 0 0 3.3 KB
#5770 WriteAndFlushEnrichedTraces net6.0 473μs 190ns 736ns 0 0 0 2.7 KB
#5770 WriteAndFlushEnrichedTraces netcoreapp3.1 639μs 297ns 1.15μs 0 0 0 2.7 KB
#5770 WriteAndFlushEnrichedTraces net472 831μs 269ns 1.04μs 0.414 0 0 3.3 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 187μs 1.06μs 7.12μs 0.213 0 0 18.45 KB
master SendRequest netcoreapp3.1 216μs 1.25μs 10.5μs 0.227 0 0 20.61 KB
master SendRequest net472 0.00159ns 0.000462ns 0.00179ns 0 0 0 0 b
#5770 SendRequest net6.0 189μs 1.04μs 6.15μs 0.184 0 0 18.45 KB
#5770 SendRequest netcoreapp3.1 219μs 1.24μs 8.29μs 0.218 0 0 20.61 KB
#5770 SendRequest net472 0.000204ns 0.000176ns 0.000634ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 570μs 3.1μs 18.1μs 0.561 0 0 41.66 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 683μs 2.89μs 13.6μs 0.349 0 0 41.79 KB
master WriteAndFlushEnrichedTraces net472 883μs 4.07μs 15.2μs 8.3 2.62 0.437 53.34 KB
#5770 WriteAndFlushEnrichedTraces net6.0 577μs 2.81μs 11.6μs 0.566 0 0 41.57 KB
#5770 WriteAndFlushEnrichedTraces netcoreapp3.1 674μs 3.28μs 13.5μs 0.332 0 0 41.81 KB
#5770 WriteAndFlushEnrichedTraces net472 856μs 4μs 15.5μs 8.87 2.53 0.422 53.29 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.28μs 1.45ns 5.63ns 0.0141 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.69μs 1.05ns 4.06ns 0.0142 0 0 1.02 KB
master ExecuteNonQuery net472 2.02μs 2.05ns 7.1ns 0.156 0 0 987 B
#5770 ExecuteNonQuery net6.0 1.26μs 1.68ns 6.52ns 0.0145 0 0 1.02 KB
#5770 ExecuteNonQuery netcoreapp3.1 1.77μs 1.37ns 5.29ns 0.0135 0 0 1.02 KB
#5770 ExecuteNonQuery net472 1.95μs 1.95ns 7.54ns 0.156 0 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.23μs 0.353ns 1.22ns 0.0135 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.57μs 0.618ns 2.39ns 0.0135 0 0 976 B
master CallElasticsearch net472 2.55μs 1.24ns 4.65ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.34μs 0.981ns 3.67ns 0.0134 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.53μs 0.633ns 2.45ns 0.0137 0 0 1.02 KB
master CallElasticsearchAsync net472 2.43μs 5.08ns 19.7ns 0.166 0 0 1.05 KB
#5770 CallElasticsearch net6.0 1.15μs 0.979ns 3.79ns 0.0138 0 0 976 B
#5770 CallElasticsearch netcoreapp3.1 1.59μs 3.56ns 13.8ns 0.0128 0 0 976 B
#5770 CallElasticsearch net472 2.38μs 1.82ns 7.03ns 0.157 0.0012 0 995 B
#5770 CallElasticsearchAsync net6.0 1.22μs 0.871ns 3.26ns 0.013 0 0 952 B
#5770 CallElasticsearchAsync netcoreapp3.1 1.66μs 0.716ns 2.58ns 0.0136 0 0 1.02 KB
#5770 CallElasticsearchAsync net472 2.53μs 2.16ns 8.38ns 0.167 0.00127 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.2μs 0.567ns 2.12ns 0.0132 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.65μs 1.72ns 6.22ns 0.0125 0 0 952 B
master ExecuteAsync net472 1.8μs 0.948ns 3.67ns 0.145 0 0 915 B
#5770 ExecuteAsync net6.0 1.21μs 0.444ns 1.6ns 0.0134 0 0 952 B
#5770 ExecuteAsync netcoreapp3.1 1.64μs 1.14ns 4.26ns 0.0129 0 0 952 B
#5770 ExecuteAsync net472 1.77μs 0.943ns 3.65ns 0.145 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.03μs 2.33ns 8.7ns 0.0306 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.19μs 1.88ns 7.02ns 0.0363 0 0 2.76 KB
master SendAsync net472 7.75μs 2.25ns 8.73ns 0.499 0 0 3.15 KB
#5770 SendAsync net6.0 3.97μs 1.93ns 7.49ns 0.0299 0 0 2.22 KB
#5770 SendAsync netcoreapp3.1 5.07μs 4.61ns 17.8ns 0.0353 0 0 2.76 KB
#5770 SendAsync net472 7.82μs 1.47ns 5.7ns 0.498 0 0 3.15 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.49μs 0.787ns 3.05ns 0.0231 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.26μs 3.4ns 13.2ns 0.0226 0 0 1.64 KB
master EnrichedLog net472 2.74μs 1.85ns 7.18ns 0.249 0 0 1.57 KB
#5770 EnrichedLog net6.0 1.53μs 4.35ns 16.8ns 0.023 0 0 1.64 KB
#5770 EnrichedLog netcoreapp3.1 2.3μs 1.03ns 3.86ns 0.022 0 0 1.64 KB
#5770 EnrichedLog net472 2.76μs 2ns 7.73ns 0.249 0 0 1.57 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 114μs 306ns 1.15μs 0.0577 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 120μs 278ns 1.08μs 0.0592 0 0 4.28 KB
master EnrichedLog net472 147μs 212ns 823ns 0.665 0.222 0 4.46 KB
#5770 EnrichedLog net6.0 118μs 376ns 1.46μs 0.0587 0 0 4.28 KB
#5770 EnrichedLog netcoreapp3.1 118μs 274ns 1.06μs 0.059 0 0 4.28 KB
#5770 EnrichedLog net472 150μs 244ns 947ns 0.674 0.225 0 4.46 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 3μs 0.771ns 2.88ns 0.03 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.36μs 1.29ns 4.67ns 0.03 0 0 2.2 KB
master EnrichedLog net472 4.9μs 1.8ns 6.98ns 0.319 0 0 2.02 KB
#5770 EnrichedLog net6.0 3.15μs 1.07ns 4.14ns 0.03 0 0 2.2 KB
#5770 EnrichedLog netcoreapp3.1 4.4μs 3.23ns 12.5ns 0.0285 0 0 2.2 KB
#5770 EnrichedLog net472 4.84μs 1.39ns 5.38ns 0.321 0 0 2.02 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.3μs 0.857ns 3.32ns 0.0156 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.79μs 0.976ns 3.78ns 0.0153 0 0 1.14 KB
master SendReceive net472 2.08μs 1.02ns 3.82ns 0.183 0 0 1.16 KB
#5770 SendReceive net6.0 1.37μs 0.427ns 1.66ns 0.0157 0 0 1.14 KB
#5770 SendReceive netcoreapp3.1 1.73μs 1.08ns 4.2ns 0.0156 0 0 1.14 KB
#5770 SendReceive net472 2.25μs 1.07ns 4.12ns 0.183 0.00112 0 1.16 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.71μs 0.516ns 2ns 0.0217 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.91μs 2.67ns 10.3ns 0.0216 0 0 1.65 KB
master EnrichedLog net472 4.37μs 1.25ns 4.66ns 0.323 0 0 2.04 KB
#5770 EnrichedLog net6.0 2.74μs 0.588ns 2.28ns 0.0218 0 0 1.6 KB
#5770 EnrichedLog netcoreapp3.1 3.95μs 3.78ns 14.7ns 0.0217 0 0 1.65 KB
#5770 EnrichedLog net472 4.42μs 1.75ns 6.78ns 0.324 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 397ns 0.213ns 0.825ns 0.00801 0 0 576 B
master StartFinishSpan netcoreapp3.1 666ns 0.438ns 1.7ns 0.00774 0 0 576 B
master StartFinishSpan net472 567ns 0.285ns 1.1ns 0.0918 0 0 578 B
master StartFinishScope net6.0 490ns 0.149ns 0.578ns 0.00974 0 0 696 B
master StartFinishScope netcoreapp3.1 697ns 0.358ns 1.39ns 0.00942 0 0 696 B
master StartFinishScope net472 913ns 0.876ns 3.39ns 0.104 0 0 658 B
#5770 StartFinishSpan net6.0 393ns 0.215ns 0.835ns 0.00812 0 0 576 B
#5770 StartFinishSpan netcoreapp3.1 613ns 0.252ns 0.943ns 0.00771 0 0 576 B
#5770 StartFinishSpan net472 570ns 0.269ns 1.04ns 0.0917 0 0 578 B
#5770 StartFinishScope net6.0 486ns 0.283ns 1.1ns 0.00976 0 0 696 B
#5770 StartFinishScope netcoreapp3.1 725ns 1.52ns 5.88ns 0.00944 0 0 696 B
#5770 StartFinishScope net472 875ns 0.835ns 3.01ns 0.105 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5770

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.115 677.94 608.21

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 678ns 0.279ns 1.08ns 0.00987 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 945ns 0.656ns 2.54ns 0.00948 0 0 696 B
master RunOnMethodBegin net472 1.11μs 0.407ns 1.58ns 0.104 0 0 658 B
#5770 RunOnMethodBegin net6.0 608ns 0.408ns 1.58ns 0.00985 0 0 696 B
#5770 RunOnMethodBegin netcoreapp3.1 940ns 0.353ns 1.27ns 0.00944 0 0 696 B
#5770 RunOnMethodBegin net472 1.09μs 1.66ns 6.44ns 0.104 0 0 658 B

@andrewlock

andrewlock commented Jul 4, 2024

Copy link
Copy Markdown
Member Author

Throughput/Crank Report ⚡

Throughput results for AspNetCoreSimpleController comparing the following branches/commits:

Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red.

Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards!

gantt
    title Throughput Linux x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5770) (11.706M)   : 0, 11705613
    master (11.924M)   : 0, 11924044
    benchmarks/2.9.0 (11.883M)   : 0, 11882814

    section Automatic
    This PR (5770) (7.950M)   : 0, 7950178
    master (7.828M)   : 0, 7827944
    benchmarks/2.9.0 (8.446M)   : 0, 8445613

    section Trace stats
    master (8.153M)   : 0, 8153092

    section Manual
    master (11.617M)   : 0, 11616636

    section Manual + Automatic
    This PR (5770) (7.256M)   : 0, 7256160
    master (7.365M)   : 0, 7364918

    section DD_TRACE_ENABLED=0
    master (10.799M)   : 0, 10798925

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5770) (9.438M)   : 0, 9438129
    master (9.551M)   : 0, 9551120
    benchmarks/2.9.0 (9.760M)   : 0, 9759697

    section Automatic
    This PR (5770) (6.588M)   : 0, 6587606
    master (6.610M)   : 0, 6609773

    section Trace stats
    master (6.890M)   : 0, 6889536

    section Manual
    master (9.385M)   : 0, 9384897

    section Manual + Automatic
    This PR (5770) (6.197M)   : 0, 6196862
    master (6.104M)   : 0, 6103569

    section DD_TRACE_ENABLED=0
    master (8.918M)   : 0, 8917738

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5770) (9.999M)   : 0, 9998839

    section Automatic
    This PR (5770) (6.705M)   : 0, 6705428

    section Manual + Automatic
    This PR (5770) (6.291M)   : 0, 6291119

Loading

@andrewlock

Copy link
Copy Markdown
Member Author

When this is merged, we should also bump to the latest .NET 8 build version as it likely includes fixes we need

@andrewlock
andrewlock force-pushed the andrew/ci/try-fix-builds branch from 0a59c1e to fe1376b Compare August 15, 2024 12:34
@andrewlock andrewlock mentioned this pull request Aug 15, 2024
3 tasks
@andrewlock
andrewlock force-pushed the andrew/ci/try-fix-builds branch from fe1376b to 9001630 Compare August 23, 2024 09:46
@andrewlock
andrewlock merged commit bc54af3 into master Aug 28, 2024
@andrewlock
andrewlock deleted the andrew/ci/try-fix-builds branch August 28, 2024 13:42
@github-actions github-actions Bot added this to the vNext-v3 milestone Aug 28, 2024
andrewlock added a commit that referenced this pull request Aug 28, 2024
## Summary of changes

Replaces the ruby tool `fpm` with `nfpm` and `tar`

## Reason for change

`fpm` is a ruby tool, which means we have to install ruby. This has
historically caused a bunch of issues at various points when
dependencies change (e.g. we add/update anything or change dockerfiles).

[`nfpm` is a go tool](https://github.com/goreleaser/nfpm) created
specifically to do pretty much the same thing as `fpm`, but without
requiring ruby. The only slightly annoying thing is that it doesn't
support raw "tar" so we have to use the built-in `tar` for that
(although that's not a big hardship).

## Implementation details

- Install `nfpm` in the docker images and remove the `fpm` install (and
removing all the other ruby-related code)
- Call `tar` to pack the `tar` images, and `nfpm` to pack the `deb/rpm`
packages
- `nfpm` is a "config" based tool, so we dump the yaml config to a file,
and pass that to the execution
- I have validated the nfpm and fpm deb output are essentially
identical, there are just a few nuances
- `fpm` adds a `License` field to the `.deb` header, but that's non
standard. [The correct
approach](https://www.debian.org/doc/debian-policy/ch-docs.html#copyright-information)
is to include a specific license file. See [this
issue](goreleaser/nfpm#847) for more details.
- Similarly, `fpm` adds a `Vendor` field that is non standard (but
`Maintainer` is standard and is added).
- `fpm` adds `Relocations: /var/datadog` to the `.rpm` header, so I have
replicated that for nfpm, but I don't know that we actually _want_
that... If we let people relocate the headers, then the documentation is
wrong for the profiler env vars etc. Left it as-is anyway, to reduce
chance of breaking people, just something I spotted.
- The `"Apache License 2.0"` license string used for `.rpm` previously
is not a valid value, as defined by fedora, so switched it to the
supported moniker
[here](https://docs.fedoraproject.org/en-US/legal/allowed-licenses/).
- The `tar` files were "accidentally" including the before/after
scripts, so I've made sure to still include them, incase anyone was
relying on those (they run the `createLogPath.sh` file, and create a
symlink to dd-dotnet in `/usr/bin`)

## Test coverage

[Ran a full test with all installers
here](https://dev.azure.com/datadoghq/dd-trace-dotnet/_build/results?buildId=162539&view=results)
- ignore the couple of failures in the dotnet tool smoke tests, those
are failures on `master` I need to fix 😅

Will manually compare the output of this run too:
- [x] tar (`tar -tzvf *.tar.gz`)
- The same, except the before/after scripts weren't being made
executable. Fixed
- [x] deb (`dpkg --info *.deb` and `dpkg -c *.deb`)
  - Minor differences: 
    - nfpm adds the directories as entries
    - nfpm doesn't have the non-standard License field (unlike fpm)
    - nfpm adds the license in the required copyright path
    - nfpm doesn't include a dummy changelog.gz file (unlike fpm)
- [x] rpm (`rpm -qipl --scripts *.rpm`)
- Minor differences, nfpm adds the directories as entries, nothing
significant though

## Other details

Stacked on
- #5770

because we need to change the dockerfiles, and we need the Centos7 fixes
in there at the very least. We'll need to update the VMSS images though
after making these changes so I've been delaying until that makes sense
up to this point.
andrewlock added a commit that referenced this pull request Aug 28, 2024
## Summary of changes

Adds support for the tracer on alpine on ARM64

## Reason for change

We currently support x64 on glibc/alpine but only glibc on arm64. This
closes that matrix which makes it easier to understand

## Implementation details

There's several layers, but at a high level
- Anywhere where we detect platform, make sure to include
`linux-musl-arm64` as well as `linux-arm64`
- Build the tracer + profiler on alpine arm64

There were several difficulties
- The ruby-based fpm bundler we use doesn't work on alpine arm64, hence
#5905
- I couldn't get our existing alpine.build.dockerfile to compile on
arm64 (where we currently compile llvm/clang16 on alpine14).
- To work around it, created a separate alpine.build.arm64.dockerfile
image which uses alpine:18 (the first version that includes clang16) as
the base.
- Obviously this gives us different requirements in arm64, but I think
that's fine because a) this is a new feature b) we already have
differences on the glibc requirements for arm64 c) We only support .NET
5+ anyway on arm64 (.NET 6 really given .NET 5 is mostly gone) and they
ship alpine:18 images for .NET 6+
- I created a multi arch base image from the two base images ([as some
bloke with a blog describes
here](https://andrewlock.net/combining-multiple-docker-images-into-a-multi-arch-image/))
- I had difficulty compiling the profiler on arm64 initially (we require
it for some crash tracking functionality), as we were getting `undefined
reference to `_Uaarch64_get_accessors_int'` when trying to compile
libunwind. @gleocadie tracked it down to [this
issue](libunwind/libunwind#788), and fixed it
by just not building the libunwind tests 🙇‍♂️
- The sqlite IAST instrumentation tests on alpine arm64 were failing in
.NET 5. I _think_ that's because the sqlite package we're using there
doesn't support it (which makes sense) so just disabled the tests for
that scenario. They pass in .NET 6+ so I'm not worried about it.
- Removed the "noop" smoke tests stage (there's nothing to run in it
currently)
- We can't even install .NET Core 2.1 using the dotnet install script on
alpine arm64, so bailing out. We can probably bail out of more too, but
that's not _necessary_ so haven't done it yet.

There's still one outstanding issue I can't get my head around, on
_debian x64_ (i.e. not something that should have changed) The
`OnEolFrameworkInSsi_WhenForwarderPathExists_CallsForwarderWithExpectedTelemetry`
tests is failing by crashing. It's bizarre, I can't figure it out, if
anyone has any ideas, please let me know 😅

## Test coverage

I've run full installer + full TFM tests
[here](https://dev.azure.com/datadoghq/dd-trace-dotnet/_build/results?buildId=162869&view=results)
🤞

## Other details

Stacked on 
- #5770
- #5905

as they both change key parts of the build + will mean we need to
rebuild the VMs

Fixes #3850

---------

Co-authored-by: Gregory LEOCADIE <[email protected]>
andrewlock added a commit that referenced this pull request Aug 30, 2024
## Summary of changes

- Vendor the `dotnet-install.sh` and `dotnet-install.ps1` scripts into
the repo
- Replace the centos7 repo references with vault based ones

## Reason for change

- https://dotnet.microsoft.com/ went down recently, which meant we
couldn't download `dotnet-install.sh` or `dotnet-install.ps1`, which
broke a bunch of things, so vendor it.
- Centos7 recently shut down their repo feed, which means you can no
longer pull packages. Use vault repo instead until we deprecate centos7
entirely

## Implementation details

- Vendor the scripts
- Replace downloading of the script with direct reference
- do some `sed` to replace the centos7 repo

## Test coverage

Largely, this is the test, if it all works, I think we're good

## Other details

Supersedes #5759
Requires updating the VMs

<!-- ⚠️ Note: where possible, please obtain 2 approvals prior to
merging. Unless CODEOWNERS specifies otherwise, for external teams it is
typically best to have one review from a team member, and one review
from apm-dotnet. Trivial changes do not require 2 reviews. -->
andrewlock added a commit that referenced this pull request Aug 30, 2024
## Summary of changes

Replaces the ruby tool `fpm` with `nfpm` and `tar`

## Reason for change

`fpm` is a ruby tool, which means we have to install ruby. This has
historically caused a bunch of issues at various points when
dependencies change (e.g. we add/update anything or change dockerfiles).

[`nfpm` is a go tool](https://github.com/goreleaser/nfpm) created
specifically to do pretty much the same thing as `fpm`, but without
requiring ruby. The only slightly annoying thing is that it doesn't
support raw "tar" so we have to use the built-in `tar` for that
(although that's not a big hardship).

## Implementation details

- Install `nfpm` in the docker images and remove the `fpm` install (and
removing all the other ruby-related code)
- Call `tar` to pack the `tar` images, and `nfpm` to pack the `deb/rpm`
packages
- `nfpm` is a "config" based tool, so we dump the yaml config to a file,
and pass that to the execution
- I have validated the nfpm and fpm deb output are essentially
identical, there are just a few nuances
- `fpm` adds a `License` field to the `.deb` header, but that's non
standard. [The correct
approach](https://www.debian.org/doc/debian-policy/ch-docs.html#copyright-information)
is to include a specific license file. See [this
issue](goreleaser/nfpm#847) for more details.
- Similarly, `fpm` adds a `Vendor` field that is non standard (but
`Maintainer` is standard and is added).
- `fpm` adds `Relocations: /var/datadog` to the `.rpm` header, so I have
replicated that for nfpm, but I don't know that we actually _want_
that... If we let people relocate the headers, then the documentation is
wrong for the profiler env vars etc. Left it as-is anyway, to reduce
chance of breaking people, just something I spotted.
- The `"Apache License 2.0"` license string used for `.rpm` previously
is not a valid value, as defined by fedora, so switched it to the
supported moniker
[here](https://docs.fedoraproject.org/en-US/legal/allowed-licenses/).
- The `tar` files were "accidentally" including the before/after
scripts, so I've made sure to still include them, incase anyone was
relying on those (they run the `createLogPath.sh` file, and create a
symlink to dd-dotnet in `/usr/bin`)

## Test coverage

[Ran a full test with all installers
here](https://dev.azure.com/datadoghq/dd-trace-dotnet/_build/results?buildId=162539&view=results)
- ignore the couple of failures in the dotnet tool smoke tests, those
are failures on `master` I need to fix 😅

Will manually compare the output of this run too:
- [x] tar (`tar -tzvf *.tar.gz`)
- The same, except the before/after scripts weren't being made
executable. Fixed
- [x] deb (`dpkg --info *.deb` and `dpkg -c *.deb`)
  - Minor differences: 
    - nfpm adds the directories as entries
    - nfpm doesn't have the non-standard License field (unlike fpm)
    - nfpm adds the license in the required copyright path
    - nfpm doesn't include a dummy changelog.gz file (unlike fpm)
- [x] rpm (`rpm -qipl --scripts *.rpm`)
- Minor differences, nfpm adds the directories as entries, nothing
significant though

## Other details

Stacked on
- #5770

because we need to change the dockerfiles, and we need the Centos7 fixes
in there at the very least. We'll need to update the VMSS images though
after making these changes so I've been delaying until that makes sense
up to this point.
andrewlock added a commit that referenced this pull request Aug 30, 2024
## Summary of changes

The `release/2.x` branch is broken since I updated the VMs

## Reason for change

I updated VMs yesterday, which cleared the build cache. I knew that
would slow down release/2.x builds but I forgot it would completely
break them due to the centos7 mess.

## Implementation details

Backported some PRs to fix the layer caching etc

- #5770
- #5905
- #5933 (just the changes
in the alpine dockerfile)

## Test coverage

This is the test, hopefully it works 🤞
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:builds project files, build scripts, pipelines, versioning, releases, packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants