Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 46 additions & 46 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -683,52 +683,52 @@ jobs:
TargetPath: $(Build.ArtifactStagingDirectory)
ArtifactName: $(artifact)

#- job: TestRpmPackageMariner
# displayName: Test Rpm Package Mariner
# timeoutInMinutes: 120
# dependsOn:
# - BuildRpmPackageMariner
# - ExtractMetadata
# condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual', 'Schedule'))
# pool:
# name: $(pool)
# strategy:
# matrix:
# 2.0 AMD64:
# image: mcr.microsoft.com/cbl-mariner/base/core:2.0
# artifact: rpm-mariner2.0-amd64
# pool: ${{ variables.ubuntu_pool }}
# 2.0 ARM64:
# image: mcr.microsoft.com/cbl-mariner/base/core:2.0
# artifact: rpm-mariner2.0-arm64
# pool: ${{ variables.ubuntu_arm64_pool }}
# steps:
# - task: DownloadPipelineArtifact@1
# displayName: 'Download Metadata'
# inputs:
# TargetPath: '$(Build.ArtifactStagingDirectory)/metadata'
# artifactName: metadata
#
# - task: DownloadPipelineArtifact@1
# displayName: 'Download Build Artifacts'
# inputs:
# TargetPath: '$(Build.ArtifactStagingDirectory)/rpm'
# artifactName: $(artifact)
#
# - bash: ./scripts/ci/install_docker.sh
# displayName: Install Docker
#
# - bash: |
# set -ex
#
# CLI_VERSION=`cat $SYSTEM_ARTIFACTSDIRECTORY/metadata/version`
# RPM_NAME=$(find $SYSTEM_ARTIFACTSDIRECTORY/rpm/ -type f -name "azure-cli-$CLI_VERSION-1.cm2.*.rpm" -printf '%f\n')
#
# echo "== Test rpm package on ${IMAGE} =="
# docker pull $IMAGE
# docker run --rm -e RPM_NAME=$RPM_NAME -v $SYSTEM_ARTIFACTSDIRECTORY/rpm:/mnt/rpm -v $(pwd):/azure-cli $IMAGE /bin/bash "/azure-cli/scripts/release/rpm/test_mariner_in_docker.sh"
#
# displayName: 'Test Rpm Package Mariner'
- job: TestRpmPackageMariner
displayName: Test Rpm Package Mariner
timeoutInMinutes: 120
dependsOn:
- BuildRpmPackageMariner
- ExtractMetadata
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual', 'Schedule'))
pool:
name: $(pool)
strategy:
matrix:
2.0 AMD64:
image: mcr.microsoft.com/cbl-mariner/base/core:2.0
artifact: rpm-mariner2.0-amd64
pool: ${{ variables.ubuntu_pool }}
2.0 ARM64:
image: mcr.microsoft.com/cbl-mariner/base/core:2.0
artifact: rpm-mariner2.0-arm64
pool: ${{ variables.ubuntu_arm64_pool }}
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Metadata'
inputs:
TargetPath: '$(Build.ArtifactStagingDirectory)/metadata'
artifactName: metadata

- task: DownloadPipelineArtifact@1
displayName: 'Download Build Artifacts'
inputs:
TargetPath: '$(Build.ArtifactStagingDirectory)/rpm'
artifactName: $(artifact)

- bash: ./scripts/ci/install_docker.sh
displayName: Install Docker

- bash: |
set -ex

CLI_VERSION=`cat $SYSTEM_ARTIFACTSDIRECTORY/metadata/version`
RPM_NAME=$(find $SYSTEM_ARTIFACTSDIRECTORY/rpm/ -type f -name "azure-cli-$CLI_VERSION-1.cm2.*.rpm" -printf '%f\n')

echo "== Test rpm package on ${IMAGE} =="
docker pull $IMAGE
docker run --rm -e RPM_NAME=$RPM_NAME -v $SYSTEM_ARTIFACTSDIRECTORY/rpm:/mnt/rpm -v $(pwd):/azure-cli $IMAGE /bin/bash "/azure-cli/scripts/release/rpm/test_mariner_in_docker.sh"

displayName: 'Test Rpm Package Mariner'

# TODO: rpmbuild on Red Hat UBI 8 is slow for unknown reason. Still working with Red Hat to investigate.
- job: BuildRpmPackages
Expand Down
7 changes: 6 additions & 1 deletion scripts/release/rpm/mariner.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ FROM ${image} AS build-env
ARG cli_version=dev

RUN tdnf update -y

# kernel-headers, glibc-devel, binutils are needed to install psutil python package on ARM64
RUN tdnf install -y binutils file rpm-build gcc libffi-devel python3-devel openssl-devel make diffutils patch dos2unix perl sed kernel-headers glibc-devel binutils
# ca-certificates: Mariner by default only adds a very minimal set of root certs to trust certain Microsoft
# resources (primarily packages.microsoft.com). ca-certificates contains the official Microsoft curated set of
# trusted root certificates. It has replaced the set of Mozilla Trusted Root Certificates.
RUN tdnf install -y binutils file rpm-build gcc libffi-devel python3-devel openssl-devel make diffutils patch \
dos2unix perl sed kernel-headers glibc-devel binutils ca-certificates

WORKDIR /azure-cli

Expand Down
4 changes: 2 additions & 2 deletions scripts/release/rpm/test_mariner_in_docker.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash

# This script should be run in a centos7 docker.
# This script should be run in a Mariner 2.0 docker container.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about change centos7 to ubi or fedora in test_rpm_in_docker.sh

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That‘s irrelevant to this PR. Let's keep this PR clean.

set -exv

export USERNAME=azureuser

tdnf --nogpgcheck install /mnt/rpm/$RPM_NAME -y

tdnf install git gcc python3-devel python3-pip findutils -y
tdnf install git gcc python3-devel python3-pip findutils ca-certificates -y

ln -s -f /usr/bin/python3 /usr/bin/python
time az self-test
Expand Down