-
Notifications
You must be signed in to change notification settings - Fork 138
[main] Add source-build-pre-release pipeline yaml #3079
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
572115c
Add source-build-pre-release pipeline yaml
lbussell 859b3b7
Update doc to reference new pipeline
lbussell 90c67b9
Remove extra testing step.
lbussell 04a46e6
Use SdkVersion for download step
lbussell 6e4f5ed
Fix typo in release checklist
lbussell 652e7cd
Rewrites based on code review
lbussell eacbc39
Change staging pipeline resource name
lbussell a8de4cb
Try az storage fs instead of blob
lbussell a627264
Revert "Try az storage fs instead of blob"
lbussell dcace32
List files from storage account
lbussell 3c61a63
Exit if tarball build failed
lbussell f1af178
Use blob list instead of blob directory
lbussell 2f1c8ce
Check that tarball was uploaded
lbussell 298d9c9
Remove unused logging
lbussell 6e895b1
Change staging pipeline resource name
lbussell 1ade6c5
Merge branch 'dev/loganbussell/source-build-pre-release-testing' into…
lbussell 2573283
Switch back to release filepath
lbussell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| trigger: none | ||
| pr: none | ||
|
|
||
| pool: | ||
| name: NetCore1ESPool-Svc-Internal | ||
| demands: ImageOverride -equals 1es-ubuntu-2004 | ||
|
|
||
| resources: | ||
| pipelines: | ||
| - pipeline: dotnet-staging-pipeline-resource | ||
| source: Stage-DotNet | ||
|
|
||
| parameters: | ||
| - name: useSpecificPipelineRunIDs | ||
| displayName: Use Specific Pipeline Run IDs | ||
| type: boolean | ||
| default: false | ||
| - name: dotnetInstallerOfficialRunID | ||
| displayName: dotnet-installer-official-ci run ID | ||
| type: string | ||
| default: '200XXXX' | ||
| - name: dotnetInstallerTarballBuildRunID | ||
| displayName: dotnet-installer-source-build-tarball-build run ID | ||
| type: string | ||
| default: '200XXXX' | ||
|
|
||
| variables: | ||
| - template: templates/installer-pipeline-variables.yml | ||
| - group: DotNet-MSRC-Storage | ||
| - name: storageAccountName | ||
| value: 'dotnetclimsrc' | ||
| - name: blobContainerName | ||
| value: 'source-build' | ||
| - name: blobContainerUploadBaseFilePath | ||
| value: 'release' | ||
|
|
||
| jobs: | ||
| - job: UploadSourceTarballJob | ||
| displayName: Upload Source Tarball | ||
|
|
||
| steps: | ||
| - template: templates/get-build-info.yml | ||
| parameters: | ||
| dotnetStagingPipelineResource: dotnet-staging-pipeline-resource | ||
| getAssociatedPipelineRuns: true | ||
| useSpecificPipelineRunIDs: ${{ parameters.useSpecificPipelineRunIDs }} | ||
| dotnetInstallerOfficialRunID: ${{ parameters.dotnetInstallerOfficialRunID }} | ||
| dotnetInstallerTarballBuildRunID: ${{ parameters.dotnetInstallerTarballBuildRunID }} | ||
|
|
||
| - task: DownloadPipelineArtifact@2 | ||
| name: DownloadSourceTarballStep | ||
| displayName: Download Source Tarball | ||
| inputs: | ||
| source: 'specific' | ||
| artifact: 'BlobArtifacts' | ||
| patterns: 'BlobArtifacts/dotnet-sdk-source-$(SdkVersion).tar.gz' | ||
| project: 'internal' | ||
| pipeline: $(installerOfficialCiPipelineId) | ||
| runVersion: 'specific' | ||
| runId: $(InstallerOfficialRunId) | ||
|
|
||
| - script: | | ||
| set -euxo pipefail | ||
| az config set extension.use_dynamic_install=yes_without_prompt | ||
|
|
||
| source_tarball_upload_path="$(blobContainerUploadBaseFilePath)/$(ReleaseChannel)/$(RuntimeVersion)-$(SdkVersion)" | ||
| source_tarball_filename="dotnet-sdk-source-$(SdkVersion).tar.gz" | ||
|
|
||
| if [ ! -f "$(PIPELINE.WORKSPACE)/${source_tarball_filename}" ]; then | ||
| echo "##vso[task.logissue type=error]File ${source_tarball_filename} not found on disk. It might not have been downloaded. Exiting..." | ||
| fi | ||
|
|
||
| az storage blob upload --account-name "$(storageAccountName)" --container-name "$(blobContainerName)" --file "$(PIPELINE.WORKSPACE)/${source_tarball_filename}" --name "${source_tarball_upload_path}/${source_tarball_filename}" | ||
|
|
||
| source_tarball_blob_list=$(az storage blob list --account-name "$(storageAccountName)" --container-name "$(blobContainerName)" --prefix "${source_tarball_upload_path}/${source_tarball_filename}") | ||
| number_of_blobs=$(echo $source_tarball_blob_list | jq -r 'length') | ||
|
|
||
| if [ $number_of_blobs -eq 0 ]; then | ||
| echo "##vso[task.logissue type=error]File ${source_tarball_filename} not found in blob storage. It might not have been downloaded earlier, and might not have been uploaded to $(blobContainerName). Exiting..." | ||
| exit 1 | ||
| elif [ $number_of_blobs -gt 1 ]; then | ||
| echo "##vso[task.logissue type=error]More than one blob named ${source_tarball_filename} found in blob storage. Exiting..." | ||
| exit 1 | ||
| fi | ||
| name: UploadSourceTarballStep | ||
| displayName: Upload Source Tarball | ||
| env: | ||
| AZURE_STORAGE_KEY: $(dotnetclimsrc-access-key) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| parameters: | ||
| - name: dotnetStagingPipelineResource | ||
| type: string | ||
| default: '' | ||
| - name: getAssociatedPipelineRuns | ||
| type: boolean | ||
| default: false | ||
| - name: useSpecificPipelineRunIDs | ||
| type: boolean | ||
| default: false | ||
| - name: dotnetInstallerOfficialRunID | ||
| type: string | ||
| default: '' | ||
| - name: dotnetInstallerTarballBuildRunID | ||
| type: string | ||
| default: '' | ||
|
|
||
| steps: | ||
| - download: ${{ parameters.dotnetStagingPipelineResource }} | ||
| artifact: manifests | ||
| patterns: 'manifest.json' | ||
| displayName: Download Release Manifest | ||
|
|
||
| - download: ${{ parameters.dotnetStagingPipelineResource }} | ||
| artifact: drop | ||
| patterns: 'config.json' | ||
| displayName: Download Release Config | ||
|
|
||
| - script: | | ||
| set -euo pipefail | ||
| manifest_path=$(PIPELINE.WORKSPACE)/dotnet-staging-pipeline-resource/manifests/manifest.json | ||
| config_path=$(PIPELINE.WORKSPACE)/dotnet-staging-pipeline-resource/drop/config.json | ||
| runtime_version="$(jq -r '.Runtime' $config_path)" | ||
| release_channel="$(jq -r '.Channel' $config_path)" | ||
| # Source-build only supports the lowest avaiable feature band. | ||
| # Sort the SDK releases by number and pick the lowest value. | ||
| sdk_version="$(jq -r '.Sdks | sort_by(. | split(".") | map(tonumber)) | .[0]' $config_path)" | ||
| # replace the last two characters in sdk_version with xx | ||
| branch_version=$(echo $sdk_version | sed 's/..$/xx/') | ||
| branch_name="refs/heads/internal/release/${branch_version}" | ||
| commit=$(jq -r --arg BRANCH "${branch_name}" '.builds[] | select(.repo == "https://dev.azure.com/dnceng/internal/_git/dotnet-installer") | select(.branch == $BRANCH) | .commit' $manifest_path) | ||
| if [[ ! $commit ]]; then | ||
| echo "##vso[task.logissue type=error]Installer commit not set. Exiting..." | ||
| exit 1 | ||
| fi | ||
| echo "Release channel: ${release_channel}" | ||
| echo "Runtime version: ${runtime_version}" | ||
| echo "SDK version: ${sdk_version}" | ||
| echo "Installer commit: ${commit}" | ||
| echo "##vso[task.setvariable variable=SdkVersion]${sdk_version}" | ||
| echo "##vso[task.setvariable variable=RuntimeVersion]${runtime_version}" | ||
| echo "##vso[task.setvariable variable=ReleaseChannel]${release_channel}" | ||
| echo "##vso[task.setvariable variable=InstallerCommit]${commit}" | ||
| name: ReadReleaseInfoStep | ||
| displayName: Read Release Info | ||
|
|
||
| - ${{ if eq(parameters.getAssociatedPipelineRuns, true) }}: | ||
| - ${{ if eq(parameters.useSpecificPipelineRunIDs, false) }}: | ||
| - script: | | ||
| set -euo pipefail | ||
| az config set extension.use_dynamic_install=yes_without_prompt | ||
| installer_official_runs=$(az pipelines runs list --organization $(azDoOrg) --project $(azDoProject) --pipeline-ids $(installerOfficialCiPipelineId)) | ||
| installer_official_run_ids=$(echo $installer_official_runs | jq -r '[.[] | select(.sourceVersion == "$(InstallerCommit)") | .id]') | ||
| num_official_runs=$(echo $installer_official_run_ids | jq 'length') | ||
| if [ "$num_official_runs" != "1" ]; then | ||
| echo "##vso[task.logissue type=error]There are ${num_official_runs} of dotnet-installer-official-ci for $(InstallerCommit). Please manually specify run IDs to use." | ||
| echo "##vso[task.logissue type=error]Run IDs are: ${installer_official_run_ids}" | ||
| exit 1 | ||
| fi | ||
| installer_official_run_id=$(echo $installer_official_run_ids | jq -r '.[0]') | ||
| installer_tarball_build_runs=$(az pipelines runs list --organization $(azDoOrg) --project $(azDoProject) --pipeline-ids $(installerTarabllBuildCiPipelineId)) | ||
| installer_tarball_build_run_ids=$(echo $installer_tarball_build_runs | jq -r '[.[] | select(.sourceVersion == "$(InstallerCommit)") | { "result": .result, "id": .id }]') | ||
| num_tarball_build_runs=$(echo $installer_tarball_build_run_ids | jq 'length') | ||
| if [ "$num_tarball_build_runs" != "1" ]; then | ||
| echo "##vso[task.logissue type=error]There are ${num_tarball_build_runs} runs of dotnet-installer-source-build-tarball-build for $(InstallerCommit). Please manually specify run IDs to use." | ||
| echo "##vso[task.logissue type=error]Run IDs are: ${installer_tarball_build_run_ids}" | ||
| exit 1 | ||
| fi | ||
| installer_tarball_build_run_id=$(echo $installer_tarball_build_run_ids | jq -r '.[0].id') | ||
| installer_tarball_build_run_result=$(echo $installer_tarball_build_run_ids | jq -r '.[0].result') | ||
| if [[ ("$installer_tarball_build_run_result" == "failed") && "$(useSpecificPipelineRunIDs)" ]]; then | ||
| echo "##vso[task.logissue type=error]: dotnet-installer-source-build-tarball-build run ID ${installer_tarball_build_run_id} failed. Please manually specify a tarball build ID to use instead. Exiting..." | ||
| exit 1 | ||
| fi | ||
| echo "dotnet-installer-official-ci run ID: ${installer_official_run_id}" | ||
| echo "dotnet-installer-source-build-tarball-build run ID: ${installer_tarball_build_run_id}" | ||
| echo "##vso[task.setvariable variable=InstallerOfficialRunId]${installer_official_run_id}" | ||
| echo "##vso[task.setvariable variable=InstallerTarballBuildRunId]${installer_tarball_build_run_id}" | ||
| name: GetAssociatedPipelineRunsStep | ||
| displayName: Get Associated Pipeline Run IDs | ||
| env: | ||
| AZURE_DEVOPS_EXT_PAT: $(System.AccessToken) | ||
| - ${{ if eq(parameters.useSpecificPipelineRunIDs, true) }}: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI usage of |
||
| - script: | | ||
| set -euo pipefail | ||
| installer_official_run_id="${{ parameters.dotnetInstallerOfficialRunID }}" | ||
| installer_tarball_build_run_id="${{ parameters.dotnetInstallerTarballBuildRunID }}" | ||
| echo "dotnet-installer-official-ci run ID: ${installer_official_run_id}" | ||
| echo "dotnet-installer-source-build-tarball-build run ID: ${installer_tarball_build_run_id}" | ||
| echo "##vso[task.setvariable variable=InstallerOfficialRunId]${installer_official_run_id}" | ||
| echo "##vso[task.setvariable variable=InstallerTarballBuildRunId]${installer_tarball_build_run_id}" | ||
| name: SetAssociatedPipelineRunsStep | ||
| displayName: Set Associated Pipeline Run IDs | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Information about dotnet/installer pipelines that won't change and is useful in multiple pipelines | ||
| variables: | ||
| - name: azDoProject | ||
| value: 'internal' | ||
| - name: azDoOrg | ||
| value: 'https://dev.azure.com/dnceng/' | ||
| - name: installerOfficialCiPipelineId | ||
| value: '286' | ||
| - name: installerTarabllBuildCiPipelineId | ||
| value: '1011' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.