From 5251ae2442a645d7c9078073ebd2a7a32986eacf Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Mon, 14 Apr 2025 16:51:38 +0800 Subject: [PATCH 1/3] Init --- azure-pipelines.yml | 16 ++++++++-------- scripts/release/rpm/azure-cli.spec | 1 + scripts/release/rpm/ubi.dockerfile | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0e93e93335e..060cb6a33cf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -816,13 +816,13 @@ jobs: dockerfile: ubi image: registry.access.redhat.com/ubi8/ubi:8.4 artifact: rpm-ubi8-${{ arch.value }} - python_package: python39 + python_package: python3.12 pool: ${{ arch.pool }} Red Hat Universal Base Image 9 ${{ arch.name }}: dockerfile: ubi image: registry.access.redhat.com/ubi9/ubi:9.0.0 artifact: rpm-ubi9-${{ arch.value }} - python_package: python3.9 + python_package: python3.12 pool: ${{ arch.pool }} steps: - bash: ./scripts/ci/install_docker.sh @@ -864,17 +864,17 @@ jobs: artifact: rpm-ubi8-${{ arch.value }} distro: el8 image: registry.access.redhat.com/ubi8/ubi:8.4 - python_package: python39 - python_cmd: python3.9 - pip_cmd: pip3.9 + python_package: python3.12 + python_cmd: python3.12 + pip_cmd: pip3.12 pool: ${{ arch.pool }} Red Hat Universal Base Image 9 ${{ arch.name }}: artifact: rpm-ubi9-${{ arch.value }} distro: el9 image: registry.access.redhat.com/ubi9/ubi:9.0.0 - python_package: python3.9 - python_cmd: python3.9 - pip_cmd: pip3.9 + python_package: python3.12 + python_cmd: python3.12 + pip_cmd: pip3.12 pool: ${{ arch.pool }} steps: - task: DownloadPipelineArtifact@1 diff --git a/scripts/release/rpm/azure-cli.spec b/scripts/release/rpm/azure-cli.spec index d8e6b610884..c8b65d2fc23 100644 --- a/scripts/release/rpm/azure-cli.spec +++ b/scripts/release/rpm/azure-cli.spec @@ -58,6 +58,7 @@ deactivate # Fix up %{buildroot} appearing in some files... for d in %{buildroot}%{cli_lib_dir}/bin/*; do perl -p -i -e "s#%{buildroot}##g" $d; done; +rm %{buildroot}%{cli_lib_dir}/pyvenv.cfg # Create executable (entry script) diff --git a/scripts/release/rpm/ubi.dockerfile b/scripts/release/rpm/ubi.dockerfile index 6a5de643b94..596d757ef39 100644 --- a/scripts/release/rpm/ubi.dockerfile +++ b/scripts/release/rpm/ubi.dockerfile @@ -5,7 +5,7 @@ ARG image=registry.access.redhat.com/ubi8/ubi:8.4 FROM ${image} AS build-env ARG cli_version=dev -ARG python_package=python39 +ARG python_package=python3.12 RUN yum update -y RUN yum install -y wget rpm-build gcc libffi-devel ${python_package}-devel openssl-devel make bash diffutils patch dos2unix perl @@ -18,7 +18,7 @@ COPY . . # We have to explicitly specify 'python39' to install Python 3.9. RUN --mount=type=secret,id=PIP_INDEX_URL export PIP_INDEX_URL=$(cat /run/secrets/PIP_INDEX_URL) && \ dos2unix ./scripts/release/rpm/azure-cli.spec && \ - REPO_PATH=$(pwd) CLI_VERSION=$cli_version PYTHON_PACKAGE=$python_package PYTHON_CMD=python3.9 \ + REPO_PATH=$(pwd) CLI_VERSION=$cli_version PYTHON_PACKAGE=$python_package PYTHON_CMD=$python_package \ rpmbuild -v -bb --clean scripts/release/rpm/azure-cli.spec && \ cp /root/rpmbuild/RPMS/*/azure-cli-${cli_version}-1.*.rpm /azure-cli-dev.rpm && \ mkdir /out && cp /root/rpmbuild/RPMS/*/azure-cli-${cli_version}-1.*.rpm /out/ From a64cea1e51b748ea90f44a135e0bf34b7dcfb9f5 Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Fri, 18 Apr 2025 16:00:08 +0800 Subject: [PATCH 2/3] Install pip --- scripts/release/rpm/test_rpm_in_docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/release/rpm/test_rpm_in_docker.sh b/scripts/release/rpm/test_rpm_in_docker.sh index be4cc9a4e66..564a19752c6 100644 --- a/scripts/release/rpm/test_rpm_in_docker.sh +++ b/scripts/release/rpm/test_rpm_in_docker.sh @@ -7,7 +7,7 @@ export USERNAME=azureuser dnf --nogpgcheck install /mnt/rpm/$RPM_NAME -y -dnf install git gcc $PYTHON_PACKAGE-devel findutils -y +dnf install git gcc $PYTHON_PACKAGE-devel findutils $PYTHON_PACKAGE-pip -y ln -s -f /usr/bin/$PYTHON_CMD /usr/bin/python ln -s -f /usr/bin/$PIP_CMD /usr/bin/pip From 8ae6d826267c21ced697b1350052e5348c8cbd54 Mon Sep 17 00:00:00 2001 From: Hang Date: Wed, 23 Apr 2025 15:54:50 +0800 Subject: [PATCH 3/3] Remove python3.12-devel, gcc --- scripts/release/rpm/test_rpm_in_docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/release/rpm/test_rpm_in_docker.sh b/scripts/release/rpm/test_rpm_in_docker.sh index 564a19752c6..3748bbc023c 100644 --- a/scripts/release/rpm/test_rpm_in_docker.sh +++ b/scripts/release/rpm/test_rpm_in_docker.sh @@ -7,7 +7,7 @@ export USERNAME=azureuser dnf --nogpgcheck install /mnt/rpm/$RPM_NAME -y -dnf install git gcc $PYTHON_PACKAGE-devel findutils $PYTHON_PACKAGE-pip -y +dnf install git findutils $PYTHON_PACKAGE-pip -y ln -s -f /usr/bin/$PYTHON_CMD /usr/bin/python ln -s -f /usr/bin/$PIP_CMD /usr/bin/pip