Skip to content

Commit

Permalink
Build Images Pipeline: Additional job for rust test modules (#4916) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
and-rewsmith authored Apr 30, 2021
1 parent 474ee73 commit 09d243e
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 34 deletions.
1 change: 0 additions & 1 deletion builds/misc/images-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
args: "-c Release"
scriptPath: scripts/linux/buildBranch.sh
- template: templates/build-broker-watchdog.yaml
- template: templates/consolidate-build-artifacts.yaml
# Code Sign
- template: ../templates/dotnet2-globaljson.yaml # switch to dotnet 2 as primary install for code sign
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
Expand Down
24 changes: 14 additions & 10 deletions builds/misc/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
displayName: Build ($(Build.Configuration)) dotnet artifacts

- template: templates/build-broker-watchdog.yaml
- template: templates/build-rust-test-modules.yaml

- template: templates/consolidate-build-artifacts.yaml

- script: scripts/linux/createArtifactInfo.sh --output-folder '$(Build.BinariesDirectory)/publish' --build-number $(Build.BuildNumber)
displayName: 'Create Artifact Info File'
Expand Down Expand Up @@ -189,13 +186,6 @@ jobs:
imageName: azureiotedge-c2dmessage-tester
project: CloudToDeviceMessageTester

# Generic Mqtt Tester
- template: templates/image-linux.yaml
parameters:
name: Generic Mqtt Tester
imageName: azureiotedge-generic-mqtt-tester
project: generic-mqtt-tester

################################################################################
- job: linux_API_proxy_module
################################################################################
Expand Down Expand Up @@ -227,6 +217,20 @@ jobs:
inputs:
dockerImagesToScan: '$(registry.address)/microsoft/azureiotedge-api-proxy:$(Build.BuildNumber)-linux-amd64,$(registry.address)/microsoft/azureiotedge-api-proxy:$(Build.BuildNumber)-linux-arm32v7,$(registry.address)/microsoft/azureiotedge-api-proxy:$(Build.BuildNumber)-linux-arm64v8'

################################################################################
- job: RustTestModules
################################################################################
timeoutInMinutes: 180
displayName: Rust Test Modules
pool:
vmImage: 'ubuntu-18.04'
steps:
- template: templates/rust-test-module-build.yaml
- template: templates/rust-test-module-images.yaml
parameters:
module.path: 'test/modules/generic-mqtt-tester'
module.name: 'generic-mqtt-tester'

################################################################################
- job: manifest
################################################################################
Expand Down
2 changes: 2 additions & 0 deletions builds/misc/templates/build-broker-watchdog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ steps:
inputs:
filePath: scripts/linux/cross-platform-rust-build.sh
arguments: --os ubuntu18.04 --arch aarch64 --build-path edge-hub/watchdog
- script: scripts/linux/consolidate-build-artifacts.sh --build-binaries-dir '$(Build.BinariesDirectory)' --artifact-name 'edge-hub'
displayName: Consolidate Edge Hub Artifacts
6 changes: 0 additions & 6 deletions builds/misc/templates/consolidate-build-artifacts.yaml

This file was deleted.

33 changes: 33 additions & 0 deletions builds/misc/templates/rust-test-module-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
parameters:
os: 'linux'
module.path: ''
module.name: ''

steps:
- task: Docker@2
displayName: Build amd64 image for ${{ parameters['module.name'] }}
inputs:
repository: microsoft/azureiotedge-${{ parameters['module.name'] }}
command: buildAndPush
containerRegistry: iotedge-edgebuilds-acr
Dockerfile: ${{ parameters['module.path'] }}/docker/${{ parameters['os'] }}/amd64/Dockerfile
buildContext: ${{ parameters['module.path'] }}/target
tags: $(Build.BuildNumber)-linux-amd64
- task: Docker@2
displayName: Build arm32 image for ${{ parameters['module.name'] }}
inputs:
repository: microsoft/azureiotedge-${{ parameters['module.name'] }}
command: buildAndPush
containerRegistry: iotedge-edgebuilds-acr
Dockerfile: ${{ parameters['module.path'] }}/docker/${{ parameters['os'] }}/arm32v7/Dockerfile
buildContext: ${{ parameters['module.path'] }}/target
tags: $(Build.BuildNumber)-linux-arm32v7
- task: Docker@2
displayName: Build arm64 image for ${{ parameters['module.name'] }}
inputs:
repository: microsoft/azureiotedge-${{ parameters['module.name'] }}
command: buildAndPush
containerRegistry: iotedge-edgebuilds-acr
Dockerfile: ${{ parameters['module.path'] }}/docker/${{ parameters['os'] }}/arm64v8/Dockerfile
buildContext: ${{ parameters['module.path'] }}/target
tags: $(Build.BuildNumber)-linux-arm64v8
17 changes: 0 additions & 17 deletions scripts/linux/consolidate-build-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,6 @@ TARGET_AMD64_MUSL="x86_64-unknown-linux-musl"
TARGET_AMD64_GNU="x86_64-unknown-linux-gnu"

case "$ARTIFACT_NAME" in
generic-mqtt-tester)
ARTIFACTS_SOURCE="test/modules/$ARTIFACT_NAME"
ARTIFACTS_DEST="${BUILD_BINARIESDIRECTORY}/publish/$ARTIFACT_NAME"

# make build context structure
mkdir "$ARTIFACTS_DEST"
mkdir -p "$ARTIFACTS_DEST/$TARGET_AMD64_GNU/release"
mkdir -p "$ARTIFACTS_DEST/$TARGET_ARM32V7/release"
mkdir -p "$ARTIFACTS_DEST/$TARGET_ARM64V8/release"

# copy artifacts
cp "$ARTIFACTS_SOURCE/target/$TARGET_AMD64_GNU/release/$ARTIFACT_NAME" "$ARTIFACTS_DEST/$TARGET_AMD64_GNU/release" || true
cp "$ARTIFACTS_SOURCE/target/$TARGET_ARM32V7/release/$ARTIFACT_NAME" "$ARTIFACTS_DEST/$TARGET_ARM32V7/release" || true
cp "$ARTIFACTS_SOURCE/target/$TARGET_ARM64V8/release/$ARTIFACT_NAME" "$ARTIFACTS_DEST/$TARGET_ARM64V8/release" || true
cp -r "$ARTIFACTS_SOURCE/docker" "$ARTIFACTS_DEST"
;;

edge-hub)
EDGEHUB_ARTIFACTS_SOURCE="$BUILD_BINARIESDIRECTORY/publish/Microsoft.Azure.Devices.Edge.Hub.Service"
MQTT_ARTIFACTS_SOURCE="mqtt"
Expand Down

0 comments on commit 09d243e

Please sign in to comment.