@@ -73,4 +73,79 @@ Note that regular signing checks (such as `signtool.exe verify /pa python.exe`)
7373and malware scans will treat the files as correctly signed.
7474It's only more complicated to verify that it was signed _ specifically_ with our cert.
7575
76+ ## Auto-start ARM64 VM
77+
78+ Until Azure Pipelines offers ARM64 machines as standard, we use a custom VM to run PGO profiling.
79+ This VM is hosted on Steve's subscription and is automatically launched by the start-arm64vm.yml stage.
80+
81+ To replicate the configuration for a new subscription or VM, here are the steps:
82+
83+ * Visit https://dev.azure.com/Python/cpython/_settings/adminservices to update/create an
84+ Azure Resource Manager connection using Workload Identity Federation (a.k.a. OIDC).
85+ * Create two custom roles in your Azure Subscription. The full JSON for each role is below,
86+ and can be uploaded to the Azure Portal as a starting point for the role.
87+ * Assign the "VM Restarter" role to the service principal/account used for WIF * on the resource group*
88+ * Assign the "VM Updater" role to the service principal * on the VM* . This allows the VM to be updated,
89+ but does not allow the workflow permission to create new VMs.
90+ * Visit https://dev.azure.com/Python/cpython/_settings/agentqueues?queueId=24&view=agents and click
91+ "New agent" to get the download URL for the Azure Pipelines agent. Extract onto the VM an run ` config.cmd ` .
92+ Give ` https://dev.azure.com/Python ` as the server URL.
93+ * Visit https://dev.azure.com/Python/_usersSettings/tokens to create a PAT with "Agent Pools (Read & manage)"
94+ scope and paste it into the VM's config script when prompted.
95+ * Give "Windows ARM64" as the pool name; any (unique) agent name is okay.
96+ * Ensure Git is installed on the VM and you're ready to run.
97+
98+ The VM Restarter role (manually set the assignable scopes to your subscription after uploading to the portal):
99+
100+ ``` json
101+ {
102+ "properties" : {
103+ "roleName" : " VM Restarter" ,
104+ "description" : " Allows starting, stopping, and scheduling of VMs." ,
105+ "assignableScopes" : [],
106+ "permissions" : [
107+ {
108+ "actions" : [
109+ " Microsoft.Compute/virtualMachines/read" ,
110+ " Microsoft.Compute/virtualMachines/start/action" ,
111+ " Microsoft.Compute/virtualMachines/powerOff/action" ,
112+ " Microsoft.Compute/virtualMachines/restart/action" ,
113+ " Microsoft.Compute/virtualMachines/deallocate/action" ,
114+ " Microsoft.DevTestLab/schedules/delete" ,
115+ " Microsoft.DevTestLab/schedules/read" ,
116+ " Microsoft.DevTestLab/schedules/write" ,
117+ " Microsoft.DevTestLab/schedules/Execute/action" ,
118+ " Microsoft.DevTestLab/schedules/Retarget/action"
119+ ],
120+ "notActions" : [],
121+ "dataActions" : [],
122+ "notDataActions" : []
123+ }
124+ ]
125+ }
126+ }
127+ ```
128+
129+ The VM Updater role:
130+
131+ ``` json
132+ {
133+ "properties" : {
134+ "roleName" : " VM Updater" ,
135+ "description" : " Allows creating or modifying VMs." ,
136+ "assignableScopes" : [],
137+ "permissions" : [
138+ {
139+ "actions" : [
140+ " Microsoft.Compute/virtualMachines/write"
141+ ],
142+ "notActions" : [],
143+ "dataActions" : [],
144+ "notDataActions" : []
145+ }
146+ ]
147+ }
148+ }
149+ ```
150+
76151(Further documentation to be added as we find out what ought to be documented.)
0 commit comments