Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Packaging] Release Azure Linux 3 RPM package #29348

Merged
merged 9 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
48 changes: 25 additions & 23 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ jobs:

- job: BuildDockerImageAzureLinux
displayName: Build Docker Image Azure Linux
dependsOn: BuildRpmPackageMariner
dependsOn: BuildRpmPackageAzureLinux
strategy:
matrix:
${{ each arch in parameters.architectures }}:
Expand Down Expand Up @@ -766,19 +766,20 @@ jobs:
displayName: 'Test Homebrew Package'


- job: BuildRpmPackageMariner
- job: BuildRpmPackageAzureLinux
displayName: Build Rpm Package Mariner
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual', 'Schedule'))
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 }}
${{ each arch in parameters.architectures }}:
Mariner 2.0 ${{ arch.name }}:
image: mcr.microsoft.com/cbl-mariner/base/core:2.0
artifact: rpm-mariner2.0-${{ arch.value }}
pool: ${{ arch.pool }}
Azure Linux 3.0 ${{ arch.name }}:
image: azurelinuxpreview.azurecr.io/public/azurelinux/base/core:3.0
artifact: rpm-azurelinux3.0-${{ arch.value }}
pool: ${{ arch.pool }}
pool:
name: $(pool)
steps:
Expand All @@ -802,25 +803,26 @@ jobs:
TargetPath: $(Build.ArtifactStagingDirectory)
ArtifactName: $(artifact)

- job: TestRpmPackageMariner
displayName: Test Rpm Package Mariner
- job: TestRpmPackageAzureLinux
displayName: Test Rpm Package
timeoutInMinutes: 120
dependsOn:
- BuildRpmPackageMariner
- BuildRpmPackageAzureLinux
- 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 }}
${{ each arch in parameters.architectures }}:
Mariner 2.0 ${{ arch.name }}:
image: mcr.microsoft.com/cbl-mariner/base/core:2.0
artifact: rpm-mariner2.0-${{ arch.value }}
pool: ${{ arch.pool }}
Azure Linux 3.0 ${{ arch.name }}:
image: azurelinuxpreview.azurecr.io/public/azurelinux/base/core:3.0
artifact: rpm-azurelinux3.0-${{ arch.value }}
pool: ${{ arch.pool }}
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Metadata'
Expand All @@ -841,7 +843,7 @@ jobs:
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')
RPM_NAME=$(find $SYSTEM_ARTIFACTSDIRECTORY/rpm/ -type f -name "azure-cli-$CLI_VERSION-1.*.rpm" -printf '%f\n')
Copy link
Member

Choose a reason for hiding this comment

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

What will be the new package name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

azure-cli-2.62.0-1.azl3.x86_64.rpm

Copy link
Member

Choose a reason for hiding this comment

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

Can we add some example names to the comment, including both Mariner 2 and Azure Linux 3? This will increase the readability.


echo "== Test rpm package on ${IMAGE} =="
docker pull $IMAGE
Expand Down Expand Up @@ -1253,7 +1255,7 @@ jobs:
- BuildHomebrewFormula
- TestHomebrewFormula
- TestHomebrewPackage
- BuildRpmPackageMariner
- BuildRpmPackageAzureLinux
- BuildRpmPackages
- TestRpmPackage
- BuildDebPackages
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'License :: OSI Approved :: MIT License',
]

Expand Down
13 changes: 0 additions & 13 deletions scripts/release/rpm/build.sh

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/release/rpm/mariner.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ COPY . .
RUN dos2unix ./scripts/release/rpm/azure-cli.spec && \
REPO_PATH=$(pwd) CLI_VERSION=$cli_version PYTHON_PACKAGE=python3 PYTHON_CMD=python3 \
rpmbuild -v -bb --clean scripts/release/rpm/azure-cli.spec && \
cp /usr/src/mariner/RPMS/*/azure-cli-${cli_version}-1.*.rpm /azure-cli-dev.rpm && \
mkdir /out && cp /usr/src/mariner/RPMS/*/azure-cli-${cli_version}-1.*.rpm /out/
cp /usr/src/*/RPMS/*/azure-cli-${cli_version}-1.*.rpm /azure-cli-dev.rpm && \
Copy link
Member

Choose a reason for hiding this comment

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

What is the new path on Azure Linux 3.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/usr/src/azl/RPMS/x86_64/azure-cli-2.62.0-1.azl3.x86_64.rpm

Copy link
Member

Choose a reason for hiding this comment

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

Let's add some example names in the comment.

mkdir /out && cp /usr/src/*/RPMS/*/azure-cli-${cli_version}-1.*.rpm /out/

FROM ${image} AS execution-env

Expand Down
2 changes: 1 addition & 1 deletion scripts/release/rpm/test_mariner_in_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ time az self-test
time az --version

cd /azure-cli/
pip install wheel
python -m pip install --upgrade pip setuptools
Copy link
Contributor Author

@bebound bebound Aug 2, 2024

Choose a reason for hiding this comment

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

Previously, python3-setuptools package is installed by python3-devel package. The pip and setuptools are not latest version.
In Azure Linux 3, setuptools is not installed automatically. Use pip to explicitly install latest pip and setuptools

wheel is not a required package.

./scripts/ci/build.sh

# From Fedora36, when using `pip install --prefix` with root privileges, the package is installed into `{prefix}/local/lib`.
Expand Down
4 changes: 2 additions & 2 deletions scripts/release/rpm/test_rpm_in_docker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# This script should be run in a centos7 docker.
# This script should be run in a ubi8, ubi9 docker.
set -exv

export USERNAME=azureuser
Expand All @@ -15,7 +15,7 @@ time az self-test
time az --version

cd /azure-cli/
pip install wheel
python -m pip install --upgrade pip setuptools
./scripts/ci/build.sh

# From Fedora36, when using `pip install --prefix` with root privileges, the package is installed into `{prefix}/local/lib`.
Expand Down
Loading