update deployment scripts for consumption plan (#204)
* update deployment script to include consumption plan, and add a consumption series * fix run-scalemonitor.ps1
This commit is contained in:
Родитель
b910e0e343
Коммит
2f03f54759
|
@ -36,11 +36,21 @@ if (-not ((az functionapp list -g $groupName --query "[].name"| ConvertFrom-Json
|
||||||
{
|
{
|
||||||
# look up connection strings
|
# look up connection strings
|
||||||
$eventHubsConnectionString = (az eventhubs namespace authorization-rule keys list --resource-group $groupName --namespace-name $namespaceName --name RootManageSharedAccessKey | ConvertFrom-Json).primaryConnectionString
|
$eventHubsConnectionString = (az eventhubs namespace authorization-rule keys list --resource-group $groupName --namespace-name $namespaceName --name RootManageSharedAccessKey | ConvertFrom-Json).primaryConnectionString
|
||||||
|
$corpusConnectionString = (az storage account show-connection-string --name gutenbergcorpus | ConvertFrom-Json).connectionString
|
||||||
|
|
||||||
Write-Host "Creating $Plan Function App..."
|
Write-Host "Creating $Plan Function App..."
|
||||||
az functionapp plan create --resource-group $groupName --name $functionAppName --location $location --sku $Plan
|
|
||||||
az functionapp create --name $functionAppName --storage-account $storageName --plan $functionAppName --resource-group $groupName --functions-version 4
|
if ($Plan -eq "Consumption")
|
||||||
az functionapp config set -n $functionAppName -g $groupName --use-32bit-worker-process false
|
{
|
||||||
|
az functionapp create --name $functionAppName --storage-account $storageName --consumption-plan-location $location --resource-group $groupName --functions-version 4
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
az functionapp plan create --resource-group $groupName --name $functionAppName --location $location --sku $Plan
|
||||||
|
az functionapp create --name $functionAppName --storage-account $storageName --plan $functionAppName --resource-group $groupName --functions-version 4
|
||||||
|
}
|
||||||
|
|
||||||
|
az functionapp config set -n $functionAppName -g $groupName --use-32bit-worker-process false
|
||||||
az functionapp config appsettings set -n $functionAppName -g $groupName --settings EventHubsConnection=$eventHubsConnectionString
|
az functionapp config appsettings set -n $functionAppName -g $groupName --settings EventHubsConnection=$eventHubsConnectionString
|
||||||
az functionapp config appsettings set -n $functionAppName -g $groupName --settings CorpusConnection=$corpusConnectionString
|
az functionapp config appsettings set -n $functionAppName -g $groupName --settings CorpusConnection=$corpusConnectionString
|
||||||
}
|
}
|
||||||
|
@ -49,16 +59,20 @@ else
|
||||||
Write-Host "Function app already exists."
|
Write-Host "Function app already exists."
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Configuring Function App Scale=$MinNodes-$MaxNodes"
|
|
||||||
az functionapp plan update -g $groupName -n $functionAppName --max-burst $MaxNodes --number-of-workers $MinNodes --min-instances $MinNodes
|
if (-not ($Plan -eq "Consumption"))
|
||||||
az resource update -n $functionAppName/config/web -g $groupName --set properties.minimumElasticInstanceCount=$MinNodes --resource-type Microsoft.Web/sites
|
|
||||||
if ($MinNode -eq $MaxNodes)
|
|
||||||
{
|
{
|
||||||
az resource update -n $functionAppName/config/web -g $groupName --set properties.functionsRuntimeScaleMonitoringEnabled=0 --resource-type Microsoft.Web/sites
|
Write-Host "Configuring Function App Scale=$MinNodes-$MaxNodes"
|
||||||
}
|
az functionapp plan update -g $groupName -n $functionAppName --max-burst $MaxNodes --number-of-workers $MinNodes --min-instances $MinNodes
|
||||||
else
|
az resource update -n $functionAppName/config/web -g $groupName --set properties.minimumElasticInstanceCount=$MinNodes --resource-type Microsoft.Web/sites
|
||||||
{
|
if ($MinNode -eq $MaxNodes)
|
||||||
az resource update -n $functionAppName/config/web -g $groupName --set properties.functionsRuntimeScaleMonitoringEnabled=1 --resource-type Microsoft.Web/sites
|
{
|
||||||
|
az resource update -n $functionAppName/config/web -g $groupName --set properties.functionsRuntimeScaleMonitoringEnabled=0 --resource-type Microsoft.Web/sites
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
az resource update -n $functionAppName/config/web -g $groupName --set properties.functionsRuntimeScaleMonitoringEnabled=1 --resource-type Microsoft.Web/sites
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($DeployCode)
|
if ($DeployCode)
|
||||||
|
|
|
@ -11,4 +11,4 @@ $Env:AzureWebJobsStorage = (az storage account show-connection-string --name $st
|
||||||
$Env:EventHubsConnection = (az eventhubs namespace authorization-rule keys list --resource-group $groupName --namespace-name $namespaceName --name RootManageSharedAccessKey | ConvertFrom-Json).primaryConnectionString
|
$Env:EventHubsConnection = (az eventhubs namespace authorization-rule keys list --resource-group $groupName --namespace-name $namespaceName --name RootManageSharedAccessKey | ConvertFrom-Json).primaryConnectionString
|
||||||
|
|
||||||
# open visual studio
|
# open visual studio
|
||||||
dotnet run -p ..\..\ScalingTests\ScalingTests.csproj
|
dotnet run --project ..\ScaleMonitor\ScaleMonitor.csproj
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/usr/bin/pwsh
|
||||||
|
param (
|
||||||
|
$ResultsFile="./results.csv",
|
||||||
|
$PrintColumnNames=$true,
|
||||||
|
$tu=20
|
||||||
|
)
|
||||||
|
|
||||||
|
# read the settings that are common to all scripts
|
||||||
|
. ./settings.ps1
|
||||||
|
|
||||||
|
if ($PrintColumnNames)
|
||||||
|
{
|
||||||
|
Add-Content -path $ResultsFile -value "plan,nodes,tag,test,tu,starttime,iteration,size,duration"
|
||||||
|
}
|
||||||
|
|
||||||
|
./series/runsingle -Tag neth -HubName CX0 -Plan Consumption -NumReps 4 -Orchestration FileHash -Data 5000 -DelayAfterRun 40 -ResultsFile $ResultsFile -ThroughputUnits $tu
|
||||||
|
./series/runmany -Tag neth -HubName CX1 -Plan Consumption -NumReps 4 -Orchestration BankTransaction -NumOrchestrations 3000 -PortionSize 0 -DelayAfterRun 60 -ResultsFile $ResultsFile -ThroughputUnits $tu
|
||||||
|
./series/runmany -Tag neth -HubName CX2 -Plan Consumption -NumReps 4 -Orchestration FanOutFanInOrchestration -Data "/1000" -NumOrchestrations 200 -PortionSize 0 -DelayAfterRun 60 -ResultsFile $ResultsFile -ThroughputUnits $tu
|
||||||
|
./series/runmany -Tag neth -HubName CX3 -Plan Consumption -NumReps 4 -Orchestration HelloSequence5 -NumOrchestrations 10000 -PortionSize 200 -DelayAfterRun 50 -ResultsFile $ResultsFile -ThroughputUnits $tu
|
||||||
|
./series/runsingle -Tag neth -HubName CX4 -Plan Consumption -NumReps 4 -Orchestration WordCount -Data "15x40" -ResultsFile $ResultsFile -ThroughputUnits $tu
|
||||||
|
./series/runsingle -Tag neth -HubName CX5 -Plan Consumption -NumReps 4 -Orchestration CollisionSearch/divide-and-conquer -Data 400 -DelayAfterRun 40 -ResultsFile $ResultsFile -ThroughputUnits $tu
|
||||||
|
./series/runsingle -Tag neth -HubName CX6 -Plan Consumption -NumReps 4 -Orchestration CollisionSearch/flat-parallel -Data 400 -DelayAfterRun 40 -ResultsFile $ResultsFile -ThroughputUnits $tu -DeleteAfterTests $true
|
Загрузка…
Ссылка в новой задаче