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

Migrate diagnostics repo to 1ES #4567

Merged
merged 6 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
667 changes: 266 additions & 401 deletions diagnostics.yml

Large diffs are not rendered by default.

522 changes: 274 additions & 248 deletions eng/pipelines/build.yml

Large diffs are not rendered by default.

72 changes: 72 additions & 0 deletions eng/pipelines/global-variables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
parameters:
runtimeFeed: default
runtimeFeedToken: default
isCodeQLRun: false

variables:
- name: _TeamName
value: DotNetCore

- name: _SignType
value: ''

# # Internal build pools.
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- group: DotNet-Diagnostics-SDL-Params
- group: DotNet-MSRC-Storage
- template: /eng/common/templates-official/variables/pool-providers.yml@self
- name: BuildPool
value: $(DncEngInternalBuildPool)
- name: WindowsImage
value: 1es-windows-2022-pt
- name: LinuxImage
value: 1es-ubuntu-2204-pt
- name: macOSImage
value: macOS-latest
- name: sourceBuildTemplate
value: /eng/common/templates-official/job/source-build.yml@self
- name: jobTemplate
value: /eng/common/templates-official/job/job.yml@self
- ${{ if eq(parameters.isCodeQLRun, 'true') }}:
- name: Codeql.Enabled
value: True
- name: Codeql.Cadence
value: 0
- name: Codeql.TSAEnabled
value: True
- name: Codeql.BuildIdentifier
value: $(System.JobDisplayName)
- name: Codeql.Language
value: csharp,cpp
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
- name: _SignType
value: real
# Public build settings
- ${{ else }}:
- template: /eng/common/templates/variables/pool-providers.yml@self
- name: BuildPool
value: $(DncEngPublicBuildPool)
- name: sourceBuildTemplate
value: /eng/common/templates/job/source-build.yml@self
- name: jobTemplate
value: /eng/common/templates/job/job.yml@self
- name: WindowsImage
value: windows.vs2022.amd64.open
- name: LinuxImage
value: Build.Ubuntu.2204.Amd64.Open
- name: macOSImage
value: macOS-latest

# Custom feed and token
- ${{ if eq(parameters.runtimeFeed, 'custom') }}:
- name: RuntimeFeedUrl
value: $(DotnetRuntimeDownloadFeed)
- ${{ if eq(parameters.runtimeFeedToken, 'custom') }}:
- name: RuntimeFeedBase64SasToken
value: $(DotnetRuntimeDownloadBase64SasToken)
- ${{ if eq(parameters.runtimeFeed, 'dotnetclimsrc-feed') }}:
- name: RuntimeFeedUrl
value: https://dotnetclimsrc.blob.core.windows.net/dotnet
- ${{ if eq(parameters.runtimeFeedToken, 'dotnetclimsrc-sas-token-base64') }}:
- name: RuntimeFeedBase64SasToken
value: $(dotnetclimsrc-read-sas-token-base64)
49 changes: 29 additions & 20 deletions eng/pipelines/pipeline-resources.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,71 @@
parameters:
- name: stages
type: stageList
- name: stages
type: stageList
- name: isOfficialBuild
type: boolean

resources:
containers:
- container: linux_x64
extends:
template: templateDispatch.yml
parameters:
${{ if parameters.isOfficialBuild }}:
templatePath: template1es.yml
${{ else }}:
templatePath: templatePublic.yml

stages: ${{ parameters.stages }}

containers:
linux_x64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7

- container: linux_arm
linux_arm:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross
env:
ROOTFS_DIR: /crossrootfs/arm

- container: linux_arm64
linux_arm64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-arm64
env:
ROOTFS_DIR: /crossrootfs/arm64

- container: linux_musl_x64
linux_musl_x64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.13-WithNode

- container: linux_musl_arm
linux_musl_arm:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-arm-alpine
env:
ROOTFS_DIR: /crossrootfs/arm

- container: linux_musl_arm64
linux_musl_arm64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-arm64-alpine
env:
ROOTFS_DIR: /crossrootfs/arm64

- container: test_linux_x64
test_linux_x64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7

- container: test_linux_musl_x64
test_linux_musl_x64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.13-WithNode
options: --cap-add=SYS_PTRACE

- container: test_debian_11_amd64
test_debian_11_amd64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-amd64
options: '--env PYTHONPATH=/usr/bin/python3.9'

- container: test_fedora_36
test_fedora_36:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-36
options: --cap-add=SYS_PTRACE

- container: test_opensuse_15_2
test_opensuse_15_2:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-15.2-helix-amd64

- container: test_ubuntu_18_04
test_ubuntu_18_04:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04

- container: test_ubuntu_20_04
test_ubuntu_20_04:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04
options: '--env PYTHONPATH=/usr/bin/python3.8'

- container: test_ubuntu_22_04
test_ubuntu_22_04:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04
options: '--env PYTHONPATH=/usr/bin/python3.10'

