Skip to content

Commit

Permalink
Merge pull request #2668 from microsoft/arcbox_3.0
Browse files Browse the repository at this point in the history
ArcBox 3.0 Canary > Main
  • Loading branch information
likamrat authored Aug 14, 2024
2 parents 6cd6eaa + 81067d0 commit 83a0945
Show file tree
Hide file tree
Showing 104 changed files with 19,006 additions and 7,770 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ assignees: ''

**Have you looked at the Troubleshooting and Logs section?**
<!---Relevant logs retrieval instructions can be found in the Troubleshooting section.
- [Jumpstart ArcBox "Full" troubleshooting](https://azurearcjumpstart.com/azure_jumpstart_arcbox/Full#basic-troubleshooting)
- [Jumpstart ArcBox for IT Pros troubleshooting](https://azurearcjumpstart.com/azure_jumpstart_arcbox/ITPro#basic-troubleshooting)
- [Jumpstart ArcBox for DevOps troubleshooting](https://azurearcjumpstart.com/azure_jumpstart_arcbox/DevOps#basic-troubleshooting)
- [Jumpstart ArcBox for DataOps troubleshooting](https://azurearcjumpstart.com/azure_jumpstart_arcbox/DataOps#basic-troubleshooting)
Expand Down
147 changes: 147 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
trigger:
branches:
include:
- arcbox_3.0
paths:
include:
- azure_jumpstart_arcbox/*

parameters:
- name: ResourceGroupName
displayName: 'Resource Group Name'
type: string
default: 'arcbox-itpro-integration-tests'
- name: AzureSubscription
displayName: 'Azure Subscription'
type: string
default: 'Azure Arc Jumpstart Develop(98a19988-5c3d-4824-a685-f5cf12ae5c19)'
- name: githubAccount
displayName: 'githubAccount'
type: string
default: 'microsoft'
- name: githubBranch
displayName: 'githubBranch'
type: string
default: 'arcbox_3.0'
- name: flavor
displayName: 'flavor'
type: string
default: 'ITPro'

variables:
- group: 'integration-tests'
- name: ResourceGroupName
value: ${{parameters.ResourceGroupName}}
- name: githubAccount
value: ${{parameters.githubAccount}}
- name: githubBranch
value: ${{parameters.githubBranch}}
- name: flavor
value: ${{parameters.flavor}}

stages:
- stage: 'ArcBox_deployment'
jobs:
- job: Deploy
timeoutInMinutes: 235 # 5 minutes before the ACA self-hosted runner in order for the runner to gracefully shutdown
pool:
name: arc-jumpstart-container-apps-pool
#vmImage: 'ubuntu-latest'
continueOnError: 'true'
steps:

- task: BicepInstall@0
displayName: 'Install Bicep'
inputs:
version: 0.24.24

- task: AzurePowerShell@5
displayName: 'Deploy resource group'
inputs:
azureSubscription: ${{parameters.AzureSubscription}}
ScriptType: 'InlineScript'
azurePowerShellVersion: 'LatestVersion'
Inline: |
Write-Host "Running deployment from machine $(hostname) and public IP $(irm ifconfig.me/ip)"
$RGname = "$(ResourceGroupName)"
New-AzResourceGroup -Name $RGname -Location "eastus"
- task: AzurePowerShell@5
displayName: 'Deploy Bicep template'
inputs:
azureSubscription: ${{parameters.AzureSubscription}}
ScriptType: 'InlineScript'
azurePowerShellVersion: 'LatestVersion'
Inline: |
Write-Host "Deploying to $(ResourceGroupName)"
$githubAccount = "$(githubAccount)"
$githubBranch = "$(githubBranch)"
$flavor = "$(flavor)"
if ($githubAccount -ne "microsoft") {
Write-Host "Checking out $githubAccount/$githubBranch"
git remote add upstream https://github.com/$($githubAccount)/azure_arc.git
git fetch upstream
git checkout -b $githubBranch upstream/$githubBranch
}
New-AzResourceGroupDeployment -Name ArcBox `
-ResourceGroupName $(ResourceGroupName) `
-TemplateFile azure_jumpstart_arcbox/bicep/main.bicep `
-TemplateParameterObject @{ `
spnClientId = "$(spnClientId)" ; `
spnClientSecret = "$(spnClientSecret)" ; `
spnTenantId = "$(spnTenantId)" ; `
windowsAdminUsername = "arcdemo" ; `
windowsAdminPassword = "$(windowsAdminPassword)" ; `
sshRSAPublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCsdlSaF10Uw0fFysiIV0VYeJGE1CaV0ZjZcakcKgafiqZ04sAzf7KnoIjPVyx6LXoDTKGtv1e5eFjRZA7Z0Bu+a3JqY252/yr/B2R3Mu5qZHbKFncpVEXn7sUmYk4rDG5vToFxbhpKX5EGyvM1M0quoUv3Uv9reBsSDdjk7n7oA2Q+89rj4nfRuTEMQRwvNBaLeNRSlWuzPq4EkpwxSWRzIC2auC5K0rxGiTMPTXMOQ3l0DvzKRoEsygHA4c3uw0PTntSlgSSTgtGdQfuX63hAD4QPTVfeQdsW5+Nq3clr+6SHgeGdwHhKjUVTF+E2olfSYtuV4CqPW8dZdDBOZg7pXLMSVumZVKCZiUV6uBJkvLBRMzMiFsfXOVrgyThMqq+8y4tg/V3l/3S8z5Lngy4WoCAQMHQ1SloPmy9s4QnbjCFEQx/cIq9H+Uw6HAYhdQFh/w/tuIP+KIqOpMOrltZuaoqx3AOOL3BPXJMbv3opiZxCEZQFf68n+Zn6uRc9u1EENA9s1DrjG1j/CHWzbX/t63Ig/xQLgKLu9T+evua3dcWsYc3j1Gvk8R+ioXV7x0/fi6twrhSQxBIIL0D2Pxm8TBfJ3mVXk0kYGGq1mBsoxAzjoBhcbdwUMXHbAksj4/UuuAK5VfH278hlXo/BHSgDLZ98fdS63nq7rIr6qWmBrQ==" ; `
logAnalyticsWorkspaceName = "arcbox-la" ; `
flavor = $flavor ; `
deployBastion = $false ; `
githubAccount = $githubAccount ; `
githubBranch = $githubBranch ; `
vmAutologon = $true ; `
rdpPort = "3389" `
}
- task: AzurePowerShell@5
displayName: 'Upload Pester test-results from ArcBox VM'
inputs:
azureSubscription: ${{parameters.AzureSubscription}}
ScriptType: FilePath
azurePowerShellVersion: 'LatestVersion'
ScriptPath: 'azure_jumpstart_arcbox/artifacts/integration_tests/scripts/Wait-ArcBoxDeployment.ps1'
ScriptArguments: -ResourceGroupName $(ResourceGroupName) -githubAccount $(githubAccount) -githubBranch $(githubBranch)

- task: AzurePowerShell@5
displayName: 'Download Pester test-results from storage account to pipeline agent'
inputs:
azureSubscription: ${{parameters.AzureSubscription}}
ScriptType: FilePath
azurePowerShellVersion: 'LatestVersion'
ScriptPath: 'azure_jumpstart_arcbox/artifacts/integration_tests/scripts/Get-PesterResult.ps1'
ScriptArguments: -ResourceGroupName $(ResourceGroupName)

- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: NUnit
testResultsFiles: '$(System.DefaultWorkingDirectory)/testresults/*.xml'

- stage: destroy
displayName: 'ArcBox_teardown'
#condition: succeeded('deploy')
jobs:
- deployment:
displayName: "Get approval"
environment: 'teardown_approval'
- job: Delete
steps:
- task: AzurePowerShell@5
displayName: 'Delete resource group'
inputs:
azureSubscription: ${{parameters.AzureSubscription}}
ScriptType: 'InlineScript'
azurePowerShellVersion: 'LatestVersion'
Inline: |
Write-Host "Deleting resource group $(ResourceGroupName)"
Remove-AzResourceGroup -Name $(ResourceGroupName) -Force -WhatIf
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,10 @@
},
"variables": {
"templateBaseUrl": "[concat('https://raw.githubusercontent.com/', parameters('githubAccount'), '/azure_arc/', parameters('githubBranch'), '/azure_arc_app_services_jumpstart/cluster_api/capi_azure/ARM/')]",
"capiTemplateUrl": "[uri(variables('templateBaseUrl'), 'ubuntuCapi.json')]",
"clientVmTemplateUrl": "[uri(variables('templateBaseUrl'), 'clientVm.json')]",
"mgmtStagingStorageUrl": "[uri(variables('templateBaseUrl'), 'mgmtStagingStorage.json')]",
"logAnalyticsUrl": "[uri(variables('templateBaseUrl'), 'logAnalytics.json')]",
"VNETUrl": "[uri(variables('templateBaseUrl'), 'VNET.json')]",
"capiArcAppClusterName": "[concat('ArcBox-CAPI-Data','-',parameters('guid'))]",
// Virtual Network configuration
"virtualNetworkName": "Arc-App-CAPI-VNet",
"subnetName": "Arc-App-CAPI-Subnet",
Expand Down Expand Up @@ -167,68 +165,6 @@
}
}
},
{
"type": "Microsoft.Resources/deployments",
"comments": "Deploy the CAPI environment",
"apiVersion": "2021-04-01",
"name": "ubuntuCAPIDeployment",
"dependsOn": [ "stagingStorageAccountDeployment", "VNETDeployment" ],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('capiTemplateUrl')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"sshRSAPublicKey": {
"value": "[parameters('sshRSAPublicKey')]"
},
"spnClientId": {
"value": "[parameters('spnClientId')]"
},
"spnClientSecret": {
"value": "[parameters('spnClientSecret')]"
},
"spnTenantId": {
"value": "[parameters('spnTenantId')]"
},
"stagingStorageAccountName": {
"value": "[reference('stagingStorageAccountDeployment').outputs.storageAccountName.value]"
},
"logAnalyticsWorkspaceName": {
"value": "[parameters('logAnalyticsWorkspaceName')]"
},
"templateBaseUrl": {
"value": "[variables('templateBaseUrl')]"
},
"virtualNetworkName": {
"value": "[variables('virtualNetworkName')]"
},
"subnetName": {
"value": "[variables('subnetName')]"
},
"subnetAddressPrefix": {
"value": "[variables('subnetAddressPrefix')]"
},
"deployBastion": {
"value": "[parameters('deployBastion')]"
},
"bastionHostName": {
"value": "[parameters('bastionHostName')]"
},
"bastionSubnetRef": {
"value": "[variables('bastionSubnetRef')]"
},
"bastionSubnetPrefix": {
"value": "[variables('bastionSubnetPrefix')]"
},
"capiArcAppClusterName" : {
"value": "[variables('capiArcAppClusterName')]"
}

}
}
},
{
"type": "Microsoft.Resources/deployments",
"comments": "Deploys the Client Windows VM",
Expand Down Expand Up @@ -298,9 +234,6 @@
},
"bastionSubnetPrefix": {
"value": "[variables('bastionSubnetPrefix')]"
},
"capiArcAppClusterName" : {
"value": "[variables('capiArcAppClusterName')]"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ function registerArcForServers() {
elseif (Get-InstalledModule -Name Az.Accounts -MinimumVersion 2.2) {
# New versions of Az.Account support getting access tokens
#
$token = Get-AzAccessToken
$token = (Get-AzAccessToken -AsSecureString).token
$params += "--access-token"
$params += $token.Token
$params += ConvertFrom-SecureString $token -AsPlainText
}

& "$env:ProgramFiles\AzureConnectedMachineAgent\azcmagent.exe" $params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ function registerArcForServers() {
elseif (Get-InstalledModule -Name Az.Accounts -MinimumVersion 2.2) {
# New versions of Az.Account support getting access tokens
#
$token = Get-AzAccessToken
$token = (Get-AzAccessToken -AsSecureString).token
$params += "--access-token"
$params += $token.Token
$params += ConvertFrom-SecureString $token -AsPlainText
}

& "$env:ProgramFiles\AzureConnectedMachineAgent\azcmagent.exe" $params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ function registerArcForServers() {
elseif (Get-InstalledModule -Name Az.Accounts -MinimumVersion 2.2) {
# New versions of Az.Account support getting access tokens
#
$token = Get-AzAccessToken
$token = (Get-AzAccessToken -AsSecureString).token
$params += "--access-token"
$params += $token.Token
$params += ConvertFrom-SecureString $token -AsPlainText
}

& "$env:ProgramFiles\AzureConnectedMachineAgent\azcmagent.exe" $params
Expand Down
Loading

0 comments on commit 83a0945

Please sign in to comment.