Skip to content

Commit be7dbaa

Browse files
authored
Updated ACSA Scenario for fixes (#2754)
* initial test deployment * path update * yaml rename * swapping out github links for main azure-arc repo * Update acsa-deploy.yaml * Update container name to use mcr
1 parent 282fb0f commit be7dbaa

File tree

15 files changed

+71
-795
lines changed

15 files changed

+71
-795
lines changed

azure_edge_iot_ops_jumpstart/esa_fault_detection/artifacts/LogonScript.ps1 renamed to azure_edge_iot_ops_jumpstart/acsa_fault_detection/artifacts/LogonScript.ps1

Lines changed: 27 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ function Add-AzureStorageAccountSecret {
332332
kubectl create secret generic -n $Namespace $SecretName --from-literal=azurestorageaccountkey="$secretValue" --from-literal=azurestorageaccountname="$StorageAccount"
333333
}
334334

335-
#Begin ESA Installation.
335+
#Begin ACSA Installation.
336336
#Documentation: https://aepreviews.ms/docs/edge-storage-accelerator/how-to-install-edge-storage-accelerator/
337337
# Create a storage account
338338
# Echo the container and account name
@@ -374,54 +374,34 @@ if ($maxUserInstances -lt 1024) {
374374
Write-Host "Installing Open Service Mesh (OSM)..."
375375
az k8s-extension create --resource-group "$env:resourceGroup" --cluster-name "$env:arcClusterName" --cluster-type connectedClusters --extension-type Microsoft.openservicemesh --scope cluster --name osm
376376
Write-Host "Open Service Mesh (OSM) installed successfully."
377-
# Disable ACStor for single-node cluster
378-
Write-Host "Disabling ACStor for single-node cluster..."
379-
# Create the config.json file
380-
$acstorConfig = @{
381-
"feature.diskStorageClass" = "local-path"
382-
"acstorController.enabled" = $false
383-
}
384377

385-
$acstorConfigJson = $acstorConfig | ConvertTo-Json -Depth 100
386-
Set-Content -Path "config.json" -Value $acstorConfigJson
387-
Write-Host "ACStor disabled for single-node cluster."
388-
Write-Host "Checking if Edge Storage Accelerator Arc Extension is installed..."
389-
$extensionExists = az k8s-extension show --resource-group "$env:resourceGroup" --cluster-name "$env:arcClusterName" --cluster-type connectedClusters --name hydraext --query "extensionType" --output tsv
390-
if ($extensionExists -eq "microsoft.edgestorageaccelerator") {
391-
Write-Host "Edge Storage Accelerator Arc Extension is already installed."
392-
} else {
393-
Write-Host "Installing Edge Storage Accelerator Arc Extension..."
394-
az k8s-extension create --resource-group "$env:resourceGroup" --cluster-name "$env:arcClusterName" --cluster-type connectedClusters --name hydraext --extension-type microsoft.edgestorageaccelerator --config-file "config.json"
395-
Write-Host "Edge Storage Accelerator Arc Extension installed successfully."
396-
}
397378

398-
# Create Kubernetes secret for Azure Storage account
399-
Write-Host "Creating Kubernetes secret for Azure Storage account..."
400-
$secretName = "$env:storageAccountName-secret"
401-
Add-AzureStorageAccountSecret -ResourceGroup $env:resourceGroup -StorageAccount $env:storageAccountName -Namespace "default" -SecretName "esa-secret"
402-
Write-Host "Kubernetes secret created successfully."
403-
Write-Host "Downloading pv.yaml file..."
404-
$pvYamlUrl = "https://raw.githubusercontent.com/microsoft/azure_arc/main/azure_edge_iot_ops_jumpstart/esa_fault_detection/yaml/pv.yaml"
405-
406-
$pvYamlPath = "pv.yaml"
407-
Invoke-WebRequest -Uri $pvYamlUrl -OutFile $pvYamlPath
408-
# Update the secret name and container name in the pv.yaml file
409-
#$pvYamlContent = Get-Content -Path $pvYamlPath -Raw
410-
#$pvYamlContent = $pvYamlContent -replace '\${CONTAINER_NAME}-secret', $secretName
411-
#$pvYamlContent = $pvYamlContent -replace '\${CONTAINER_NAME}', $env:storageContainer
412-
#Set-Content -Path $pvYamlPath -Value $pvYamlContent
413-
# Apply the pv.yaml file using kubectl
414-
Write-Host "Applying pv.yaml configuration..."
415-
kubectl apply -f $pvYamlPath
416-
Write-Host "pv.yaml configuration applied successfully."
417-
Write-Host "Downloading esa-deploy.yaml file..."
418-
$esadeployYamlUrl = "https://raw.githubusercontent.com/microsoft/azure_arc/main/azure_edge_iot_ops_jumpstart/esa_fault_detection/yaml/esa-deploy.yaml"
419-
$esadeployYamlPath = "esa-deploy.yaml"
420-
Invoke-WebRequest -Uri $esadeployYamlUrl -OutFile $esadeployYamlPath
421-
# Apply the p-deploy.yaml file using kubectl
422-
Write-Host "Applying esadeploy.yaml configuration..."
423-
kubectl apply -f $esadeployYamlPath
424-
Write-Host "esa-deploy.yaml configuration applied successfully."
379+
$uniqueSuffix = (New-Guid).Guid.Substring(0,6)
380+
$extensionName = "acsa-$uniqueSuffix"
381+
Write-Output "Extension Name: $extensionName"
382+
383+
az k8s-extension create --resource-group $env:resourceGroup --cluster-name $env:arcClusterName --cluster-type connectedClusters --name $extensionName --extension-type microsoft.arc.containerstorage --config feature.diskStorageClass="default,local-path" --config edgeStorageConfiguration.create=true
384+
385+
386+
$principalID = az k8s-extension list --cluster-name $env:arcClusterName --resource-group $env:resourceGroup --cluster-type connectedClusters --query "[?extensionType=='microsoft.arc.containerstorage'].identity.principalId | [0]" -o tsv
387+
388+
az role assignment create --assignee-object-id $principalID --assignee-principal-type ServicePrincipal --role "Storage Blob Data Owner" --scope "/subscriptions/$Env:subscriptionId/resourceGroups/$env:resourceGroup/providers/Microsoft.Storage/storageAccounts/$env:storageAccountName"
389+
390+
391+
$acsadeployYamlUrl = "https://raw.githubusercontent.com/microsoft/azure_arc/main/azure_edge_iot_ops_jumpstart/acsa_fault_detection/yaml/acsa-deploy.yaml"
392+
$acsadeployYamlPath = "acsa-deploy.yaml"
393+
Invoke-WebRequest -Uri $acsadeployYamlUrl -OutFile $acsadeployYamlPath
394+
395+
# Replace {STORAGEACCOUNT} with the actual storage account name
396+
$yamlContent = Get-Content $acsadeployYamlPath -Raw
397+
$yamlContent = $yamlContent.Replace("{STORAGEACCOUNT}", $env:storageAccountName)
398+
Set-Content -Path $acsadeployYamlPath -Value $yamlContent
399+
400+
401+
# Apply the acsa-deploy.yaml file using kubectl
402+
Write-Host "Applying acsa-deploy.yaml configuration..."
403+
kubectl apply -f $acsadeployYamlPath
404+
Write-Host "acsa-deploy.yaml configuration applied successfully."
425405

426406
# Stop the PowerShell process monitoring Kubernetes pods
427407

azure_edge_iot_ops_jumpstart/esa_fault_detection/azuredeploy.json renamed to azure_edge_iot_ops_jumpstart/acsa_fault_detection/azuredeploy.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"parameters": {
55
"vmName": {
66
"type": "string",
7-
"defaultValue": "ESA-Demo",
7+
"defaultValue": "ACSA-Demo",
88
"metadata": {
99
"description": "The name of you Virtual Machine."
1010
}
@@ -56,7 +56,7 @@
5656
},
5757
"bastionHostName": {
5858
"type": "string",
59-
"defaultValue": "ESA-Demo-Bastion",
59+
"defaultValue": "ACSA-Demo-Bastion",
6060
"metadata": {
6161
"description": "the Azure Bastion host name"
6262
}
@@ -120,7 +120,7 @@
120120
},
121121
"virtualNetworkName": {
122122
"type": "string",
123-
"defaultValue": "ESA-Demo-VNET",
123+
"defaultValue": "ACSA-Demo-VNET",
124124
"metadata": {
125125
"description": "Name of the VNET"
126126
}
@@ -134,7 +134,7 @@
134134
},
135135
"networkSecurityGroupName": {
136136
"type": "string",
137-
"defaultValue": "ESA-Demo-NSG",
137+
"defaultValue": "ACSA-Demo-NSG",
138138
"metadata": {
139139
"description": "Name of the Network Security Group"
140140
}
@@ -154,7 +154,7 @@
154154
}
155155
},
156156
"variables": {
157-
"templateBaseUrl": "[concat('https://raw.githubusercontent.com/', parameters('githubAccount'), '/azure_arc/', parameters('githubBranch'), '/azure_edge_iot_ops_jumpstart/esa_fault_detection/')]",
157+
"templateBaseUrl": "[concat('https://raw.githubusercontent.com/', parameters('githubAccount'), '/azure_arc/', parameters('githubBranch'), '/azure_edge_iot_ops_jumpstart/acsa_fault_detection/')]",
158158
"vmName": "[concat(parameters('vmName'))]",
159159
"publicIpAddressName": "[concat(parameters('vmName'), '-PIP' )]",
160160
"networkInterfaceName": "[concat(parameters('vmName'),'-NIC')]",

azure_edge_iot_ops_jumpstart/esa_fault_detection/yaml/esa-deploy.yaml renamed to azure_edge_iot_ops_jumpstart/acsa_fault_detection/yaml/acsa-deploy.yaml

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,66 @@
1-
apiVersion: v1
2-
kind: PersistentVolumeClaim
1+
kind: PersistentVolumeClaim
2+
apiVersion: v1
33
metadata:
4-
name: esa-pvc
5-
namespace: default
6-
spec:
7-
accessModes:
8-
- ReadWriteMany
9-
resources:
10-
requests:
11-
storage: 5Gi
12-
storageClassName: esa
13-
volumeMode: Filesystem
14-
volumeName: esa-pv
15-
status:
16-
accessModes:
17-
- ReadWriteMany
18-
capacity:
19-
storage: 5Gi
4+
### Create a name for your PVC ###
5+
name: acsa-pvc
6+
### Use a namespace that matched your intended consuming pod, or "default" ###
7+
namespace: default
8+
spec:
9+
accessModes:
10+
- ReadWriteMany
11+
resources:
12+
requests:
13+
storage: 10Gi
14+
storageClassName: cloud-backed-sc
15+
---
16+
apiVersion: "arccontainerstorage.azure.net/v1"
17+
kind: EdgeSubvolume
18+
metadata:
19+
name: faultdata
20+
spec:
21+
edgevolume: acsa-pvc
22+
path: faultdata # If you change this path, line 33 in deploymentExample.yaml must be updated. Don't use a preceding slash.
23+
auth:
24+
authType: MANAGED_IDENTITY
25+
storageaccountendpoint: "https://{STORAGEACCOUNT}.blob.core.windows.net/"
26+
container: fault-detection
27+
ingestPolicy: edgeingestpolicy-default # Optional: See the following instructions if you want to update the ingestPolicy with your own configuration
2028
---
2129
apiVersion: apps/v1
2230
kind: Deployment
2331
metadata:
24-
name: esa-webserver
32+
name: acsa-webserver
2533
spec:
2634
replicas: 1
2735
selector:
2836
matchLabels:
29-
app: esa-webserver
37+
app: acsa-webserver
3038
template:
3139
metadata:
3240
labels:
33-
app: esa-webserver
41+
app: acsa-webserver
3442
spec:
3543
containers:
36-
- name: esa-webserver
37-
image: jumpstartprod.azurecr.io/esa-webserver:latest
44+
- name: acsa-webserver
45+
image: mcr.microsoft.com/jumpstart/scenarios/acsa_ai_webserver:1.0.0
3846
ports:
3947
- containerPort: 8000
4048
env:
4149
- name: RTSP_URL
4250
value: rtsp://virtual-rtsp:8554/stream
4351
- name: LOCAL_STORAGE
44-
value: /app/esa_storage
52+
value: /app/acsa_storage/faultdata
4553
volumeMounts:
4654
### This name must match the volumes.name attribute below ###
4755
- name: blob
4856
### This mountPath is where the PVC will be attached to the pod's filesystem ###
49-
mountPath: "/app/esa_storage"
57+
mountPath: "/app/acsa_storage"
5058
volumes:
5159
### User-defined 'name' that will be used to link the volumeMounts. This name must match volumeMounts.name as specified above. ###
5260
- name: blob
5361
persistentVolumeClaim:
5462
### This claimName must refer to the PVC resource 'name' as defined in the PVC config. This name will match what your PVC resource was actually named. ###
55-
claimName: esa-pvc
63+
claimName: acsa-pvc
5664

5765

5866
---
@@ -89,7 +97,8 @@ spec:
8997
mountPath: /samples
9098
containers:
9199
- name: virtual-rtsp
92-
image: "agoraarmbladev.azurecr.io/kerberos/virtual-rtsp:latest"
100+
### chnage to dockerhub image link
101+
image: "kerberos/virtual-rtsp"
93102
imagePullPolicy: Always
94103
ports:
95104
- containerPort: 8554
@@ -122,14 +131,14 @@ spec:
122131
apiVersion: v1
123132
kind: Service
124133
metadata:
125-
name: esa-webserver-svc
134+
name: acsa-webserver-svc
126135
labels:
127-
app: esa-webserver
136+
app: acsa-webserver
128137
spec:
129138
type: LoadBalancer
130139
ports:
131140
- port: 8000
132141
targetPort: 8000
133142
protocol: TCP
134143
selector:
135-
app: esa-webserver
144+
app: acsa-webserver

azure_edge_iot_ops_jumpstart/esa_fault_detection/artifacts/esa_ai/Dockerfile

Lines changed: 0 additions & 27 deletions
This file was deleted.

azure_edge_iot_ops_jumpstart/esa_fault_detection/artifacts/esa_ai/index.html

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)