diff --git a/builds/e2e/e2e.yaml b/builds/e2e/e2e.yaml index d657554e334..039b583584b 100644 --- a/builds/e2e/e2e.yaml +++ b/builds/e2e/e2e.yaml @@ -460,7 +460,7 @@ jobs: ################################################################################ - job: mariner2_amd64 ################################################################################ - displayName: Mariner 2.0 amd64 + displayName: Mariner 2.0 amd64 (minimal) dependsOn: Token condition: and(succeeded('Token'), eq(variables['run.EFLOW.amd64'], 'true')) pool: @@ -474,6 +474,7 @@ jobs: identityArtifactName: aziot-identity-mariner2-amd64 artifactName: iotedged-mariner2-amd64 sas_uri: $[ dependencies.Token.outputs['generate.sas_uri'] ] + minimal: true timeoutInMinutes: 90 @@ -486,9 +487,8 @@ jobs: ################################################################################ - job: mariner2_arm64 ################################################################################ - displayName: Mariner 2.0 arm64 + displayName: Mariner 2.0 arm64 (minimal) dependsOn: Token - condition: and(succeeded('Token'), eq(variables['run.EFLOW.arm64'], 'true')) pool: name: $(pool.linux.arm.name) demands: @@ -500,6 +500,58 @@ jobs: identityArtifactName: aziot-identity-mariner2-aarch64 artifactName: iotedged-mariner2-aarch64 sas_uri: $[ dependencies.Token.outputs['generate.sas_uri'] ] + minimal: true + + timeoutInMinutes: 90 + + steps: + - template: templates/e2e-setup.yaml + - template: templates/e2e-run.yaml + parameters: + sas_uri: $(sas_uri) + +################################################################################ + - job: azurelinux3_amd64 +################################################################################ + displayName: Azure Linux 3.0 amd64 + dependsOn: Token + condition: and(succeeded('Token'), eq(variables['run.EFLOW.amd64'], 'true')) + pool: + name: $(pool.linux.name) + demands: + - ImageOverride -equals agent-aziotedge-azurelinux-3.0-msmoby + + variables: + os: linux + arch: amd64 + identityArtifactName: aziot-identity-azurelinux3-amd64 + artifactName: iotedged-azurelinux3-amd64 + 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: azurelinux3_arm64 +################################################################################ + displayName: Azure Linux 3.0 arm64 + dependsOn: Token + pool: + name: $(pool.linux.arm.name) + demands: + - ImageOverride -equals agent-aziotedge-azurelinux-3.0-arm64-msmoby + + variables: + os: linux + arch: arm64 + identityArtifactName: aziot-identity-azurelinux3-aarch64 + artifactName: iotedged-azurelinux3-aarch64 + sas_uri: $[ dependencies.Token.outputs['generate.sas_uri'] ] timeoutInMinutes: 90 diff --git a/builds/misc/templates/build-packages.yaml b/builds/misc/templates/build-packages.yaml index 565c215958f..4b4a167e1a7 100644 --- a/builds/misc/templates/build-packages.yaml +++ b/builds/misc/templates/build-packages.yaml @@ -330,9 +330,9 @@ stages: PathtoPublish: '$(build.artifactstagingdirectory)/iotedged' ################################################################################ - - job: mariner_linux + - job: azurelinux ################################################################################ - displayName: Mariner Linux + displayName: Azure Linux condition: or(eq(variables['build.linux.mariner'], ''), eq(variables['build.linux.mariner'], true)) timeoutInMinutes: 90 strategy: @@ -342,8 +342,9 @@ stages: agent-image: agent-aziotedge-ubuntu-20.04-docker arch: amd64 os: mariner + os_id: cm os_version: 2 - mariner_release: 2.0-stable + release_tag: 2.0-stable target.identity: iot-identity-service/packages/mariner2/amd64 target.iotedged: builds/mariner2/out/RPMS/x86_64 2.0-aarch64: @@ -351,10 +352,31 @@ stages: agent-image: agent-aziotedge-ubuntu-20.04-arm64-docker arch: aarch64 os: mariner + os_id: cm os_version: 2 - mariner_release: 2.0-stable + release_tag: 2.0-stable target.identity: iot-identity-service/packages/mariner2/aarch64 target.iotedged: builds/mariner2/out/RPMS/aarch64 + 3.0-amd64: + agent-pool: $(pool.linux.name) + agent-image: agent-aziotedge-ubuntu-22.04-msmoby + arch: amd64 + os: azurelinux + os_id: azl + os_version: 3 + release_tag: 3.0-stable + target.identity: iot-identity-service/packages/azurelinux3/amd64 + target.iotedged: builds/azurelinux3/out/RPMS/x86_64 + 3.0-aarch64: + agent-pool: $(pool.linux.arm.name) + agent-image: agent-aziotedge-ubuntu-22.04-arm64-msmoby + arch: aarch64 + os: azurelinux + os_id: azl + os_version: 3 + release_tag: 3.0-stable + target.identity: iot-identity-service/packages/azurelinux3/aarch64 + target.iotedged: builds/azurelinux3/out/RPMS/aarch64 pool: name: $(agent-pool) demands: @@ -369,11 +391,11 @@ stages: echo "##vso[task.setvariable variable=PACKAGE_ARCH;]$(arch)" echo "PACKAGE_OS=$(os)" echo "##vso[task.setvariable variable=OSVERSION;]$(os_version)" - mariner_arch=$(arch) - if [ $mariner_arch == "amd64" ]; then - mariner_arch="x86_64" + azurelinux_arch=$(arch) + if [ $azurelinux_arch == "amd64" ]; then + azurelinux_arch="x86_64" fi - echo "##vso[task.setvariable variable=MARINER_ARCH;]$mariner_arch" + echo "##vso[task.setvariable variable=AZURELINUX_ARCH;]$azurelinux_arch" displayName: Set Version - bash: | set -xeuo pipefail @@ -403,12 +425,14 @@ stages: '/src/ci/package.sh' popd # aziot-edge package script expects to query the version from the identity package in the root source directory - sudo cp iot-identity-service/packages/mariner$(os_version)/$(arch)/aziot-identity-service-$packageVersion-1.cm$(os_version).$(MARINER_ARCH).rpm . + os_dirs='$(os)$(os_version)/$(arch)' + os_suffix='$(os_id)$(os_version).$(AZURELINUX_ARCH)' + sudo cp iot-identity-service/packages/$os_dirs/aziot-identity-service-$packageVersion-1.$os_suffix.rpm . displayName: Create aziot-identity packages - task: CopyFiles@2 displayName: Copy aziot-identity build logs to artifact staging inputs: - SourceFolder: iot-identity-service/Mariner-Build/build/logs/pkggen/rpmbuilding + SourceFolder: iot-identity-service/AzureLinux-Build/build/logs/pkggen/rpmbuilding Contents: | **/*.rpm.log TargetFolder: '$(build.artifactstagingdirectory)/aziot-identity' @@ -435,8 +459,8 @@ stages: -v "$(Build.SourcesDirectory):/src" \ -e "ARCH=$arch" \ -e "OS=$OS" \ - -e "MARINER_RELEASE=$MARINER_RELEASE" \ - -e "MARINER_ARCH=$MARINER_ARCH" \ + -e "AZURELINUX_RELEASE=$RELEASE_TAG" \ + -e "ARCH=$AZURELINUX_ARCH" \ -e "VERSION=$VERSION" \ --privileged \ 'mcr.microsoft.com/mirror/docker/library/ubuntu:22.04' \ @@ -445,7 +469,7 @@ stages: - task: CopyFiles@2 displayName: Copy aziot-edge build logs to artifact staging inputs: - SourceFolder: builds/mariner2/build/logs/pkggen/rpmbuilding + SourceFolder: builds/$(os)$(os_version)/build/logs/pkggen/rpmbuilding Contents: | **/*.rpm.log TargetFolder: '$(build.artifactstagingdirectory)/iotedged' diff --git a/edgelet/Cargo.lock b/edgelet/Cargo.lock index c9aeb0b7452..7404f8036ed 100644 --- a/edgelet/Cargo.lock +++ b/edgelet/Cargo.lock @@ -127,7 +127,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "aziot-cert-client-async" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "aziot-cert-common-http", "aziot-key-common", @@ -140,7 +140,7 @@ dependencies = [ [[package]] name = "aziot-cert-common-http" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "aziot-key-common", "serde", @@ -149,7 +149,7 @@ dependencies = [ [[package]] name = "aziot-certd-config" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "cert-renewal", "hex", @@ -192,7 +192,7 @@ dependencies = [ [[package]] name = "aziot-identity-client-async" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "aziot-cert-common-http", "aziot-identity-common", @@ -206,7 +206,7 @@ dependencies = [ [[package]] name = "aziot-identity-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "aziot-key-common", "http-common", @@ -217,7 +217,7 @@ dependencies = [ [[package]] name = "aziot-identity-common-http" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "aziot-cert-common-http", "aziot-identity-common", @@ -230,7 +230,7 @@ dependencies = [ [[package]] name = "aziot-identityd-config" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "aziot-identity-common", "cert-renewal", @@ -245,7 +245,7 @@ dependencies = [ [[package]] name = "aziot-key-client" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "aziot-key-common", "aziot-key-common-http", @@ -260,7 +260,7 @@ dependencies = [ [[package]] name = "aziot-key-client-async" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "aziot-key-common", "aziot-key-common-http", @@ -273,7 +273,7 @@ dependencies = [ [[package]] name = "aziot-key-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "serde", ] @@ -281,7 +281,7 @@ dependencies = [ [[package]] name = "aziot-key-common-http" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "aziot-key-common", "http-common", @@ -291,7 +291,7 @@ dependencies = [ [[package]] name = "aziot-key-openssl-engine" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "aziot-key-client", "aziot-key-common", @@ -309,7 +309,7 @@ dependencies = [ [[package]] name = "aziot-keyd-config" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "http-common", "libc", @@ -319,7 +319,7 @@ dependencies = [ [[package]] name = "aziot-keys-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "pkcs11", "serde", @@ -329,7 +329,7 @@ dependencies = [ [[package]] name = "aziot-tpmd-config" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "http-common", "serde", @@ -338,7 +338,7 @@ dependencies = [ [[package]] name = "aziotctl-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "anyhow", "aziot-certd-config", @@ -445,7 +445,7 @@ dependencies = [ [[package]] name = "cert-renewal" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "async-trait", "chrono", @@ -543,7 +543,7 @@ dependencies = [ [[package]] name = "config-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "serde", "toml", @@ -1200,7 +1200,7 @@ dependencies = [ [[package]] name = "http-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "async-trait", "base64 0.21.2", @@ -1500,7 +1500,7 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "logger" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "env_logger", "log", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "openssl-build" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "cc", ] @@ -1689,7 +1689,7 @@ dependencies = [ [[package]] name = "openssl-sys2" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "openssl-build", "openssl-sys", @@ -1698,7 +1698,7 @@ dependencies = [ [[package]] name = "openssl2" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "foreign-types", "foreign-types-shared", @@ -1758,7 +1758,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs11" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "foreign-types-shared", "lazy_static", @@ -1775,7 +1775,7 @@ dependencies = [ [[package]] name = "pkcs11-sys" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" [[package]] name = "pkg-config" @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "test-common" version = "0.1.0" -source = "git+https://github.com/Azure/iot-identity-service?branch=main#1e38b9e5295cc09f0fd4c6b810632fd91e0340f5" +source = "git+https://github.com/Azure/iot-identity-service?branch=main#0452db3f15c4e7d0ee21acf545a314e18ff866d2" dependencies = [ "aziot-identity-common", "aziot-identity-common-http", diff --git a/edgelet/build/linux/package-mariner.sh b/edgelet/build/linux/package-mariner.sh index b5b986c2ffa..f4173866786 100755 --- a/edgelet/build/linux/package-mariner.sh +++ b/edgelet/build/linux/package-mariner.sh @@ -9,23 +9,22 @@ export DEBIAN_FRONTEND=noninteractive export TZ=UTC -# need to use preview repo for the next 2 weeks untill mariner 2.0 gets moved to prod -case "${MARINER_RELEASE}" in - '1.0'*) +case "$AZURELINUX_RELEASE" in + '2.0'*) UsePreview=n - MarinerIdentity=mariner1 - PackageExtension="cm1" + AzureLinuxIdentity=mariner2 + PackageExtension=cm2 ;; - '2.0'*) + '3.0'*) UsePreview=n - MarinerIdentity=mariner2 - PackageExtension="cm2" + AzureLinuxIdentity=azurelinux3 + PackageExtension=azl3 ;; esac BUILD_REPOSITORY_LOCALPATH="$(realpath "${BUILD_REPOSITORY_LOCALPATH:-$DIR/../../..}")" -EDGELET_ROOT="${BUILD_REPOSITORY_LOCALPATH}/edgelet" -MARINER_BUILD_ROOT="${BUILD_REPOSITORY_LOCALPATH}/builds/${MarinerIdentity}" +EDGELET_ROOT="$BUILD_REPOSITORY_LOCALPATH/edgelet" +AZURELINUX_BUILD_ROOT="$BUILD_REPOSITORY_LOCALPATH/builds/$AzureLinuxIdentity" REVISION="${REVISION:-1}" apt-get update -y @@ -34,25 +33,25 @@ apt-get install -y software-properties-common add-apt-repository -y ppa:longsleep/golang-backports apt-get update -y apt-get install -y \ - cmake curl gcc g++ git jq make pkg-config \ - libclang1 libssl-dev llvm-dev \ - cpio genisoimage golang-1.21-go qemu-utils pigz python3-pip python3-distutils rpm tar wget + cmake cpio curl g++ gcc genisoimage git golang-1.21-go jq libclang1 libssl-dev \ + llvm-dev make pigz pkg-config python3-distutils python3-pip qemu-utils rpm tar \ + wget zstd rm -f /usr/bin/go ln -vs /usr/lib/go-1.21/bin/go /usr/bin/go touch /.mariner-toolkit-ignore-dockerenv -# Download Mariner repo and build toolkit -mkdir -p ${MARINER_BUILD_ROOT} -MarinerToolkitDir='/tmp/CBL-Mariner' -if ! [ -f "$MarinerToolkitDir/toolkit.tar.gz" ]; then - rm -rf "$MarinerToolkitDir" - git clone 'https://github.com/microsoft/CBL-Mariner.git' --branch "$MARINER_RELEASE" --depth 1 "$MarinerToolkitDir" - pushd "$MarinerToolkitDir/toolkit/" +# Build Azure Linux toolkit +mkdir -p "$AZURELINUX_BUILD_ROOT" +AzureLinuxToolkitDir='/tmp/azurelinux' +if ! [ -f "$AzureLinuxToolkitDir/toolkit.tar.gz" ]; then + rm -rf "$AzureLinuxToolkitDir" + git clone 'https://github.com/microsoft/azurelinux.git' --branch "$AZURELINUX_RELEASE" --depth 1 "$AzureLinuxToolkitDir" + pushd "$AzureLinuxToolkitDir/toolkit/" make package-toolkit REBUILD_TOOLS=y popd - cp "$MarinerToolkitDir"/out/toolkit-*.tar.gz "${MARINER_BUILD_ROOT}/toolkit.tar.gz" - rm -rf MarinerToolkitDir + cp "$AzureLinuxToolkitDir"/out/toolkit-*.tar.gz "$AZURELINUX_BUILD_ROOT/toolkit.tar.gz" + rm -rf $AzureLinuxToolkitDir fi echo 'Installing rustup' @@ -60,7 +59,7 @@ curl -sSLf https://sh.rustup.rs | sh -s -- -y . ~/.cargo/env pushd $EDGELET_ROOT -case "${MARINER_ARCH}" in +case "$ARCH" in 'x86_64') rustup target add x86_64-unknown-linux-gnu ;; @@ -72,30 +71,30 @@ popd # get aziot-identity-service version IIS_VERSION=$( - rpm -qp --queryformat '%{Version}' $(ls /src/aziot-identity-service-*.$PackageExtension.${MARINER_ARCH}.rpm | head -1) + rpm -qp --queryformat '%{Version}' $(ls /src/aziot-identity-service-*.$PackageExtension.$ARCH.rpm | head -1) ) # Update versions in specfiles -pushd "${BUILD_REPOSITORY_LOCALPATH}" -sed -i "s/@@VERSION@@/${VERSION}/g" ${BUILD_REPOSITORY_LOCALPATH}/builds/mariner/SPECS/aziot-edge/aziot-edge.signatures.json -sed -i "s/@@VERSION@@/${VERSION}/g" ${BUILD_REPOSITORY_LOCALPATH}/builds/mariner/SPECS/aziot-edge/aziot-edge.spec -sed -i "s/@@RELEASE@@/${REVISION}/g" ${BUILD_REPOSITORY_LOCALPATH}/builds/mariner/SPECS/aziot-edge/aziot-edge.spec +pushd "$BUILD_REPOSITORY_LOCALPATH" +sed -i "s/@@VERSION@@/$VERSION/g" ${BUILD_REPOSITORY_LOCALPATH}/builds/mariner/SPECS/aziot-edge/aziot-edge.signatures.json +sed -i "s/@@VERSION@@/$VERSION/g" ${BUILD_REPOSITORY_LOCALPATH}/builds/mariner/SPECS/aziot-edge/aziot-edge.spec +sed -i "s/@@RELEASE@@/$REVISION/g" ${BUILD_REPOSITORY_LOCALPATH}/builds/mariner/SPECS/aziot-edge/aziot-edge.spec # Update aziot-identity-service version dependency if [[ ! -z $IIS_VERSION ]]; then - sed -i "s/@@IIS_VERSION@@/${IIS_VERSION}/g" ${BUILD_REPOSITORY_LOCALPATH}/builds/mariner/SPECS/aziot-edge/aziot-edge.spec + sed -i "s/@@IIS_VERSION@@/$IIS_VERSION/g" ${BUILD_REPOSITORY_LOCALPATH}/builds/mariner/SPECS/aziot-edge/aziot-edge.spec else # if a version could not be parsed remove the version dependency sed -i "s/aziot-identity-service = @@IIS_VERSION@@%{?dist}/aziot-identity-service/g" ${BUILD_REPOSITORY_LOCALPATH}/builds/mariner/SPECS/aziot-edge/aziot-edge.spec fi popd -pushd "${EDGELET_ROOT}" +pushd "$EDGELET_ROOT" -# Cargo vendored dependencies are being downloaded now to be cached for mariner iotedge build. +# Cargo vendored dependencies are being downloaded now to be cached for Azure Linux iotedge build. echo "set cargo home location" -mkdir ${BUILD_REPOSITORY_LOCALPATH}/cargo-home -export CARGO_HOME=${BUILD_REPOSITORY_LOCALPATH}/cargo-home +mkdir $BUILD_REPOSITORY_LOCALPATH/cargo-home +export CARGO_HOME=$BUILD_REPOSITORY_LOCALPATH/cargo-home echo "Vendoring Rust dependencies" cargo vendor vendor @@ -122,40 +121,40 @@ cp ../LICENSE ./LICENSE popd # EDGELET_ROOT # Create source tarball, including cargo dependencies and license -tmp_dir=$(mktemp -d -t mariner-iotedge-build-XXXXXXXXXX) -pushd $tmp_dir -echo "Creating source tarball aziot-edge-${VERSION}.tar.gz" -tar -czvf aziot-edge-${VERSION}.tar.gz --transform s/./aziot-edge-${VERSION}/ -C "${BUILD_REPOSITORY_LOCALPATH}" . +tmp_dir="$(mktemp -d -t azurelinux-iotedge-build-XXXXXXXXXX)" +pushd "$tmp_dir" +echo "Creating source tarball aziot-edge-$VERSION.tar.gz" +tar -czvf aziot-edge-$VERSION.tar.gz --transform s/./aziot-edge-$VERSION/ -C "$BUILD_REPOSITORY_LOCALPATH" . popd # Copy source tarball to expected locations -mkdir -p "${MARINER_BUILD_ROOT}/SPECS/aziot-edge/SOURCES/" -mv "${tmp_dir}/aziot-edge-${VERSION}.tar.gz" "${MARINER_BUILD_ROOT}/SPECS/aziot-edge/SOURCES/" -rm -rf ${tmp_dir} +mkdir -p "$AZURELINUX_BUILD_ROOT/SPECS/aziot-edge/SOURCES/" +mv "$tmp_dir/aziot-edge-$VERSION.tar.gz" "$AZURELINUX_BUILD_ROOT/SPECS/aziot-edge/SOURCES/" +rm -rf "$tmp_dir" # Copy spec files to expected locations -cp "${BUILD_REPOSITORY_LOCALPATH}/builds/mariner/SPECS/aziot-edge/aziot-edge.signatures.json" "${MARINER_BUILD_ROOT}/SPECS/aziot-edge/" -cp "${BUILD_REPOSITORY_LOCALPATH}/builds/mariner/SPECS/aziot-edge/aziot-edge.spec" "${MARINER_BUILD_ROOT}/SPECS/aziot-edge/" +cp "${BUILD_REPOSITORY_LOCALPATH}/builds/mariner/SPECS/aziot-edge/aziot-edge.signatures.json" "$AZURELINUX_BUILD_ROOT/SPECS/aziot-edge/" +cp "${BUILD_REPOSITORY_LOCALPATH}/builds/mariner/SPECS/aziot-edge/aziot-edge.spec" "$AZURELINUX_BUILD_ROOT/SPECS/aziot-edge/" tmp_dir=$(mktemp -d) pushd $tmp_dir mkdir "rust" cp -r ~/.cargo "rust" cp -r ~/.rustup "rust" -tar cf "${MARINER_BUILD_ROOT}/SPECS/aziot-edge/SOURCES/rust.tar.gz" "rust" +tar cf "$AZURELINUX_BUILD_ROOT/SPECS/aziot-edge/SOURCES/rust.tar.gz" "rust" popd # copy over IIS RPM -mkdir -p ${MARINER_BUILD_ROOT}/out/RPMS/${MARINER_ARCH} -mv /src/aziot-identity-service-*.$PackageExtension.${MARINER_ARCH}.rpm ${MARINER_BUILD_ROOT}/out/RPMS/${MARINER_ARCH} +mkdir -p $AZURELINUX_BUILD_ROOT/out/RPMS/$ARCH +mv /src/aziot-identity-service-*.$PackageExtension.$ARCH.rpm $AZURELINUX_BUILD_ROOT/out/RPMS/$ARCH # Prepare toolkit -pushd ${MARINER_BUILD_ROOT} +pushd $AZURELINUX_BUILD_ROOT tar xzf toolkit.tar.gz pushd toolkit -# Build Mariner RPM packages +# Build Azure Linux RPM packages make build-packages PACKAGE_BUILD_LIST="aziot-edge" SRPM_FILE_SIGNATURE_HANDLING=update USE_PREVIEW_REPO=$UsePreview CONFIG_FILE= -j$(nproc) popd popd 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 d49c20cc5b3..6115e96451b 100644 --- a/test/Microsoft.Azure.Devices.Edge.Test.Common/linux/EdgeDaemon.cs +++ b/test/Microsoft.Azure.Devices.Edge.Test.Common/linux/EdgeDaemon.cs @@ -87,6 +87,14 @@ void ThrowUnsupportedOs() => ThrowUnsupportedOs(); } + packageExtension = SupportedPackageExtension.Rpm; + break; + case "azurelinux": + if (version != "3.0") + { + ThrowUnsupportedOs(); + } + packageExtension = SupportedPackageExtension.Rpm; break; default: diff --git a/test/Microsoft.Azure.Devices.Edge.Test.Common/linux/PackageManagement.cs b/test/Microsoft.Azure.Devices.Edge.Test.Common/linux/PackageManagement.cs index 146e7a89f5d..7e7033793ed 100644 --- a/test/Microsoft.Azure.Devices.Edge.Test.Common/linux/PackageManagement.cs +++ b/test/Microsoft.Azure.Devices.Edge.Test.Common/linux/PackageManagement.cs @@ -59,7 +59,7 @@ public string[] GetInstallCommandsFromLocal(string path) "sudo mv -f ~/override.conf ${pathToOverride}/overrides.conf", "sudo systemctl daemon-reload" }, - "mariner" => new[] + "mariner" or "azurelinux" => new[] { "set -e", $"sudo dnf -y install {string.Join(' ', packages)}",