From eb554ab49f9894c738fdb8f500ab1724c9222ab5 Mon Sep 17 00:00:00 2001 From: Denis Molokanov Date: Thu, 25 Feb 2021 16:34:26 -0800 Subject: [PATCH] nested connectivity pipeline (#4471) updated `nested-connectivity.yaml` to work with a nested pipeline. Running the connectivity stage doesn't need to lock the agent because it deploys and waits for the result. Made changes to existing templates to be able to reuse for nested-connectivity. --- builds/e2e/connectivity.yaml | 1 + builds/e2e/nested-connectivity.yaml | 158 +++++++------- builds/e2e/templates/connectivity-deploy.yaml | 38 +++- builds/e2e/templates/nested-agent-deploy.yaml | 95 ++++---- builds/e2e/templates/nested-get-root-ca.yaml | 1 + builds/e2e/templates/nested-get-secrets.yaml | 1 + ...eployment_connectivity_mqtt.template.json} | 205 +++++------------- ...ededge_middleLayerBaseDeployment_mqtt.json | 17 +- ...estededge_topLayerBaseDeployment_mqtt.json | 2 +- scripts/linux/trcE2ETest.sh | 2 +- 10 files changed, 226 insertions(+), 294 deletions(-) rename e2e_deployment_files/{nested_connectivity_deployment.template.json => nestededge_bottomLayerBaseDeployment_connectivity_mqtt.template.json} (77%) diff --git a/builds/e2e/connectivity.yaml b/builds/e2e/connectivity.yaml index ce06d641abe..b70846a56bb 100644 --- a/builds/e2e/connectivity.yaml +++ b/builds/e2e/connectivity.yaml @@ -360,4 +360,5 @@ jobs: customEdgeAgent.image: '$(customEdgeAgent.image)' customEdgeHub.image: '$(customEdgeHub.image)' test.runtimeLogLevel: '$(test.runtimeLogLevel)' + connectivity.nested: 'false' testInfo.testName: '$(testInfo.testName)' diff --git a/builds/e2e/nested-connectivity.yaml b/builds/e2e/nested-connectivity.yaml index 216ee63c314..be0fda703c6 100644 --- a/builds/e2e/nested-connectivity.yaml +++ b/builds/e2e/nested-connectivity.yaml @@ -3,16 +3,26 @@ pr: none variables: NugetSecurityAnalysisWarningLevel: warn - images.artifact.name.linux: 'core-linux' - vsts.project: $(System.TeamProjectId) + +resources: + pipelines: + - pipeline: images + source: 'Azure-IoT-Edge-Core Build Images' + branch: master + - pipeline: packages + source: 'Azure-IoT-Edge-Core Edgelet Packages' + branch: master -jobs: -################################################################################ - - job: linux_amd64_moby -################################################################################ - displayName: Linux AMD64 Moby - condition: ne(variables['agent.group'], '') - timeoutInMinutes: 180 +stages: +- stage: SetupVMs + jobs: + - template: templates/nested-parent-vm-setup.yaml + parameters: + transportType: mqtt + - job: Deploy_Connectivity_Linux_Amd64 + displayName: Set up and run connectivity tests on Linux Amd64 + dependsOn: SetupVM_level4_mqtt + condition: and(succeeded(), eq(variables['run.linux.amd64.moby'], 'true')) strategy: matrix: Online: @@ -51,29 +61,29 @@ jobs: testrun.network.frequencies: "00:05:00 00:20:00 3" testrun.network.runProfile: "Offline" testrun.duration: "01:15:00" - SatelliteGood(60/0/1): - testrun.config: 7 - testrun.network.description: "SatelliteGood(60/0/1)" - testrun.network.frequencies: "01:00:00 00:00:00 1" - testrun.network.runProfile: "SatelliteGood" - testrun.duration: "01:00:00" - Cellular3G(60/0/1): - testrun.config: 8 - testrun.network.description: "Cellular3G(60/0/1)" - testrun.network.frequencies: "01:00:00 00:00:00 1" - testrun.network.runProfile: "Cellular3G" - testrun.duration: "01:00:00" + timeoutInMinutes: 180 pool: name: $(pool.name) demands: - agent-group -equals $(agent.group) - Agent.OS -equals Linux - Agent.OSArchitecture -equals X64 - - run-connectivity -equals true - - nested-edge -equals L3 + - status -equals unlocked variables: - edgelet.artifact.name: 'iotedged-ubuntu16.04-amd64' - steps: + parentName: $[ dependencies.SetupVM_level4_mqtt.outputs['deployIoTEdge.deviceName'] ] + parentDeviceId: $[ dependencies.SetupVM_level4_mqtt.outputs['createIdentity.parentDeviceId'] ] + edgelet.artifact.name: 'iotedged-ubuntu18.04-amd64' + aziotis.artifact.name: 'packages_ubuntu-18.04_amd64' + aziotis.package.filter: 'aziot-identity-service_*_amd64.deb' + hostPlatform: 'linux_amd64_moby' + quickstart.package.name: 'IotEdgeQuickstart.linux-x64.tar.gz' + nestededge: true + vsts.project: $(System.TeamProjectId) + identityServiceArtifactName: packages_ubuntu-18.04_amd64 + identityServicePackageFilter: aziot-identity-service_*_amd64.deb + artifactName: iotedged-ubuntu18.04-amd64 + steps: + - template: templates/set-run-flag.yaml - task: Bash@3 name: Print_test_parameters displayName: 'Print test parameters' @@ -87,70 +97,30 @@ jobs: echo "testrun.duration=$(testrun.duration)" echo "deploymentFileName=$(deploymentFileName)" echo "test.runtimeLogLevel=$(test.runtimeLogLevel)" - - template: templates/set-run-flag.yaml - - checkout: none - condition: and(succeeded(), eq(variables['run.flag'], 1)) - - task: AzureKeyVault@1 - condition: eq(variables['run.flag'], 1) - displayName: 'EdgeBuild Azure Key Vault' - inputs: - azureSubscription: $(azure.subscription) - KeyVaultName: edgebuildkv - SecretsFilter: 'edgebuilds-azurecr-io-username,edgebuilds-azurecr-io-pwd,kvLogAnalyticWorkspaceId,kvLogAnalyticSharedKey,EdgeConnectivityStorageAccountConnString' - - task: AzureKeyVault@1 - condition: eq(variables['run.flag'], 1) - displayName: 'Nested Edge Azure Key Vault' - inputs: - azureSubscription: $(azure.subscription) - KeyVaultName: edgebuildkv - SecretsFilter: 'IotHubStressConnString,EventHubStressConnStr' - - task: DownloadBuildArtifacts@0 - condition: and(succeeded(), eq(variables['run.flag'], 1)) - displayName: 'Download Edgelet Artifacts' - inputs: - buildType: specific - project: $(vsts.project) - pipeline: $(edgelet.package.build) - branchName: $(edgelet.package.branchName) - buildVersionToDownload: latestFromBranch - downloadPath: '$(Build.StagingDirectory)' - artifactName: $(edgelet.artifact.name) - allowPartiallySucceededBuilds: true - - task: DownloadBuildArtifacts@0 - condition: and(succeeded(), eq(variables['run.flag'], 1)) - displayName: 'Download Images Artifacts' - inputs: - buildType: specific - project: $(vsts.project) - pipeline: $(images.build) - branchName: $(images.branchName) - buildVersionToDownload: latestFromBranch - downloadPath: '$(Build.StagingDirectory)' - artifactName: $(images.artifact.name.linux) - allowPartiallySucceededBuilds: true - itemPattern: | - $(images.artifact.name.linux)/IotEdgeQuickstart.linux-x64.tar.gz - $(images.artifact.name.linux)/e2e_deployment_files/$(deploymentFileName) - $(images.artifact.name.linux)/scripts/linux/trcE2ETest.sh - $(images.artifact.name.linux)/artifactInfo.txt - # Deploy connectivity test + echo "run.flag=$(run.flag)" + - template: templates/nested-get-secrets.yaml + - template: templates/nested-get-root-ca.yaml + - template: templates/nested-agent-deploy.yaml + parameters: + skipInstall: true - template: templates/connectivity-deploy.yaml parameters: release.label: 'ct$(agent.group)' test.buildNumber: '$(Build.BuildNumber)' test.buildId: '$(Build.BuildId)' + test.startDelay: '$(test.startDelay)' build.source.branch: '$(Build.SourceBranchName)' - build.repo.path: '$(Build.SourcesDirectory)' edgelet.source.branch: '$(edgelet.package.branchName)' images.source.branch: '$(images.branchName)' + build.repo.path: '$(Build.SourcesDirectory)' edgelet.artifact.name: '$(edgelet.artifact.name)' - images.artifact.name: '$(images.artifact.name.linux)' - container.registry: '$(container.registry)' + images.artifact.name: '$(az.pipeline.images.artifacts)' + container.registry: '$(cr.address)' container.registry.username: '$(edgebuilds-azurecr-io-username)' container.registry.password: '$(edgebuilds-azurecr-io-pwd)' iotHub.connectionString: '$(IotHubStressConnString)' eventHub.connectionString: '$(EventHubStressConnStr)' - deploymentFileName: '$(deploymentFileName)' + deploymentFileName: 'nestededge_bottomLayerBaseDeployment_connectivity_mqtt.template.json' upstream.protocol: '$(upstream.protocol)' loadGen.message.frequency: '$(loadGen.message.frequency.amd64)' edgeHubRestartTest.restartPeriod: '$(edgeHubRestartTest.restartPeriod)' @@ -168,8 +138,42 @@ jobs: metricsCollector.metricsEndpointsCSV: '$(metricsCollector.metricsEndpointsCSV)' metricsCollector.scrapeFrequencyInSecs: '$(metricsCollector.scrapeFrequencyInSecs)' metricsCollector.uploadTarget: '$(metricsCollector.uploadTarget)' - metricsCollector.hostPlatform: 'linux_amd64_moby' + metricsCollector.hostPlatform: '$(hostPlatform)' edgeRuntime.buildNumber: '$(edgeRuntime.buildNumber)' customEdgeAgent.image: '$(customEdgeAgent.image)' customEdgeHub.image: '$(customEdgeHub.image)' test.runtimeLogLevel: '$(test.runtimeLogLevel)' + connectivity.parentHostname: '$(parentName)' + connectivity.parentEdgeDevice: '$(parentDeviceId)' + quickstart.package.name: '$(quickstart.package.name)' + aziotis.artifact.name: '$(aziotis.artifact.name)' + aziotis.package.filter: '$(aziotis.package.filter)' + connectivity.nested: 'true' + - job: Clean_up + dependsOn: + - SetupVM_level5_mqtt + - SetupVM_level4_mqtt + - Deploy_connectivity_Linux_Amd64 + condition: always() + displayName: Clean up identities and unlock agents + variables: + deviceLvl5AgentName: $[ dependencies.SetupVM_level5_mqtt.outputs['lock_test_agent.agentName'] ] + deviceLvl4AgentName: $[ dependencies.SetupVM_level4_mqtt.outputs['lock_test_agent.agentName'] ] + amd64AgentName: $[ dependencies.Deploy_connectivity_Linux_Amd64.outputs['lock_test_agent.agentName'] ] + pool: + name: $(pool.name) + demands: + - agent-group -equals $(agent.group) + - Agent.OS -equals Linux + - Agent.OSArchitecture -equals X64 + - status -equals unlocked_$(Build.BuildId) + steps: + - template: templates/nested-get-secrets.yaml + - template: templates/unlock-test-agent.yaml + parameters: + agentName: $(deviceLvl5AgentName) + lvl: 5 + - template: templates/unlock-test-agent.yaml + parameters: + agentName: $(deviceLvl4AgentName) + lvl: 4 \ No newline at end of file diff --git a/builds/e2e/templates/connectivity-deploy.yaml b/builds/e2e/templates/connectivity-deploy.yaml index 51bd8d704bb..7248def1bc1 100644 --- a/builds/e2e/templates/connectivity-deploy.yaml +++ b/builds/e2e/templates/connectivity-deploy.yaml @@ -31,6 +31,7 @@ parameters: customEdgeAgent.image: '' customEdgeHub.image: '' test.runtimeLogLevel: '' + connectivity.nested: 'false' steps: - task: CopyFiles@2 @@ -57,18 +58,35 @@ steps: condition: and(succeeded(), eq(variables['run.flag'], 1)) displayName: 'Generate device certificates' inputs: + ${{ if eq(parameters['connectivity.nested'], 'false') }}: + workingDirectory: "$(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/CACertificates" + ${{ if eq(parameters['connectivity.nested'], 'true') }}: + workingDirectory: "/certs" targetType: inline - workingDirectory: "$(Agent.HomeDirectory)/../artifacts/${{ parameters['images.artifact.name'] }}/CACertificates" script: | - chmod +x certGen.sh + if [ $(nestededge) ]; then + sudo chmod -R 777 /certs + hostName=$(ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}') + echo " Hostname IP: ${hostName}" + echo "Installing test certificate bundle" + ./certGen.sh create_edge_device_certificate "${hostName}" + + echo "##vso[task.setvariable variable=HostName]${hostName}" + + echo "##vso[task.setvariable variable=TrustBundle]/certs/certs/azure-iot-test-only.root.ca.cert.pem" + echo "##vso[task.setvariable variable=DeviceCaCert]/certs/certs/iot-edge-device-${hostName}-full-chain.cert.pem" + echo "##vso[task.setvariable variable=DeviceCaKey]/certs/private/iot-edge-device-${hostName}.key.pem" + else + chmod +x certGen.sh - ./certGen.sh create_root_and_intermediate - ./certGen.sh create_edge_device_ca_certificate 'ConnectivityTestDeviceCA' - - echo "##vso[task.setvariable variable=TrustBundle]$(pwd)/certs/azure-iot-test-only.intermediate-full-chain.cert.pem" - echo "##vso[task.setvariable variable=DeviceCaCert]$(pwd)/certs/iot-edge-device-ca-ConnectivityTestDeviceCA.cert.pem" - echo "##vso[task.setvariable variable=DeviceCaKey]$(pwd)/private/iot-edge-device-ca-ConnectivityTestDeviceCA.key.pem" + ./certGen.sh create_root_and_intermediate + ./certGen.sh create_edge_device_ca_certificate 'ConnectivityTestDeviceCA' + echo "##vso[task.setvariable variable=TrustBundle]$(pwd)/certs/azure-iot-test-only.intermediate-full-chain.cert.pem" + echo "##vso[task.setvariable variable=DeviceCaCert]$(pwd)/certs/iot-edge-device-ca-ConnectivityTestDeviceCA.cert.pem" + echo "##vso[task.setvariable variable=DeviceCaKey]$(pwd)/private/iot-edge-device-ca-ConnectivityTestDeviceCA.key.pem" + fi + - task: Bash@3 condition: and(succeeded(), eq(variables['run.flag'], 1)) displayName: 'Run Connectivity Deployment' @@ -135,6 +153,10 @@ steps: workingDirectory: "$(Agent.HomeDirectory)/.." env: + E2E_nestedEdgeTest: $(nestededge) E2E_trustedCaCerts: $(TrustBundle) E2E_deviceCaCert: $(DeviceCaCert) E2E_deviceCaPrivateKey: $(DeviceCaKey) + E2E_parentHostname: ${{ parameters['connectivity.parentHostname'] }} + E2E_parentEdgeDevice: ${{ parameters['connectivity.parentEdgeDevice'] }} + E2E_hostname: $(Hostname) diff --git a/builds/e2e/templates/nested-agent-deploy.yaml b/builds/e2e/templates/nested-agent-deploy.yaml index 6d0ef40022c..b3a05de8cce 100644 --- a/builds/e2e/templates/nested-agent-deploy.yaml +++ b/builds/e2e/templates/nested-agent-deploy.yaml @@ -1,3 +1,8 @@ +parameters: +- name: skipInstall + type: boolean + default: false + steps: - checkout: self clean: true @@ -24,9 +29,11 @@ steps: Write-Output ">> Package Build ID=$packageBuildId" Write-Output ">> Image Build ID=$imageBuildId" - displayName: Override artifacts with user-supplied args + displayName: Override artifacts with user-supplied args + condition: or(eq(variables['run.flag'], ''), eq(variables['run.flag'], 1)) - task: DownloadBuildArtifacts@0 displayName: 'Download Images Artifacts' + condition: or(eq(variables['run.flag'], ''), eq(variables['run.flag'], 1)) inputs: buildType: specific project: $(resources.pipeline.images.projectID) @@ -36,9 +43,18 @@ steps: downloadPath: '$(Build.StagingDirectory)' artifactName: $(az.pipeline.images.artifacts) allowPartiallySucceededBuilds: true - itemPattern: $(az.pipeline.images.artifacts)/artifactInfo.txt + ${{ if not(parameters.skipInstall) }}: + itemPattern: $(az.pipeline.images.artifacts)/artifactInfo.txt + ${{ if parameters.skipInstall }}: + itemPattern: | + $(az.pipeline.images.artifacts)/$(quickstart.package.name) + $(az.pipeline.images.artifacts)/e2e_deployment_files/* + $(az.pipeline.images.artifacts)/scripts/linux/trcE2ETest.sh + $(az.pipeline.images.artifacts)/artifactInfo.txt + $(az.pipeline.images.artifacts)/scripts/local/test/DownloadIdentityService.ps1 - task: DownloadBuildArtifacts@0 displayName: 'Download Edgelet Artifacts' + condition: or(eq(variables['run.flag'], ''), eq(variables['run.flag'], 1)) inputs: buildType: specific project: $(resources.pipeline.packages.projectID) @@ -47,9 +63,10 @@ steps: buildId: $(packageBuildId) downloadPath: '$(Build.StagingDirectory)' allowPartiallySucceededBuilds: true - artifactName: $(artifactName) + artifactName: $(artifactName) - task: PowerShell@2 displayName: 'Download aziot-identity-service' + condition: or(eq(variables['run.flag'], ''), eq(variables['run.flag'], 1)) inputs: filePath: $(Build.SourcesDirectory)/scripts/local/test/DownloadIdentityService.ps1 workingDirectory: $(Build.SourcesDirectory) @@ -59,42 +76,44 @@ steps: PACKAGE_FILTER: $(identityServicePackageFilter) DOWNLOAD_PATH: $(Build.StagingDirectory) IDENTITY_SERVICE_COMMIT: $(aziotis.commit) - - task: Bash@3 - displayName: 'Install artifacts' - name: InstallArtifacts - inputs: - targetType: inline - script: | - echo 'Stop IoT Edge services' - sudo systemctl stop aziot-edged.workload.socket aziot-edged.mgmt.socket || true - sudo systemctl stop iotedge.socket iotedge.mgmt.socket || true - sudo systemctl kill iotedge || true - sudo systemctl stop iotedge || true - sudo systemctl stop aziot-keyd aziot-certd aziot-identityd aziot-edged || true - sudo dpkg --purge aziot-edge aziot-identity-service + - ${{ if not(parameters.skipInstall) }}: + - task: Bash@3 + displayName: 'Install artifacts' + name: InstallArtifacts + inputs: + targetType: inline + script: | + echo 'Stop IoT Edge services' + sudo systemctl stop aziot-edged.workload.socket aziot-edged.mgmt.socket || true + sudo systemctl stop iotedge.socket iotedge.mgmt.socket || true + sudo systemctl kill iotedge || true + sudo systemctl stop iotedge || true + sudo systemctl stop aziot-keyd aziot-certd aziot-identityd aziot-edged || true + sudo dpkg --purge aziot-edge aziot-identity-service - sudo rm -rf /var/lib/aziot/ - sudo rm -rf /var/lib/iotedge/ - sudo rm -rf /etc/aziot/ - sudo rm -rf /etc/systemd/system/aziot-*.service.d/ + sudo rm -rf /var/lib/aziot/ + sudo rm -rf /var/lib/iotedge/ + sudo rm -rf /etc/aziot/ + sudo rm -rf /etc/systemd/system/aziot-*.service.d/ - echo 'Restart docker' - sudo systemctl restart docker # needed due to https://github.com/moby/moby/issues/23302 + echo 'Restart docker' + sudo systemctl restart docker # needed due to https://github.com/moby/moby/issues/23302 - echo "Install artifacts" - iotedge_library=$( find $(Build.SourcesDirectory)/aziot-identity-service -type f -iname "$(identityServicePackageFilter)") - - ls "$(Build.StagingDirectory)" - ls "$(Build.StagingDirectory)/$(artifactName)" - declare -a pkg_list="$(Build.StagingDirectory)/$(artifactName)/*.deb" - iotedge_package="${pkg_list[*]}" + echo "Install artifacts" + iotedge_library=$( find $(Build.SourcesDirectory)/aziot-identity-service -type f -iname "$(identityServicePackageFilter)") + + ls "$(Build.StagingDirectory)" + ls "$(Build.StagingDirectory)/$(artifactName)" + declare -a pkg_list="$(Build.StagingDirectory)/$(artifactName)/*.deb" + iotedge_package="${pkg_list[*]}" - echo " Install library" - sudo dpkg -i --force-confnew ${iotedge_library} - echo " Install edgelet" - sudo dpkg -i --force-confnew ${iotedge_package} - - template: nested-deploy-config.yaml - parameters: - deploymentFile: $(deploymentFile) - deviceId: $(deviceId) - level: $(level) + echo " Install library" + sudo dpkg -i --force-confnew ${iotedge_library} + echo " Install edgelet" + sudo dpkg -i --force-confnew ${iotedge_package} + - ${{ if not(parameters.skipInstall) }}: + - template: nested-deploy-config.yaml + parameters: + deploymentFile: $(deploymentFile) + deviceId: $(deviceId) + level: $(level) diff --git a/builds/e2e/templates/nested-get-root-ca.yaml b/builds/e2e/templates/nested-get-root-ca.yaml index 83f1294215c..d0dd93ec2cf 100644 --- a/builds/e2e/templates/nested-get-root-ca.yaml +++ b/builds/e2e/templates/nested-get-root-ca.yaml @@ -1,6 +1,7 @@ steps: - task: Bash@3 displayName: 'Get rootCA' + condition: or(eq(variables['run.flag'], ''), eq(variables['run.flag'], 1)) inputs: targetType: inline script: | diff --git a/builds/e2e/templates/nested-get-secrets.yaml b/builds/e2e/templates/nested-get-secrets.yaml index 1d73d1d1d26..b7d726b8e12 100644 --- a/builds/e2e/templates/nested-get-secrets.yaml +++ b/builds/e2e/templates/nested-get-secrets.yaml @@ -1,6 +1,7 @@ steps: - task: AzureKeyVault@1 displayName: 'EdgeBuild Azure Key Vault' + condition: or(eq(variables['run.flag'], ''), eq(variables['run.flag'], 1)) inputs: azureSubscription: $(az.subscription) KeyVaultName: $(azure.keyVault) diff --git a/e2e_deployment_files/nested_connectivity_deployment.template.json b/e2e_deployment_files/nestededge_bottomLayerBaseDeployment_connectivity_mqtt.template.json similarity index 77% rename from e2e_deployment_files/nested_connectivity_deployment.template.json rename to e2e_deployment_files/nestededge_bottomLayerBaseDeployment_connectivity_mqtt.template.json index 555f88ee4cc..a3a572adbd2 100644 --- a/e2e_deployment_files/nested_connectivity_deployment.template.json +++ b/e2e_deployment_files/nestededge_bottomLayerBaseDeployment_connectivity_mqtt.template.json @@ -2,7 +2,7 @@ "modulesContent": { "$edgeAgent": { "properties.desired": { - "schemaVersion": "1.0", + "schemaVersion": "1.1", "runtime": { "type": "docker", "settings": { @@ -12,7 +12,7 @@ "rc1": { "username": "", "password": "", - "address": "" + "address": "$upstream:443" } } } @@ -35,28 +35,31 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-agent:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-agent:-linux-", "createOptions": "{\"ExposedPorts\": {\"9600/tcp\": {}}, \"HostConfig\": {\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"PortBindings\": {\"9600/tcp\": [{\"HostPort\": \"9600\"}]}}}" } }, "edgeHub": { "type": "docker", "settings": { - "image": "/microsoft/azureiotedge-hub:-linux-", - "createOptions": "{\"ExposedPorts\": {\"9600/tcp\": {}}, \"HostConfig\": {\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"PortBindings\": {\"8883/tcp\": [{\"HostPort\": \"8883\"}],\"5671/tcp\": [{\"HostPort\": \"5671\"}],\"9600/tcp\": [{\"HostPort\": \"9601\"}]}}}" + "image": "$upstream:443/microsoft/azureiotedge-hub:-linux-", + "createOptions": "{\"ExposedPorts\": {\"9600/tcp\": {}}, \"HostConfig\": {\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"100m\",\"max-file\":\"7\"}}, \"PortBindings\": {\"8883/tcp\": [{\"HostPort\": \"8883\"}],\"5671/tcp\": [{\"HostPort\": \"5671\"}],\"9600/tcp\": [{\"HostPort\": \"9601\"}]}}}" }, "env": { - "experimentalfeatures__enabled": { + "experimentalFeatures__enabled": { "value": "true" }, - "experimentalfeatures__enableMetrics": { + "experimentalFeatures__nestedEdgeEnabled": { "value": "true" }, - "NestedEdgeEnabled": { + "experimentalFeatures__mqttBrokerEnabled": { "value": "true" }, - "mqttBrokerSettings:enabled": { + "experimentalfeatures__enableMetrics": { "value": "true" + }, + "RuntimeLogLevel": { + "value": "debug" } }, "status": "running", @@ -93,7 +96,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-load-gen:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-load-gen:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}" } }, @@ -126,7 +129,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-load-gen:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-load-gen:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}" } }, @@ -162,7 +165,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-direct-method-sender:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-direct-method-sender:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"NetworkMode\":\"host\"},\"NetworkingConfig\":{\"EndpointsConfig\":{\"host\":{}}}}" } }, @@ -183,7 +186,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-direct-method-receiver:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-direct-method-receiver:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}" } }, @@ -219,7 +222,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-direct-method-sender:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-direct-method-sender:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"NetworkMode\":\"host\"},\"NetworkingConfig\":{\"EndpointsConfig\":{\"host\":{}}}}" } }, @@ -240,7 +243,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-direct-method-receiver:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-direct-method-receiver:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}" } }, @@ -279,7 +282,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-direct-method-sender:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-direct-method-sender:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"NetworkMode\":\"host\"},\"NetworkingConfig\":{\"EndpointsConfig\":{\"host\":{}}}}" } }, @@ -303,7 +306,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-relayer:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-relayer:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}" } }, @@ -327,7 +330,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-relayer:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-relayer:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}" } }, @@ -387,7 +390,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-test-result-coordinator:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-test-result-coordinator:-linux-", "createOptions": "{\"HostConfig\": {\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"PortBindings\": {\"5001/tcp\": [{\"HostPort\": \"5001\"}]}}}" } }, @@ -420,7 +423,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-twin-tester:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-twin-tester:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"NetworkMode\":\"host\"},\"NetworkingConfig\":{\"EndpointsConfig\":{\"host\":{}}}}" } }, @@ -453,7 +456,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-twin-tester:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-twin-tester:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}" } }, @@ -486,7 +489,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-twin-tester:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-twin-tester:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"NetworkMode\":\"host\"},\"NetworkingConfig\":{\"EndpointsConfig\":{\"host\":{}}}}" } }, @@ -519,7 +522,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-twin-tester:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-twin-tester:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}" } }, @@ -555,7 +558,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-deployment-tester:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-deployment-tester:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"NetworkMode\":\"host\"},\"NetworkingConfig\":{\"EndpointsConfig\":{\"host\":{}}}}" } }, @@ -576,118 +579,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-deployment-tester:-linux-", - "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}" - } - }, - "cloudToDeviceMessageSender1": { - "version": "1.0", - "type": "docker", - "status": "running", - "restartPolicy": "always", - "env": { - "C2DMESSAGE_TESTER_MODE": { - "value": "Sender" - }, - "IOT_HUB_CONNECTION_STRING": { - "value": "" - }, - "trackingId": { - "value": "" - }, - "testDuration": { - "value": "" - }, - "testStartDelay": { - "value": "" - }, - "ReportingEndpointUrl": { - "value": "http://localhost:5001" - } - }, - "settings": { - "image": "/microsoft/azureiotedge-c2dmessage-tester:-linux-", - "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"NetworkMode\":\"host\"},\"NetworkingConfig\":{\"EndpointsConfig\":{\"host\":{}}}}" - } - }, - "cloudToDeviceMessageReceiver1": { - "version": "1.0", - "type": "docker", - "status": "running", - "restartPolicy": "always", - "env": { - "C2DMESSAGE_TESTER_MODE": { - "value": "Receiver" - }, - "IOT_HUB_CONNECTION_STRING": { - "value": "" - }, - "transportType": { - "value": "Amqp" - }, - "ReportingEndpointUrl": { - "value": "http://testResultCoordinator:5001" - } - }, - "settings": { - "image": "/microsoft/azureiotedge-c2dmessage-tester:-linux-", - "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}" - } - }, - "cloudToDeviceMessageSender2": { - "version": "1.0", - "type": "docker", - "status": "running", - "restartPolicy": "always", - "env": { - "C2DMESSAGE_TESTER_MODE": { - "value": "Sender" - }, - "IOT_HUB_CONNECTION_STRING": { - "value": "" - }, - "trackingId": { - "value": "" - }, - "testDuration": { - "value": "" - }, - "testStartDelay": { - "value": "" - }, - "transportType": { - "value": "Mqtt" - }, - "ReportingEndpointUrl": { - "value": "http://localhost:5001" - } - }, - "settings": { - "image": "/microsoft/azureiotedge-c2dmessage-tester:-linux-", - "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"NetworkMode\":\"host\"},\"NetworkingConfig\":{\"EndpointsConfig\":{\"host\":{}}}}" - } - }, - "cloudToDeviceMessageReceiver2": { - "version": "1.0", - "type": "docker", - "status": "running", - "restartPolicy": "always", - "env": { - "C2DMESSAGE_TESTER_MODE": { - "value": "Receiver" - }, - "IOT_HUB_CONNECTION_STRING": { - "value": "" - }, - "transportType": { - "value": "Mqtt" - }, - "ReportingEndpointUrl": { - "value": "http://testResultCoordinator:5001" - } - }, - "settings": { - "image": "/microsoft/azureiotedge-c2dmessage-tester:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-deployment-tester:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}" } }, @@ -720,7 +612,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-network-controller:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-network-controller:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"Privileged\":\"true\",\"NetworkMode\":\"host\",\"Binds\":[\"/var/run/docker.sock:/var/run/docker.sock\"]},\"NetworkingConfig\":{\"EndpointsConfig\":{\"host\":{}}}}" } }, @@ -750,7 +642,7 @@ } }, "settings": { - "image": "/microsoft/azureiotedge-metrics-collector:-linux-", + "image": "$upstream:443/microsoft/azureiotedge-metrics-collector:-linux-", "createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"NetworkMode\":\"host\"},\"NetworkingConfig\":{\"EndpointsConfig\":{\"host\":{}}}}" } } @@ -759,7 +651,7 @@ }, "$edgeHub": { "properties.desired": { - "schemaVersion": "1.0", + "schemaVersion": "1.2", "routes": { "loadGen1ToRelayer1": "FROM /messages/modules/loadGen1/outputs/output1 INTO BrokeredEndpoint(\"/modules/relayer1/inputs/input1\")", "relayer1ToCloud": "FROM /messages/modules/relayer1/outputs/output1 INTO $upstream", @@ -768,6 +660,27 @@ }, "storeAndForwardConfiguration": { "timeToLiveSecs": 86400 + }, + "mqttBroker": { + "authorizations": [ + { + "identities": [ + "{{iot:identity}}" + ], + "allow": [ + { + "operations": [ + "mqtt:connect", + "mqtt:publish", + "mqtt:subscribe" + ], + "resources": [ + "#" + ] + } + ] + } + ] } } }, @@ -862,20 +775,6 @@ "TolerancePeriod": "00:01:00", "TestDescription": "edge agent ping" }, - "reportMetadata13": { - "TestReportType": "CountingReport", - "TestOperationResultType": "Messages", - "ExpectedSource": "cloudToDeviceMessageSender1.send", - "ActualSource": "cloudToDeviceMessageReceiver1.receive", - "TestDescription": "C2D | amqp" - }, - "reportMetadata14": { - "TestReportType": "CountingReport", - "TestOperationResultType": "Messages", - "ExpectedSource": "cloudToDeviceMessageSender2.send", - "ActualSource": "cloudToDeviceMessageReceiver2.receive", - "TestDescription": "C2D | mqtt" - }, "reportMetadata15": { "TestReportType": "NetworkControllerReport", "Source": "networkController", diff --git a/e2e_deployment_files/nestededge_middleLayerBaseDeployment_mqtt.json b/e2e_deployment_files/nestededge_middleLayerBaseDeployment_mqtt.json index d4997345300..8d5fd08ab72 100644 --- a/e2e_deployment_files/nestededge_middleLayerBaseDeployment_mqtt.json +++ b/e2e_deployment_files/nestededge_middleLayerBaseDeployment_mqtt.json @@ -30,7 +30,7 @@ "type": "docker", "settings": { "image": "$upstream:443/microsoft/azureiotedge-hub:-linux-", - "createOptions": "{\"HostConfig\": {\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"PortBindings\": {\"8883/tcp\": [{\"HostPort\": \"8883\"}],\"5671/tcp\": [{\"HostPort\": \"5671\"}]}}}" + "createOptions": "{\"HostConfig\": {\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"100m\",\"max-file\":\"7\"}}, \"PortBindings\": {\"8883/tcp\": [{\"HostPort\": \"8883\"}],\"5671/tcp\": [{\"HostPort\": \"5671\"}]}}}" }, "env": { "experimentalFeatures__enabled": { @@ -122,21 +122,6 @@ } ] } - ], - "bridges": [ - { - "endpoint": "$upstream", - "settings": [ - { - "direction": "in", - "topic": "relay/#" - }, - { - "direction": "out", - "topic": "initiate/#" - } - ] - } ] } } diff --git a/e2e_deployment_files/nestededge_topLayerBaseDeployment_mqtt.json b/e2e_deployment_files/nestededge_topLayerBaseDeployment_mqtt.json index c5e55bd85aa..80eaba2e8fa 100644 --- a/e2e_deployment_files/nestededge_topLayerBaseDeployment_mqtt.json +++ b/e2e_deployment_files/nestededge_topLayerBaseDeployment_mqtt.json @@ -32,7 +32,7 @@ "type": "docker", "settings": { "image": "/microsoft/azureiotedge-hub:-linux-", - "createOptions": "{\"HostConfig\": {\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"PortBindings\": {\"8883/tcp\": [{\"HostPort\": \"8883\"}],\"5671/tcp\": [{\"HostPort\": \"5671\"}]}}}" + "createOptions": "{\"HostConfig\": {\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"100m\",\"max-file\":\"7\"}}, \"PortBindings\": {\"8883/tcp\": [{\"HostPort\": \"8883\"}],\"5671/tcp\": [{\"HostPort\": \"5671\"}]}}}" }, "env": { "experimentalFeatures__enabled": { diff --git a/scripts/linux/trcE2ETest.sh b/scripts/linux/trcE2ETest.sh index 11c162c3680..13fb2abd584 100755 --- a/scripts/linux/trcE2ETest.sh +++ b/scripts/linux/trcE2ETest.sh @@ -161,7 +161,7 @@ function prepare_test_from_artifacts() { mkdir -p "$quickstart_working_folder" tar -C "$quickstart_working_folder" -xzf "$(get_artifact_file "$E2E_TEST_DIR" quickstart)" - echo "Copy deployment artifact to $deployment_working_file" + echo "Copy deployment artifact $DEPLOYMENT_FILE_NAME to $deployment_working_file" cp "$REPO_PATH/e2e_deployment_files/$DEPLOYMENT_FILE_NAME" "$deployment_working_file" sed -i -e "s@@$image_architecture_label@g" "$deployment_working_file"