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

[main] Update common Docker engineering infrastructure with latest #1196

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
8 changes: 4 additions & 4 deletions eng/common/templates/1es-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ parameters:
- name: pool
type: object
default:
name: NetCore1ESPool-Internal
image: 1es-ubuntu-2204
name: $(default1ESInternalPoolName)
image: $(default1ESInternalPoolImage)
os: linux
- name: sourceAnalysisPool
type: object
default:
name: NetCore1ESPool-Internal
image: 1es-windows-2022
name: $(defaultSourceAnalysisPoolName)
image: $(defaultSourceAnalysisPoolImage)
os: windows

resources:
Expand Down
11 changes: 9 additions & 2 deletions eng/common/templates/1es-unofficial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ parameters:
- name: pool
type: object
default:
name: NetCore1ESPool-Internal
image: 1es-windows-2022
name: $(default1ESInternalPoolName)
image: $(default1ESInternalPoolImage)
os: linux
- name: sourceAnalysisPool
type: object
default:
name: $(defaultSourceAnalysisPoolName)
image: $(defaultSourceAnalysisPoolImage)
os: windows

resources:
Expand All @@ -50,4 +56,5 @@ extends:
exclude:
- repository: InternalVersionsRepo
- repository: PublicVersionsRepo
sourceAnalysisPool: ${{ parameters.sourceAnalysisPool }}
stages: ${{ parameters.stages }}
4 changes: 2 additions & 2 deletions eng/common/templates/jobs/cg-build-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
- job: BuildProjects
displayName: Build Projects
pool:
name: NetCore1ESPool-Internal
image: 1es-ubuntu-2204
name: $(default1ESInternalPoolName)
image: $(default1ESInternalPoolImage)
os: linux
steps:
- powershell: >
Expand Down
39 changes: 39 additions & 0 deletions eng/common/templates/jobs/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ parameters:
jobs:
- job: Publish
pool: ${{ parameters.pool }}
timeoutInMinutes: 90
variables:
- name: imageBuilder.commonCmdArgs
value: >
Expand All @@ -27,6 +28,8 @@ jobs:
value: $(artifactsPath)/imageInfo
- name: sourceBuildIdOutputDir
value: $(Build.ArtifactStagingDirectory)/sourceBuildId
- name: imageInfoRawContentUrl
value: https://raw.githubusercontent.com/$(gitHubVersionsRepoInfo.org)/$(gitHubVersionsRepoInfo.repo)/$(gitHubVersionsRepoInfo.branch)/$(gitHubImageInfoVersionsPath)
- ${{ parameters.customPublishVariables }}
steps:
- template: /eng/common/templates/steps/retain-build.yml@self
Expand Down Expand Up @@ -103,6 +106,10 @@ jobs:
parameters:
dryRunArg: $(dryRunArg)
condition: and(succeeded(), eq(variables['publishReadme'], 'true'))
- script: |
mkdir -p $(Build.ArtifactStagingDirectory)/eol-annotation-data
curl -fSL --output $(Build.ArtifactStagingDirectory)/eol-annotation-data/image-info-old.json $(imageInfoRawContentUrl)
displayName: Download Original Image Info File
- script: >
$(runImageBuilderCmd) publishImageInfo
'$(imageInfoContainerDir)/image-info.json'
Expand All @@ -117,6 +124,8 @@ jobs:
$(imageBuilder.commonCmdArgs)
condition: and(succeeded(), eq(variables['publishImageInfo'], 'true'))
displayName: Publish Image Info
- script: curl -fSL --output $(Build.ArtifactStagingDirectory)/eol-annotation-data/image-info-new.json $(imageInfoRawContentUrl)
displayName: Download Updated Image Info File
- template: /eng/common/templates/steps/run-imagebuilder.yml@self
parameters:
displayName: Ingest Kusto Image Info
Expand All @@ -134,6 +143,33 @@ jobs:
--architecture '*'
$(dryRunArg)
$(imageBuilder.commonCmdArgs)
- template: /eng/common/templates/steps/run-imagebuilder.yml@self
parameters:
displayName: Generate EOL Annotation Data
serviceConnection: $(publish.serviceConnectionName)
internalProjectName: internal
condition: and(succeeded(), eq(variables['publishEolAnnotations'], 'true'))
args: >
generateEolAnnotationData
'$(artifactsPath)/eol-annotation-data/eol-annotation-data.json'
'$(artifactsPath)/eol-annotation-data/image-info-old.json'
'$(artifactsPath)/eol-annotation-data/image-info-new.json'
'$(publishRepoPrefix)'
'$(acr.server)'
$(generateEolAnnotationDataExtraOptions)
$(dryRunArg)
- template: /eng/common/templates/steps/publish-artifact.yml@self
parameters:
path: $(Build.ArtifactStagingDirectory)/eol-annotation-data
artifactName: eol-annotation-data-$(System.JobAttempt)
displayName: Publish EOL Annotation Data Artifact
internalProjectName: internal
publicProjectName: public
condition: and(succeeded(), eq(variables['publishEolAnnotations'], 'true'))
- template: /eng/common/templates/steps/annotate-eol-digests.yml@self
parameters:
internalProjectName: ${{ parameters.internalProjectName }}
dataFile: $(artifactsPath)/eol-annotation-data/eol-annotation-data.json
- script: >
$(runImageBuilderCmd) postPublishNotification
'$(publishNotificationRepoName)'
Expand All @@ -154,6 +190,9 @@ jobs:
--task "Wait for MCR Doc Ingestion (Authenticated)"
--task "Publish Image Info"
--task "Ingest Kusto Image Info (Authenticated)"
--task "Generate EOL Annotation Data (Authenticated)"
--task "Annotate EOL Images (Authenticated)"
--task "Wait for Annotation Ingestion (Authenticated)"
$(dryRunArg)
$(imageBuilder.commonCmdArgs)
displayName: Post Publish Notification
Expand Down
34 changes: 20 additions & 14 deletions eng/common/templates/stages/dotnet/build-test-publish-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,47 +70,53 @@ stages:
${{ elseif eq(variables['System.TeamProject'], parameters.publicProjectName) }}:
vmImage: $(defaultLinuxAmd64PoolImage)
${{ elseif eq(variables['System.TeamProject'], parameters.internalProjectName) }}:
name: NetCore1ESPool-Internal
image: 1es-ubuntu-2204
name: $(linuxAmd64InternalPoolName)
image: $(linuxAmd64InternalPoolImage)
os: linux

