diff --git a/builds/misc/addons-publish.yaml b/builds/misc/addons-publish.yaml index f53b222706..c4338c6f9f 100644 --- a/builds/misc/addons-publish.yaml +++ b/builds/misc/addons-publish.yaml @@ -54,9 +54,11 @@ jobs: filePath: '$(System.DefaultWorkingDirectory)/scripts/linux/moveImage.sh' arguments: '--from $(registry.address)/$(from.registry.namespace)/azureiotedge-api-proxy:$(version)-linux-arm64v8 --to $(registry.address)/$(to.registry.namespace)/azureiotedge-api-proxy:$(version)-linux-arm64v8' - - task: Bash@3 - displayName: 'Publish Api Proxy Manifest' - inputs: - targetType: filePath - filePath: '$(System.DefaultWorkingDirectory)/scripts/linux/buildManifest.sh' - arguments: '-r $(registry.address) -v $(version) -t $(System.DefaultWorkingDirectory)/edge-modules/api-proxy-module/docker/manifest.yaml.template -n $(to.registry.namespace) --tags "$(tags)"' \ No newline at end of file + - script: | + scripts/linux/buildManifest.sh \ + -r $(registry.address) \ + -i 'azureiotedge-api-proxy' \ + -v $(version) \ + -n $(to.registry.namespace) \ + --tags '$(tags)' + displayName: 'Publish Api Proxy Manifest' \ No newline at end of file diff --git a/builds/misc/addons-release.yaml b/builds/misc/addons-release.yaml index 01894fe301..f178498d91 100644 --- a/builds/misc/addons-release.yaml +++ b/builds/misc/addons-release.yaml @@ -91,8 +91,6 @@ stages: else echo '##vso[task.setvariable variable=buildVersion]$(version)' fi - sudo apt-get update && sudo apt-get -y install qemu binfmt-support qemu-user-static && \ - docker -v displayName: 'Set build version' - template: templates/image-linux.yaml parameters: @@ -100,7 +98,6 @@ stages: imageName: azureiotedge-api-proxy project: api-proxy-module version: $(buildVersion) - bin_dir: '$(Build.BinariesDirectory)' ################################################################################ - stage: PublishManifests @@ -114,10 +111,6 @@ stages: jobs: - job: PublishManifest displayName: Publish Manifest - strategy: - matrix: - ApiProxy: - manifestFilePath: '$(System.DefaultWorkingDirectory)/edge-modules/api-proxy-module/docker/manifest.yaml.template' steps: # Both docker logins needed for if we need to test this job. In this case images should go to edgebuilds. - task: Docker@2 @@ -137,7 +130,14 @@ stages: echo '##vso[task.setvariable variable=buildVersion]$(version)' fi displayName: 'Set build version' - - script: scripts/linux/buildManifest.sh -r $(registry.address) -v $(buildVersion) -t $(manifestFilePath) -n microsoft --tags "$(tags)" + - script: | + scripts/linux/buildManifest.sh \ + -r $(registry.address) \ + -i 'azureiotedge-api-proxy' \ + -v $(buildVersion) \ + -n 'microsoft' \ + --tags '$(tags)' + displayName: 'Create Api Proxy manifest' - job: ComponentGovernance steps: diff --git a/builds/misc/images-publish.yaml b/builds/misc/images-publish.yaml index b203674ed8..9b4f76181f 100644 --- a/builds/misc/images-publish.yaml +++ b/builds/misc/images-publish.yaml @@ -204,38 +204,38 @@ jobs: echo "##vso[task.setvariable variable=tempSensor.tags;]$TEMP_SENSOR_TAGS_STR" displayName: Set Version and Tags - - task: Bash@3 + - script: | + scripts/linux/buildManifest.sh \ + -r "$(to.registry.address)" \ + -i "azureiotedge-agent" \ + -v "$(resources.pipeline.images.runName)" \ + -n "$(to.registry.namespace)" \ + --tags '$(tags)' displayName: 'Publish Edge Agent Manifest' - inputs: - targetType: filePath - filePath: '$(System.DefaultWorkingDirectory)/scripts/linux/buildManifest.sh' - arguments: '-r "$(to.registry.address)" -v "$(resources.pipeline.images.runName)" -t $(System.DefaultWorkingDirectory)/edge-agent/docker/manifest.yaml.template -n "$(to.registry.namespace)" --tags "$(tags)"' - env: - BUILD_REPOSITORY_LOCALPATH: $(System.DefaultWorkingDirectory) - - task: Bash@3 + - script: | + scripts/linux/buildManifest.sh \ + -r "$(to.registry.address)" \ + -i "azureiotedge-hub" \ + -v "$(resources.pipeline.images.runName)" \ + -n "$(to.registry.namespace)" \ + --tags '$(tags)' displayName: 'Publish Edge Hub Manifest' - inputs: - targetType: filePath - filePath: '$(System.DefaultWorkingDirectory)/scripts/linux/buildManifest.sh' - arguments: '-r "$(to.registry.address)" -v "$(resources.pipeline.images.runName)" -t $(System.DefaultWorkingDirectory)/edge-hub/docker/manifest.yaml.template -n "$(to.registry.namespace)" --tags "$(tags)"' - env: - BUILD_REPOSITORY_LOCALPATH: $(System.DefaultWorkingDirectory) - - task: Bash@3 + - script: | + scripts/linux/buildManifest.sh \ + -r "$(to.registry.address)" \ + -i "azureiotedge-simulated-temperature-sensor" \ + -v "$(resources.pipeline.images.runName)" \ + -n "$(to.registry.namespace)" \ + --tags '$(tempSensor.tags)' displayName: 'Publish Temperature Sensor Manifest' - inputs: - targetType: filePath - filePath: '$(System.DefaultWorkingDirectory)/scripts/linux/buildManifest.sh' - arguments: '-r "$(to.registry.address)" -v "$(resources.pipeline.images.runName)" -t $(System.DefaultWorkingDirectory)/edge-modules/SimulatedTemperatureSensor/docker/manifest.yaml.template -n "$(to.registry.namespace)" --tags "$(tempSensor.tags)"' - env: - BUILD_REPOSITORY_LOCALPATH: $(System.DefaultWorkingDirectory) - - task: Bash@3 + - script: | + scripts/linux/buildManifest.sh \ + -r "$(to.registry.address)" \ + -i "azureiotedge-diagnostics" \ + -v "$(resources.pipeline.images.runName)" \ + -n "$(to.unlisted.registry.namespace)" \ + --tags '$(tags)' displayName: 'Publish Diagnostic Module Manifest' - inputs: - targetType: filePath - filePath: '$(System.DefaultWorkingDirectory)/scripts/linux/buildManifest.sh' - arguments: '-r "$(to.registry.address)" -v "$(resources.pipeline.images.runName)" -t $(System.DefaultWorkingDirectory)/edge-modules/iotedge-diagnostics-dotnet/docker/manifest.yaml.template -n "$(to.unlisted.registry.namespace)" --tags "$(tags)"' - env: - BUILD_REPOSITORY_LOCALPATH: $(System.DefaultWorkingDirectory) \ No newline at end of file diff --git a/builds/misc/images-release.yaml b/builds/misc/images-release.yaml index fc851d2615..624b536fcc 100644 --- a/builds/misc/images-release.yaml +++ b/builds/misc/images-release.yaml @@ -376,7 +376,6 @@ stages: name: "Edge Hub" project: Microsoft.Azure.Devices.Edge.Hub.Service version: $(version) - bin_dir: '$(Build.BinariesDirectory)' use_rocksdb: true - job: BuildImageEdgeAgent steps: @@ -386,7 +385,6 @@ stages: name: "Edge Agent" project: Microsoft.Azure.Devices.Edge.Agent.Service version: $(version) - bin_dir: '$(Build.BinariesDirectory)' use_rocksdb: true - job: BuildImageTemperatureSensor steps: @@ -396,7 +394,6 @@ stages: name: "Temperature Sensor" project: SimulatedTemperatureSensor version: $(version) - bin_dir: '$(Build.BinariesDirectory)' - job: BuildImageDiagnostics steps: - template: templates/image-linux.yaml @@ -405,7 +402,6 @@ stages: name: "Diagnostics Module" project: IotedgeDiagnosticsDotnet version: $(version) - bin_dir: '$(Build.BinariesDirectory)' ################################################################################ - stage: PublishManifests @@ -422,13 +418,13 @@ stages: strategy: matrix: EdgeAgent: - manifestFilePath: '$(System.DefaultWorkingDirectory)/edge-agent/docker/manifest.yaml.template' + imageName: 'azureiotedge-agent' EdgeHub: - manifestFilePath: '$(System.DefaultWorkingDirectory)/edge-hub/docker/manifest.yaml.template' + imageName: 'azureiotedge-hub' SimulatedTemperatureSensor: - manifestFilePath: '$(System.DefaultWorkingDirectory)/edge-modules/SimulatedTemperatureSensor/docker/manifest.yaml.template' + imageName: 'azureiotedge-simulated-temperature-sensor' Diagnostics: - manifestFilePath: '$(System.DefaultWorkingDirectory)/edge-modules/iotedge-diagnostics-dotnet/docker/manifest.yaml.template' + imageName: 'azureiotedge-diagnostics' steps: # Both docker logins needed for if we need to test this job. In this case images should go to edgebuilds. - task: Docker@2 @@ -441,4 +437,11 @@ stages: inputs: command: login containerRegistry: iotedge-release-acr - - script: scripts/linux/buildManifest.sh -r $(registry.address) -v $(version) -t $(manifestFilePath) -n '$(namespace)' --tags "$(tags)" \ No newline at end of file + - script: | + scripts/linux/buildManifest.sh \ + -r $(registry.address) \ + -i $(imageName) \ + -v $(version) \ + -n '$(namespace)' \ + --tags '$(tags)' + displayName: Create manifest for '$(imageName)' diff --git a/builds/misc/templates/build-api-proxy.yaml b/builds/misc/templates/build-api-proxy.yaml index 91fbac696b..1c44cb2b68 100644 --- a/builds/misc/templates/build-api-proxy.yaml +++ b/builds/misc/templates/build-api-proxy.yaml @@ -1,9 +1,7 @@ parameters: name: 'API proxy' - imageName: 'api-proxy-module' project: 'api-proxy-module' configuration: 'release' - filePath: 'scripts/linux/buildAPIProxy.sh' binDir: '$(Build.BinariesDirectory)' jobs: @@ -19,18 +17,13 @@ jobs: arm64: arch: "aarch64" steps: - - bash: | - sudo apt-get update && sudo apt-get -y install qemu binfmt-support qemu-user-static && \ - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && \ - docker buildx rm mbuilder || true && \ - docker buildx create --name mbuilder || true && \ - docker buildx use mbuilder - docker -v - - task: Bash@3 + - script: | + scripts/linux/buildAPIProxy.sh \ + -P ${{ parameters.project }} \ + -c ${{ parameters.configuration }} \ + --target-arch $(arch) \ + --bin-dir ${{ parameters.binDir }} displayName: Build API-Proxy - $(arch) - inputs: - filePath: ${{ parameters.filePath }} - arguments: -i ${{ parameters.imageName }} -P ${{ parameters.project }} -c ${{ parameters.configuration }} --target-arch $(arch) --bin-dir ${{ parameters.binDir }} - task: PublishBuildArtifacts@1 inputs: pathtoPublish: '${{ parameters.binDir }}/publish' diff --git a/builds/misc/templates/build-images.yaml b/builds/misc/templates/build-images.yaml index 7a7792b966..6244b8ac08 100644 --- a/builds/misc/templates/build-images.yaml +++ b/builds/misc/templates/build-images.yaml @@ -157,11 +157,11 @@ stages: steps: - template: image-linux.yaml parameters: - name: Edge Agent - imageName: azureiotedge-agent - project: Microsoft.Azure.Devices.Edge.Agent.Service - bin_dir: '$(Build.BinariesDirectory)' - use_rocksdb: true + name: Edge Agent + imageName: azureiotedge-agent + project: Microsoft.Azure.Devices.Edge.Agent.Service + version: $(Build.BuildNumber) + use_rocksdb: true - job: BuildImageEdgeHub steps: @@ -170,7 +170,7 @@ stages: name: Edge Hub imageName: azureiotedge-hub project: Microsoft.Azure.Devices.Edge.Hub.Service - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) use_rocksdb: true - job: BuildImageTemperatureSensor @@ -180,7 +180,7 @@ stages: name: Temperature Sensor imageName: azureiotedge-simulated-temperature-sensor project: SimulatedTemperatureSensor - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) - job: BuildImageDiagnostics steps: @@ -189,7 +189,7 @@ stages: name: Diagnostics imageName: azureiotedge-diagnostics project: IotedgeDiagnosticsDotnet - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) - job: BuildImageTemperatureFilter steps: @@ -198,7 +198,7 @@ stages: name: Temperature Filter imageName: azureiotedge-temperature-filter project: TemperatureFilter - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) - job: BuildImageLoadGen steps: @@ -207,7 +207,8 @@ stages: name: Load Gen imageName: azureiotedge-load-gen project: load-gen - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) + - job: BuildImageTestAnalyzer steps: - template: image-linux.yaml @@ -215,7 +216,7 @@ stages: name: Test Analyzer imageName: azureiotedge-analyzer project: TestAnalyzer - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) use_rocksdb: true # Functions Sample - Not supported on linux arm64 @@ -226,7 +227,7 @@ stages: name: Functions Sample imageName: azureiotedge-functions-filter project: EdgeHubTriggerCSharp - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) - job: BuildImageDirectMethodSender steps: @@ -235,7 +236,7 @@ stages: name: Direct Method Sender imageName: azureiotedge-direct-method-sender project: DirectMethodSender - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) - job: BuildImageDirectMethodReceiver steps: @@ -244,7 +245,7 @@ stages: name: Direct Method Receiver imageName: azureiotedge-direct-method-receiver project: DirectMethodReceiver - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) - job: BuildImageMetricsValidator steps: @@ -253,7 +254,7 @@ stages: name: Metrics Validator imageName: azureiotedge-metrics-validator project: MetricsValidator - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) - job: BuildImageNumberLogger steps: @@ -262,7 +263,7 @@ stages: name: Number Logger imageName: azureiotedge-number-logger project: NumberLogger - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) - job: BuildImageModuleRestarter steps: @@ -271,7 +272,7 @@ stages: name: Module Restarter imageName: azureiotedge-module-restarter project: ModuleRestarter - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) - job: BuildImageTwinTester steps: @@ -280,8 +281,9 @@ stages: name: TwinTester imageName: azureiotedge-twin-tester project: TwinTester - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) use_rocksdb: true + - job: BuildImageRelayer steps: - template: image-linux.yaml @@ -289,7 +291,7 @@ stages: name: Relayer imageName: azureiotedge-relayer project: Relayer - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) - job: BuildImageNetworkController steps: @@ -298,7 +300,7 @@ stages: name: Network Controller imageName: azureiotedge-network-controller project: NetworkController - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) use_rocksdb: true - job: BuildImageTestResultCoordinator @@ -308,7 +310,7 @@ stages: name: TestResultCoordinator imageName: azureiotedge-test-result-coordinator project: TestResultCoordinator - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) use_rocksdb: true - job: BuildImageTestMetricsCollector @@ -318,8 +320,7 @@ stages: name: Test Metrics Collector imageName: azureiotedge-test-metrics-collector project: TestMetricsCollector - bin_dir: '$(Build.BinariesDirectory)' - + version: $(Build.BuildNumber) - job: BuildImageDeploymentTester steps: @@ -328,8 +329,7 @@ stages: name: DeploymentTester imageName: azureiotedge-deployment-tester project: DeploymentTester - bin_dir: '$(Build.BinariesDirectory)' - + version: $(Build.BuildNumber) - job: BuildImageEdgeHubRestartTester steps: @@ -338,7 +338,7 @@ stages: name: EdgeHubRestartTester imageName: azureiotedge-edgehub-restart-tester project: EdgeHubRestartTester - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) - job: BuildImageCloudToDeviceMessageTester steps: @@ -347,7 +347,7 @@ stages: name: Cloud To Device Message Tester imageName: azureiotedge-c2dmessage-tester project: CloudToDeviceMessageTester - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) - job: BuildImageMetricsCollector steps: @@ -356,19 +356,16 @@ stages: name: Metrics Collector imageName: azureiotedge-metrics-collector project: Microsoft.Azure.Devices.Edge.Azure.Monitor - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) - job: BuildImageApiProxy steps: - - bash: | - sudo apt-get update && sudo apt-get -y install qemu binfmt-support qemu-user-static && \ - docker -v - template: image-linux.yaml parameters: name: API Proxy imageName: azureiotedge-api-proxy project: api-proxy-module - bin_dir: '$(Build.BinariesDirectory)' + version: $(Build.BuildNumber) ################################################################################ - stage: PublishManifests @@ -380,24 +377,24 @@ stages: - ImageOverride -equals agent-aziotedge-ubuntu-20.04-docker dependsOn: BuildImages variables: - tags: "['latest']" + tags: '["latest"]' jobs: - job: PublishManifest displayName: Publish Manifest strategy: matrix: EdgeAgent: - manifestFilePath: '$(System.DefaultWorkingDirectory)/edge-agent/docker/manifest.yaml.template' + imageName: 'azureiotedge-agent' EdgeHub: - manifestFilePath: '$(System.DefaultWorkingDirectory)/edge-hub/docker/manifest.yaml.template' + imageName: 'azureiotedge-hub' SimulatedTemperatureSensor: - manifestFilePath: '$(System.DefaultWorkingDirectory)/edge-modules/SimulatedTemperatureSensor/docker/manifest.yaml.template' + imageName: 'azureiotedge-simulated-temperature-sensor' Diagnostics: - manifestFilePath: '$(System.DefaultWorkingDirectory)/edge-modules/iotedge-diagnostics-dotnet/docker/manifest.yaml.template' + imageName: 'azureiotedge-diagnostics' MetricsCollector: - manifestFilePath: '$(System.DefaultWorkingDirectory)/edge-modules/metrics-collector/docker/manifest.yaml.template' + imageName: 'azureiotedge-metrics-collector' ApiProxy: - manifestFilePath: '$(System.DefaultWorkingDirectory)/edge-modules/api-proxy-module/docker/manifest.yaml.template' + imageName: 'azureiotedge-api-proxy' steps: - task: Docker@2 displayName: Docker login edgebuilds @@ -405,7 +402,14 @@ stages: command: login containerRegistry: iotedge-edgebuilds-acr - - script: scripts/linux/buildManifest.sh -r $(registry.address) -v $(Build.BuildNumber) -t $(manifestFilePath) -n microsoft --tags "$(tags)" + - script: | + scripts/linux/buildManifest.sh \ + -r $(registry.address) \ + -i $(imageName) \ + -v $(Build.BuildNumber) \ + -n 'microsoft' \ + --tags '$(tags)' + displayName: Create manifest for '$(imageName)' - job: ComponentGovernance steps: diff --git a/builds/misc/templates/build-rocksdb.yaml b/builds/misc/templates/build-rocksdb.yaml index 708bc7d706..f4064a9e51 100644 --- a/builds/misc/templates/build-rocksdb.yaml +++ b/builds/misc/templates/build-rocksdb.yaml @@ -7,17 +7,14 @@ jobs: pool_name: $(pool.linux.name) agent_image: agent-aziotedge-ubuntu-20.04-docker arch: amd64 - postfix: amd64 arm32: pool_name: $(pool.linux.arm.name) agent_image: agent-aziotedge-ubuntu-20.04-arm64-docker arch: arm32v7 - postfix: armhf arm64: pool_name: $(pool.linux.arm.name) agent_image: agent-aziotedge-ubuntu-20.04-arm64-docker arch: arm64v8 - postfix: arm64 pool: name: $(pool_name) demands: @@ -29,7 +26,6 @@ jobs: /usr/bin/newgrp docker < /dev/null; then - echo "--source-map specified, but required tool 'gnarly' not found in PATH" + echo '--source-map specified, but required tool 'gnarly' not found in PATH' print_help_and_exit fi - DOCKERFILE="$EXE_DOCKER_DIR/linux/$ARCH/Dockerfile" - if [[ ! -f ${DOCKERFILE} ]]; then - echo "No Dockerfile at $DOCKERFILE" - print_help_and_exit + dockerfile1="$EXE_DOCKER_DIR/linux/Dockerfile" + if [[ -f "$dockerfile1" ]]; then + DOCKERFILE="$dockerfile1" + else + arch=$(convert_arch $ARCH) + dockerfile2="$EXE_DOCKER_DIR/linux/$arch/Dockerfile" + if [[ -f "$dockerfile2" ]]; then + DOCKERFILE="$dockerfile2" + else + echo "No Dockerfile at '$dockerfile1' or '$dockerfile2'" + print_help_and_exit + fi fi } @@ -171,7 +199,7 @@ process_args() { # Build docker image and push it to private repo # # @param[1] - imagename; Name of the docker edge image to publish; Required; -# @param[2] - arch; Arch of base image; Required; +# @param[2] - arch; Architectures to build; Required; # @param[3] - dockerfile; Path to the dockerfile; Required; # @param[4] - context_path; docker context path; Required; # @param[5] - build_args; docker context path; Optional; @@ -183,28 +211,25 @@ docker_build_and_tag_and_push() { dockerfile="$3" context_path="$4" build_args="$5" + build_context='' if [[ -z "$imagename" ]] || [[ -z "$arch" ]] || [[ -z "$dockerfile" ]] || [[ -z "$context_path" ]]; then echo "Error: Arguments are invalid [$imagename] [$arch] [$dockerfile] [$context_path]" exit 1 fi - image="$DOCKER_REGISTRY/$DOCKER_NAMESPACE/$imagename:$DOCKER_IMAGEVERSION-linux-$arch" - - case "$arch" in - 'amd64') platform='linux/amd64' ;; - 'arm32v7') platform='linux/arm/v7' ;; - 'arm64v8') platform='linux/arm64' ;; - esac - docker buildx create --use --bootstrap trap "docker buildx rm" EXIT + suffix=$(convert_arch $arch) + image="$DOCKER_REGISTRY/$DOCKER_NAMESPACE/$imagename:$DOCKER_IMAGEVERSION-linux-$suffix" + platform="linux/$arch" + if [[ ${SKIP_PUSH} -eq 0 ]]; then - attrs='type=image,push=true' + output_type='registry' echo "Building and pushing image '$image'" else - attrs='type=docker' + output_type='docker' echo "Building image '$image', skipping push" fi @@ -212,37 +237,21 @@ docker_build_and_tag_and_push() { build_context=$(gnarly --mod-config $SOURCE_MAP $dockerfile) fi - # When Docker introduced provenance attestation in buildx 0.10.0 it broke - # our multi-arch image builds. By default, `buildx build` now defaults to - # `--provenance true` which causes even single-architecture images to be - # built as a manifest list (aka multi-arch image). When we use our older - # manifest-tool to create a manifest from three single-arch images (amd64, - # arm32v7, and arm64v8), the tool fails because it can't create a manifest - # list that points to other manifest lists. To mitigate, we'll disable - # provenance attestation for now. docker buildx build \ --no-cache \ --platform $platform \ - --provenance false \ - --build-arg 'EXE_DIR=.' \ + $([ -z "$build_args" ] || echo $build_args) \ --file $dockerfile \ - --output=$attrs,name=$image,buildinfo-attrs=true \ + --output=type=$output_type,name=$image,buildinfo-attrs=true \ $([ -z "$build_context" ] || echo $build_context) \ $context_path - - if [[ $? -ne 0 ]]; then - echo "Docker build failed with exit code $?" - exit 1 - fi - - return $? } ############################################################################### # Main Script Execution ############################################################################### check_arch -process_args "$@" +process_args $@ build_args=("EXE_DIR=.") diff --git a/scripts/linux/buildLocalEdgeHub.sh b/scripts/linux/buildLocalEdgeHub.sh index 9a16901823..2a06f8bd92 100755 --- a/scripts/linux/buildLocalEdgeHub.sh +++ b/scripts/linux/buildLocalEdgeHub.sh @@ -19,9 +19,9 @@ function usage() { echo "$SCRIPT_NAME [options]" echo "" echo "options" - echo "--registry-address Path where to put librocksdb folder containing built artifact." - echo "--version Tag for built edge hub image." - echo " -h, --help Print this help and exit." + echo "--registry-address Docker registry where Edge Hub image will be published." + echo "--version Tag for built edge hub image." + echo " -h, --help Print this help and exit." exit 1 } @@ -56,5 +56,5 @@ function process_args() { process_args "$@" scripts/linux/buildBranch.sh --no-rocksdb-bin -scripts/linux/buildRocksDb.sh --output-dir "$(pwd)/target/publish/Microsoft.Azure.Devices.Edge.Hub.Service" --postfix amd64 --build-number debug --arch amd64 -scripts/linux/buildImage.sh -r "$REGISTRY_ADDRESS" -i azureiotedge-hub -n microsoft -P Microsoft.Azure.Devices.Edge.Hub.Service -v "$VERSION" --bin-dir target +scripts/linux/buildRocksDb.sh --output-dir "$(pwd)/target/publish/Microsoft.Azure.Devices.Edge.Hub.Service" --build-number debug --arch amd64 +scripts/linux/buildImage.sh -r "$REGISTRY_ADDRESS" -i azureiotedge-hub -n microsoft -P Microsoft.Azure.Devices.Edge.Hub.Service -v "$VERSION" -t amd64 --bin-dir target diff --git a/scripts/linux/buildManifest.sh b/scripts/linux/buildManifest.sh index fa611edfec..62d4a21005 100755 --- a/scripts/linux/buildManifest.sh +++ b/scripts/linux/buildManifest.sh @@ -1,30 +1,56 @@ #!/bin/bash ############################################################################### -# This script builds a multi-architecture manifest image using the -# manifest tool in the bin directory. -# This script expects that the individual images have been built, tagged, and -# pushed to the registry. +# This script builds a multi-architecture manifest image. It expects that the +# the individual images already exist in the destination registry. ############################################################################### -set -e +set -euo pipefail ############################################################################### # Define Environment Variables ############################################################################### SCRIPT_NAME=$(basename $0) - -# Get directory of running script DIR=$(cd "$(dirname "$0")" && pwd) -BUILD_REPOSITORY_LOCALPATH=${BUILD_REPOSITORY_LOCALPATH:-$DIR/../..} -ROOT_FOLDER=$BUILD_REPOSITORY_LOCALPATH -# Holds the list of tags to apply -DOCKER_TAGS="[]" -DEFAULT_DOCKER_NAMESPACE="microsoft" +DEFAULT_ARCH='amd64,arm64,arm/v7' +ARCH=$DEFAULT_ARCH +DOCKER_TAGS='[]' +DEFAULT_DOCKER_NAMESPACE='microsoft' DOCKER_NAMESPACE=$DEFAULT_DOCKER_NAMESPACE -DOCKER_IMAGE_NAME="" -IGNORE_MISSING="" +DOCKER_IMAGE_NAME= +IGNORE_MISSING= + +############################################################################### +# Check format and content of --target-arch argument +############################################################################### +check_arch() { + IFS=',' read -a architectures <<< "$ARCH" + for arch in ${architectures[@]} + do + case "$arch" in + 'amd64'|'arm64'|'arm/v7') ;; + *) echo "Unsupported architecture '$arch'" && exit 1 ;; + esac + done +} + +############################################################################### +# Convert from the format of the --target-arch argument to the format we use in +# our image tags. Docker defines the former (amd64, arm64, or arm/v7; see +# Docker's TARGETARCH automatic variable[1]), we define the latter (amd64, +# arm64v8, and arm32v7). +# [1] https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope +############################################################################### +convert_arch() { + arch="$1" + case "$arch" in + 'amd64') echo 'amd64' ;; + 'arm64') echo 'arm64v8' ;; + 'arm/v7') echo 'arm32v7' ;; + *) echo "Unsupported architecture '$arch'" && exit 1 ;; + esac +} ############################################################################### # Print usage information pertaining to this script and exit @@ -35,13 +61,12 @@ usage() echo "Note: Depending on the options you might have to run this as root or sudo." echo "" echo "options" - echo " -r, --registry Docker registry required to build, tag and run the module" - echo " -n, --namespace Docker namespace (default: $DEFAULT_DOCKER_NAMESPACE)" - echo " -i, --image-name Docker image name (Optional if specified in template yaml)" - echo " -v, --image-version Docker Image Version." - echo " -t, --template Yaml file template for manifest definition." - echo " --tags Additional tags to add to the docker image. Specify as a list of strings. e.g. --tags \"['1.0']\"" - echo " --ignore-missing Ignore missing images in manifest" + echo " -r, --registry Docker registry required to build, tag and run the module" + echo " -n, --namespace Docker namespace (default: $DEFAULT_DOCKER_NAMESPACE)" + echo " -i, --image-name Docker image name" + echo " -v, --image-version Docker image version. Assumes arch-specific images have the same tag with '-linux-{arch] appended'" + echo " -t, --target-arch Comma-separated list of architectures to combine into multi-arch image (default: $DEFAULT_ARCH)" + echo " --tags Add tags to the docker image. Specify as a JSON array of strings, e.g., --tags '[\"1.0\"]'" exit 1; } @@ -63,52 +88,53 @@ process_args() DOCKER_REGISTRY="$arg" save_next_arg=0 elif [ $save_next_arg -eq 2 ]; then - DOCKER_IMAGEVERSION="$arg" - save_next_arg=0 - elif [ $save_next_arg -eq 3 ]; then - YAML_TEMPLATE="$arg" - save_next_arg=0 - elif [ $save_next_arg -eq 4 ]; then - DOCKER_TAGS="$arg" - save_next_arg=0 - elif [ $save_next_arg -eq 5 ]; then DOCKER_NAMESPACE="$arg" save_next_arg=0 - elif [ $save_next_arg -eq 6 ]; then + elif [ $save_next_arg -eq 3 ]; then DOCKER_IMAGE_NAME="$arg" save_next_arg=0 + elif [ $save_next_arg -eq 4 ]; then + DOCKER_IMAGEVERSION="$arg" + save_next_arg=0 + elif [ $save_next_arg -eq 5 ]; then + ARCH="$arg" + check_arch + save_next_arg=0 + elif [ $save_next_arg -eq 6 ]; then + DOCKER_TAGS="$arg" + save_next_arg=0 else case "$arg" in "-h" | "--help" ) usage;; "-r" | "--registry" ) save_next_arg=1;; - "-v" | "--image-version" ) save_next_arg=2;; - "-t" | "--template" ) save_next_arg=3;; - "--tags" ) save_next_arg=4;; - "-n" | "--namespace" ) save_next_arg=5;; - "-i" | "--image-name" ) save_next_arg=6;; - "--ignore-missing" ) IGNORE_MISSING="--ignore-missing";; + "-n" | "--namespace" ) save_next_arg=2;; + "-i" | "--image-name" ) save_next_arg=3;; + "-v" | "--image-version" ) save_next_arg=4;; + "-t" | "--target-arch" ) save_next_arg=5;; + "--tags" ) save_next_arg=6;; * ) usage;; esac fi done - if [[ -z ${DOCKER_REGISTRY} ]]; then - echo "Registry Parameter Invalid" + if [[ -z "$DOCKER_REGISTRY" ]]; then + echo 'The --registry parameter is required' print_help_and_exit fi - if [[ -z ${DOCKER_IMAGEVERSION} ]]; then - echo "Docker image version not found." + if [[ -z "$DOCKER_IMAGE_NAME" ]]; then + echo 'The --image-name parameter is required' print_help_and_exit fi - if [[ -z ${YAML_TEMPLATE} ]]; then - echo "Template file not found." + if [[ -z "$DOCKER_IMAGEVERSION" ]]; then + echo 'The --image-version parameter is required' print_help_and_exit fi - if [[ -z ${DOCKER_IMAGE_NAME} ]]; then - echo "Docker image name not set, assuming name in template" + if [[ $(echo "$DOCKER_TAGS" | jq -r '. | type') != 'array' ]]; then + echo 'The value of --tags must be a JSON array' + print_help_and_exit fi } @@ -117,26 +143,24 @@ process_args() ############################################################################### process_args $@ -# Create temp file to store modified yaml file -manifest=$(mktemp /tmp/manifest.yaml.XXXXXX) -[ $? -eq 0 ] || exit $? +image_name="$DOCKER_REGISTRY/$DOCKER_NAMESPACE/$DOCKER_IMAGE_NAME" +arch_digests=() -sed "s/__REGISTRY__/${DOCKER_REGISTRY}/g; s/__VERSION__/${DOCKER_IMAGEVERSION}/g; s/__TAGS__/${DOCKER_TAGS}/g; s/__NAMESPACE__/${DOCKER_NAMESPACE}/g; s/__NAME__/${DOCKER_IMAGE_NAME}/g;" $YAML_TEMPLATE > $manifest -[ $? -eq 0 ] || exit $? +IFS=',' read -a architectures <<< "$ARCH" +for arch in ${architectures[@]} +do + image="$image_name:$DOCKER_IMAGEVERSION-linux-$(convert_arch $arch)" + arch_digests+=( $(docker buildx imagetools inspect $image --format '{{json .Manifest}}' | + jq --arg arch "$arch" -r '.manifests[] | + select($arch == ([.platform | (.architecture, .variant // empty)] | join("/"))) | + .digest') ) +done -echo "Build image with following manifest:" -cat $manifest +# combine the primary tag (e.g., '1.4.0') and any caller-supplied tags into an array +tags=( $(echo "$DOCKER_TAGS" | + jq -r --arg primary_tag "$DOCKER_IMAGEVERSION" '. + [ $primary_tag ] | unique | join("\n")') ) -# Download and execute the manifest tool -curl -Lo /tmp/manifest-tool 'https://edgebuild.blob.core.windows.net/iotedge-win-arm32v7-tools/manifest-tool-linux-amd64' && - chmod +x /tmp/manifest-tool && - /tmp/manifest-tool --debug push from-spec $IGNORE_MISSING $manifest - -echo "Done Building And Pushing Docker Images" - - -[ $? -eq 0 ] || exit $? - -# Remove the temp file -rm $manifest -[ $? -eq 0 ] || exit $? +# build the multi-arch image with all given tags, using all given arch-specific images as sources +docker buildx imagetools create \ + ${tags[@]/#/--tag $image_name:} \ + "${arch_digests[@]/#/$image_name@}" diff --git a/scripts/linux/buildRocksDb.sh b/scripts/linux/buildRocksDb.sh index 927ab209ef..738a598f07 100755 --- a/scripts/linux/buildRocksDb.sh +++ b/scripts/linux/buildRocksDb.sh @@ -16,7 +16,6 @@ SCRIPT_NAME=$(basename "$0") ARCH= BUILD_NUMBER= OUTPUT_DIR= -POSTFIX= SOURCE_MAP= ############################################################################### @@ -26,8 +25,7 @@ function usage() { echo "$SCRIPT_NAME [options]" echo "" echo "options" - echo "--output-dir Path where to put librocksdb folder containing built artifact." - echo "--postfix Options: amd64, armhf, arm64." + echo "--output-dir Path to librocksdb folder that contains resulting binaries." echo "--build-number Build number for which to tag image." echo "--arch Options: amd64, arm32v7, arm64v8." echo "--source-map Path to the JSON file that maps Dockerfile image sources to their replacements. Assumes the tool 'gnarly' is in the PATH" @@ -50,30 +48,33 @@ function process_args() { OUTPUT_DIR=$arg save_next_arg=0 elif [ ${save_next_arg} -eq 2 ]; then - POSTFIX=$arg - save_next_arg=0 - elif [ ${save_next_arg} -eq 3 ]; then BUILD_NUMBER=$arg save_next_arg=0 - elif [ ${save_next_arg} -eq 4 ]; then + elif [ ${save_next_arg} -eq 3 ]; then ARCH=$arg save_next_arg=0 - elif [[ ${save_next_arg} -eq 5 ]]; then + elif [[ ${save_next_arg} -eq 4 ]]; then SOURCE_MAP="$arg" save_next_arg=0 else case "$arg" in "-h" | "--help") usage ;; "--output-dir") save_next_arg=1 ;; - "--postfix") save_next_arg=2 ;; - "--build-number") save_next_arg=3 ;; - "--arch") save_next_arg=4 ;; - "--source-map") save_next_arg=5 ;; + "--build-number") save_next_arg=2 ;; + "--arch") save_next_arg=3 ;; + "--source-map") save_next_arg=4 ;; *) usage ;; esac fi done + if [ ! -d "$OUTPUT_DIR" ]; then + echo "Value '$OUTPUT_DIR' specified by --output-dir is not a valid directory" + print_help_and_exit + fi + + OUTPUT_DIR=$(realpath $OUTPUT_DIR) + if [[ -n "$SOURCE_MAP" ]] && [[ ! -f "$SOURCE_MAP" ]]; then echo "File specified by --source-map does not exist" print_help_and_exit @@ -88,15 +89,14 @@ function process_args() { process_args "$@" case "$ARCH" in -'amd64') platform='linux/amd64' ;; -'arm32v7') platform='linux/arm/v7' ;; -'arm64v8') platform='linux/arm64' ;; -*) echo "Unrecognized platform '$ARCH'" && exit 1 + 'amd64') platform='linux/amd64' ;; + 'arm32v7') platform='linux/arm/v7' ;; + 'arm64v8') platform='linux/arm64' ;; + *) echo "Unrecognized platform '$ARCH'" && exit 1 esac -build_image=rocksdb-build:main-$POSTFIX-$BUILD_NUMBER -mkdir -p $OUTPUT_DIR/librocksdb -cd $BUILD_REPOSITORY_LOCALPATH/edge-util/docker/linux/$ARCH +build_image=rocksdb-build:main-$ARCH-$BUILD_NUMBER +cd $BUILD_REPOSITORY_LOCALPATH/edge-util/docker/linux build_context= if [[ -n "$SOURCE_MAP" ]]; then @@ -113,4 +113,9 @@ docker buildx build \ $([ -z "$build_context" ] || echo $build_context) \ . -docker run --rm -v $OUTPUT_DIR/librocksdb:/artifacts $build_image cp /publish/librocksdb.so.$POSTFIX /artifacts +docker run \ + --rm \ + --platform $platform \ + -v $OUTPUT_DIR/librocksdb/$platform:/artifacts/$platform \ + $build_image \ + cp /publish/$platform/librocksdb.so /artifacts/$platform/ diff --git a/scripts/linux/docker/manifest.yaml.template b/scripts/linux/docker/manifest.yaml.template deleted file mode 100644 index 7c470c31ac..0000000000 --- a/scripts/linux/docker/manifest.yaml.template +++ /dev/null @@ -1,18 +0,0 @@ -image: __REGISTRY__/__NAMESPACE__/__NAME__:__VERSION__ -tags: __TAGS__ -manifests: - - - image: __REGISTRY__/__NAMESPACE__/__NAME__:__VERSION__-linux-amd64 - platform: - architecture: amd64 - os: linux - - - image: __REGISTRY__/__NAMESPACE__/__NAME__:__VERSION__-linux-arm32v7 - platform: - architecture: arm - os: linux - - - image: __REGISTRY__/__NAMESPACE__/__NAME__:__VERSION__-linux-arm64v8 - platform: - architecture: aarch64 - os: linux diff --git a/test/connectivity/modules/NetworkController/NetworkController.csproj b/test/connectivity/modules/NetworkController/NetworkController.csproj index 638e4ebb2a..25d4b63521 100644 --- a/test/connectivity/modules/NetworkController/NetworkController.csproj +++ b/test/connectivity/modules/NetworkController/NetworkController.csproj @@ -10,9 +10,7 @@ - - - + diff --git a/test/connectivity/modules/NetworkController/docker/linux/amd64/Dockerfile b/test/connectivity/modules/NetworkController/docker/linux/Dockerfile similarity index 100% rename from test/connectivity/modules/NetworkController/docker/linux/amd64/Dockerfile rename to test/connectivity/modules/NetworkController/docker/linux/Dockerfile diff --git a/test/connectivity/modules/NetworkController/docker/linux/arm32v7/Dockerfile b/test/connectivity/modules/NetworkController/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index 36931b0890..0000000000 --- a/test/connectivity/modules/NetworkController/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine - -ARG EXE_DIR=. - -RUN apk update && \ - apk add --no-cache iproute2 - -ENV MODULE_NAME "NetworkController.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet NetworkController.dll diff --git a/test/connectivity/modules/NetworkController/docker/linux/arm64v8/Dockerfile b/test/connectivity/modules/NetworkController/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index 36931b0890..0000000000 --- a/test/connectivity/modules/NetworkController/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine - -ARG EXE_DIR=. - -RUN apk update && \ - apk add --no-cache iproute2 - -ENV MODULE_NAME "NetworkController.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet NetworkController.dll diff --git a/test/modules/CloudToDeviceMessageTester/docker/linux/amd64/Dockerfile b/test/modules/CloudToDeviceMessageTester/docker/linux/Dockerfile similarity index 100% rename from test/modules/CloudToDeviceMessageTester/docker/linux/amd64/Dockerfile rename to test/modules/CloudToDeviceMessageTester/docker/linux/Dockerfile diff --git a/test/modules/CloudToDeviceMessageTester/docker/linux/arm32v7/Dockerfile b/test/modules/CloudToDeviceMessageTester/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index 53df3af415..0000000000 --- a/test/modules/CloudToDeviceMessageTester/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "CloudToDeviceMessageTester.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet CloudToDeviceMessageTester.dll diff --git a/test/modules/CloudToDeviceMessageTester/docker/linux/arm64v8/Dockerfile b/test/modules/CloudToDeviceMessageTester/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index 53df3af415..0000000000 --- a/test/modules/CloudToDeviceMessageTester/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "CloudToDeviceMessageTester.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet CloudToDeviceMessageTester.dll diff --git a/test/modules/DeploymentTester/docker/linux/amd64/Dockerfile b/test/modules/DeploymentTester/docker/linux/Dockerfile similarity index 100% rename from test/modules/DeploymentTester/docker/linux/amd64/Dockerfile rename to test/modules/DeploymentTester/docker/linux/Dockerfile diff --git a/test/modules/DeploymentTester/docker/linux/arm32v7/Dockerfile b/test/modules/DeploymentTester/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index 508ddcd04c..0000000000 --- a/test/modules/DeploymentTester/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "DeploymentTester.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet DeploymentTester.dll diff --git a/test/modules/DeploymentTester/docker/linux/arm64v8/Dockerfile b/test/modules/DeploymentTester/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index 508ddcd04c..0000000000 --- a/test/modules/DeploymentTester/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "DeploymentTester.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet DeploymentTester.dll diff --git a/test/modules/DirectMethodReceiver/docker/linux/amd64/Dockerfile b/test/modules/DirectMethodReceiver/docker/linux/Dockerfile similarity index 100% rename from test/modules/DirectMethodReceiver/docker/linux/amd64/Dockerfile rename to test/modules/DirectMethodReceiver/docker/linux/Dockerfile diff --git a/test/modules/DirectMethodReceiver/docker/linux/arm32v7/Dockerfile b/test/modules/DirectMethodReceiver/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index a73d3e11bb..0000000000 --- a/test/modules/DirectMethodReceiver/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "DirectMethodReceiver.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"[%Y-%m-%d %H:%M:%S %:z]"): Starting Module" && \ - exec /usr/bin/dotnet DirectMethodReceiver.dll diff --git a/test/modules/DirectMethodReceiver/docker/linux/arm64v8/Dockerfile b/test/modules/DirectMethodReceiver/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index 4bc701cb3e..0000000000 --- a/test/modules/DirectMethodReceiver/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "DirectMethodReceiver.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet DirectMethodReceiver.dll diff --git a/test/modules/DirectMethodSender/docker/linux/amd64/Dockerfile b/test/modules/DirectMethodSender/docker/linux/Dockerfile similarity index 100% rename from test/modules/DirectMethodSender/docker/linux/amd64/Dockerfile rename to test/modules/DirectMethodSender/docker/linux/Dockerfile diff --git a/test/modules/DirectMethodSender/docker/linux/arm32v7/Dockerfile b/test/modules/DirectMethodSender/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index 1321542f26..0000000000 --- a/test/modules/DirectMethodSender/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "DirectMethodSender.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet DirectMethodSender.dll diff --git a/test/modules/DirectMethodSender/docker/linux/arm64v8/Dockerfile b/test/modules/DirectMethodSender/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index 1321542f26..0000000000 --- a/test/modules/DirectMethodSender/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "DirectMethodSender.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet DirectMethodSender.dll diff --git a/test/modules/EdgeHubRestartTester/docker/linux/amd64/Dockerfile b/test/modules/EdgeHubRestartTester/docker/linux/Dockerfile similarity index 100% rename from test/modules/EdgeHubRestartTester/docker/linux/amd64/Dockerfile rename to test/modules/EdgeHubRestartTester/docker/linux/Dockerfile diff --git a/test/modules/EdgeHubRestartTester/docker/linux/arm32v7/Dockerfile b/test/modules/EdgeHubRestartTester/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index 1c3d8d9213..0000000000 --- a/test/modules/EdgeHubRestartTester/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "EdgeHubRestartTester.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet EdgeHubRestartTester.dll diff --git a/test/modules/EdgeHubRestartTester/docker/linux/arm64v8/Dockerfile b/test/modules/EdgeHubRestartTester/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index 1c3d8d9213..0000000000 --- a/test/modules/EdgeHubRestartTester/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "EdgeHubRestartTester.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet EdgeHubRestartTester.dll diff --git a/test/modules/MetricsValidator/docker/linux/amd64/Dockerfile b/test/modules/MetricsValidator/docker/linux/Dockerfile similarity index 100% rename from test/modules/MetricsValidator/docker/linux/amd64/Dockerfile rename to test/modules/MetricsValidator/docker/linux/Dockerfile diff --git a/test/modules/MetricsValidator/docker/linux/arm32v7/Dockerfile b/test/modules/MetricsValidator/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index 207f23941f..0000000000 --- a/test/modules/MetricsValidator/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "MetricsValidator.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet MetricsValidator.dll diff --git a/test/modules/MetricsValidator/docker/linux/arm64v8/Dockerfile b/test/modules/MetricsValidator/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index 207f23941f..0000000000 --- a/test/modules/MetricsValidator/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "MetricsValidator.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet MetricsValidator.dll diff --git a/test/modules/ModuleRestarter/docker/linux/amd64/Dockerfile b/test/modules/ModuleRestarter/docker/linux/Dockerfile similarity index 100% rename from test/modules/ModuleRestarter/docker/linux/amd64/Dockerfile rename to test/modules/ModuleRestarter/docker/linux/Dockerfile diff --git a/test/modules/ModuleRestarter/docker/linux/arm32v7/Dockerfile b/test/modules/ModuleRestarter/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index a6501d083f..0000000000 --- a/test/modules/ModuleRestarter/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "ModuleRestarter.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet ModuleRestarter.dll diff --git a/test/modules/ModuleRestarter/docker/linux/arm64v8/Dockerfile b/test/modules/ModuleRestarter/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index a6501d083f..0000000000 --- a/test/modules/ModuleRestarter/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "ModuleRestarter.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet ModuleRestarter.dll diff --git a/test/modules/NumberLogger/docker/linux/amd64/Dockerfile b/test/modules/NumberLogger/docker/linux/Dockerfile similarity index 100% rename from test/modules/NumberLogger/docker/linux/amd64/Dockerfile rename to test/modules/NumberLogger/docker/linux/Dockerfile diff --git a/test/modules/NumberLogger/docker/linux/arm32v7/Dockerfile b/test/modules/NumberLogger/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index d570712016..0000000000 --- a/test/modules/NumberLogger/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "NumberLogger.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -ENTRYPOINT /usr/bin/dotnet NumberLogger.dll - diff --git a/test/modules/NumberLogger/docker/linux/arm64v8/Dockerfile b/test/modules/NumberLogger/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index 7868126f55..0000000000 --- a/test/modules/NumberLogger/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "NumberLogger.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -ENTRYPOINT /usr/bin/dotnet NumberLogger.dll diff --git a/test/modules/Relayer/docker/linux/amd64/Dockerfile b/test/modules/Relayer/docker/linux/Dockerfile similarity index 100% rename from test/modules/Relayer/docker/linux/amd64/Dockerfile rename to test/modules/Relayer/docker/linux/Dockerfile diff --git a/test/modules/Relayer/docker/linux/arm32v7/Dockerfile b/test/modules/Relayer/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index 785b071a41..0000000000 --- a/test/modules/Relayer/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "Relayer.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet Relayer.dll diff --git a/test/modules/Relayer/docker/linux/arm64v8/Dockerfile b/test/modules/Relayer/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index 785b071a41..0000000000 --- a/test/modules/Relayer/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "Relayer.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet Relayer.dll diff --git a/test/modules/TemperatureFilter/docker/linux/amd64/Dockerfile b/test/modules/TemperatureFilter/docker/linux/Dockerfile similarity index 100% rename from test/modules/TemperatureFilter/docker/linux/amd64/Dockerfile rename to test/modules/TemperatureFilter/docker/linux/Dockerfile diff --git a/test/modules/TemperatureFilter/docker/linux/arm32v7/Dockerfile b/test/modules/TemperatureFilter/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index c84548511a..0000000000 --- a/test/modules/TemperatureFilter/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "TemperatureFilter.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Temperature Filter" && \ - exec /usr/bin/dotnet TemperatureFilter.dll diff --git a/test/modules/TemperatureFilter/docker/linux/arm64v8/Dockerfile b/test/modules/TemperatureFilter/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index c84548511a..0000000000 --- a/test/modules/TemperatureFilter/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "TemperatureFilter.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Temperature Filter" && \ - exec /usr/bin/dotnet TemperatureFilter.dll diff --git a/test/modules/TestAnalyzer/docker/linux/arm64v8/Dockerfile b/test/modules/TestAnalyzer/docker/linux/Dockerfile similarity index 82% rename from test/modules/TestAnalyzer/docker/linux/arm64v8/Dockerfile rename to test/modules/TestAnalyzer/docker/linux/Dockerfile index 28e76f2a4b..1b5a301349 100644 --- a/test/modules/TestAnalyzer/docker/linux/arm64v8/Dockerfile +++ b/test/modules/TestAnalyzer/docker/linux/Dockerfile @@ -3,6 +3,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine ARG EXE_DIR=. +ARG TARGETPLATFORM # RocksDB requires snappy RUN apk update && \ @@ -19,7 +20,7 @@ RUN adduser -Ds /bin/sh moduleuser USER moduleuser # Install RocksDB -COPY $EXE_DIR/librocksdb/librocksdb.so.arm64 /usr/local/lib/librocksdb.so +COPY $EXE_DIR/librocksdb/$TARGETPLATFORM/librocksdb.so /usr/local/lib/librocksdb.so CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ exec /usr/bin/dotnet TestAnalyzer.dll diff --git a/test/modules/TestAnalyzer/docker/linux/amd64/Dockerfile b/test/modules/TestAnalyzer/docker/linux/amd64/Dockerfile deleted file mode 100644 index 837372078a..0000000000 --- a/test/modules/TestAnalyzer/docker/linux/amd64/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine - -ARG EXE_DIR=. - -# RocksDB requires snappy -RUN apk update && \ - apk add --no-cache snappy libcap - -ENV MODULE_NAME "TestAnalyzer.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -# Install RocksDB -COPY $EXE_DIR/librocksdb/librocksdb.so.amd64 /usr/local/lib/librocksdb.so - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet TestAnalyzer.dll diff --git a/test/modules/TestAnalyzer/docker/linux/arm32v7/Dockerfile b/test/modules/TestAnalyzer/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index 03b24cfd90..0000000000 --- a/test/modules/TestAnalyzer/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine - -ARG EXE_DIR=. - -# RocksDB requires snappy -RUN apk update && \ - apk add --no-cache snappy libcap - -ENV MODULE_NAME "TestAnalyzer.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -# Install RocksDB -COPY $EXE_DIR/librocksdb/librocksdb.so.armhf /usr/local/lib/librocksdb.so - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet TestAnalyzer.dll diff --git a/test/modules/TestMetricsCollector/docker/linux/amd64/Dockerfile b/test/modules/TestMetricsCollector/docker/linux/Dockerfile similarity index 100% rename from test/modules/TestMetricsCollector/docker/linux/amd64/Dockerfile rename to test/modules/TestMetricsCollector/docker/linux/Dockerfile diff --git a/test/modules/TestMetricsCollector/docker/linux/arm32v7/Dockerfile b/test/modules/TestMetricsCollector/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index 0f637271d3..0000000000 --- a/test/modules/TestMetricsCollector/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "TestMetricsCollector.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet TestMetricsCollector.dll diff --git a/test/modules/TestMetricsCollector/docker/linux/arm64v8/Dockerfile b/test/modules/TestMetricsCollector/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index 0f637271d3..0000000000 --- a/test/modules/TestMetricsCollector/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "TestMetricsCollector.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet TestMetricsCollector.dll diff --git a/test/modules/TestResultCoordinator/docker/linux/arm32v7/Dockerfile b/test/modules/TestResultCoordinator/docker/linux/Dockerfile similarity index 84% rename from test/modules/TestResultCoordinator/docker/linux/arm32v7/Dockerfile rename to test/modules/TestResultCoordinator/docker/linux/Dockerfile index 2bf9e354e8..42d2700613 100644 --- a/test/modules/TestResultCoordinator/docker/linux/arm32v7/Dockerfile +++ b/test/modules/TestResultCoordinator/docker/linux/Dockerfile @@ -3,6 +3,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine ARG EXE_DIR=. +ARG TARGETPLATFORM # RocksDB requires snappy RUN apk update && \ @@ -22,7 +23,7 @@ RUN adduser -Ds /bin/sh moduleuser USER moduleuser # Install RocksDB -COPY $EXE_DIR/librocksdb/librocksdb.so.armhf /usr/local/lib/librocksdb.so +COPY $EXE_DIR/librocksdb/$TARGETPLATFORM/librocksdb.so /usr/local/lib/librocksdb.so CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ exec /usr/bin/dotnet TestResultCoordinator.dll diff --git a/test/modules/TestResultCoordinator/docker/linux/amd64/Dockerfile b/test/modules/TestResultCoordinator/docker/linux/amd64/Dockerfile deleted file mode 100644 index bcf1cacaa7..0000000000 --- a/test/modules/TestResultCoordinator/docker/linux/amd64/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine - -ARG EXE_DIR=. - -# RocksDB requires snappy -RUN apk update && \ - apk add --no-cache snappy libcap - -ENV MODULE_NAME "TestResultCoordinator.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Expose HTTP port -EXPOSE 5001/tcp - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -# Install RocksDB -COPY $EXE_DIR/librocksdb/librocksdb.so.amd64 /usr/local/lib/librocksdb.so - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet TestResultCoordinator.dll diff --git a/test/modules/TestResultCoordinator/docker/linux/arm64v8/Dockerfile b/test/modules/TestResultCoordinator/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index cc101737b0..0000000000 --- a/test/modules/TestResultCoordinator/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine - -ARG EXE_DIR=. - -# RocksDB requires snappy -RUN apk update && \ - apk add --no-cache snappy libcap - -ENV MODULE_NAME "TestResultCoordinator.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Expose HTTP port -EXPOSE 5001/tcp - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -# Install RocksDB -COPY $EXE_DIR/librocksdb/librocksdb.so.arm64 /usr/local/lib/librocksdb.so - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet TestResultCoordinator.dll diff --git a/test/modules/TwinTester/docker/linux/amd64/Dockerfile b/test/modules/TwinTester/docker/linux/Dockerfile similarity index 82% rename from test/modules/TwinTester/docker/linux/amd64/Dockerfile rename to test/modules/TwinTester/docker/linux/Dockerfile index ae9077bd2b..42b6dec959 100644 --- a/test/modules/TwinTester/docker/linux/amd64/Dockerfile +++ b/test/modules/TwinTester/docker/linux/Dockerfile @@ -3,6 +3,7 @@ FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine ARG EXE_DIR=. +ARG TARGETPLATFORM # RocksDB requires snappy RUN apk update && \ @@ -15,7 +16,7 @@ WORKDIR /app COPY $EXE_DIR/ ./ # Install RocksDB -COPY $EXE_DIR/librocksdb/librocksdb.so.amd64 /usr/local/lib/librocksdb.so +COPY $EXE_DIR/librocksdb/$TARGETPLATFORM/librocksdb.so /usr/local/lib/librocksdb.so # Add an unprivileged user account for running the module RUN adduser -Ds /bin/sh moduleuser diff --git a/test/modules/TwinTester/docker/linux/arm32v7/Dockerfile b/test/modules/TwinTester/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index 345e056dfb..0000000000 --- a/test/modules/TwinTester/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine - -ARG EXE_DIR=. - -# RocksDB requires snappy -RUN apk update && \ - apk add --no-cache snappy libcap - -ENV MODULE_NAME "TwinTester.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Install RocksDB -COPY $EXE_DIR/librocksdb/librocksdb.so.armhf /usr/local/lib/librocksdb.so - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet TwinTester.dll diff --git a/test/modules/TwinTester/docker/linux/arm64v8/Dockerfile b/test/modules/TwinTester/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index dbef3cce60..0000000000 --- a/test/modules/TwinTester/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine - -ARG EXE_DIR=. - -# RocksDB requires snappy -RUN apk update && \ - apk add --no-cache snappy libcap - -ENV MODULE_NAME "TwinTester.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Install RocksDB -COPY $EXE_DIR/librocksdb/librocksdb.so.arm64 /usr/local/lib/librocksdb.so - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet TwinTester.dll diff --git a/test/modules/load-gen/docker/linux/amd64/Dockerfile b/test/modules/load-gen/docker/linux/Dockerfile similarity index 100% rename from test/modules/load-gen/docker/linux/amd64/Dockerfile rename to test/modules/load-gen/docker/linux/Dockerfile diff --git a/test/modules/load-gen/docker/linux/arm32v7/Dockerfile b/test/modules/load-gen/docker/linux/arm32v7/Dockerfile deleted file mode 100644 index 7aaf5df221..0000000000 --- a/test/modules/load-gen/docker/linux/arm32v7/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "load-gen.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet load-gen.dll diff --git a/test/modules/load-gen/docker/linux/arm64v8/Dockerfile b/test/modules/load-gen/docker/linux/arm64v8/Dockerfile deleted file mode 100644 index 7aaf5df221..0000000000 --- a/test/modules/load-gen/docker/linux/arm64v8/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine - -ARG EXE_DIR=. - -ENV MODULE_NAME "load-gen.dll" - -WORKDIR /app - -COPY $EXE_DIR/ ./ - -# Add an unprivileged user account for running the module -RUN adduser -Ds /bin/sh moduleuser -USER moduleuser - -CMD echo "$(date --utc +"%Y-%m-%d %H:%M:%S %:z") Starting Module" && \ - exec /usr/bin/dotnet load-gen.dll