stages: ${{ parameters.stages }}
30 changes: 9 additions & 21 deletions eng/pipelines/prepare-release.yml
mikem8361 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
stages:
- stage: PrepareReleaseStage
displayName: Release Preparation
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) }}:
dependsOn:
- publish_using_darc
jobs:
- job: PrepareReleaseJob
displayName: Prepare release with Darc
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: NetCore-Public
demands: ImageOverride -equals windows.vs2022.amd64.open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals windows.vs2022.amd64
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) }}:
templateContext:
outputs:
- output: pipelineArtifact
path: '$(System.ArtifactsDirectory)\ReleaseStaging'
artifact: DiagnosticsRelease
displayName: 'Publish Release Drop'
condition: succeeded()
variables:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) }}:
- group: DotNet-Diagnostics-Storage
Expand All @@ -24,11 +22,6 @@ stages:
- script: '$(Build.Repository.LocalPath)\dotnet.cmd build $(Build.Repository.LocalPath)\eng\release\DiagnosticsReleaseTool\DiagnosticsReleaseTool.csproj -c Release /bl'
workingDirectory: '$(System.ArtifactsDirectory)'
displayName: 'Build Manifest generation and asset publishing tool'
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(System.ArtifactsDirectory)'
publishLocation: 'pipeline'
artifact: 'DiagnosticsReleaseToolBin'
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) }}:
- task: UseDotNet@2
displayName: 'Use .NET Core runtime 6.x'
Expand All @@ -52,7 +45,7 @@ stages:
-ReleaseVersion "$(Build.BuildNumber)"
workingDirectory: '$(Build.Repository.LocalPath)'
- script: >-
dotnet.cmd run --project $(Build.Repository.LocalPath)\eng\release\DiagnosticsReleaseTool\DiagnosticsReleaseTool.csproj -c Release
$(Build.Repository.LocalPath)\dotnet.cmd run --project $(Build.Repository.LocalPath)\eng\release\DiagnosticsReleaseTool\DiagnosticsReleaseTool.csproj -c Release
--
prepare-release
--input-drop-path "$(System.ArtifactsDirectory)\ReleaseTarget"
Expand All @@ -66,8 +59,3 @@ stages:
-v True
workingDirectory: '$(Build.Repository.LocalPath)\'
displayName: 'Manifest generation and asset publishing'
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(System.ArtifactsDirectory)\ReleaseStaging'
publishLocation: 'pipeline'
artifact: 'DiagnosticsRelease'
25 changes: 25 additions & 0 deletions eng/pipelines/publish-pipeline-artifact-shim.yml
mdh1418 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
parameters:
inputs: {}
displayName: 'Publish Pipeline Artifact'
condition: succeeded()
continueOnError: true

steps:
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
# If we are using this in a project other than the public one, use the 1es task.
- task: 1es.PublishPipelineArtifact@1
inputs:
targetPath: ${{ parameters.inputs.targetPath }}
artifactName: ${{ parameters.inputs.artifactName }}
mikem8361 marked this conversation as resolved.
Show resolved Hide resolved
condition: ${{ parameters.condition }}
displayName: ${{ parameters.displayName }}
continueOnError: ${{ parameters.continueOnError }}
- ${{ else }}:
# Otherwise, use the public task.
- task: PublishPipelineArtifact@1
inputs:
targetPath: ${{ parameters.inputs.targetPath }}
artifactName: ${{ parameters.inputs.artifactName }}
condition: ${{ parameters.condition }}
displayName: ${{ parameters.displayName }}
continueOnError: ${{ parameters.continueOnError }}
30 changes: 30 additions & 0 deletions eng/pipelines/template1es.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

mikem8361 marked this conversation as resolved.
Show resolved Hide resolved
parameters:
- name: templatePath
type: string
default: no
mdh1418 marked this conversation as resolved.
Show resolved Hide resolved
- name: stages
type: stageList
- name: containers
type: object


resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool:
name: netcore1espool-internal
image: 1es-windows-2022-pt
os: windows

containers:
${{ parameters.containers }}

stages: ${{ parameters.stages }}
13 changes: 13 additions & 0 deletions eng/pipelines/templateDispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
parameters:
- name: templatePath
type: string
- name: stages
type: stageList
- name: containers
type: object

extends:
template: ${{ parameters.templatePath }}
parameters:
stages: ${{ parameters.stages }}
containers: ${{ parameters.containers }}
19 changes: 19 additions & 0 deletions eng/pipelines/templatePublic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
parameters:
- name: templatePath
type: string
default: no
mdh1418 marked this conversation as resolved.
Show resolved Hide resolved
- name: stages
type: stageList
- name: containers
type: object

resources:
containers:
- ${{ each container_pair in parameters.containers }}:
- ${{ if container_pair.value.image }}:
- container: ${{ container_pair.key }}
${{ each pair in container_pair.value }}:
${{ if notIn(pair.key, 'tenantId', 'identityType', 'registry') }}:
${{ pair.key }}: ${{ pair.value }}

stages: ${{ parameters.stages }}