From 32f7481b40bdac21953d9e78b29914e0f1ae8d6d Mon Sep 17 00:00:00 2001 From: Damon Barry Date: Wed, 26 Apr 2023 11:55:09 -0700 Subject: [PATCH] Add RHEL 9 * Add RHEL 9 This change adds support for RHEL 9 by building packages in the CI build pipeline, running the end-to-end tests on an RHEL 9 agent, and building, signing, and publishing packages to packages.microsoft.com and our GitHub release pages. I confirmed that the CI build produces RHEL 9 packages, that those packages can be installed on an RHEL 9 agent, and that all the end-to-end tests pass. Co-authored-by: Micah Lewis <1009123+micahl@users.noreply.github.com> --- builds/e2e/e2e.yaml | 23 +++++++- builds/misc/packages-release.yaml | 26 +++++++--- builds/misc/templates/build-packages.yaml | 4 ++ edgelet/Cargo.lock | 52 +++++++++---------- edgelet/build/linux/package.sh | 30 ++++++++++- edgelet/doc/devguide.md | 2 +- scripts/linux/publishReleasePackages.sh | 3 ++ .../linux/EdgeDaemon.cs | 2 +- 8 files changed, 106 insertions(+), 36 deletions(-) diff --git a/builds/e2e/e2e.yaml b/builds/e2e/e2e.yaml index 72311562044..6afd15066a0 100644 --- a/builds/e2e/e2e.yaml +++ b/builds/e2e/e2e.yaml @@ -282,6 +282,27 @@ jobs: - template: templates/e2e-setup.yaml - template: templates/e2e-run.yaml + ################################################################################ + - job: redhat9_amd64 + ################################################################################ + displayName: RedHat9 amd64 + + pool: + name: $(pool.linux.name) + demands: + - ImageOverride -equals agent-aziotedge-rhel-9-msmoby + + variables: + os: linux + arch: amd64 + artifactName: iotedged-redhat9-amd64 + identityServiceArtifactName: packages_redhat-ubi9-latest_amd64 + identityServicePackageFilter: aziot-identity-service-*.x86_64.rpm + + steps: + - template: templates/e2e-setup.yaml + - template: templates/e2e-run.yaml + ################################################################################ - job: linux_amd64_proxy ################################################################################ @@ -357,4 +378,4 @@ jobs: steps: - template: templates/e2e-setup.yaml - - template: templates/e2e-run.yaml \ No newline at end of file + - template: templates/e2e-run.yaml diff --git a/builds/misc/packages-release.yaml b/builds/misc/packages-release.yaml index 8cfa8e74eec..94d15edfa5c 100644 --- a/builds/misc/packages-release.yaml +++ b/builds/misc/packages-release.yaml @@ -39,6 +39,10 @@ stages: arch: amd64 os: redhat8 target.iotedged: edgelet/target/rpmbuild/RPMS/x86_64 + RedHat9-amd64: + arch: amd64 + os: redhat9 + target.iotedged: edgelet/target/rpmbuild/RPMS/x86_64 Debian10-amd64: os: debian10 @@ -65,7 +69,7 @@ stages: os: debian11 arch: aarch64 target.iotedged: edgelet/target/aarch64-unknown-linux-gnu/release - + Ubuntu1804-amd64: os: ubuntu18.04 arch: amd64 @@ -193,6 +197,11 @@ stages: artifactName: iotedged-redhat8-amd64 identityServiceArtifactName: packages_redhat-ubi8-latest_amd64 identityServicePackageFilter: aziot-identity-service-*.x86_64.rpm + RedHat9-amd64: + os: redhat9 + artifactName: iotedged-redhat9-amd64 + identityServiceArtifactName: packages_redhat-ubi9-latest_amd64 + identityServicePackageFilter: aziot-identity-service-*.x86_64.rpm Ubuntu1804-amd64: os: ubuntu18.04 @@ -204,7 +213,7 @@ stages: artifactName: iotedged-ubuntu18.04-aarch64 identityServiceArtifactName: packages_ubuntu-18.04_aarch64 identityServicePackageFilter: aziot-identity-service_*_arm64.deb - + Ubuntu2004-amd64: os: ubuntu20.04 artifactName: iotedged-ubuntu20.04-amd64 @@ -305,7 +314,7 @@ stages: scriptType: bash scriptPath: $(Build.SourcesDirectory)/scripts/linux/publishReleasePackages.sh arguments: -p $(os) -w $(System.ArtifactsDirectory) -d $(System.ArtifactsDirectory)/$(artifactName) -s $(package-server-name) - + ############################################################################## - stage: PublishPackagesGithub ############################################################################## @@ -374,7 +383,12 @@ stages: artifactName: iotedged-redhat8-amd64 identityServiceArtifactName: packages_redhat-ubi8-latest_amd64 identityServicePackageFilter: aziot-identity-service-*.x86_64.rpm - + RedHat9-amd64: + os: redhat9 + artifactName: iotedged-redhat9-amd64 + identityServiceArtifactName: packages_redhat-ubi9-latest_amd64 + identityServicePackageFilter: aziot-identity-service-*.x86_64.rpm + Debian10-amd64: os: debian10 artifactName: iotedged-debian10-amd64 @@ -390,7 +404,7 @@ stages: artifactName: iotedged-debian10-aarch64 identityServiceArtifactName: packages_debian-10-slim_aarch64 identityServicePackageFilter: aziot-identity-service_*_arm64.deb - + Debian11-amd64: os: debian11 artifactName: iotedged-debian11-amd64 @@ -618,4 +632,4 @@ stages: test-released-images "$(Build.SourceBranchName)" displayName: Released Images Smoke Tests env: - DEVOPS_PAT: "$(IotEdge1-PAT-msazure)" \ No newline at end of file + DEVOPS_PAT: "$(IotEdge1-PAT-msazure)" diff --git a/builds/misc/templates/build-packages.yaml b/builds/misc/templates/build-packages.yaml index bef4ecdeb35..5333eead52c 100644 --- a/builds/misc/templates/build-packages.yaml +++ b/builds/misc/templates/build-packages.yaml @@ -59,6 +59,10 @@ stages: arch: amd64 os: redhat8 target.iotedged: edgelet/target/rpmbuild/RPMS/x86_64 + RedHat9-amd64: + arch: amd64 + os: redhat9 + target.iotedged: edgelet/target/rpmbuild/RPMS/x86_64 Debian10-amd64: os: debian10 diff --git a/edgelet/Cargo.lock b/edgelet/Cargo.lock index 364774a67e5..0b0f0d56706 100644 --- a/edgelet/Cargo.lock +++ b/edgelet/Cargo.lock @@ -72,7 +72,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "aziot-cert-client-async" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "aziot-cert-common-http", "aziot-key-common", @@ -85,7 +85,7 @@ dependencies = [ [[package]] name = "aziot-cert-common-http" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "aziot-key-common", "serde", @@ -94,7 +94,7 @@ dependencies = [ [[package]] name = "aziot-certd-config" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "cert-renewal", "hex", @@ -137,7 +137,7 @@ dependencies = [ [[package]] name = "aziot-identity-client-async" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "aziot-cert-common-http", "aziot-identity-common", @@ -151,7 +151,7 @@ dependencies = [ [[package]] name = "aziot-identity-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "aziot-key-common", "http-common", @@ -162,7 +162,7 @@ dependencies = [ [[package]] name = "aziot-identity-common-http" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "aziot-cert-common-http", "aziot-identity-common", @@ -175,7 +175,7 @@ dependencies = [ [[package]] name = "aziot-identityd-config" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "aziot-identity-common", "cert-renewal", @@ -190,7 +190,7 @@ dependencies = [ [[package]] name = "aziot-key-client" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "aziot-key-common", "aziot-key-common-http", @@ -205,7 +205,7 @@ dependencies = [ [[package]] name = "aziot-key-client-async" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "aziot-key-common", "aziot-key-common-http", @@ -218,7 +218,7 @@ dependencies = [ [[package]] name = "aziot-key-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "serde", ] @@ -226,7 +226,7 @@ dependencies = [ [[package]] name = "aziot-key-common-http" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "aziot-key-common", "http-common", @@ -236,7 +236,7 @@ dependencies = [ [[package]] name = "aziot-key-openssl-engine" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "aziot-key-client", "aziot-key-common", @@ -254,7 +254,7 @@ dependencies = [ [[package]] name = "aziot-keyd-config" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "http-common", "libc", @@ -264,7 +264,7 @@ dependencies = [ [[package]] name = "aziot-keys-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "pkcs11", "serde", @@ -274,7 +274,7 @@ dependencies = [ [[package]] name = "aziot-tpmd-config" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "http-common", "serde", @@ -283,7 +283,7 @@ dependencies = [ [[package]] name = "aziotctl-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "anyhow", "aziot-certd-config", @@ -366,7 +366,7 @@ checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" [[package]] name = "cert-renewal" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "async-trait", "chrono", @@ -455,7 +455,7 @@ dependencies = [ [[package]] name = "config-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "serde", "toml", @@ -1157,7 +1157,7 @@ dependencies = [ [[package]] name = "http-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "async-trait", "base64 0.21.0", @@ -1471,7 +1471,7 @@ dependencies = [ [[package]] name = "logger" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "env_logger", "log", @@ -1620,7 +1620,7 @@ dependencies = [ [[package]] name = "openssl-build" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "cc", ] @@ -1663,7 +1663,7 @@ dependencies = [ [[package]] name = "openssl-sys2" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "openssl-build", "openssl-sys", @@ -1672,7 +1672,7 @@ dependencies = [ [[package]] name = "openssl2" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "foreign-types", "foreign-types-shared", @@ -1732,7 +1732,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs11" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "foreign-types-shared", "lazy_static", @@ -1749,7 +1749,7 @@ dependencies = [ [[package]] name = "pkcs11-sys" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" [[package]] name = "pkg-config" @@ -2166,7 +2166,7 @@ dependencies = [ [[package]] name = "test-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#df1885b6a78ef6491673c65659ead90a2740427a" +source = "git+https://github.com/Azure/iot-identity-service?branch=release/1.4#24f227d644ead36ab8fb4195f6203de4603097d3" dependencies = [ "aziot-identity-common", "aziot-identity-common-http", diff --git a/edgelet/build/linux/package.sh b/edgelet/build/linux/package.sh index 1f59a6bfb22..d6a333d8c89 100755 --- a/edgelet/build/linux/package.sh +++ b/edgelet/build/linux/package.sh @@ -51,6 +51,24 @@ case "$PACKAGE_OS" in esac ;; + 'redhat9') + # Converts debian versioning to rpm version + # deb 1.0.1~dev100 ~> rpm 1.0.1-0.1.dev100 + RPM_VERSION="$(echo "$VERSION" | cut -d"~" -f1)" + RPM_TAG="$(echo "$VERSION" | cut -s -d"~" -f2)" + if [ -n "$RPM_TAG" ]; then + RPM_RELEASE="0.$REVISION.$RPM_TAG" + else + RPM_RELEASE="$REVISION" + fi + + case "$PACKAGE_ARCH" in + 'amd64') + DOCKER_IMAGE='redhat/ubi9:latest' + ;; + esac + ;; + 'debian10') DOCKER_IMAGE='debian:10-slim' ;; @@ -117,6 +135,16 @@ case "$PACKAGE_OS.$PACKAGE_ARCH" in ' ;; + redhat9.amd64) + SETUP_COMMAND=$' + dnf distro-sync -y && + dnf install -y \ + git make rpm-build \ + gcc gcc-c++ \ + libcurl-devel libuuid-devel openssl-devel && + ' + ;; + debian*.amd64) SETUP_COMMAND=$' export DEBIAN_FRONTEND=noninteractive @@ -298,7 +326,7 @@ case "$PACKAGE_OS" in MAKE_COMMAND="$MAKE_COMMAND && make rpm rpmbuilddir=/project/edgelet/target/rpmbuild 'TARGET=$MAKE_TARGET_DIR' 'VERSION=$VERSION' 'REVISION=$REVISION' 'CARGOFLAGS=--manifest-path ./Cargo.toml $CARGO_TARGET_FLAG' RPMBUILDFLAGS='-v -bb --clean --define \"_topdir /project/edgelet/target/rpmbuild\" $RPMBUILD_TARGET_FLAG'" ;; - redhat8) + redhat8|redhat9) case "$PACKAGE_ARCH" in amd64) MAKE_TARGET_DIR='target/release' diff --git a/edgelet/doc/devguide.md b/edgelet/doc/devguide.md index c4641a0eafb..3abe10a17e9 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 `centos7`, `redhat8`, `debian10`, `debian11`, `ubuntu18.04`, `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 `centos7`, `redhat8`, `redhat9`, `debian10`, `debian11`, `ubuntu18.04`, `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`. diff --git a/scripts/linux/publishReleasePackages.sh b/scripts/linux/publishReleasePackages.sh index 38d95f3ac4c..42410c377d3 100755 --- a/scripts/linux/publishReleasePackages.sh +++ b/scripts/linux/publishReleasePackages.sh @@ -51,6 +51,9 @@ check_os() { elif [[ "$PACKAGE_OS" == "redhat8" ]]; then OS_NAME="redhat" OS_VERSION="8" + elif [[ "$PACKAGE_OS" == "redhat9" ]]; then + OS_NAME="redhat" + OS_VERSION="9" else echo "Unsupported OS: $PACKAGE_OS" exit 1 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 45a2537505d..21febba6fc9 100644 --- a/test/Microsoft.Azure.Devices.Edge.Test.Common/linux/EdgeDaemon.cs +++ b/test/Microsoft.Azure.Devices.Edge.Test.Common/linux/EdgeDaemon.cs @@ -55,7 +55,7 @@ public static async Task CreateAsync(CancellationToken token) version = version.Split('.')[0]; packageExtension = SupportedPackageExtension.Rpm; - if (version != "8") + if (version != "8" && version != "9") { throw new NotImplementedException($"Daemon is only installed on Red Hat version 8.X, operating system '{os} {version}'"); }