Skip to content

Commit dd83ebc

Browse files
[Rollout] Production rollout 2024-09-10 (#3940)
2 parents 54e19ab + b58b1d2 commit dd83ebc

39 files changed

+1276
-808
lines changed

.github/ISSUE_TEMPLATE/rollout-issue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ In case the services don't work as expected after the rollout, it's necessary to
7171

7272
## Rollout times
7373

74-
Use the following [Kusto query](https://dataexplorer.azure.com/clusters/engsrvprod/databases/engineeringdata?query=H4sIAAAAAAAAA51Qy07DMBC89ytWuTSWwg+k6gFUCfWCqhZxQSha4m1j5Eew10B5/DubUETgiE+r8ezM7GhqLUaCx0zx2PQY0RFTTOU2WBsyr3UNNvgDLEEtZpYYLolXOSKb4AUsG3NiVNDsTUy8YzxQDYmjGUGLfzAFbzOQd20cWeNpS22IOo3YOzx3JHEusrF6rWG5BDH49XUlCcH4cuI2dVEncsrOYTSvJK4YWaI6WdoN82CsKiCvBxRfJuhpuY/hgVqGyaH7EB1yw8JKPfpy2D770q6g6LrauUIa+ljMejmSR6Hb+SbSeS9qT2ihHElqfidqHFKLUnw5afOnchEcCyhk2OR7a1IHOUl1sMLYFkpV3/Ih8f/0V9TbcBwMbtAajUygR8iRZ3FYfALfQdHDGQIAAA==) to gather data about rollout times:
74+
Use the following [Kusto query](https://dataexplorer.azure.com/clusters/engsrvprod/databases/engineeringdata?query=H4sIAAAAAAAAA52QP0%2FDQAzF934KK0tzUlgYU2UAtUJdUNWyIRSZxG0O3eWCzwHKn%2B%2BOE4oIjNxkvbN%2Fz341VQ6Z4LEnPpYdMnoS4phug3Ohl3WdgwvtAQqzmDkSuCJZ9oxiQwsFpKU9NWRQ7i1H2QkeKIcobEfR4R%2FNwNsM9N1YT862tKUqcB1H7R2eG9JtLnvr6nUNRQFq8OvrWhcE26YTt6mLOTXH3ntk%2B0rqiiy6qteh3VAPxiYDautBxZeJehruODxQJTA5dB%2FYo5SiXbHDNh2mz77YGSRNk3ufaEIfi1mnR8oIup1vmC46pT2hg3RsMvM7pUmIFWru6STNn8QVOAaQaLHp752NDfRRo4MlcpUYk33jQ5T%2F8ZfUuXAcDFbnKxCKEpW7%2BATR1TCdDgIAAA%3D%3D) to gather data about rollout times:
7575

7676
* Pre-Approval run time: `<TO BE FILLED>`
7777
* Post-Approval run time: `<TO BE FILLED>`

.vault-config/product-construction-dev.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@ secrets:
2525
location: engkeyvault
2626
name: BotAccount-dotnet-bot
2727
gitHubBotAccountName: dotnet-bot
28+
29+
github:
30+
type: github-app-secret
31+
parameters:
32+
hasPrivateKey: true
33+
hasWebhookSecret: false
34+
hasOAuthSecret: true

azure-pipelines-product-construction-service.yml

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Changes the format of the Build.BuildNumber variable
2-
name: $(Date:yyyyMMdd)$(Rev:r)
3-
41
trigger:
52
batch: true
63
branches:
@@ -21,6 +18,14 @@ variables:
2118
value: product-construction-service.api
2219
- name: diffFolder
2320
value: $(Build.ArtifactStagingDirectory)/diff
21+
- name: _TeamName
22+
value: DotNetCore
23+
- name: _PublishUsingPipelines
24+
value: true
25+
- name: _DotNetArtifactsCategory
26+
value: .NETCore
27+
- name: _SignType
28+
value: test
2429
- ${{ if ne(variables['Build.SourceBranch'], 'refs/heads/production') }}:
2530
- name: subscriptionId
2631
value: e6b5f9f5-0ca4-4351-879b-014d78400ec2
@@ -133,3 +138,74 @@ stages:
133138
- publish: $(diffFolder)
134139
displayName: Upload snapshot diff
135140
artifact: DeploymentDiff
141+
142+
- stage: BuildRepo
143+
displayName: Build and Publish Repo
144+
dependsOn: []
145+
jobs:
146+
- job: BuildAndPublish
147+
displayName: Build and Publish Repo
148+
pool:
149+
name: NetCore1ESPool-Internal
150+
demands: ImageOverride -equals 1es-windows-2019
151+
152+
variables:
153+
- name: BuildConfig
154+
value: Release
155+
156+
steps:
157+
- checkout: self
158+
159+
- powershell: |
160+
. .\eng\common\tools.ps1
161+
InitializeDotNetCli -install:$true
162+
.\.dotnet\dotnet workload update --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json
163+
.\.dotnet\dotnet workload install aspire --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json
164+
displayName: Install .NET and Aspire Workload
165+
166+
- powershell: >
167+
.\eng\common\build.ps1
168+
-restore
169+
-pack
170+
-configuration $(BuildConfig)
171+
-projects .\src\Microsoft.DotNet.Darc\Darc\Microsoft.DotNet.Darc.csproj
172+
displayName: Build Darc
173+
174+
- powershell: >
175+
.\eng\common\build.ps1
176+
-restore
177+
-build
178+
-configuration $(BuildConfig)
179+
-projects .\test\ProductConstructionService.ScenarioTests\ProductConstructionService.ScenarioTests.csproj
180+
displayName: Build ScenarioTests
181+
182+
- publish: $(Build.SourcesDirectory)\artifacts\bin\ProductConstructionService.ScenarioTests\$(BuildConfig)\net8.0\publish
183+
artifact: ProductConstructionService.ScenarioTests
184+
185+
- publish: $(Build.SourcesDirectory)\artifacts\packages\$(BuildConfig)\NonShipping
186+
artifact: PackageArtifacts
187+
188+
- stage: TestPCS
189+
displayName: Run E2E Product Construction Service Tests
190+
dependsOn:
191+
- DeployPCS
192+
- BuildRepo
193+
194+
jobs:
195+
- template: /eng/templates/jobs/e2e-pcs-tests.yml
196+
parameters:
197+
name: scenarioTests_GitHub
198+
displayName: GitHub tests
199+
testFilter: 'TestCategory=GitHub'
200+
201+
- template: /eng/templates/jobs/e2e-pcs-tests.yml
202+
parameters:
203+
name: scenarioTests_AzDO
204+
displayName: AzDO tests
205+
testFilter: 'TestCategory=AzDO'
206+
207+
- template: /eng/templates/jobs/e2e-pcs-tests.yml
208+
parameters:
209+
name: scenarioTests_Other
210+
displayName: Other tests
211+
testFilter: 'TestCategory!=GitHub&TestCategory!=AzDO'

docs/DevGuide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
('https://github.com/maestro-auth-test/maestro-test', 289474),
1818
('https://github.com/maestro-auth-test/maestro-test2', 289474),
1919
('https://github.com/maestro-auth-test/maestro-test3', 289474),
20+
('https://github.com/maestro-auth-test/arcade', 289474),
2021
('https://github.com/maestro-auth-test/dnceng-vmr', 289474);
2122
```
2223

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
param location string
2+
param containerRegistryName string
3+
param containerImageName string
4+
param containerCpuCoreCount string
5+
param containerMemory string
6+
param aspnetcoreEnvironment string
7+
param productConstructionServiceName string
8+
param applicationInsightsConnectionString string
9+
param pcsIdentityId string
10+
param containerEnvironmentId string
11+
param contributorRoleId string
12+
param deploymentIdentityPrincipalId string
13+
14+
// common environment variables used by the app
15+
var containerAppEnv = [
16+
{
17+
name: 'ASPNETCORE_ENVIRONMENT'
18+
value: aspnetcoreEnvironment
19+
}
20+
{
21+
name: 'Logging__Console__FormatterName'
22+
value: 'simple'
23+
}
24+
{
25+
name: 'Logging__Console__FormatterOptions__SingleLine'
26+
value: 'true'
27+
}
28+
{
29+
name: 'Logging__Console__FormatterOptions__IncludeScopes'
30+
value: 'true'
31+
}
32+
{
33+
name: 'ASPNETCORE_LOGGING__CONSOLE__DISABLECOLORS'
34+
value: 'true'
35+
}
36+
{
37+
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
38+
value: applicationInsightsConnectionString
39+
}
40+
{
41+
name: 'VmrPath'
42+
value: '/mnt/datadir/vmr'
43+
}
44+
{
45+
name: 'TmpPath'
46+
value: '/mnt/datadir/tmp'
47+
}
48+
]
49+
50+
// container app hosting the Product Construction Service
51+
resource containerApp 'Microsoft.App/containerApps@2023-04-01-preview' = {
52+
name: productConstructionServiceName
53+
location: location
54+
identity: {
55+
type: 'UserAssigned'
56+
userAssignedIdentities: { '${pcsIdentityId}' : {}}
57+
}
58+
properties: {
59+
managedEnvironmentId: containerEnvironmentId
60+
configuration: {
61+
activeRevisionsMode: 'Multiple'
62+
maxInactiveRevisions: 5
63+
ingress: {
64+
external: true
65+
targetPort: 8080
66+
transport: 'http'
67+
}
68+
dapr: { enabled: false }
69+
registries: [
70+
{
71+
server: '${containerRegistryName}.azurecr.io'
72+
identity: pcsIdentityId
73+
}
74+
]
75+
}
76+
template: {
77+
scale: {
78+
minReplicas: 1
79+
maxReplicas: 1
80+
}
81+
serviceBinds: []
82+
containers: [
83+
{
84+
image: containerImageName
85+
name: 'api'
86+
env: containerAppEnv
87+
resources: {
88+
cpu: json(containerCpuCoreCount)
89+
memory: containerMemory
90+
ephemeralStorage: '50Gi'
91+
}
92+
volumeMounts: [
93+
{
94+
volumeName: 'data'
95+
mountPath: '/mnt/datadir'
96+
}
97+
]
98+
probes: [
99+
{
100+
httpGet: {
101+
path: '/alive'
102+
port: 8080
103+
scheme: 'HTTP'
104+
}
105+
initialDelaySeconds: 5
106+
periodSeconds: 10
107+
successThreshold: 1
108+
failureThreshold: 3
109+
type: 'Startup'
110+
}
111+
{
112+
httpGet: {
113+
path: '/health'
114+
port: 8080
115+
scheme: 'HTTP'
116+
}
117+
initialDelaySeconds: 60
118+
failureThreshold: 10
119+
successThreshold: 1
120+
periodSeconds: 30
121+
type: 'Readiness'
122+
}
123+
]
124+
}
125+
]
126+
volumes: [
127+
{
128+
name: 'data'
129+
storageType: 'EmptyDir'
130+
}
131+
]
132+
}
133+
}
134+
}
135+
136+
// Give the PCS Deployment MI the Contributor role in the containerapp to allow it to deploy
137+
resource deploymentSubscriptionTriggererContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
138+
scope: containerApp
139+
name: guid(subscription().id, resourceGroup().id, '${productConstructionServiceName}-contributor')
140+
properties: {
141+
roleDefinitionId: contributorRoleId
142+
principalType: 'ServicePrincipal'
143+
principalId: deploymentIdentityPrincipalId
144+
}
145+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
param location string
2+
param logAnalyticsName string
3+
param containerEnvironmentName string
4+
param productConstructionServiceSubnetId string
5+
param infrastructureResourceGroupName string
6+
param applicationInsightsName string
7+
8+
resource logAnalytics 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = {
9+
name: logAnalyticsName
10+
location: location
11+
properties: any({
12+
retentionInDays: 30
13+
features: {
14+
searchVersion: 1
15+
}
16+
sku: {
17+
name: 'PerGB2018'
18+
}
19+
})
20+
}
21+
22+
resource containerEnvironment 'Microsoft.App/managedEnvironments@2023-04-01-preview' = {
23+
name: containerEnvironmentName
24+
location: location
25+
properties: {
26+
appLogsConfiguration: {
27+
destination: 'log-analytics'
28+
logAnalyticsConfiguration: {
29+
customerId: logAnalytics.properties.customerId
30+
sharedKey: logAnalytics.listKeys().primarySharedKey
31+
}
32+
}
33+
workloadProfiles: [
34+
{
35+
name: 'Consumption'
36+
workloadProfileType: 'Consumption'
37+
}
38+
]
39+
vnetConfiguration: {
40+
infrastructureSubnetId: productConstructionServiceSubnetId
41+
}
42+
infrastructureResourceGroup: infrastructureResourceGroupName
43+
}
44+
}
45+
46+
// application insights for service logging
47+
resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
48+
name: applicationInsightsName
49+
location: location
50+
kind: 'web'
51+
properties: {
52+
Application_Type: 'web'
53+
publicNetworkAccessForIngestion: 'Enabled'
54+
publicNetworkAccessForQuery: 'Enabled'
55+
RetentionInDays: 120
56+
WorkspaceResourceId: logAnalytics.id
57+
}
58+
}
59+
60+
output applicationInsightsConnectionString string = applicationInsights.properties.ConnectionString
61+
output containerEnvironmentId string = containerEnvironment.id

0 commit comments

Comments
 (0)