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

Push EOL annotations in publish stage #1413

Merged
merged 3 commits into from
Aug 27, 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
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
lbussell marked this conversation as resolved.
Show resolved Hide resolved
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)
lbussell marked this conversation as resolved.
Show resolved Hide resolved
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
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
5 changes: 4 additions & 1 deletion eng/common/templates/steps/annotate-eol-digests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ 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
Expand All @@ -22,11 +23,13 @@ steps:
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
2 changes: 2 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
4 changes: 3 additions & 1 deletion eng/pipelines/annotate-eol-digests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ parameters:

variables:
- template: templates/variables/image-builder.yml
- name: publishEolAnnotations
value: true

extends:
template: /eng/common/templates/1es-official.yml@self
Expand All @@ -22,4 +24,4 @@ extends:
- template: /eng/common/templates/steps/init-docker-linux.yml@self
- template: /eng/common/templates/steps/annotate-eol-digests.yml@self
parameters:
dataFile: ${{ parameters.dataFile }}
dataFile: /repo/${{ parameters.dataFile }}