Skip to content

Commit 84cd0fb

Browse files
dennisamelingdscho
authored andcommitted
self-hosted-runners: make Azure region configurable
This makes it easier to configure the Azure VM region. Let's default to "westus2" while we're at it, as it's one of the cheaper options available at the time of writing. Signed-off-by: Dennis Ameling <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent da94fce commit 84cd0fb

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/create-azure-self-hosted-runners.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ env:
4040
# Note that you'll need "p" (arm64 processor) and ideally "d" (local temp disk). The number 8 stands for 8 CPU-cores.
4141
# For a convenient overview of all arm64 VM types, see e.g. https://azureprice.net/?_cpuArchitecture=Arm64
4242
AZURE_VM_TYPE: Standard_D8plds_v5
43+
# At the time of writing, "eastus", "eastus2" and "westus2" were among the cheapest region for the VM type we're using.
44+
# For more information, see https://learn.microsoft.com/en-us/azure/virtual-machines/dplsv5-dpldsv5-series (which
45+
# unfortunately does not have more information about price by region)
46+
AZURE_VM_REGION: westus2
4347

4448
# The following secrets are required for this workflow to run:
4549
# AZURE_CREDENTIALS - Credentials for the Azure CLI. It's recommended to set up a resource
@@ -153,7 +157,7 @@ jobs:
153157
with:
154158
resourceGroupName: ${{ secrets.AZURE_RESOURCE_GROUP }}
155159
template: ./azure-self-hosted-runners/azure-arm-template.json
156-
parameters: ./azure-self-hosted-runners/azure-arm-template-example-parameters.json githubActionsRunnerRegistrationUrl="${{ env.ACTIONS_RUNNER_REGISTRATION_URL }}" githubActionsRunnerToken="${{ env.ACTIONS_RUNNER_TOKEN }}" postDeploymentPsScriptUrl="${{ env.POST_DEPLOYMENT_SCRIPT_URL }}" virtualMachineName=${{ steps.generate-vm-name.outputs.vm_name }} virtualMachineSize="${{ env.AZURE_VM_TYPE }}" publicIpAddressName1=${{ steps.generate-vm-name.outputs.vm_name }}-ip adminUsername=${{ secrets.AZURE_VM_USERNAME }} adminPassword=${{ secrets.AZURE_VM_PASSWORD }} stopService=${{ env.DEALLOCATE_IMMEDIATELY }} githubActionsRunnerPath="${{ env.ACTIONS_RUNNER_PATH }}"
160+
parameters: ./azure-self-hosted-runners/azure-arm-template-example-parameters.json githubActionsRunnerRegistrationUrl="${{ env.ACTIONS_RUNNER_REGISTRATION_URL }}" githubActionsRunnerToken="${{ env.ACTIONS_RUNNER_TOKEN }}" postDeploymentPsScriptUrl="${{ env.POST_DEPLOYMENT_SCRIPT_URL }}" virtualMachineName=${{ steps.generate-vm-name.outputs.vm_name }} virtualMachineSize="${{ env.AZURE_VM_TYPE }}" publicIpAddressName1=${{ steps.generate-vm-name.outputs.vm_name }}-ip adminUsername=${{ secrets.AZURE_VM_USERNAME }} adminPassword=${{ secrets.AZURE_VM_PASSWORD }} stopService=${{ env.DEALLOCATE_IMMEDIATELY }} githubActionsRunnerPath="${{ env.ACTIONS_RUNNER_PATH }}" location="${{ env.AZURE_VM_REGION }}"
157161

158162
- name: Deallocate the VM for later use
159163
if: env.DEALLOCATE_IMMEDIATELY == 'true'

azure-self-hosted-runners/azure-arm-template-example-parameters.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
33
"contentVersion": "1.0.0.0",
44
"parameters": {
5-
"location": {
6-
"value": "westeurope"
7-
},
85
"enableAcceleratedNetworking": {
96
"value": true
107
},

0 commit comments

Comments
 (0)