Skip to content

Commit ed3508f

Browse files
authored
[release/8.0] Switch to dSAS for internal runtimes (dotnet#56488)
* Update arcade * Switch to dSAS for internal runtimes * Enable internal sources for source build * Fixup for publishing in arcade 8.0 * Fix spaciong
1 parent 54df535 commit ed3508f

23 files changed

+316
-73
lines changed

.azure/pipelines/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ variables:
101101
value: /bl:artifacts/log/Release/Build.Installers.binlog
102102
- name: WindowsArm64InstallersLogArgs
103103
value: /bl:artifacts/log/Release/Build.Installers.Arm64.binlog
104-
- group: DotNetBuilds storage account read tokens
105104
- name: _InternalRuntimeDownloadArgs
106105
value: -RuntimeSourceFeed https://dotnetbuilds.blob.core.windows.net/internal
107106
-RuntimeSourceFeedKey $(dotnetbuilds-internal-container-read-token-base64)
@@ -675,6 +674,7 @@ extends:
675674
# Source build
676675
- template: /eng/common/templates-official/job/source-build.yml@self
677676
parameters:
677+
enableInternalSources: true
678678
platform:
679679
name: 'Managed'
680680
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9'

.azure/pipelines/jobs/default-build.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ jobs:
210210
# Include the variables we always want.
211211
COMPlus_DbgEnableMiniDump: 1
212212
COMPlus_DbgMiniDumpName: "$(System.DefaultWorkingDirectory)/dotnet-%d.%t.core"
213-
DotNetBuildsInternalReadSasToken: $(dotnetbuilds-internal-container-read-token)
214213
# Expand provided `env:` properties, if any.
215214
${{ if step.env }}:
216215
${{ step.env }}
@@ -222,14 +221,12 @@ jobs:
222221
env:
223222
COMPlus_DbgEnableMiniDump: 1
224223
COMPlus_DbgMiniDumpName: "$(System.DefaultWorkingDirectory)/dotnet-%d.%t.core"
225-
DotNetBuildsInternalReadSasToken: $(dotnetbuilds-internal-container-read-token)
226224
- ${{ if ne(parameters.agentOs, 'Windows') }}:
227225
- script: $(BuildDirectory)/build.sh --ci --nobl --configuration $(BuildConfiguration) $(BuildScriptArgs)
228226
displayName: Run build.sh
229227
env:
230228
COMPlus_DbgEnableMiniDump: 1
231229
COMPlus_DbgMiniDumpName: "$(System.DefaultWorkingDirectory)/dotnet-%d.%t.core"
232-
DotNetBuildsInternalReadSasToken: $(dotnetbuilds-internal-container-read-token)
233230

234231
- ${{ parameters.afterBuild }}
235232

@@ -441,6 +438,20 @@ jobs:
441438
env:
442439
Token: $(dn-bot-dnceng-artifact-feeds-rw)
443440

441+
# Populates internal runtime SAS tokens.
442+
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
443+
444+
# Populate dotnetbuilds-internal base64 sas tokens.
445+
- template: /eng/common/templates-official/steps/get-delegation-sas.yml
446+
parameters:
447+
federatedServiceConnection: 'dotnetbuilds-internal-read'
448+
outputVariableName: 'dotnetbuilds-internal-container-read-token'
449+
expiryInHours: 1
450+
base64Encode: false
451+
storageAccount: dotnetbuilds
452+
container: internal
453+
permissions: rl
454+
444455
# Add COMPlus_* environment variables to build steps.
445456
- ${{ if ne(parameters.steps, '')}}:
446457
- ${{ each step in parameters.steps }}:

eng/Version.Details.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -376,26 +376,26 @@
376376
<Uri>https://github.com/dotnet/winforms</Uri>
377377
<Sha>abda8e3bfa78319363526b5a5f86863ec979940e</Sha>
378378
</Dependency>
379-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24266.3">
379+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24352.1">
380380
<Uri>https://github.com/dotnet/arcade</Uri>
381-
<Sha>e6f70c7dd528f05cd28cec2a179d58c22e91d9ac</Sha>
381+
<Sha>8b879da4e449c48d99f3f642fc429379a64e8fe8</Sha>
382382
<SourceBuild RepoName="arcade" ManagedOnly="true" />
383383
</Dependency>
384-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="8.0.0-beta.24266.3">
384+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="8.0.0-beta.24352.1">
385385
<Uri>https://github.com/dotnet/arcade</Uri>
386-
<Sha>e6f70c7dd528f05cd28cec2a179d58c22e91d9ac</Sha>
386+
<Sha>8b879da4e449c48d99f3f642fc429379a64e8fe8</Sha>
387387
</Dependency>
388-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="8.0.0-beta.24266.3">
388+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="8.0.0-beta.24352.1">
389389
<Uri>https://github.com/dotnet/arcade</Uri>
390-
<Sha>e6f70c7dd528f05cd28cec2a179d58c22e91d9ac</Sha>
390+
<Sha>8b879da4e449c48d99f3f642fc429379a64e8fe8</Sha>
391391
</Dependency>
392-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.24266.3">
392+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.24352.1">
393393
<Uri>https://github.com/dotnet/arcade</Uri>
394-
<Sha>e6f70c7dd528f05cd28cec2a179d58c22e91d9ac</Sha>
394+
<Sha>8b879da4e449c48d99f3f642fc429379a64e8fe8</Sha>
395395
</Dependency>
396-
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="8.0.0-beta.24266.3">
396+
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="8.0.0-beta.24352.1">
397397
<Uri>https://github.com/dotnet/arcade</Uri>
398-
<Sha>e6f70c7dd528f05cd28cec2a179d58c22e91d9ac</Sha>
398+
<Sha>8b879da4e449c48d99f3f642fc429379a64e8fe8</Sha>
399399
</Dependency>
400400
<Dependency Name="Microsoft.Extensions.Diagnostics.Testing" Version="8.1.0-preview.23604.1">
401401
<Uri>https://github.com/dotnet/extensions</Uri>

eng/Versions.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@
162162
<NuGetVersioningVersion>6.2.4</NuGetVersioningVersion>
163163
<NuGetFrameworksVersion>6.2.4</NuGetFrameworksVersion>
164164
<!-- Packages from dotnet/arcade -->
165-
<MicrosoftDotNetBuildTasksInstallersVersion>8.0.0-beta.24266.3</MicrosoftDotNetBuildTasksInstallersVersion>
166-
<MicrosoftDotNetBuildTasksTemplatingVersion>8.0.0-beta.24266.3</MicrosoftDotNetBuildTasksTemplatingVersion>
167-
<MicrosoftDotNetRemoteExecutorVersion>8.0.0-beta.24266.3</MicrosoftDotNetRemoteExecutorVersion>
165+
<MicrosoftDotNetBuildTasksInstallersVersion>8.0.0-beta.24352.1</MicrosoftDotNetBuildTasksInstallersVersion>
166+
<MicrosoftDotNetBuildTasksTemplatingVersion>8.0.0-beta.24352.1</MicrosoftDotNetBuildTasksTemplatingVersion>
167+
<MicrosoftDotNetRemoteExecutorVersion>8.0.0-beta.24352.1</MicrosoftDotNetRemoteExecutorVersion>
168168
<!-- Packages from dotnet/source-build-externals -->
169169
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>8.0.0-alpha.1.24269.1</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
170170
<!-- Packages from dotnet/source-build-reference-packages -->

eng/common/post-build/publish-using-darc.ps1

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ param(
22
[Parameter(Mandatory=$true)][int] $BuildId,
33
[Parameter(Mandatory=$true)][int] $PublishingInfraVersion,
44
[Parameter(Mandatory=$true)][string] $AzdoToken,
5-
[Parameter(Mandatory=$true)][string] $MaestroToken,
65
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro.dot.net',
76
[Parameter(Mandatory=$true)][string] $WaitPublishingFinish,
87
[Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters,
@@ -31,13 +30,13 @@ try {
3130
}
3231

3332
& $darc add-build-to-channel `
34-
--id $buildId `
35-
--publishing-infra-version $PublishingInfraVersion `
36-
--default-channels `
37-
--source-branch main `
38-
--azdev-pat $AzdoToken `
39-
--bar-uri $MaestroApiEndPoint `
40-
--password $MaestroToken `
33+
--id $buildId `
34+
--publishing-infra-version $PublishingInfraVersion `
35+
--default-channels `
36+
--source-branch main `
37+
--azdev-pat "$AzdoToken" `
38+
--bar-uri "$MaestroApiEndPoint" `
39+
--ci `
4140
@optionalParams
4241

4342
if ($LastExitCode -ne 0) {

eng/common/templates-official/job/publish-build-assets.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,16 @@ jobs:
7676

7777
- task: NuGetAuthenticate@1
7878

79-
- task: PowerShell@2
79+
- task: AzureCLI@2
8080
displayName: Publish Build Assets
8181
inputs:
82-
filePath: eng\common\sdk-task.ps1
83-
arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet
82+
azureSubscription: "Darc: Maestro Production"
83+
scriptType: ps
84+
scriptLocation: scriptPath
85+
scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1
86+
arguments: >
87+
-task PublishBuildAssets -restore -msbuildEngine dotnet
8488
/p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests'
85-
/p:BuildAssetRegistryToken=$(MaestroAccessToken)
8689
/p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com
8790
/p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }}
8891
/p:OfficialBuildId=$(Build.BuildNumber)
@@ -144,7 +147,6 @@ jobs:
144147
arguments: -BuildId $(BARBuildId)
145148
-PublishingInfraVersion 3
146149
-AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)'
147-
-MaestroToken '$(MaestroApiAccessToken)'
148150
-WaitPublishingFinish true
149151
-ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}'
150152
-SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'

eng/common/templates-official/job/source-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ parameters:
3131
# container and pool.
3232
platform: {}
3333

34+
# If set to true and running on a non-public project,
35+
# Internal blob storage locations will be enabled.
36+
# This is not enabled by default because many repositories do not need internal sources
37+
# and do not need to have the required service connections approved in the pipeline.
38+
enableInternalSources: false
39+
3440
jobs:
3541
- job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }}
3642
displayName: Source-Build (${{ parameters.platform.name }})
@@ -62,6 +68,8 @@ jobs:
6268
clean: all
6369

6470
steps:
71+
- ${{ if eq(parameters.enableInternalSources, true) }}:
72+
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
6573
- template: /eng/common/templates-official/steps/source-build.yml
6674
parameters:
6775
platform: ${{ parameters.platform }}

eng/common/templates-official/job/source-index-stage1.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
value: ${{ parameters.sourceIndexPackageSource }}
2424
- name: BinlogPath
2525
value: ${{ parameters.binlogPath }}
26-
- template: /eng/common/templates/variables/pool-providers.yml
26+
- template: /eng/common/templates-official/variables/pool-providers.yml
2727

2828
${{ if ne(parameters.pool, '') }}:
2929
pool: ${{ parameters.pool }}
@@ -34,7 +34,8 @@ jobs:
3434
demands: ImageOverride -equals windows.vs2019.amd64.open
3535
${{ if eq(variables['System.TeamProject'], 'internal') }}:
3636
name: $(DncEngInternalBuildPool)
37-
demands: ImageOverride -equals windows.vs2019.amd64
37+
image: windows.vs2022.amd64
38+
os: windows
3839

3940
steps:
4041
- ${{ each preStep in parameters.preSteps }}:
@@ -70,16 +71,13 @@ jobs:
7071
scriptType: 'ps'
7172
scriptLocation: 'inlineScript'
7273
inlineScript: |
73-
echo "##vso[task.setvariable variable=ARM_CLIENT_ID]$env:servicePrincipalId"
74-
echo "##vso[task.setvariable variable=ARM_ID_TOKEN]$env:idToken"
75-
echo "##vso[task.setvariable variable=ARM_TENANT_ID]$env:tenantId"
74+
echo "##vso[task.setvariable variable=ARM_CLIENT_ID;issecret=true]$env:servicePrincipalId"
75+
echo "##vso[task.setvariable variable=ARM_ID_TOKEN;issecret=true]$env:idToken"
76+
echo "##vso[task.setvariable variable=ARM_TENANT_ID;issecret=true]$env:tenantId"
7677
7778
- script: |
78-
echo "Client ID: $(ARM_CLIENT_ID)"
79-
echo "ID Token: $(ARM_ID_TOKEN)"
80-
echo "Tenant ID: $(ARM_TENANT_ID)"
8179
az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN)
8280
displayName: "Login to Azure"
8381
8482
- script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1
85-
displayName: Upload stage1 artifacts to source index
83+
displayName: Upload stage1 artifacts to source index

eng/common/templates-official/jobs/source-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ parameters:
2121
# one job runs on 'defaultManagedPlatform'.
2222
platforms: []
2323

24+
# If set to true and running on a non-public project,
25+
# Internal nuget and blob storage locations will be enabled.
26+
# This is not enabled by default because many repositories do not need internal sources
27+
# and do not need to have the required service connections approved in the pipeline.
28+
enableInternalSources: false
29+
2430
jobs:
2531

2632
- ${{ if ne(parameters.allCompletedJobId, '') }}:
@@ -38,9 +44,11 @@ jobs:
3844
parameters:
3945
jobNamePrefix: ${{ parameters.jobNamePrefix }}
4046
platform: ${{ platform }}
47+
enableInternalSources: ${{ parameters.enableInternalSources }}
4148

4249
- ${{ if eq(length(parameters.platforms), 0) }}:
4350
- template: /eng/common/templates-official/job/source-build.yml
4451
parameters:
4552
jobNamePrefix: ${{ parameters.jobNamePrefix }}
4653
platform: ${{ parameters.defaultManagedPlatform }}
54+
enableInternalSources: ${{ parameters.enableInternalSources }}

eng/common/templates-official/post-build/post-build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,16 @@ stages:
272272

273273
- task: NuGetAuthenticate@1
274274

275-
- task: PowerShell@2
275+
- task: AzureCLI@2
276276
displayName: Publish Using Darc
277277
inputs:
278-
filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
278+
azureSubscription: "Darc: Maestro Production"
279+
scriptType: ps
280+
scriptLocation: scriptPath
281+
scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
279282
arguments: -BuildId $(BARBuildId)
280283
-PublishingInfraVersion ${{ parameters.publishingInfraVersion }}
281284
-AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)'
282-
-MaestroToken '$(MaestroApiAccessToken)'
283285
-WaitPublishingFinish true
284286
-ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}'
285287
-SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'

0 commit comments

Comments
 (0)