Skip to content

Commit 5129dc8

Browse files
authored
Don't merge sample build artifacts (#6851)
## Summary of changes Don't bother to "merge" the samples into a single artifact to reduce download size ## Reason for change When we moved the sample build to a separate stage (to avoid re-work and to run the build in parallel) we added a job that would aggregate all the different TFMs into a single artifact. This was for simplicity on the consuming side. However, the size of this merged sample artifact was huge, such that it takes ~6 minutes to download again in some cases (the arm64 agents are _much_ slower to do the download). In general, only a single TFM is ever used anyway (because we parallelize our tests by TFM too), so this is mostly unnecessarily wasted time. ## Implementation details - Remove the `merge` job in the `build_samples` stage - Add a "helper" `download-samples.yml` script to make sure you download the different samples to the correct folder (standalone goes in `bin`, multi-version goes in `publish` currently) - Update usages ## Test coverage - Ran an "all areas" test [here](https://dev.azure.com/datadoghq/dd-trace-dotnet/_build/results?buildId=176344&view=logs&j=66fb5b47-c134-514a-33bf-1ca485953300) - Ran an "all TFMs" test [here](https://dev.azure.com/datadoghq/dd-trace-dotnet/_build/results?buildId=176347&view=results) ## Other details Removing the `merge` job also speeds up the `build_samples` stage which is sometimes a blocker for testing stages, so that's an extra bonus
1 parent 75523cd commit 5129dc8

File tree

2 files changed

+39
-124
lines changed

2 files changed

+39
-124
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
parameters:
2+
- name: 'framework'
3+
type: 'string'
4+
default: ''
5+
6+
steps:
7+
- task: DownloadPipelineArtifact@2
8+
displayName: Download standalone samples
9+
inputs:
10+
artifact: samples-standalone
11+
path: $(outputDir)/bin
12+
retryCountOnTaskFailure: 5
13+
14+
- ${{ if ne(parameters.framework, '') }}:
15+
- task: DownloadPipelineArtifact@2
16+
displayName: Download multi-version samples
17+
inputs:
18+
artifact: samples-multi-version-${{ parameters.framework }}
19+
path: $(outputDir)/publish
20+
retryCountOnTaskFailure: 5

.azure-pipelines/ultimate-pipeline.yml

Lines changed: 19 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ stages:
15601560
jobs:
15611561
- template: steps/update-github-status-jobs.yml
15621562
parameters:
1563-
jobs: [standalone, multi_version, merge]
1563+
jobs: [standalone, multi_version]
15641564

15651565
- job: standalone
15661566
timeoutInMinutes: 60 #default value
@@ -1579,7 +1579,7 @@ stages:
15791579

15801580
- publish: $(outputDir)/bin
15811581
displayName: Upload artifact samples (bin only)
1582-
artifact: samples-bin-standalone
1582+
artifact: samples-standalone
15831583

15841584
- publish: artifacts/build_data
15851585
displayName: Uploading logs
@@ -1624,7 +1624,7 @@ stages:
16241624
retryCountOnTaskFailure: 1
16251625

16261626
- publish: $(outputDir)/publish
1627-
displayName: Upload artifact samples (bin only)
1627+
displayName: Upload artifact samples (publish only)
16281628
artifact: samples-multi-version-$(framework)
16291629

16301630
- publish: artifacts/build_data
@@ -1633,91 +1633,6 @@ stages:
16331633
condition: failed()
16341634
continueOnError: true
16351635

