Skip to content

Commit 9a30068

Browse files
authored
FIX: Upgrade RHEL 9 containers to Python 3.12 in CI (#396)
### Work Item / Issue Reference <!-- IMPORTANT: Please follow the PR template guidelines below. For mssql-python maintainers: Insert your ADO Work Item ID below (e.g. AB#37452) For external contributors: Insert Github Issue number below (e.g. #149) Only one reference is required - either GitHub issue OR ADO Work Item. --> <!-- mssql-python maintainers: ADO Work Item --> > [AB#41417](https://sqlclientdrivers.visualstudio.com/c6d89619-62de-46a0-8b46-70b92a84d85e/_workitems/edit/41417) <!-- External contributors: GitHub Issue --> > GitHub Issue: #<ISSUE_NUMBER> ------------------------------------------------------------------- ### Summary <!-- Insert your summary of changes below. Minimum 10 characters required. --> This pull request updates the PR validation pipeline to use Python 3.12 (available in RHEL 9.4+) instead of Python 3.9 for both x64 and ARM64 RHEL 9 containers. It also makes corresponding updates to the virtual environment setup and build steps, and omits certain packages to avoid conflicts. **Python version upgrade and environment updates:** * Updated all references and installation steps from `python3`/Python 3.9 to `python3.12`/Python 3.12 in the pipeline script, including virtual environment creation and dependency installation. [[1]](diffhunk://#diff-296c8f902bbd70f34ee1c8c32383c8c99165fe4c8e5b0f234f8f22246e56a621L1104-R1114) [[2]](diffhunk://#diff-296c8f902bbd70f34ee1c8c32383c8c99165fe4c8e5b0f234f8f22246e56a621L1167-R1167) [[3]](diffhunk://#diff-296c8f902bbd70f34ee1c8c32383c8c99165fe4c8e5b0f234f8f22246e56a621L1184-R1183) [[4]](diffhunk://#diff-296c8f902bbd70f34ee1c8c32383c8c99165fe4c8e5b0f234f8f22246e56a621L1320-R1329) [[5]](diffhunk://#diff-296c8f902bbd70f34ee1c8c32383c8c99165fe4c8e5b0f234f8f22246e56a621L1386-R1385) [[6]](diffhunk://#diff-296c8f902bbd70f34ee1c8c32383c8c99165fe4c8e5b0f234f8f22246e56a621L1403-R1401) **Package management improvements:** * Omitted installation of `curl` and `wget` to avoid conflicts with `curl-minimal` when setting up the Python 3.12 environment. [[1]](diffhunk://#diff-296c8f902bbd70f34ee1c8c32383c8c99165fe4c8e5b0f234f8f22246e56a621L1104-R1114) [[2]](diffhunk://#diff-296c8f902bbd70f34ee1c8c32383c8c99165fe4c8e5b0f234f8f22246e56a621L1320-R1329) <!-- ### PR Title Guide > For feature requests FEAT: (short-description) > For non-feature requests like test case updates, config updates , dependency updates etc CHORE: (short-description) > For Fix requests FIX: (short-description) > For doc update requests DOC: (short-description) > For Formatting, indentation, or styling update STYLE: (short-description) > For Refactor, without any feature changes REFACTOR: (short-description) > For release related changes, without any feature changes RELEASE: #<RELEASE_VERSION> (short-description) ### Contribution Guidelines External contributors: - Create a GitHub issue first: https://github.com/microsoft/mssql-python/issues/new - Link the GitHub issue in the "GitHub Issue" section above - Follow the PR title format and provide a meaningful summary mssql-python maintainers: - Create an ADO Work Item following internal processes - Link the ADO Work Item in the "ADO Work Item" section above - Follow the PR title format and provide a meaningful summary -->
1 parent 356ed50 commit 9a30068

1 file changed

Lines changed: 19 additions & 18 deletions

File tree

eng/pipelines/pr-validation-pipeline.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,7 @@ jobs:
982982
./build.sh
983983
"
984984
displayName: 'Build pybind bindings (.so) in $(distroName) ARM64 container'
985+
retryCountOnTaskFailure: 2
985986
986987
- script: |
987988
# Uninstall ODBC Driver before running tests
@@ -1101,18 +1102,17 @@ jobs:
11011102
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
11021103
subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms || dnf config-manager --set-enabled ubi-9-codeready-builder
11031104
1104-
# Install Python 3.9 (available in RHEL 9 UBI) and development tools
1105-
dnf install -y python3 python3-pip python3-devel cmake curl wget gnupg2 glibc-devel kernel-headers
1106-
dnf install -y python3-libs python3-debug
1107-
dnf install -y gcc gcc-c++ make binutils
1108-
dnf install -y cmake
1105+
# Install Python 3.12 (available in RHEL 9.4+) and development tools
1106+
# Note: curl and wget omitted to avoid conflicts with curl-minimal
1107+
dnf install -y python3.12 python3.12-pip python3.12-devel python3.12-libs gnupg2 glibc-devel kernel-headers
1108+
dnf install -y gcc gcc-c++ make binutils cmake
11091109
# If that doesn't work, try installing from different repositories
11101110
if ! which gcc; then
11111111
echo 'Trying alternative gcc installation...'
11121112
dnf --enablerepo=ubi-9-codeready-builder install -y gcc gcc-c++
11131113
fi
11141114
# Verify installation
1115-
python3 --version
1115+
python3.12 --version
11161116
which gcc && which g++
11171117
gcc --version
11181118
g++ --version
@@ -1164,8 +1164,8 @@ jobs:
11641164
- script: |
11651165
# Install Python dependencies in the container using virtual environment
11661166
docker exec test-container-rhel9 bash -c "
1167-
# Create a virtual environment with Python 3.9
1168-
python3 -m venv myvenv
1167+
# Create a virtual environment with Python 3.12
1168+
python3.12 -m venv myvenv
11691169
source myvenv/bin/activate
11701170
11711171
# Install dependencies in the virtual environment
@@ -1181,7 +1181,7 @@ jobs:
11811181
# Build pybind bindings in the container
11821182
docker exec test-container-rhel9 bash -c "
11831183
source myvenv/bin/activate
1184-
ls /usr/include/python3.9
1184+
ls /usr/include/python3.12
11851185
# Set compiler environment variables
11861186
export CC=/usr/bin/gcc
11871187
export CXX=/usr/bin/g++
@@ -1317,18 +1317,17 @@ jobs:
13171317
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
13181318
subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms || dnf config-manager --set-enabled ubi-9-codeready-builder
13191319
1320-
# Install Python 3.9 (available in RHEL 9 UBI) and development tools
1321-
dnf install -y python3 python3-pip python3-devel cmake curl wget gnupg2 glibc-devel kernel-headers
1322-
dnf install -y python3-libs python3-debug
1323-
dnf install -y gcc gcc-c++ make binutils
1324-
dnf install -y cmake
1320+
# Install Python 3.12 (available in RHEL 9.4+) and development tools
1321+
# Note: curl and wget omitted to avoid conflicts with curl-minimal
1322+
dnf install -y python3.12 python3.12-pip python3.12-devel python3.12-libs gnupg2 glibc-devel kernel-headers
1323+
dnf install -y gcc gcc-c++ make binutils cmake
13251324
# If that doesn't work, try installing from different repositories
13261325
if ! which gcc; then
13271326
echo 'Trying alternative gcc installation...'
13281327
dnf --enablerepo=ubi-9-codeready-builder install -y gcc gcc-c++
13291328
fi
13301329
# Verify installation and architecture
1331-
python3 --version
1330+
python3.12 --version
13321331
which gcc && which g++
13331332
gcc --version
13341333
g++ --version
@@ -1383,8 +1382,8 @@ jobs:
13831382
- script: |
13841383
# Install Python dependencies in the container using virtual environment
13851384
docker exec test-container-rhel9-arm64 bash -c "
1386-
# Create a virtual environment with Python 3.9
1387-
python3 -m venv myvenv
1385+
# Create a virtual environment with Python 3.12
1386+
python3.12 -m venv myvenv
13881387
source myvenv/bin/activate
13891388
13901389
# Install dependencies in the virtual environment
@@ -1400,7 +1399,7 @@ jobs:
14001399
# Build pybind bindings in the ARM64 container
14011400
docker exec test-container-rhel9-arm64 bash -c "
14021401
source myvenv/bin/activate
1403-
ls /usr/include/python3.9
1402+
ls /usr/include/python3.12
14041403
# Set compiler environment variables
14051404
export CC=/usr/bin/gcc
14061405
export CXX=/usr/bin/g++
@@ -1410,6 +1409,7 @@ jobs:
14101409
./build.sh
14111410
"
14121411
displayName: 'Build pybind bindings (.so) in RHEL 9 ARM64 container'
1412+
retryCountOnTaskFailure: 2
14131413
14141414
- script: |
14151415
# Uninstall ODBC Driver before running tests
@@ -1881,6 +1881,7 @@ jobs:
18811881
./build.sh
18821882
"
18831883
displayName: 'Build pybind bindings (.so) in Alpine ARM64 container'
1884+
retryCountOnTaskFailure: 2
18841885
18851886
- script: |
18861887
# Uninstall ODBC Driver before running tests to use bundled libraries

0 commit comments

Comments
 (0)