# Linux Arm64
linuxArm64Pool:
os: linux
hostArchitecture: Arm64
image: Mariner-2-Docker-ARM64
image: $(linuxArm64PoolImage)
${{ if eq(variables['System.TeamProject'], parameters.publicProjectName) }}:
name: Docker-Linux-Arm-Public
name: $(linuxArm64PublicPoolName)
${{ if eq(variables['System.TeamProject'], parameters.internalProjectName) }}:
name: Docker-Linux-Arm-Internal
name: $(linuxArm64InternalPoolName)

# Linux Arm32
linuxArm32Pool:
os: linux
hostArchitecture: Arm64
image: Mariner-2-Docker-ARM64
image: $(linuxArm32PoolImage)
${{ if eq(variables['System.TeamProject'], parameters.publicProjectName) }}:
name: Docker-Linux-Arm-Public
name: $(linuxArm32PublicPoolName)
${{ if eq(variables['System.TeamProject'], parameters.internalProjectName) }}:
name: Docker-Linux-Arm-Internal
name: $(linuxArm32InternalPoolName)

# Windows Server 2016
windows2016Pool:
os: windows
name: Docker-2016-${{ variables['System.TeamProject'] }}
name: $(windowsServer2016PoolName)
${{ if eq(variables['System.TeamProject'], parameters.publicProjectName) }}:
image: $(windowsServer2016PublicPoolImage)
${{ if eq(variables['System.TeamProject'], parameters.internalProjectName) }}:
image: Server2016-NESDockerBuilds-PT
image: $(windowsServer2016InternalPoolImage)

# Windows Server 2019 (1809)
windows1809Pool:
os: windows
name: Docker-1809-${{ variables['System.TeamProject'] }}
name: $(windowsServer2019PoolName)
${{ if eq(variables['System.TeamProject'], parameters.publicProjectName) }}:
image: $(windowsServer2019PublicPoolImage)
${{ if eq(variables['System.TeamProject'], parameters.internalProjectName) }}:
image: Server2019-1809-NESDockerBuilds-1ESPT
image: $(windowsServer2019InternalPoolImage)

