Skip to content

Commit

Permalink
Add support for Debian 12 to the build/test pipelines (#7276)
Browse files Browse the repository at this point in the history
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:
  • Loading branch information
damonbarry authored Aug 26, 2024
1 parent e4c3dc0 commit 5b7d20f
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 10 deletions.
5 changes: 2 additions & 3 deletions builds/checkin/edgelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
89 changes: 88 additions & 1 deletion builds/e2e/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
################################################################################
- job: debian_11_arm32v7
################################################################################
displayName: Debian 11 arm32v7
displayName: Debian 11 arm32v7 (minimal)
dependsOn: Token
condition: succeeded('Token')

Expand All @@ -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

Expand Down
12 changes: 12 additions & 0 deletions builds/misc/templates/build-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions edgelet/build/linux/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
;;
Expand Down
9 changes: 5 additions & 4 deletions edgelet/doc/devguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand All @@ -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.
Expand Down Expand Up @@ -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 \
Expand All @@ -67,7 +67,7 @@ dnf install -y \
libcurl-devel libuuid-devel openssl-devel &&
```

#### Debian 11
#### Debian 11-12

```sh
apt-get update
Expand All @@ -76,6 +76,7 @@ apt-get install \
gcc g++ pkg-config \
libcurl4-openssl-dev libssl-dev uuid-dev
```

#### Ubuntu 20.04

```sh
Expand Down
2 changes: 1 addition & 1 deletion edgelet/iotedge/src/check/additional_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void ThrowUnsupportedOs() =>
: SupportedPackageExtension.Deb;
break;
case "debian":
if (version != "11")
if (version != "11" && version != "12")
{
ThrowUnsupportedOs();
}
Expand Down

0 comments on commit 5b7d20f

Please sign in to comment.