-
Notifications
You must be signed in to change notification settings - Fork 145
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
Build the FleetInstaller executable and include in Windows OCI image #6644
Conversation
64a4c7b
to
29a2ff8
Compare
0b6eda5
to
d090638
Compare
Datadog ReportBranch report: ✅ 0 Failed, 250536 Passed, 2448 Skipped, 18h 33m 52.4s Total Time |
0f5a72e
to
8f8c907
Compare
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:
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). gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6644) - mean (69ms) : 65, 74
. : milestone, 69,
master - mean (69ms) : 66, 71
. : milestone, 69,
section CallTarget+Inlining+NGEN
This PR (6644) - mean (992ms) : 966, 1018
. : milestone, 992,
master - mean (997ms) : 975, 1018
. : milestone, 997,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6644) - mean (102ms) : 100, 103
. : milestone, 102,
master - mean (102ms) : 100, 104
. : milestone, 102,
section CallTarget+Inlining+NGEN
This PR (6644) - mean (674ms) : 657, 690
. : milestone, 674,
master - mean (674ms) : 658, 690
. : milestone, 674,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6644) - mean (89ms) : 87, 91
. : milestone, 89,
master - mean (89ms) : 87, 92
. : milestone, 89,
section CallTarget+Inlining+NGEN
This PR (6644) - mean (630ms) : 609, 650
. : milestone, 630,
master - mean (633ms) : 618, 647
. : milestone, 633,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6644) - mean (191ms) : 186, 196
. : milestone, 191,
master - mean (191ms) : 186, 196
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (6644) - mean (1,103ms) : 1072, 1134
. : milestone, 1103,
master - mean (1,105ms) : 1078, 1133
. : milestone, 1105,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6644) - mean (272ms) : 267, 276
. : milestone, 272,
master - mean (271ms) : 266, 275
. : milestone, 271,
section CallTarget+Inlining+NGEN
This PR (6644) - mean (864ms) : 828, 900
. : milestone, 864,
master - mean (871ms) : 829, 913
. : milestone, 871,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6644) - mean (262ms) : 257, 267
. : milestone, 262,
master - mean (263ms) : 259, 266
. : milestone, 263,
section CallTarget+Inlining+NGEN
This PR (6644) - mean (848ms) : 819, 876
. : milestone, 848,
master - mean (853ms) : 813, 893
. : milestone, 853,
|
Benchmarks Report for tracer 🐌Benchmarks for #6644 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️
|
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 | 1.125 | 461.61 | 410.33 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 463ns | 0.636ns | 2.46ns | 0.00808 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 553ns | 0.772ns | 2.99ns | 0.00779 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 609ns | 1.24ns | 4.78ns | 0.0916 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 540ns | 0.8ns | 3.1ns | 0.00978 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 738ns | 0.965ns | 3.74ns | 0.00938 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 888ns | 1.47ns | 5.7ns | 0.104 | 0 | 0 | 658 B |
#6644 | StartFinishSpan |
net6.0 | 410ns | 0.498ns | 1.93ns | 0.00812 | 0 | 0 | 576 B |
#6644 | StartFinishSpan |
netcoreapp3.1 | 556ns | 1ns | 3.88ns | 0.00766 | 0 | 0 | 576 B |
#6644 | StartFinishSpan |
net472 | 603ns | 1.51ns | 5.85ns | 0.0916 | 0 | 0 | 578 B |
#6644 | StartFinishScope |
net6.0 | 491ns | 1.25ns | 4.83ns | 0.00965 | 0 | 0 | 696 B |
#6644 | StartFinishScope |
netcoreapp3.1 | 763ns | 1.34ns | 5.19ns | 0.00907 | 0 | 0 | 696 B |
#6644 | StartFinishScope |
net472 | 856ns | 1.76ns | 6.8ns | 0.104 | 0 | 0 | 658 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 657ns | 0.752ns | 2.91ns | 0.00979 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 956ns | 1.04ns | 4.02ns | 0.00917 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.1μs | 1.64ns | 6.34ns | 0.104 | 0 | 0 | 658 B |
#6644 | RunOnMethodBegin |
net6.0 | 661ns | 0.913ns | 3.53ns | 0.00997 | 0 | 0 | 696 B |
#6644 | RunOnMethodBegin |
netcoreapp3.1 | 944ns | 1.53ns | 5.93ns | 0.00915 | 0 | 0 | 696 B |
#6644 | RunOnMethodBegin |
net472 | 1.11μs | 1.62ns | 6.26ns | 0.104 | 0 | 0 | 658 B |
9ea0872
to
16cda8e
Compare
8f8c907
to
91fc7fe
Compare
16cda8e
to
d77915f
Compare
2341ef9
to
e3f1d41
Compare
…6643) ## Summary of changes Creates an "installer" executable, designed to be executed by the fleet installer as part of configuring Windows SSI. ## Reason for change We don't want to use the existing MSI, primarily because it requires stopping and starting IIS when you update it, otherwise we risk causing crashes. The datadog-installer is responsible for copying the files added to the Windows OCI image, and running the Datadog.FleetInstaller.exe executable to configure the application. Similarly, it calls this exe when uninstalling a tracer version or removing the product ## Implementation details - Uses the fusion.dll API directly to manage the GAC entries, based on the generated PInvoke APIs defined [here](https://github.com/dotnet/pinvoke/tree/main/src/Fusion) - Sets the envivornment variables by setting the `environmentVariables` section in applicationHost.config. Uses [the _Microsoft.Web.Administration_ NuGet](https://www.nuget.org/packages/Microsoft.Web.Administration) to interact with the native API. ## Test coverage Manually tested. Subsequent PRs in the stack will add smoke and integration tests. ## Other details Explicitly designed to run on Windows Server 2016+, so targets .NET FX for simplicity. The _Microsoft.Web.Administration_ nuget is a .NET Standard 1.x dll, which creates an annoying number of dlls in the output, but it's just ugly, it works fine. There's a fair amount of duplication in the Fusion API/Microsoft.Web.Administration code with what the `dd-dotnet`/`dd-trace` tool currently does. We could certainly look at consolidating that down the line, and potentially rewriting the fleet installer tool to be a NativeAOT executable, but it's probably not worth the effort at this point. The explicit `<RuntimeIdentifier>win-x64</RuntimeIdentifier>` in the _.csproj_ is an odd one. Without it, for some reason, the gitlab build restores for x86 but tries to build for x64 which is... weird. Also, can't repro the issue locally. _Really_ don't understand what's happening there, but this works so... 🙈 Part of a stack of PRs: - #6643 👈 - #6644 - #6645
Also create a zip (as easier to manage in gitlab)
e3f1d41
to
4236975
Compare
## Summary of changes Adds a new smoke test stage, for running inside Windows using the fleet installer ## Reason for change Emulates an end-to-end smoke test for the fleet installer executable. ## Implementation details - Build the fleet installer in the AzDo pipeline, as part of the `package-windows` stage - Adds a new `fleet_installer_smoke_tests` stage for running the smoke tests - Fix issues in ASP.NET Core test app, so that it works when hosted in IIS - Add a dockerfile for running the ASP.NET Core app with the fleet installer, hosted in IIS That latter point proved to be somewhat of a nightmare. The resulting dockerfile feels kind of horrible, but I couldn't find another way to have: - Delay the start of the app pool until the container image is running (i.e. not during build time) - Start the worker process when the app pool starts, _without_ an incoming request - Shut down the app pool when the worker process exits (which is the way the aspnetcore app works) - Exit the container The workaround, using the entrypoint script, makes a 404 request to the app to spin up the worker process, manually shuts down the app pool (to make sure the app definitely shuts down and flushes), and then exits. This causes an additional span in the traces, so needed to create new snapshots. ## Test coverage This gives basic snapshot testing on 2022 which is the only version I could get to work given the hosted images on AzDo and the available python base images for the test agent. I think that is sufficient - we are going to have additional end-to-end testing of Windows images in system tests anyway. ## Other details Part of a stack of PRs: - #6643 - #6644 - #6645 👈
Summary of changes
Reason for change
We need to build the fleet installer executable, and include it in a Windows OI image
Implementation details
BuildFleetInstaller
to explicitly publish the fleet installerdownload-single-step-artifacts
to grab thewindows-tracer-home.zip
and fleet installer artifact from theBuild
stageFor tagged releases this flow is a bit more convoluted. We need to grab the fleet-instller.exe artifact from the s3 upload that's done in the
publish
step, because we don't store it on the GitHub release. It's a bit ugly, but it works.Test coverage
This is the test - if it builds, and the OCI image contains the expected files, we're good
Other details
Note that currently, the final OCI images will not contain Windows layers, until we unblock that both in our gitlab YAML, and in the libdatadog-build one pipeline.
Part of a stack of PRs: