Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support additional event hub consumer groups for testing environments #1813

Merged
merged 15 commits into from Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions builds/e2e/longhaul.yaml
Expand Up @@ -89,6 +89,7 @@ jobs:
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.amd64)'
analyzer.consumerGroupId: 'longhaul_linux_amd64'

################################################################################
- job: linux_arm32v7_moby
Expand Down Expand Up @@ -154,6 +155,7 @@ jobs:
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.arm32v7)'
analyzer.consumerGroupId: 'longhaul_linux_arm32v7'

################################################################################
- job: linux_arm64v8_docker
Expand Down Expand Up @@ -219,6 +221,7 @@ jobs:
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.arm64v8)'
analyzer.consumerGroupId: 'longhaul_linux_arm64v8'

################################################################################
- job: windows_amd64_moby
Expand Down Expand Up @@ -286,6 +289,7 @@ jobs:
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.amd64)'
analyzer.consumerGroupId: 'longhaul_windows_amd64'

################################################################################
- job: windows_servercore_amd64_moby
Expand Down Expand Up @@ -353,6 +357,7 @@ jobs:
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.amd64)'
analyzer.consumerGroupId: 'longhaul_windows_servercore_amd64'

################################################################################
- job: iotuap_amd64_moby
Expand Down Expand Up @@ -419,3 +424,4 @@ jobs:
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.amd64)'
analyzer.consumerGroupId: 'longhaul_iotuap_amd64'
6 changes: 6 additions & 0 deletions builds/e2e/stresstest.yaml
Expand Up @@ -89,6 +89,7 @@ jobs:
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.amd64)'
analyzer.consumerGroupId: 'stress_linux_amd64'

################################################################################
- job: linux_arm32v7_moby
Expand Down Expand Up @@ -154,6 +155,7 @@ jobs:
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: $(loadGen.message.frequency.arm32v7)
analyzer.consumerGroupId: 'stress_linux_arm32v7'

################################################################################
- job: linux_arm64v8_docker
Expand Down Expand Up @@ -219,6 +221,7 @@ jobs:
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: $(loadGen.message.frequency.arm64v8)
analyzer.consumerGroupId: 'stress_linux_arm64v8'

################################################################################
- job: windows_amd64_moby
Expand Down Expand Up @@ -286,6 +289,7 @@ jobs:
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.amd64)'
analyzer.consumerGroupId: 'stress_windows_amd64'

################################################################################
- job: windows_servercore_amd64_moby
Expand Down Expand Up @@ -353,6 +357,7 @@ jobs:
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.amd64)'
analyzer.consumerGroupId: 'stress_windows_servercore_amd64'

################################################################################
- job: iotuap_amd64_moby
Expand Down Expand Up @@ -419,3 +424,4 @@ jobs:
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.amd64)'
analyzer.consumerGroupId: 'stress_iotuap_amd64'
2 changes: 1 addition & 1 deletion builds/e2e/templates/longhaul-deploy-windows.yaml
Expand Up @@ -34,5 +34,5 @@ steps:
#Requires -RunAsAdministrator
$testName="LongHaul"
$ArtifactInfo=convertfrom-stringdata (get-content $(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/artifactInfo.txt -raw)
$(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/scripts/windows/test/Run-E2ETest.ps1 -E2ETestFolder "$(Agent.HomeDirectory)/.." -ReleaseLabel "${{ parameters['release.label'] }}" -ArtifactImageBuildNumber "$($ArtifactInfo.BuildNumber)" -TestName "$testName" -ContainerRegistry "${{ parameters['container.registry'] }}" -ContainerRegistryUsername "${{ parameters['container.registry.username'] }}" -ContainerRegistryPassword "${{ parameters['container.registry.password'] }}" -IoTHubConnectionString "${{ parameters['iotHub.connectionString'] }}" -EventHubConnectionString "${{ parameters['eventHub.connectionString'] }}" -SnitchBuildNumber "${{ parameters['snitch.build.number'] }}" -SnitchStorageAccount "${{ parameters['snitch.storage.account'] }}" -SnitchStorageMasterKey "${{ parameters['snitch.storage.masterKey'] }}" -SnitchAlertUrl "${{ parameters['snitch.alert.url'] }}" -LoadGenMessageFrequency "${{ parameters['loadGen.message.frequency'] }}"
philipktlin marked this conversation as resolved.
Show resolved Hide resolved
$(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/scripts/windows/test/Run-E2ETest.ps1 -E2ETestFolder "$(Agent.HomeDirectory)/.." -ReleaseLabel "${{ parameters['release.label'] }}" -ArtifactImageBuildNumber "$($ArtifactInfo.BuildNumber)" -TestName "$testName" -ContainerRegistry "${{ parameters['container.registry'] }}" -ContainerRegistryUsername "${{ parameters['container.registry.username'] }}" -ContainerRegistryPassword "${{ parameters['container.registry.password'] }}" -IoTHubConnectionString "${{ parameters['iotHub.connectionString'] }}" -EventHubConnectionString "${{ parameters['eventHub.connectionString'] }}" -SnitchBuildNumber "${{ parameters['snitch.build.number'] }}" -SnitchStorageAccount "${{ parameters['snitch.storage.account'] }}" -SnitchStorageMasterKey "${{ parameters['snitch.storage.masterKey'] }}" -SnitchAlertUrl "${{ parameters['snitch.alert.url'] }}" -LoadGenMessageFrequency "${{ parameters['loadGen.message.frequency'] }}" -EventHubConsumerGroupId "${{ parameters['analyzer.consumerGroupId'] }}"
workingDirectory: "$(Agent.HomeDirectory)/.."
3 changes: 2 additions & 1 deletion builds/e2e/templates/longhaul-deploy.yaml
Expand Up @@ -13,6 +13,7 @@ parameters:
snitch.storage.masterKey: ''
loadGen.message.frequency: ''
loadGen.transportType: 'mqtt'
analyzer.consumerGroupId: ''

steps:
- task: CopyFiles@2
Expand All @@ -36,5 +37,5 @@ steps:
testName="LongHaul"
. $(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/artifactInfo.txt
chmod +x $(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/scripts/linux/runE2ETest.sh
sudo $(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/scripts/linux/runE2ETest.sh -testDir "$(Agent.HomeDirectory)/.." -releaseLabel "${{ parameters['release.label'] }}" -artifactImageBuildNumber "$BuildNumber" -testName "$testName" -containerRegistry "${{ parameters['container.registry'] }}" -containerRegistryUsername "${{ parameters['container.registry.username'] }}" -containerRegistryPassword "${{ parameters['container.registry.password'] }}" -iotHubConnectionString "${{ parameters['iotHub.connectionString'] }}" -eventHubConnectionString "${{ parameters['eventHub.connectionString'] }}" -snitchBuildNumber "${{ parameters['snitch.build.number'] }}" -snitchStorageAccount "${{ parameters['snitch.storage.account'] }}" -snitchStorageMasterKey "${{ parameters['snitch.storage.masterKey'] }}" -snitchAlertUrl "${{ parameters['snitch.alert.url'] }}" -loadGenMessageFrequency "${{ parameters['loadGen.message.frequency'] }}" -cleanAll
sudo $(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/scripts/linux/runE2ETest.sh -testDir "$(Agent.HomeDirectory)/.." -releaseLabel "${{ parameters['release.label'] }}" -artifactImageBuildNumber "$BuildNumber" -testName "$testName" -containerRegistry "${{ parameters['container.registry'] }}" -containerRegistryUsername "${{ parameters['container.registry.username'] }}" -containerRegistryPassword "${{ parameters['container.registry.password'] }}" -iotHubConnectionString "${{ parameters['iotHub.connectionString'] }}" -eventHubConnectionString "${{ parameters['eventHub.connectionString'] }}" -snitchBuildNumber "${{ parameters['snitch.build.number'] }}" -snitchStorageAccount "${{ parameters['snitch.storage.account'] }}" -snitchStorageMasterKey "${{ parameters['snitch.storage.masterKey'] }}" -snitchAlertUrl "${{ parameters['snitch.alert.url'] }}" -loadGenMessageFrequency "${{ parameters['loadGen.message.frequency'] }}" -eventHubConsumerGroupId "${{ parameters['analyzer.consumerGroupId'] }}" -cleanAll
workingDirectory: "$(Agent.HomeDirectory)/.."
2 changes: 1 addition & 1 deletion builds/e2e/templates/stresstest-deploy-windows.yaml
Expand Up @@ -40,7 +40,7 @@ steps:
#Requires -RunAsAdministrator
$testName="Stress"
$ArtifactInfo=convertfrom-stringdata (get-content $(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/artifactInfo.txt -raw)
$(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/scripts/windows/test/Run-E2ETest.ps1 -E2ETestFolder "$(Agent.HomeDirectory)/.." -ReleaseLabel "${{ parameters['release.label'] }}" -ArtifactImageBuildNumber "$($ArtifactInfo.BuildNumber)" -TestName "$testName" -ContainerRegistry "${{ parameters['container.registry'] }}" -ContainerRegistryUsername "${{ parameters['container.registry.username'] }}" -ContainerRegistryPassword "${{ parameters['container.registry.password'] }}" -IoTHubConnectionString "${{ parameters['iotHub.connectionString'] }}" -EventHubConnectionString "${{ parameters['eventHub.connectionString'] }}" -SnitchBuildNumber "${{ parameters['snitch.build.number'] }}" -SnitchStorageAccount "${{ parameters['snitch.storage.account'] }}" -SnitchStorageMasterKey "${{ parameters['snitch.storage.masterKey'] }}" -SnitchAlertUrl "${{ parameters['snitch.alert.url'] }}" -LoadGen1TransportType "${{ parameters['loadGen1.transportType'] }}" -LoadGen2TransportType "${{ parameters['loadGen2.transportType'] }}" -LoadGen3TransportType "${{ parameters['loadGen3.transportType'] }}" -LoadGen4TransportType "${{ parameters['loadGen4.transportType'] }}" -AmqpSettingsEnabled "${{ parameters['amqp.settings.enabled'] }}" -MqttSettingsEnabled "${{ parameters['mqtt.settings.enabled'] }}" -LoadGenMessageFrequency "${{ parameters['loadGen.message.frequency'] }}"
$(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/scripts/windows/test/Run-E2ETest.ps1 -E2ETestFolder "$(Agent.HomeDirectory)/.." -ReleaseLabel "${{ parameters['release.label'] }}" -ArtifactImageBuildNumber "$($ArtifactInfo.BuildNumber)" -TestName "$testName" -ContainerRegistry "${{ parameters['container.registry'] }}" -ContainerRegistryUsername "${{ parameters['container.registry.username'] }}" -ContainerRegistryPassword "${{ parameters['container.registry.password'] }}" -IoTHubConnectionString "${{ parameters['iotHub.connectionString'] }}" -EventHubConnectionString "${{ parameters['eventHub.connectionString'] }}" -SnitchBuildNumber "${{ parameters['snitch.build.number'] }}" -SnitchStorageAccount "${{ parameters['snitch.storage.account'] }}" -SnitchStorageMasterKey "${{ parameters['snitch.storage.masterKey'] }}" -SnitchAlertUrl "${{ parameters['snitch.alert.url'] }}" -LoadGen1TransportType "${{ parameters['loadGen1.transportType'] }}" -LoadGen2TransportType "${{ parameters['loadGen2.transportType'] }}" -LoadGen3TransportType "${{ parameters['loadGen3.transportType'] }}" -LoadGen4TransportType "${{ parameters['loadGen4.transportType'] }}" -AmqpSettingsEnabled "${{ parameters['amqp.settings.enabled'] }}" -MqttSettingsEnabled "${{ parameters['mqtt.settings.enabled'] }}" -LoadGenMessageFrequency "${{ parameters['loadGen.message.frequency'] }}" -EventHubConsumerGroupId "${{ parameters['analyzer.consumerGroupId'] }}"
# schedule a task to stop iotedge service (terminate the test) in 4:30h
$ScheduleDatetime = [DateTime]::Now.AddMinutes(270)
$ScheduleDate=$ScheduleDatetime.ToString("MM/dd/yyyy")
Expand Down
3 changes: 2 additions & 1 deletion builds/e2e/templates/stresstest-deploy.yaml
Expand Up @@ -18,6 +18,7 @@ parameters:
loadGen2.transportType: 'Amqp_WebSocket_Only'
loadGen3.transportType: 'Mqtt_Tcp_Only'
loadGen4.transportType: 'Mqtt_WebSocket_Only'
analyzer.consumerGroupId: ''

steps:
- task: CopyFiles@2
Expand All @@ -42,7 +43,7 @@ steps:
. $(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/artifactInfo.txt
echo "snitcher duration in mins=$(snitcher.test.duration.in.mins)"
chmod +x $(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/scripts/linux/runE2ETest.sh
sudo $(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/scripts/linux/runE2ETest.sh -testDir "$(Agent.HomeDirectory)/.." -releaseLabel "${{ parameters['release.label'] }}" -artifactImageBuildNumber "$BuildNumber" -testName "$testName" -containerRegistry "${{ parameters['container.registry'] }}" -containerRegistryUsername "${{ parameters['container.registry.username'] }}" -containerRegistryPassword "${{ parameters['container.registry.password'] }}" -iotHubConnectionString "${{ parameters['iotHub.connectionString'] }}" -eventHubConnectionString "${{ parameters['eventHub.connectionString'] }}" -snitchBuildNumber "${{ parameters['snitch.build.number'] }}" -snitchStorageAccount "${{ parameters['snitch.storage.account'] }}" -snitchStorageMasterKey "${{ parameters['snitch.storage.masterKey'] }}" -snitchAlertUrl "${{ parameters['snitch.alert.url'] }}" -loadGen1TransportType "${{ parameters['loadGen1.transportType'] }}" -loadGen2TransportType "${{ parameters['loadGen2.transportType'] }}" -loadGen3TransportType "${{ parameters['loadGen3.transportType'] }}" -loadGen4TransportType "${{ parameters['loadGen4.transportType'] }}" -amqpSettingsEnabled "${{ parameters['amqp.settings.enabled'] }}" -mqttSettingsEnabled "${{ parameters['mqtt.settings.enabled'] }}" -loadGenMessageFrequency "${{ parameters['loadGen.message.frequency'] }}" -snitchTestDurationInSecs "$(($(snitcher.test.duration.in.mins)*60))" -cleanAll
sudo $(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/scripts/linux/runE2ETest.sh -testDir "$(Agent.HomeDirectory)/.." -releaseLabel "${{ parameters['release.label'] }}" -artifactImageBuildNumber "$BuildNumber" -testName "$testName" -containerRegistry "${{ parameters['container.registry'] }}" -containerRegistryUsername "${{ parameters['container.registry.username'] }}" -containerRegistryPassword "${{ parameters['container.registry.password'] }}" -iotHubConnectionString "${{ parameters['iotHub.connectionString'] }}" -eventHubConnectionString "${{ parameters['eventHub.connectionString'] }}" -snitchBuildNumber "${{ parameters['snitch.build.number'] }}" -snitchStorageAccount "${{ parameters['snitch.storage.account'] }}" -snitchStorageMasterKey "${{ parameters['snitch.storage.masterKey'] }}" -snitchAlertUrl "${{ parameters['snitch.alert.url'] }}" -loadGen1TransportType "${{ parameters['loadGen1.transportType'] }}" -loadGen2TransportType "${{ parameters['loadGen2.transportType'] }}" -loadGen3TransportType "${{ parameters['loadGen3.transportType'] }}" -loadGen4TransportType "${{ parameters['loadGen4.transportType'] }}" -amqpSettingsEnabled "${{ parameters['amqp.settings.enabled'] }}" -mqttSettingsEnabled "${{ parameters['mqtt.settings.enabled'] }}" -loadGenMessageFrequency "${{ parameters['loadGen.message.frequency'] }}" -snitchTestDurationInSecs "$(($(snitcher.test.duration.in.mins)*60))" -eventHubConsumerGroupId "${{ parameters['analyzer.consumerGroupId'] }}" -cleanAll
#Remove all pending jobs
atrm $(atq | cut -f1)
durationToStop=$(($(snitcher.test.duration.in.mins)+30))
Expand Down
2 changes: 1 addition & 1 deletion edge-modules/MessagesAnalyzer/Program.cs
Expand Up @@ -19,7 +19,7 @@ class Program

static async Task Main(string[] args)
{
Log.LogInformation($"Starting analyzer for deviceId: {Settings.Current.DeviceId}, exclude-modules: {string.Join(", ", Settings.Current.ExcludedModuleIds.ToArray())}");
Log.LogInformation($"Starting analyzer for [deviceId: {Settings.Current.DeviceId}] with [consumerGroupId: {Settings.Current.ConsumerGroupId}], exclude-modules: {string.Join(", ", Settings.Current.ExcludedModuleIds.ToArray())}");

await ReceiveMessages();

Expand Down
6 changes: 3 additions & 3 deletions scripts/linux/runE2ETest.sh
Expand Up @@ -170,7 +170,7 @@ function prepare_test_from_artifacts() {
local escapedSnitchAlertUrl
local escapedBuildId
sed -i -e "s@<Analyzer.EventHubConnectionString>@$EVENTHUB_CONNECTION_STRING@g" "$deployment_working_file"
sed -i -e "s@<Analyzer.ConsumerGroupId>@${EVENT_HUB_CONSUMER_GROUP:-\$Default}@g" "$deployment_working_file"
sed -i -e "s@<Analyzer.ConsumerGroupId>@${EVENT_HUB_CONSUMER_GROUP_ID:-\$Default}@g" "$deployment_working_file"
philipktlin marked this conversation as resolved.
Show resolved Hide resolved
sed -i -e "s@<LoadGen.MessageFrequency>@$LOADGEN_MESSAGE_FREQUENCY@g" "$deployment_working_file"
escapedSnitchAlertUrl="${SNITCH_ALERT_URL//&/\\&}"
escapedBuildId="${ARTIFACT_IMAGE_BUILD_NUMBER//./}"
Expand Down Expand Up @@ -350,7 +350,7 @@ function process_args() {
DPS_MASTER_SYMMETRIC_KEY="$arg"
saveNextArg=0
elif [ $saveNextArg -eq 29 ]; then
EVENT_HUB_CONSUMER_GROUP="$arg"
EVENT_HUB_CONSUMER_GROUP_ID="$arg"
saveNextArg=0
else
case "$arg" in
Expand Down Expand Up @@ -383,7 +383,7 @@ function process_args() {
'-installRootCAKeyPassword' ) saveNextArg=26;;
'-dpsScopeId' ) saveNextArg=27;;
'-dpsMasterSymmetricKey' ) saveNextArg=28;;
'-eventHubConsumerGroup' ) saveNextArg=29;;
'-eventHubConsumerGroupId' ) saveNextArg=29;;
'-cleanAll' ) CLEAN_ALL=1;;
* ) usage;;
esac
Expand Down
6 changes: 6 additions & 0 deletions scripts/windows/test/Run-E2ETest.ps1
Expand Up @@ -44,6 +44,9 @@
.PARAMETER EventHubConnectionString
Event hub connection string for receive D2C messages

.PARAMETER EventHubConsumerGroupId
Event hub consumer group id needed to avoid overloading the default Event Hub endpoint
philipktlin marked this conversation as resolved.
Show resolved Hide resolved

.PARAMETER ProxyUri
(Optional) The URI of an HTTPS proxy server; if specified, all communications to IoT Hub will go through this proxy.

Expand Down Expand Up @@ -206,6 +209,8 @@ Param (
[ValidateNotNullOrEmpty()]
[string] $EventHubConnectionString = $(Throw "Event hub connection string is required"),

[string] $EventHubConsumerGroupId = $null,
philipktlin marked this conversation as resolved.
Show resolved Hide resolved

[string] $EdgeE2ERootCACertRSAFile = $null,

[string] $EdgeE2ERootCAKeyRSAFile = $null,
Expand Down Expand Up @@ -431,6 +436,7 @@ Function PrepareTestFromArtifacts
}

(Get-Content $DeploymentWorkingFilePath).replace('<Analyzer.EventHubConnectionString>',$EventHubConnectionString) | Set-Content $DeploymentWorkingFilePath
(Get-Content $DeploymentWorkingFilePath).replace('<Analyzer.ConsumerGroupId>',$EventHubConsumerGroupId) | Set-Content $DeploymentWorkingFilePath
(Get-Content $DeploymentWorkingFilePath).replace('<LoadGen.MessageFrequency>',$LoadGenMessageFrequency) | Set-Content $DeploymentWorkingFilePath
$escapedBuildId= $ArtifactImageBuildNumber -replace "\.",""
(Get-Content $DeploymentWorkingFilePath).replace('<Snitch.AlertUrl>',$SnitchAlertUrl) | Set-Content $DeploymentWorkingFilePath
Expand Down