From 5b7d20f8ad2edf5219f43595430772f4e4919d13 Mon Sep 17 00:00:00 2001 From: Damon Barry Date: Mon, 26 Aug 2024 15:34:58 -0700 Subject: [PATCH] Add support for Debian 12 to the build/test pipelines (#7276) This change updates the build and tests pipelines to support Debian 12 amd64, arm64v8, and arm32v7. Specifically, - In end-to-end tests, convert Debian 11 arm32v7 job to "minimal" since it will no longer be the latest supported Debian version. Since the arm32v7 jobs are very slow (they run on Raspberry Pi), we only run the full battery of tests on the latest version. On the others, we just run the TempSensor test. - Add Debian 12 amd64, arm64v8, and arm32v7 jobs to the end-to-end tests pipeline. - Add Debian 12 amd64, arm64v8, and arm32v7 to the packages build pipeline and related scripts. - Update markdown docs and comments as needed. - Update end-to-end test _code_ to support Debian 12 packages. To test, I ran the CI Build and end-to-end test pipelines and confirmed they pass. ## Azure IoT Edge PR checklist: --- builds/checkin/edgelet.yaml | 5 +- builds/e2e/e2e.yaml | 89 ++++++++++++++++++- builds/misc/templates/build-packages.yaml | 12 +++ edgelet/build/linux/package.sh | 4 + edgelet/doc/devguide.md | 9 +- edgelet/iotedge/src/check/additional_info.rs | 2 +- .../linux/EdgeDaemon.cs | 2 +- 7 files changed, 113 insertions(+), 10 deletions(-) diff --git a/builds/checkin/edgelet.yaml b/builds/checkin/edgelet.yaml index 6f864dd2dfb..430860da2c1 100644 --- a/builds/checkin/edgelet.yaml +++ b/builds/checkin/edgelet.yaml @@ -162,12 +162,11 @@ jobs: $CARGO tarpaulin --out Xml --output-dir . displayName: Test workingDirectory: edgelet - - task: PublishCodeCoverageResults@1 + - task: PublishCodeCoverageResults@2 displayName: Publish code coverage results inputs: - codeCoverageTool: cobertura summaryFileLocation: "edgelet/cobertura.xml" - - task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@5 + - task: BuildQualityChecks@9 displayName: "Check build quality" inputs: checkCoverage: true diff --git a/builds/e2e/e2e.yaml b/builds/e2e/e2e.yaml index 4b951622821..daf3fd496d0 100644 --- a/builds/e2e/e2e.yaml +++ b/builds/e2e/e2e.yaml @@ -33,7 +33,7 @@ jobs: ################################################################################ - job: debian_11_arm32v7 ################################################################################ - displayName: Debian 11 arm32v7 + displayName: Debian 11 arm32v7 (minimal) dependsOn: Token condition: succeeded('Token') @@ -48,6 +48,93 @@ jobs: identityServiceArtifactName: packages_debian-11-slim_arm32v7 identityServicePackageFilter: aziot-identity-service_*_armhf.deb sas_uri: $[ dependencies.Token.outputs['generate.sas_uri'] ] + minimal: true + + timeoutInMinutes: 120 + + steps: + - template: templates/e2e-clean-directory.yaml + - template: templates/e2e-setup.yaml + - template: templates/e2e-clear-docker-cached-images.yaml + - template: templates/e2e-run.yaml + parameters: + sas_uri: $(sas_uri) + +################################################################################ + - job: debian_12_amd64 +################################################################################ + displayName: Debian 12 amd64 + dependsOn: Token + condition: succeeded('Token') + + pool: + name: $(pool.linux.name) + demands: + - ImageOverride -equals agent-aziotedge-debian-12-msmoby + + variables: + os: linux + arch: amd64 + artifactName: iotedged-debian12-amd64 + identityServiceArtifactName: packages_debian-12-slim_amd64 + identityServicePackageFilter: aziot-identity-service_*_amd64.deb + sas_uri: $[ dependencies.Token.outputs['generate.sas_uri'] ] + + timeoutInMinutes: 90 + + steps: + - template: templates/e2e-setup.yaml + - template: templates/e2e-run.yaml + parameters: + sas_uri: $(sas_uri) + +################################################################################ + - job: debian_12_arm64v8 +################################################################################ + displayName: Debian 12 arm64v8 + dependsOn: Token + condition: succeeded('Token') + + pool: + name: $(pool.custom.name) + demands: debian12-arm64-e2e-tests + + variables: + os: linux + arch: arm64v8 + artifactName: iotedged-debian12-aarch64 + identityServiceArtifactName: packages_debian-12-slim_aarch64 + identityServicePackageFilter: aziot-identity-service_*_arm64.deb + sas_uri: $[ dependencies.Token.outputs['generate.sas_uri'] ] + + timeoutInMinutes: 120 + + steps: + - template: templates/e2e-clean-directory.yaml + - template: templates/e2e-setup.yaml + - template: templates/e2e-clear-docker-cached-images.yaml + - template: templates/e2e-run.yaml + parameters: + sas_uri: $(sas_uri) + +################################################################################ + - job: debian_12_arm32v7 +################################################################################ + displayName: Debian 12 arm32v7 + dependsOn: Token + condition: succeeded('Token') + + pool: + name: $(pool.custom.name) + demands: deb12-e2e-tests + + variables: + os: linux + arch: arm32v7 + artifactName: iotedged-debian12-arm32v7 + identityServiceArtifactName: packages_debian-12-slim_arm32v7 + identityServicePackageFilter: aziot-identity-service_*_armhf.deb + sas_uri: $[ dependencies.Token.outputs['generate.sas_uri'] ] timeoutInMinutes: 120 diff --git a/builds/misc/templates/build-packages.yaml b/builds/misc/templates/build-packages.yaml index dfb7a26a729..3bbca97d734 100644 --- a/builds/misc/templates/build-packages.yaml +++ b/builds/misc/templates/build-packages.yaml @@ -70,6 +70,18 @@ stages: os: debian11 arch: aarch64 target.iotedged: edgelet/target/aarch64-unknown-linux-gnu/release + Debian12-amd64: + os: debian12 + arch: amd64 + target.iotedged: edgelet/target/release + Debian12-arm32v7: + os: debian12 + arch: arm32v7 + target.iotedged: edgelet/target/armv7-unknown-linux-gnueabihf/release + Debian12-aarch64: + os: debian12 + arch: aarch64 + target.iotedged: edgelet/target/aarch64-unknown-linux-gnu/release Ubuntu2004-amd64: arch: amd64 diff --git a/edgelet/build/linux/package.sh b/edgelet/build/linux/package.sh index f71951cdf32..4c9e68394d6 100755 --- a/edgelet/build/linux/package.sh +++ b/edgelet/build/linux/package.sh @@ -55,6 +55,10 @@ case "$PACKAGE_OS" in DOCKER_IMAGE='mcr.microsoft.com/mirror/docker/library/debian:bullseye-slim' ;; + 'debian12') + DOCKER_IMAGE='mcr.microsoft.com/mirror/docker/library/debian:bookworm-slim' + ;; + 'ubuntu20.04') DOCKER_IMAGE='mcr.microsoft.com/mirror/docker/library/ubuntu:20.04' ;; diff --git a/edgelet/doc/devguide.md b/edgelet/doc/devguide.md index 40d1de410b8..4d1a3dd460d 100644 --- a/edgelet/doc/devguide.md +++ b/edgelet/doc/devguide.md @@ -13,7 +13,7 @@ There are two options for building the IoT Edge Security Daemon. Linux packages are built using the `edgelet/build/linux/package.sh` script. Set the following environment variables, then invoke the script: -1. `PACKAGE_OS`: This is the OS on which the resulting packages will be installed. It should be one of `redhat8`, `redhat9`, `debian11`, `ubuntu20.04`, or `ubuntu22.04`. +1. `PACKAGE_OS`: This is the OS on which the resulting packages will be installed. It should be one of `redhat8`, `redhat9`, `debian11`, `debian12`, `ubuntu20.04`, or `ubuntu22.04`. 1. `PACKAGE_ARCH`: This is the architecture of the OS on which the resulting packages will be installed. It should be one of `amd64`, `arm32v7` or `aarch64`. @@ -23,7 +23,7 @@ For example: git clone --recurse-submodules 'https://github.com/Azure/iotedge' cd iotedge/ -PACKAGE_OS='debian11' PACKAGE_ARCH='arm32v7' ./edgelet/build/linux/package.sh +PACKAGE_OS='debian12' PACKAGE_ARCH='arm32v7' ./edgelet/build/linux/package.sh ``` The packages are built inside a Docker container, so no build dependencies are installed on the device running the script. However the user running the script does need to have permissions to invoke the `docker` command. @@ -57,7 +57,7 @@ rustup update # Install / update the toolchain used to build the daemon binari In addition, building the daemon binaries also requires these dependencies to be installed: -#### RHEL 8 +#### RHEL 8-9 ```sh dnf distro-sync -y \ @@ -67,7 +67,7 @@ dnf install -y \ libcurl-devel libuuid-devel openssl-devel && ``` -#### Debian 11 +#### Debian 11-12 ```sh apt-get update @@ -76,6 +76,7 @@ apt-get install \ gcc g++ pkg-config \ libcurl4-openssl-dev libssl-dev uuid-dev ``` + #### Ubuntu 20.04 ```sh diff --git a/edgelet/iotedge/src/check/additional_info.rs b/edgelet/iotedge/src/check/additional_info.rs index 4bcafb28c7e..f69df1a7c7b 100644 --- a/edgelet/iotedge/src/check/additional_info.rs +++ b/edgelet/iotedge/src/check/additional_info.rs @@ -36,7 +36,7 @@ impl AdditionalInfo { /// OS | id | version_id /// ---------------------+---------------------+------------ /// RedHat EL 8 | rhel | 8.5 -/// Debian 11 | debian | 11 +/// Debian 12 | debian | 12 /// openSUSE Tumbleweed | opensuse-tumbleweed | 20190325 /// Ubuntu 22.04 | ubuntu | 22.04 /// ``` diff --git a/test/Microsoft.Azure.Devices.Edge.Test.Common/linux/EdgeDaemon.cs b/test/Microsoft.Azure.Devices.Edge.Test.Common/linux/EdgeDaemon.cs index cf98751eb68..ea42b8c2cd9 100644 --- a/test/Microsoft.Azure.Devices.Edge.Test.Common/linux/EdgeDaemon.cs +++ b/test/Microsoft.Azure.Devices.Edge.Test.Common/linux/EdgeDaemon.cs @@ -63,7 +63,7 @@ void ThrowUnsupportedOs() => : SupportedPackageExtension.Deb; break; case "debian": - if (version != "11") + if (version != "11" && version != "12") { ThrowUnsupportedOs(); }