# Windows Server 2022
windows2022Pool:
os: windows
name: Docker-2022-${{ variables['System.TeamProject'] }}
name: $(windowsServer2022PoolName)
${{ if eq(variables['System.TeamProject'], parameters.publicProjectName) }}:
image: $(windowsServer2022PublicPoolImage)
${{ if eq(variables['System.TeamProject'], parameters.internalProjectName) }}:
image: Server2022-NESDockerBuilds-1ESPT
image: $(windowsServer2022InternalPoolImage)
6 changes: 5 additions & 1 deletion eng/common/templates/steps/annotate-eol-digests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,28 @@ steps:
displayName: Annotate EOL Images
serviceConnection: $(publish.serviceConnectionName)
internalProjectName: internal
condition: and(succeeded(), eq(variables['publishEolAnnotations'], 'true'))
args: >
annotateEolDigests
/repo/${{ parameters.dataFile }}
${{ parameters.dataFile }}
$(acr.server)
$(publishRepoPrefix)
$(artifactsPath)/annotation-digests/annotation-digests.txt
$(dryRunArg)
- template: /eng/common/templates/steps/publish-artifact.yml@self
parameters:
path: $(Build.ArtifactStagingDirectory)/annotation-digests
artifactName: annotation-digests-$(System.JobAttempt)
displayName: Publish Annotation Digests List
internalProjectName: internal
publicProjectName: public
condition: and(succeeded(), eq(variables['publishEolAnnotations'], 'true'))
- template: /eng/common/templates/steps/run-imagebuilder.yml@self
parameters:
displayName: Wait for Annotation Ingestion
serviceConnection: $(marStatus.serviceConnectionName)
internalProjectName: internal
condition: and(succeeded(), eq(variables['publishEolAnnotations'], 'true'))
args: >
waitForMarAnnotationIngestion
$(artifactsPath)/annotation-digests/annotation-digests.txt
12 changes: 12 additions & 0 deletions eng/common/templates/variables/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ variables:
value: ""
- name: imageBuilderDockerRunExtraOptions
value: ""
- name: generateEolAnnotationDataExtraOptions
value: ""
- name: productVersionComponents
value: 2
- name: imageInfoVariant
Expand Down Expand Up @@ -56,6 +58,16 @@ variables:
- name: defaultWindows2022PoolImage
value: windows-2022

- name: default1ESInternalPoolName
value: NetCore1ESPool-Internal
- name: default1ESInternalPoolImage
value: 1es-ubuntu-2204

- name: defaultSourceAnalysisPoolName
value: NetCore1ESPool-Internal
- name: defaultSourceAnalysisPoolImage
value: 1es-windows-2022

# Define these as placeholder values to allow string validation to succeed since we don't have the
# variable group with the actual values in public builds. For internal builds, the variable group
# will cause these values to be overridden with the real values.
Expand Down
2 changes: 1 addition & 1 deletion eng/common/templates/variables/docker-images.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variables:
imageNames.imageBuilderName: mcr.microsoft.com/dotnet-buildtools/image-builder:2516503
imageNames.imageBuilderName: mcr.microsoft.com/dotnet-buildtools/image-builder:2530171
imageNames.imageBuilder: $(imageNames.imageBuilderName)
imageNames.imageBuilder.withrepo: imagebuilder-withrepo:$(Build.BuildId)-$(System.JobId)
imageNames.testRunner: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner2.0-docker-testrunner
Expand Down
40 changes: 40 additions & 0 deletions eng/common/templates/variables/dotnet/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,46 @@ variables:
- name: dockerHubRegistryCreds
value: --registry-creds 'docker.io=$(dotnetDockerHubBot.userName);$(BotAccount-dotnet-dockerhub-bot-PAT)'

- name: linuxAmd64InternalPoolImage
value: 1es-ubuntu-2204
- name: linuxAmd64InternalPoolName
value: NetCore1ESPool-Internal

- name: linuxArm64PoolImage
value: Mariner-2-Docker-ARM64
- name: linuxArm64PublicPoolName
value: Docker-Linux-Arm-Public
- name: linuxArm64InternalPoolName
value: Docker-Linux-Arm-Internal

- name: linuxArm32PoolImage
value: Mariner-2-Docker-ARM64
- name: linuxArm32PublicPoolName
value: Docker-Linux-Arm-Public
- name: linuxArm32InternalPoolName
value: Docker-Linux-Arm-Internal

- name: windowsServer2016PublicPoolImage
value: Server2016-NESDockerBuilds
- name: windowsServer2016InternalPoolImage
value: Server2016-NESDockerBuilds-PT
- name: windowsServer2016PoolName
value: Docker-2016-${{ variables['System.TeamProject'] }}

- name: windowsServer2019PublicPoolImage
value: Server2019-1809-NESDockerBuilds
- name: windowsServer2019InternalPoolImage
value: Server2019-1809-NESDockerBuilds-1ESPT
- name: windowsServer2019PoolName
value: Docker-1809-${{ variables['System.TeamProject'] }}

- name: windowsServer2022PublicPoolImage
value: Server2022-NESDockerBuilds
- name: windowsServer2022InternalPoolImage
value: Server2022-NESDockerBuilds-1ESPT
- name: windowsServer2022PoolName
value: Docker-2022-${{ variables['System.TeamProject'] }}

- group: DotNet-Docker-Common
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- group: DotNet-Docker-Secrets-WIF