From 10220f144589fa5e4272e9fb1cd15903731d8b70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:14:51 -0500 Subject: [PATCH 01/22] make sure `upload_to_azure` includes `r2r` artifacts but not in the release artifacts --- .azure-pipelines/ultimate-pipeline.yml | 46 +++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 9baa7fd8fa4c..75fb2efd598a 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -458,7 +458,7 @@ stages: parameters: target: builder baseImage: debian - command: "BuildManagedTracerHomeR2R ExtractDebugInfoLinux" + command: "BuildManagedTracerHomeR2R ExtractDebugInfoLinux ValidateNativeTracerGlibcCompatibility" retryCountForRunCommand: 1 - publish: $(monitoringHome) @@ -600,6 +600,9 @@ stages: x64: baseImage: debian artifactSuffix: linux-x64 + x64-r2r: + baseImage: debian + artifactSuffix: linux-x64-r2r alpine: baseImage: alpine artifactSuffix: linux-musl-x64 @@ -614,11 +617,13 @@ stages: # Download _both_ musl and glibc if we're building the universal package # but only the musl package if we're building alpine package + # + # R2R only requires the tracer, as the profiler is not used there yet. - task: DownloadPipelineArtifact@2 displayName: Download tracer linux native binary (linux-x64) - condition: eq(variables['artifactSuffix'], 'linux-x64') + condition: or(eq(variables['artifactSuffix'], 'linux-x64'), eq(variables['artifactSuffix'], 'linux-x64-r2r')) inputs: - artifact: linux-tracer-home-linux-x64 + artifact: linux-tracer-home-$(artifactSuffix) path: $(monitoringHome) - task: DownloadPipelineArtifact@2 @@ -882,6 +887,9 @@ stages: arm64: baseImage: debian artifactSuffix: linux-arm64 + arm64: + baseImage: debian + artifactSuffix: linux-arm64-r2r alpine: baseImage: alpine artifactSuffix: linux-musl-arm64 @@ -896,11 +904,13 @@ stages: # Download _both_ musl and glibc if we're building the universal package # but only the musl package if we're building alpine package + # + # R2R only requires the tracer, as the profiler is not used there yet. - task: DownloadPipelineArtifact@2 displayName: Download tracer arm64 native binary - condition: eq(variables['artifactSuffix'], 'linux-arm64') + condition: or(eq(variables['artifactSuffix'], 'linux-arm64'), eq(variables['artifactSuffix'], 'linux-arm64-r2r')) inputs: - artifact: linux-tracer-home-linux-arm64 + artifact: linux-tracer-home-$(artifactSuffix) path: $(monitoringHome) - task: DownloadPipelineArtifact@2 @@ -4140,6 +4150,7 @@ stages: artifact: linux-universal-symbols-linux-arm64 path: $(Build.ArtifactStagingDirectory)/symbols/linux-musl-arm64 + # dd-dotnet - task: DownloadPipelineArtifact@2 displayName: Download dd-dotnet linux-x64 symbols inputs: @@ -4244,6 +4255,31 @@ stages: inputs: artifact: windows-msi-x64 path: $(Build.ArtifactStagingDirectory) + + # We also don't include R2R packages in the release artifacts + - task: DownloadPipelineArtifact@2 + displayName: Download linux x64 r2r packages + inputs: + artifact: linux-packages-linux-x64-r2r + path: $(Build.ArtifactStagingDirectory) + + - task: DownloadPipelineArtifact@2 + displayName: Download linux Arm64 r2r packages + inputs: + artifact: linux-packages-linux-arm64-r2r + path: $(Build.ArtifactStagingDirectory) + + - task: DownloadPipelineArtifact@2 + displayName: Download linux tracer x64 r2r symbols + inputs: + artifact: linux-tracer-symbols-linux-x64-r2r + path: $(Build.ArtifactStagingDirectory)/symbols + + - task: DownloadPipelineArtifact@2 + displayName: Download linux tracer Arm64 r2r symbols + inputs: + artifact: linux-tracer-symbols-linux-arm64-r2r + path: $(Build.ArtifactStagingDirectory)/symbols - bash: | # Write tracer version number to version.txt From d28c801d9ae2e417e0bd8caf5678390d96c6ea69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:20:58 -0500 Subject: [PATCH 02/22] typo missing r2r --- .azure-pipelines/ultimate-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 75fb2efd598a..95cd21373af4 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -887,7 +887,7 @@ stages: arm64: baseImage: debian artifactSuffix: linux-arm64 - arm64: + arm64-r2r: baseImage: debian artifactSuffix: linux-arm64-r2r alpine: From f952263e1ddaa23207ce40b239bdf121cf8d9c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:45:47 -0500 Subject: [PATCH 03/22] maybe this fixes the files not being found for R2R package? --- .azure-pipelines/ultimate-pipeline.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 95cd21373af4..ce826db8241f 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -617,8 +617,6 @@ stages: # Download _both_ musl and glibc if we're building the universal package # but only the musl package if we're building alpine package - # - # R2R only requires the tracer, as the profiler is not used there yet. - task: DownloadPipelineArtifact@2 displayName: Download tracer linux native binary (linux-x64) condition: or(eq(variables['artifactSuffix'], 'linux-x64'), eq(variables['artifactSuffix'], 'linux-x64-r2r')) @@ -628,7 +626,7 @@ stages: - task: DownloadPipelineArtifact@2 displayName: Download profiler linux native binary (linux-x64) - condition: eq(variables['artifactSuffix'], 'linux-x64') + condition: or(eq(variables['artifactSuffix'], 'linux-x64'), eq(variables['artifactSuffix'], 'linux-x64-r2r')) inputs: artifact: linux-profiler-home-linux-x64 path: $(monitoringHome) @@ -915,7 +913,7 @@ stages: - task: DownloadPipelineArtifact@2 displayName: Download profiler arm64 native binary - condition: eq(variables['artifactSuffix'], 'linux-arm64') + condition: or(eq(variables['artifactSuffix'], 'linux-arm64'), eq(variables['artifactSuffix'], 'linux-arm64-r2r')) inputs: artifact: linux-profiler-home-linux-arm64 path: $(monitoringHome) From 8df2c7c0e6c66122d5e3890166af8492707bd9be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:04:54 -0500 Subject: [PATCH 04/22] another typo not using a variable --- .azure-pipelines/ultimate-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index ce826db8241f..6c61ea7b54c2 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -628,7 +628,7 @@ stages: displayName: Download profiler linux native binary (linux-x64) condition: or(eq(variables['artifactSuffix'], 'linux-x64'), eq(variables['artifactSuffix'], 'linux-x64-r2r')) inputs: - artifact: linux-profiler-home-linux-x64 + artifact: linux-profiler-home-$(artifactSuffix) path: $(monitoringHome) - task: DownloadPipelineArtifact@2 @@ -915,7 +915,7 @@ stages: displayName: Download profiler arm64 native binary condition: or(eq(variables['artifactSuffix'], 'linux-arm64'), eq(variables['artifactSuffix'], 'linux-arm64-r2r')) inputs: - artifact: linux-profiler-home-linux-arm64 + artifact: linux-profiler-home-$(artifactSuffix) path: $(monitoringHome) - task: DownloadPipelineArtifact@2 From 73d99be679d2ed644628bc4cd64c1a1d8872af86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:35:24 -0500 Subject: [PATCH 05/22] get artifact from same place for r2r --- .azure-pipelines/ultimate-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 6c61ea7b54c2..ce826db8241f 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -628,7 +628,7 @@ stages: displayName: Download profiler linux native binary (linux-x64) condition: or(eq(variables['artifactSuffix'], 'linux-x64'), eq(variables['artifactSuffix'], 'linux-x64-r2r')) inputs: - artifact: linux-profiler-home-$(artifactSuffix) + artifact: linux-profiler-home-linux-x64 path: $(monitoringHome) - task: DownloadPipelineArtifact@2 @@ -915,7 +915,7 @@ stages: displayName: Download profiler arm64 native binary condition: or(eq(variables['artifactSuffix'], 'linux-arm64'), eq(variables['artifactSuffix'], 'linux-arm64-r2r')) inputs: - artifact: linux-profiler-home-$(artifactSuffix) + artifact: linux-profiler-home-linux-arm64 path: $(monitoringHome) - task: DownloadPipelineArtifact@2 From 2595d15829f0fe53683bcdb36bd9dfa8fd0ecd99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:08:33 -0500 Subject: [PATCH 06/22] see if adding the profiler to r2r avoids issues --- .azure-pipelines/ultimate-pipeline.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index ce826db8241f..074a59722d98 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -536,6 +536,11 @@ stages: managedBaseImage: debian artifactSuffix: linux-x64 useNativeSdkVersion: true + x64: + baseImage: centos7 + managedBaseImage: debian + artifactSuffix: linux-x64-r2r + useNativeSdkVersion: true alpine: baseImage: alpine managedBaseImage: alpine From 662be3893ec0a9599cb2a2155e90e349e1b7b738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:11:00 -0500 Subject: [PATCH 07/22] typo in matrix name --- .azure-pipelines/ultimate-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 074a59722d98..0f62443667bf 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -536,7 +536,7 @@ stages: managedBaseImage: debian artifactSuffix: linux-x64 useNativeSdkVersion: true - x64: + x64-r2r: baseImage: centos7 managedBaseImage: debian artifactSuffix: linux-x64-r2r From e83789421085961b613777895e170d82a61b75ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:48:28 -0500 Subject: [PATCH 08/22] add another artifact env var to see if that makes the ZipMonitoringHome to not fail --- .azure-pipelines/ultimate-pipeline.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 0f62443667bf..45b00a206d70 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -605,12 +605,16 @@ stages: x64: baseImage: debian artifactSuffix: linux-x64 + universalArtifactSuffix: linux-x64 x64-r2r: baseImage: debian artifactSuffix: linux-x64-r2r + # ZipMonitoringHome hardcodes the artifactSuffix, so we need to pass the correct one here + universalArtifactSuffix: linux-x64 alpine: baseImage: alpine artifactSuffix: linux-musl-x64 + universalArtifactSuffix: linux-musl-x64 pool: name: azure-linux-scale-set @@ -671,7 +675,7 @@ stages: displayName: Download universal native binaries inputs: artifact: linux-universal-home-linux-x64 - path: $(monitoringHome)/$(artifactSuffix) + path: $(monitoringHome)/$(universalArtifactSuffix) - template: steps/run-in-docker.yml parameters: From 6340013090b62fbf21ef37bf7882aefea5c9f89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:15:17 -0500 Subject: [PATCH 09/22] add universal artifact suffix for arm --- .azure-pipelines/ultimate-pipeline.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 45b00a206d70..72f093030bcf 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -894,12 +894,15 @@ stages: arm64: baseImage: debian artifactSuffix: linux-arm64 + universalArtifactSuffix: linux-arm64 arm64-r2r: baseImage: debian artifactSuffix: linux-arm64-r2r + universalArtifactSuffix: linux-arm64 alpine: baseImage: alpine artifactSuffix: linux-musl-arm64 + universalArtifactSuffix: linux-musl-arm64 pool: name: aws-arm64-auto-scaling @@ -962,7 +965,7 @@ stages: displayName: Download universal native binaries inputs: artifact: linux-universal-home-linux-arm64 - path: $(monitoringHome)/$(artifactSuffix) + path: $(monitoringHome)/$(universalArtifactSuffix) - template: steps/run-in-docker.yml parameters: From fe7fbd44a4ecefee246a5f3b54bce12595694e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:30:19 -0500 Subject: [PATCH 10/22] try to do it programatically instead --- .azure-pipelines/ultimate-pipeline.yml | 21 ++++++++++----------- tracer/build/_build/Build.Steps.cs | 12 +++++++++++- tracer/build/_build/Build.cs | 3 +++ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 72f093030bcf..4a5d19b43b83 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -605,16 +605,12 @@ stages: x64: baseImage: debian artifactSuffix: linux-x64 - universalArtifactSuffix: linux-x64 x64-r2r: baseImage: debian artifactSuffix: linux-x64-r2r - # ZipMonitoringHome hardcodes the artifactSuffix, so we need to pass the correct one here - universalArtifactSuffix: linux-x64 alpine: baseImage: alpine artifactSuffix: linux-musl-x64 - universalArtifactSuffix: linux-musl-x64 pool: name: azure-linux-scale-set @@ -675,14 +671,17 @@ stages: displayName: Download universal native binaries inputs: artifact: linux-universal-home-linux-x64 - path: $(monitoringHome)/$(universalArtifactSuffix) + path: $(monitoringHome)/$(artifactSuffix) - template: steps/run-in-docker.yml parameters: build: true target: builder baseImage: $(baseImage) - command: "ZipMonitoringHome" + ${{ if contains(variables['artifactSuffix'], 'r2r') }}: + command: "ZipMonitoringHomeR2R" + ${{ else }}: + command: "ZipMonitoringHome" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-x64 @@ -894,15 +893,12 @@ stages: arm64: baseImage: debian artifactSuffix: linux-arm64 - universalArtifactSuffix: linux-arm64 arm64-r2r: baseImage: debian artifactSuffix: linux-arm64-r2r - universalArtifactSuffix: linux-arm64 alpine: baseImage: alpine artifactSuffix: linux-musl-arm64 - universalArtifactSuffix: linux-musl-arm64 pool: name: aws-arm64-auto-scaling @@ -965,14 +961,17 @@ stages: displayName: Download universal native binaries inputs: artifact: linux-universal-home-linux-arm64 - path: $(monitoringHome)/$(universalArtifactSuffix) + path: $(monitoringHome)/$(artifactSuffix) - template: steps/run-in-docker.yml parameters: build: true target: builder baseImage: $(baseImage) - command: "ZipMonitoringHome" + ${{ if contains(variables['artifactSuffix'], 'r2r') }}: + command: "ZipMonitoringHomeR2R" + ${{ else }}: + command: "ZipMonitoringHome" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-arm64 diff --git a/tracer/build/_build/Build.Steps.cs b/tracer/build/_build/Build.Steps.cs index fc5d751d6a7a..910f08ef792a 100644 --- a/tracer/build/_build/Build.Steps.cs +++ b/tracer/build/_build/Build.Steps.cs @@ -872,6 +872,15 @@ async Task DownloadWafVersion(string libddwafVersion = null, string uncompressFo CompressZip(MonitoringHomeDirectory, WindowsTracerHomeZip, fileMode: FileMode.Create); }); + Target ZipMonitoringHomeLinuxR2R => _ => _ + .Unlisted() + .DependsOn(ZipMonitoringHomeLinux) + .Before(ZipMonitoringHomeLinux) + .Executes(() => + { + ReadyToRun = true; + }); + Target ZipMonitoringHomeLinux => _ => _ .Unlisted() .After(BuildTracerHome, BuildManagedTracerHome, BuildNativeTracerHome, BuildProfilerHome, BuildNativeLoader) @@ -884,7 +893,8 @@ async Task DownloadWafVersion(string libddwafVersion = null, string uncompressFo var nfpm = Nfpm.Value; var (arch, ext) = GetUnixArchitectureAndExtension(); - var workingDirectory = ArtifactsDirectory / $"linux-{UnixArchitectureIdentifier}"; + var workingDirectory = ArtifactsDirectory / $"linux-{UnixArchitectureIdentifier}{ + (ReadyToRun ? "-r2r" : "")}"; EnsureCleanDirectory(workingDirectory); const string packageName = "datadog-dotnet-apm"; diff --git a/tracer/build/_build/Build.cs b/tracer/build/_build/Build.cs index 41ed45412815..ec669c168fd8 100644 --- a/tracer/build/_build/Build.cs +++ b/tracer/build/_build/Build.cs @@ -107,6 +107,9 @@ partial class Build : NukeBuild [Parameter("RuntimeIdentifier sets the target platform for ReadyToRun assemblies in 'PublishManagedTracerR2R'." + "See https://learn.microsoft.com/en-us/dotnet/core/rid-catalog")] string RuntimeIdentifier { get; } + + [Parameter("Enable ReadyToRun configuration")] + bool ReadyToRun = false; public Build() { From b48994f67577cc8906609fdab327177ddfdbe74a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:39:09 -0500 Subject: [PATCH 11/22] typo in build steps --- tracer/build/_build/Build.Steps.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tracer/build/_build/Build.Steps.cs b/tracer/build/_build/Build.Steps.cs index badd2437d6c4..f0c88a6a834d 100644 --- a/tracer/build/_build/Build.Steps.cs +++ b/tracer/build/_build/Build.Steps.cs @@ -863,6 +863,14 @@ async Task DownloadWafVersion(string libddwafVersion = null, string uncompressFo { CompressZip(SymbolsDirectory, WindowsSymbolsZip, fileMode: FileMode.Create); }); + + Target ZipMonitoringHomeR2R => _ => _ + .Unlisted() + .DependsOn(ZipMonitoringHome) + .Executes(() => + { + ReadyToRun = true; + }); Target ZipMonitoringHome => _ => _ .DependsOn(ZipMonitoringHomeWindows) @@ -879,15 +887,6 @@ async Task DownloadWafVersion(string libddwafVersion = null, string uncompressFo CompressZip(MonitoringHomeDirectory, WindowsTracerHomeZip, fileMode: FileMode.Create); }); - Target ZipMonitoringHomeLinuxR2R => _ => _ - .Unlisted() - .DependsOn(ZipMonitoringHomeLinux) - .Before(ZipMonitoringHomeLinux) - .Executes(() => - { - ReadyToRun = true; - }); - Target ZipMonitoringHomeLinux => _ => _ .Unlisted() .After(BuildTracerHome, BuildManagedTracerHome, BuildNativeTracerHome, BuildProfilerHome, BuildNativeLoader) From 140c27f808f398bf3fe9c53cf70fa8789d48445d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:01:55 -0500 Subject: [PATCH 12/22] somehow doing contains didnt work, trying eq --- .azure-pipelines/ultimate-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index be82bdca5582..9e241a04af0f 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -679,7 +679,7 @@ stages: build: true target: builder baseImage: $(baseImage) - ${{ if contains(variables['artifactSuffix'], 'r2r') }}: + ${{ if eq(variables['artifactSuffix'], 'linux-x64-r2r') }}: command: "ZipMonitoringHomeR2R" ${{ else }}: command: "ZipMonitoringHome" @@ -969,7 +969,7 @@ stages: build: true target: builder baseImage: $(baseImage) - ${{ if contains(variables['artifactSuffix'], 'r2r') }}: + ${{ if eq(variables['artifactSuffix'], 'linux-arm64-r2r') }}: command: "ZipMonitoringHomeR2R" ${{ else }}: command: "ZipMonitoringHome" From 7da60c003e288a55bd3078d2401c3b70f1cd6edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:51:09 -0500 Subject: [PATCH 13/22] i cannot find a way to do this in one line :( --- .gitlab/download-serverless-artifacts.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab/download-serverless-artifacts.sh b/.gitlab/download-serverless-artifacts.sh index 03bacd9d463b..16034ee28233 100755 --- a/.gitlab/download-serverless-artifacts.sh +++ b/.gitlab/download-serverless-artifacts.sh @@ -11,13 +11,18 @@ target_dir=artifacts mkdir -p $target_dir branchName="refs/heads/$CI_COMMIT_BRANCH" +branchArg=$CI_COMMIT_BRANCH +if [ -n "$CI_COMMIT_TAG" ]; then + branchName="refs/tags/$CI_COMMIT_TAG" + branchArg=$CI_COMMIT_TAG +fi echo "Looking for azure devops PR builds for branch '$branchName' for commit '$CI_COMMIT_SHA' to start" # We should _definitely_ have the build by now, so if not, there probably won't be one # Check for PR builds first (as more likely to be "full" builds) allBuildsForPrUrl="https://dev.azure.com/datadoghq/dd-trace-dotnet/_apis/build/builds?api-version=7.1&definitions=54&\$top=100&queryOrder=queueTimeDescending&reasonFilter=pullRequest" -buildId=$(curl -sS $allBuildsForPrUrl | jq --arg version $CI_COMMIT_SHA --arg branch $CI_COMMIT_BRANCH '.value[] | select(.triggerInfo["pr.sourceBranch"] == $branch and .triggerInfo["pr.sourceSha"] == $version) | .id' | head -n 1) +buildId=$(curl -sS $allBuildsForPrUrl | jq --arg version $CI_COMMIT_SHA --arg branch $branchArg '.value[] | select(.triggerInfo["pr.sourceBranch"] == $branch and .triggerInfo["pr.sourceSha"] == $version) | .id' | head -n 1) if [ -z "${buildId}" ]; then echo "No PR builds found for commit '$CI_COMMIT_SHA' on branch '$branchName'. Checking for standalone builds..." From 3f3e6fba18e34367f5f3f884012da8f3787ef74b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 17:38:11 -0500 Subject: [PATCH 14/22] again --- .azure-pipelines/ultimate-pipeline.yml | 30 +++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 9e241a04af0f..c4d8968419a9 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -675,14 +675,21 @@ stages: path: $(monitoringHome)/$(artifactSuffix) - template: steps/run-in-docker.yml + condition: ne(variables['artifactSuffix'], 'linux-x64') parameters: build: true target: builder baseImage: $(baseImage) - ${{ if eq(variables['artifactSuffix'], 'linux-x64-r2r') }}: - command: "ZipMonitoringHomeR2R" - ${{ else }}: - command: "ZipMonitoringHome" + command: "ZipMonitoringHome" + retryCountForRunCommand: 1 + + - template: steps/run-in-docker.yml + condition: eq(variables['artifactSuffix'], 'linux-x64-r2r') + parameters: + build: true + target: builder + baseImage: $(baseImage) + command: "ZipMonitoringHomeR2R" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-x64 @@ -965,14 +972,21 @@ stages: path: $(monitoringHome)/$(artifactSuffix) - template: steps/run-in-docker.yml + condition: eq(variables['artifactSuffix'], 'linux-arm64-r2r') + parameters: + build: true + target: builder + baseImage: $(baseImage) + command: "ZipMonitoringHomeR2R" + retryCountForRunCommand: 1 + + - template: steps/run-in-docker.yml + condition: ne(variables['artifactSuffix'], 'linux-arm64-r2r') parameters: build: true target: builder baseImage: $(baseImage) - ${{ if eq(variables['artifactSuffix'], 'linux-arm64-r2r') }}: - command: "ZipMonitoringHomeR2R" - ${{ else }}: - command: "ZipMonitoringHome" + command: "ZipMonitoringHome" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-arm64 From e89510881ce1f9786faec98dbe5717564576b43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 17:48:07 -0500 Subject: [PATCH 15/22] try this other way of doing it --- .azure-pipelines/ultimate-pipeline.yml | 23 ++--------------------- tracer/build/_build/Build.Steps.cs | 8 -------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index c4d8968419a9..9c619c88512a 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -675,21 +675,11 @@ stages: path: $(monitoringHome)/$(artifactSuffix) - template: steps/run-in-docker.yml - condition: ne(variables['artifactSuffix'], 'linux-x64') parameters: build: true target: builder baseImage: $(baseImage) - command: "ZipMonitoringHome" - retryCountForRunCommand: 1 - - - template: steps/run-in-docker.yml - condition: eq(variables['artifactSuffix'], 'linux-x64-r2r') - parameters: - build: true - target: builder - baseImage: $(baseImage) - command: "ZipMonitoringHomeR2R" + command: $[format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], 'linux-x64-r2r'))] retryCountForRunCommand: 1 - publish: $(artifacts)/linux-x64 @@ -971,22 +961,13 @@ stages: artifact: linux-universal-home-linux-arm64 path: $(monitoringHome)/$(artifactSuffix) - - template: steps/run-in-docker.yml - condition: eq(variables['artifactSuffix'], 'linux-arm64-r2r') - parameters: - build: true - target: builder - baseImage: $(baseImage) - command: "ZipMonitoringHomeR2R" - retryCountForRunCommand: 1 - - template: steps/run-in-docker.yml condition: ne(variables['artifactSuffix'], 'linux-arm64-r2r') parameters: build: true target: builder baseImage: $(baseImage) - command: "ZipMonitoringHome" + command: $[format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], 'linux-x64-r2r'))] retryCountForRunCommand: 1 - publish: $(artifacts)/linux-arm64 diff --git a/tracer/build/_build/Build.Steps.cs b/tracer/build/_build/Build.Steps.cs index f0c88a6a834d..4b33b4014f03 100644 --- a/tracer/build/_build/Build.Steps.cs +++ b/tracer/build/_build/Build.Steps.cs @@ -863,14 +863,6 @@ async Task DownloadWafVersion(string libddwafVersion = null, string uncompressFo { CompressZip(SymbolsDirectory, WindowsSymbolsZip, fileMode: FileMode.Create); }); - - Target ZipMonitoringHomeR2R => _ => _ - .Unlisted() - .DependsOn(ZipMonitoringHome) - .Executes(() => - { - ReadyToRun = true; - }); Target ZipMonitoringHome => _ => _ .DependsOn(ZipMonitoringHomeWindows) From c090510297c51f6cced8bfbdc385a0a74e7e4119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 17:55:05 -0500 Subject: [PATCH 16/22] remove condition from zipmonitoringhome --- .azure-pipelines/ultimate-pipeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 9c619c88512a..d68ebc997147 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -962,7 +962,6 @@ stages: path: $(monitoringHome)/$(artifactSuffix) - template: steps/run-in-docker.yml - condition: ne(variables['artifactSuffix'], 'linux-arm64-r2r') parameters: build: true target: builder From aa8b919f2d3a1a4d8b77b6cddb97ba4f2434bdf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 18:13:29 -0500 Subject: [PATCH 17/22] again try with quotes now --- .azure-pipelines/ultimate-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index d68ebc997147..7e5e20b71928 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -679,7 +679,7 @@ stages: build: true target: builder baseImage: $(baseImage) - command: $[format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], 'linux-x64-r2r'))] + command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], 'linux-x64-r2r'))}}" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-x64 @@ -966,7 +966,7 @@ stages: build: true target: builder baseImage: $(baseImage) - command: $[format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], 'linux-x64-r2r'))] + command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], 'linux-x64-r2r'))}}" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-arm64 From 177ed65d290c03ae4b9c0a8377a907c4e7eb41c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 18:34:24 -0500 Subject: [PATCH 18/22] arch typo --- .azure-pipelines/ultimate-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 7e5e20b71928..8870292f35b0 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -966,7 +966,7 @@ stages: build: true target: builder baseImage: $(baseImage) - command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], 'linux-x64-r2r'))}}" + command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], 'linux-arm64-r2r'))}}" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-arm64 From 610ada1fe3212a521695c4e7d510fbb704ab38d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 19:24:47 -0500 Subject: [PATCH 19/22] some testing --- .azure-pipelines/ultimate-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 8870292f35b0..4a205ae5d076 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -679,7 +679,7 @@ stages: build: true target: builder baseImage: $(baseImage) - command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], 'linux-x64-r2r'))}}" + command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], linux-x64-r2r))}}" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-x64 @@ -966,7 +966,7 @@ stages: build: true target: builder baseImage: $(baseImage) - command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], 'linux-arm64-r2r'))}}" + command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], linux-arm64-r2r))}}" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-arm64 From f92318499ce9d2380281632cd21162be1527a6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 19:26:16 -0500 Subject: [PATCH 20/22] it needs quotes --- .azure-pipelines/ultimate-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 4a205ae5d076..39e0fa6ebdd4 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -679,7 +679,7 @@ stages: build: true target: builder baseImage: $(baseImage) - command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], linux-x64-r2r))}}" + command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], 'linux-x64-r2r'))}}" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-x64 @@ -966,7 +966,7 @@ stages: build: true target: builder baseImage: $(baseImage) - command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], linux-arm64-r2r))}}" + command: "${{format('ZipMonitoringHome --ReadyToRun {0} {1}', eq(variables['artifactSuffix'], 'linux-arm64-r2r'), variables['artifactSuffix'])}}" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-arm64 From 3ce0707bc2952ca1e37f82ac75ab963d5859749e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 20:06:32 -0500 Subject: [PATCH 21/22] another try --- .azure-pipelines/ultimate-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 39e0fa6ebdd4..dab3d26d0a91 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -679,7 +679,7 @@ stages: build: true target: builder baseImage: $(baseImage) - command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(variables['artifactSuffix'], 'linux-x64-r2r'))}}" + command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq($(variables['artifactSuffix']), 'linux-x64-r2r'))}}" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-x64 @@ -966,7 +966,7 @@ stages: build: true target: builder baseImage: $(baseImage) - command: "${{format('ZipMonitoringHome --ReadyToRun {0} {1}', eq(variables['artifactSuffix'], 'linux-arm64-r2r'), variables['artifactSuffix'])}}" + command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(eq($(variables['artifactSuffix']), 'linux-arm64-r2r'))}}" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-arm64 From 4454b58935f8144284498c07132e9441bbf50837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jordan=20gonz=C3=A1lez?= <30836115+duncanista@users.noreply.github.com> Date: Tue, 14 Jan 2025 20:11:45 -0500 Subject: [PATCH 22/22] typo --- .azure-pipelines/ultimate-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index dab3d26d0a91..89fffe1ba96d 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -966,7 +966,7 @@ stages: build: true target: builder baseImage: $(baseImage) - command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq(eq($(variables['artifactSuffix']), 'linux-arm64-r2r'))}}" + command: "${{format('ZipMonitoringHome --ReadyToRun {0}', eq($(variables['artifactSuffix']), 'linux-arm64-r2r'))}}" retryCountForRunCommand: 1 - publish: $(artifacts)/linux-arm64