1636-
- job: merge
1637-
dependsOn: [ standalone, multi_version ]
1638-
timeoutInMinutes: 60 #default value
1639-
pool:
1640-
name: azure-windows-scale-set-3
1641-
steps:
1642-
- checkout: none
1643-
- powershell: |
1644-
mkdir $(Build.ArtifactStagingDirectory)/bin
1645-
mkdir $(Build.ArtifactStagingDirectory)/publish
1646-
1647-
- task: DownloadPipelineArtifact@2
1648-
displayName: Download samples
1649-
inputs:
1650-
artifact: samples-bin-standalone
1651-
path: $(Build.ArtifactStagingDirectory)/bin
1652-
retryCountOnTaskFailure: 5
1653-
1654-
- task: DownloadPipelineArtifact@2
1655-
displayName: Download samples
1656-
inputs:
1657-
artifact: samples-multi-version-net462
1658-
path: $(Build.ArtifactStagingDirectory)/publish
1659-
retryCountOnTaskFailure: 5
1660-
1661-
- task: DownloadPipelineArtifact@2
1662-
displayName: Download samples
1663-
inputs:
1664-
artifact: samples-multi-version-netcoreapp2.1
1665-
path: $(Build.ArtifactStagingDirectory)/publish
1666-
retryCountOnTaskFailure: 5
1667-
1668-
- task: DownloadPipelineArtifact@2
1669-
displayName: Download samples
1670-
inputs:
1671-
artifact: samples-multi-version-netcoreapp3.0
1672-
path: $(Build.ArtifactStagingDirectory)/publish
1673-
retryCountOnTaskFailure: 5
1674-
1675-
- task: DownloadPipelineArtifact@2
1676-
displayName: Download samples
1677-
inputs:
1678-
artifact: samples-multi-version-netcoreapp3.1
1679-
path: $(Build.ArtifactStagingDirectory)/publish
1680-
retryCountOnTaskFailure: 5
1681-
1682-
- task: DownloadPipelineArtifact@2
1683-
displayName: Download samples
1684-
inputs:
1685-
artifact: samples-multi-version-net5.0
1686-
path: $(Build.ArtifactStagingDirectory)/publish
1687-
retryCountOnTaskFailure: 5
1688-
1689-
- task: DownloadPipelineArtifact@2
1690-
displayName: Download samples
1691-
inputs:
1692-
artifact: samples-multi-version-net6.0
1693-
path: $(Build.ArtifactStagingDirectory)/publish
1694-
retryCountOnTaskFailure: 5
1695-
1696-
- task: DownloadPipelineArtifact@2
1697-
displayName: Download samples
1698-
inputs:
1699-
artifact: samples-multi-version-net7.0
1700-
path: $(Build.ArtifactStagingDirectory)/publish
1701-
retryCountOnTaskFailure: 5
1702-
1703-
- task: DownloadPipelineArtifact@2
1704-
displayName: Download samples
1705-
inputs:
1706-
artifact: samples-multi-version-net8.0
1707-
path: $(Build.ArtifactStagingDirectory)/publish
1708-
retryCountOnTaskFailure: 5
1709-
1710-
- task: DownloadPipelineArtifact@2
1711-
displayName: Download samples
1712-
inputs:
1713-
artifact: samples-multi-version-net9.0
1714-
path: $(Build.ArtifactStagingDirectory)/publish
1715-
retryCountOnTaskFailure: 5
1716-
1717-
- publish: $(Build.ArtifactStagingDirectory)
1718-
displayName: Upload artifact samples
1719-
artifact: samples
1720-
17211636
# This is just to test that we _can_ build the solution on macos
17221637
# It's not used by other stages, and just ensures we don't break the macos build
17231638
- stage: build_samples_macos
@@ -1779,12 +1694,7 @@ stages:
17791694
parameters:
17801695
includeX86: true
17811696
- template: steps/restore-working-directory.yml
1782-
- task: DownloadPipelineArtifact@2
1783-
displayName: Download samples
1784-
inputs:
1785-
artifact: samples
1786-
path: $(outputDir)
1787-
retryCountOnTaskFailure: 5
1697+
- template: steps/download-samples.yml
17881698

17891699
# Cosmos is _way_ to flaky at the moment. Try enabling again at a later time
17901700
# - powershell: |
@@ -2337,12 +2247,9 @@ stages:
23372247
- template: steps/restore-working-directory.yml
23382248
parameters:
23392249
artifact: build-$(artifactSuffix)-working-directory
2340-
- task: DownloadPipelineArtifact@2
2341-
displayName: Download samples
2342-
inputs:
2343-
artifact: samples
2344-
path: $(outputDir)
2345-
retryCountOnTaskFailure: 5
2250+
- template: steps/download-samples.yml
2251+
parameters:
2252+
framework: $(publishTargetFramework)
23462253

23472254
# when we build samples separately, we could run this step and the docker-compose one below in //
23482255
# (currently the docker-compose step relies on serverless samples)
@@ -2421,12 +2328,9 @@ stages:
24212328
- template: steps/restore-working-directory.yml
24222329
parameters:
24232330
artifact: build-$(artifactSuffix)-working-directory
2424-
- task: DownloadPipelineArtifact@2
2425-
displayName: Download samples
2426-
inputs:
2427-
artifact: samples
2428-
path: $(outputDir)
2429-
retryCountOnTaskFailure: 5
2331+
- template: steps/download-samples.yml
2332+
parameters:
2333+
framework: $(publishTargetFramework)
24302334

24312335
# when we build samples separately, we could run this step and the docker-compose one below in //
24322336
# (currently the docker-compose step relies on serverless samples)
@@ -2544,12 +2448,9 @@ stages:
25442448
inputs:
25452449
artifact: linux-monitoring-home-$(artifactSuffix)
25462450
path: $(monitoringHome)
2547-
- task: DownloadPipelineArtifact@2
2548-
displayName: Download samples
2549-
inputs:
2550-
artifact: samples
2551-
path: $(outputDir)
2552-
retryCountOnTaskFailure: 5
2451+
- template: steps/download-samples.yml
2452+
parameters:
2453+
framework: $(publishTargetFramework)
25532454

25542455
- template: steps/run-in-docker.yml
25552456
parameters:
@@ -3145,12 +3046,9 @@ stages:
31453046
parameters:
31463047
artifact: build-$(artifactSuffix)-working-directory
31473048

3148-
- task: DownloadPipelineArtifact@2
3149-
displayName: Download samples
3150-
inputs:
3151-
artifact: samples
3152-
path: $(outputDir)
3153-
retryCountOnTaskFailure: 5
3049+
- template: steps/download-samples.yml
3050+
parameters:
3051+
framework: $(publishTargetFramework)
31543052

31553053
- template: steps/run-in-docker.yml
31563054
parameters:
@@ -3223,12 +3121,9 @@ stages:
32233121
- template: steps/restore-working-directory.yml
32243122
parameters:
32253123
artifact: build-$(artifactSuffix)-working-directory
3226-
- task: DownloadPipelineArtifact@2
3227-
displayName: Download samples
3228-
inputs:
3229-
artifact: samples
3230-
path: $(outputDir)
3231-
retryCountOnTaskFailure: 5
3124+
- template: steps/download-samples.yml
3125+
parameters:
3126+
framework: $(publishTargetFramework)
32323127

32333128
- template: steps/run-in-docker.yml
32343129
parameters:

0 commit comments

Comments
 (0)