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] Use Python 3.9 in RHEL 8's RPM #22606

Merged
merged 2 commits into from
Jun 3, 2022
Merged

Conversation

jiasli
Copy link
Member

@jiasli jiasli commented May 25, 2022

Description

Red Hat Enterprise Linux (RHEL) 8 now has Python 3.6, 3.8, and 3.9: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/assembly_installing-and-using-python_configuring-basic-system-settings

Since Python 3.6 has been deprecated (#19858), we use Python 3.9 on RHEL 8.

@ghost ghost requested a review from yonzhan May 25, 2022 06:28
@ghost ghost added the Auto-Assign Auto assign by bot label May 25, 2022
@ghost ghost assigned jiasli May 25, 2022
@ghost ghost added this to the Jun 2022 (2022-07-05) milestone May 25, 2022
@ghost ghost added the Packaging label May 25, 2022
@jiasli
Copy link
Member Author

jiasli commented May 25, 2022

Off-topic: Personally, I don't really like the inconsistency of python3 package. This consistency causes all the fuss in this PR:

  • RHEL 8's python3 should point to a more modern version, instead of the deprecated Python 3.6.
  • Mariner should have specific versions of Python packages like python39, so that users can choose which one to install.

Comment on lines +15 to +16
# - On Mariner 1.0, 'python3' is Python 3.7
# - On Mariner 2.0, 'python3' is Python 3.9
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think this is good. Mariner should have specific versions of Python packages (microsoft/azurelinux#3058):

Explicit is better than implicit.
-- PEP 20 – The Zen of Python

@jiasli jiasli requested a review from bebound May 25, 2022 06:59
@@ -6,20 +6,22 @@ FROM registry.access.redhat.com/ubi8/ubi:${tag} AS build-env
ARG cli_version=dev

RUN yum update -y
RUN yum install -y wget rpm-build gcc libffi-devel python3-devel openssl-devel make bash diffutils patch dos2unix python3-virtualenv perl
Copy link
Member Author

@jiasli jiasli May 25, 2022

Choose a reason for hiding this comment

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

We use venv built-in module now. No need to install python3-virtualenv.

RHEL 8's python3-virtualenv actually requires Python 3.6.

# yum install python3-virtualenv
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Last metadata expiration check: 2:24:15 ago on Wed May 25 04:37:38 2022.
Dependencies resolved.
===========================================================================================================================
 Package                       Architecture  Version                                          Repository              Size
===========================================================================================================================
Installing:
 python3-virtualenv            noarch        15.1.0-21.module+el8.5.0+12207+5c5719bc          ubi-8-appstream        101 k
Upgrading:
 chkconfig                     x86_64        1.19.1-1.el8                                     ubi-8-baseos           198 k
 platform-python               x86_64        3.6.8-45.el8                                     ubi-8-baseos            85 k
 python3-libs                  x86_64        3.6.8-45.el8                                     ubi-8-baseos           7.8 M
Installing dependencies:
 libpkgconf                    x86_64        1.4.2-1.el8                                      ubi-8-baseos            35 k
 pkgconf                       x86_64        1.4.2-1.el8                                      ubi-8-baseos            38 k
 pkgconf-m4                    noarch        1.4.2-1.el8                                      ubi-8-baseos            17 k
 pkgconf-pkg-config            x86_64        1.4.2-1.el8                                      ubi-8-baseos            15 k
 platform-python-devel         x86_64        3.6.8-45.el8                                     ubi-8-appstream        250 k
 platform-python-pip           noarch        9.0.3-22.el8                                     ubi-8-baseos           1.6 M
 python-rpm-macros             noarch        3-41.el8                                         ubi-8-appstream         15 k
 python-srpm-macros            noarch        3-41.el8                                         ubi-8-appstream         15 k
 python3-pip                   noarch        9.0.3-22.el8                                     ubi-8-appstream         20 k
 python3-rpm-generators        noarch        5-7.el8                                          ubi-8-appstream         25 k
 python3-rpm-macros            noarch        3-41.el8                                         ubi-8-appstream         14 k
 python3-setuptools            noarch        39.2.0-6.el8                                     ubi-8-baseos           163 k
 python3-wheel-wheel           noarch        1:0.31.1-3.module+el8.5.0+12207+5c5719bc         ubi-8-appstream         45 k
 python36                      x86_64        3.6.8-38.module+el8.5.0+12207+5c5719bc           ubi-8-appstream         19 k
 python36-devel                x86_64        3.6.8-38.module+el8.5.0+12207+5c5719bc           ubi-8-appstream         17 k
Enabling module streams:
 python36                                    3.6

Transaction Summary
===========================================================================================================================
Install  16 Packages
Upgrade   3 Packages

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also remove python3-virtualenv in centos7.dockerfile?

@bebound
Copy link
Contributor

bebound commented May 25, 2022

There are many sed: command not found error in Rpm Package Mariner 2.0 log. Is this a bug of Mariner 2?

@jiasli
Copy link
Member Author

jiasli commented May 25, 2022

There are many sed: command not found error in Rpm Package Mariner 2.0 log. Is this a bug of Mariner 2?

You have sharp eyes! Because Mariner 2.0 removed many packages to make the docker image as small as possible.

@jiasli jiasli merged commit 22bd245 into Azure:dev Jun 3, 2022
@jiasli jiasli deleted the ubi8-py39 branch June 3, 2022 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Packaging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants