Skip to content

Commit

Permalink
Add RHEL 9 (Azure#6850)
Browse files Browse the repository at this point in the history
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.

## Azure IoT Edge PR checklist:
  • Loading branch information
micahl authored Apr 20, 2023
1 parent 7903023 commit e34b941
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 10 deletions.
23 changes: 22 additions & 1 deletion builds/e2e/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
################################################################################
Expand Down Expand Up @@ -357,4 +378,4 @@ jobs:

steps:
- template: templates/e2e-setup.yaml
- template: templates/e2e-run.yaml
- template: templates/e2e-run.yaml
26 changes: 20 additions & 6 deletions builds/misc/packages-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
##############################################################################
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -618,4 +632,4 @@ stages:
test-released-images "$(Build.SourceBranchName)"
displayName: Released Images Smoke Tests
env:
DEVOPS_PAT: "$(IotEdge1-PAT-msazure)"
DEVOPS_PAT: "$(IotEdge1-PAT-msazure)"
4 changes: 4 additions & 0 deletions builds/misc/templates/build-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 29 additions & 1 deletion edgelet/build/linux/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
;;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion 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 `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`.

Expand Down
3 changes: 3 additions & 0 deletions scripts/linux/publishReleasePackages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static async Task<EdgeDaemon> 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}'");
}
Expand Down

0 comments on commit e34b941

Please sign in to comment.