Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Commit 08e686c

Browse files
authored
Revert "Revert "Update to python3.11 for plpython (#17135)"" (#17190)
This reverts commit 721a760.
1 parent 08cd54a commit 08e686c

12 files changed

+50
-52
lines changed

README.Rhel-Rocky.bash

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@
22

33
# Install needed packages. Please add to this list if you discover additional prerequisites
44
sudo yum group install -y "Development Tools"
5-
INSTALL_PKGS="apr-devel bison bzip2-devel cmake3 epel-release flex gcc gcc-c++ krb5-devel libcurl-devel libevent-devel libkadm5 libxml2-devel libzstd-devel openssl-devel python39 python39-devel python39-psutil python3-pip perl-ExtUtils-MakeMaker.noarch perl-ExtUtils-Embed.noarch readline-devel rsync xerces-c-devel zlib-devel python3-psutil python3-pyyaml python3-psycopg2"
5+
INSTALL_PKGS="apr-devel bison bzip2-devel cmake3 epel-release flex gcc gcc-c++ krb5-devel libcurl-devel libevent-devel libkadm5 libxml2-devel libzstd-devel openssl-devel python3.11 python3.11-devel python3.11-psutil python3.11-pip perl-ExtUtils-MakeMaker.noarch perl-ExtUtils-Embed.noarch readline-devel rsync xerces-c-devel zlib-devel python3-psutil python3-pyyaml python3-psycopg2"
66

77
sudo yum install -y $INSTALL_PKGS
88

99
sudo yum --enablerepo=powertools install -y libyaml-devel
1010

1111
sudo yum install -y postgresql
1212
sudo yum install -y postgresql-devel
13+
sudo yum install -y python3-pip
1314

14-
pip3.9 install -r python-dependencies.txt
15-
16-
#Remove the python3 softlink because on Rocky8 its pointing to python3.6 by default. We need python3.9 for gpdb7.
17-
sudo rm -rf /usr/bin/python3
18-
sudo ln -s /usr/bin/python3.9 /usr/bin/python3
15+
pip3 install -r python-dependencies.txt
1916

2017
#For all Greenplum Database host systems running RHEL, CentOs or Rocky8, SELinux must either be Disabled or configured to allow unconfined access to Greenplum processes, directories, and the gpadmin user.
2118
setenforce 0

README.macOS.arm.bash

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ brew link --force libxml2
5050
brew install postgresql
5151

5252
# Installing python3 libraries
53-
brew install python@3.9
53+
brew install python@3.11
5454
python_version=$(echo `ls /opt/homebrew/Cellar/python@3.9/`)
55-
ln -s /opt/homebrew/Cellar/python@3.9/$python_version/bin/python3.9 /opt/homebrew/bin/python3
56-
ln -s /opt/homebrew/Cellar/python@3.9/$python_version/bin/pip3.9 /opt/homebrew/bin/pip3
55+
ln -s /opt/homebrew/Cellar/python@3.11/$python_version/bin/python3.11 /opt/homebrew/bin/python3
56+
ln -s /opt/homebrew/Cellar/python@3.11/$python_version/bin/pip3.11 /opt/homebrew/bin/pip3
5757
pip3 install -r python-dependencies.txt
5858
brew install pyenv
5959
pyenv install $python_version

concourse/scripts/common.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function configure() {
146146
# The full set of configure options which were used for building the
147147
# tree must be used here as well since the toplevel Makefile depends
148148
# on these options for deciding what to test. Since we don't ship
149-
./configure --prefix=/usr/local/greenplum-db-devel --disable-orca --enable-gpcloud --enable-orafce --enable-tap-tests --with-gssapi --with-libxml --with-openssl --with-perl --with-python --with-uuid=e2fs --with-llvm --with-zstd PYTHON=python3.9 PKG_CONFIG_PATH="${GPHOME}/lib/pkgconfig" ${CONFIGURE_FLAGS}
149+
./configure --prefix=/usr/local/greenplum-db-devel --disable-orca --enable-gpcloud --enable-orafce --enable-tap-tests --with-gssapi --with-libxml --with-openssl --with-perl --with-python --with-uuid=e2fs --with-llvm --with-zstd PYTHON=python3.11 PKG_CONFIG_PATH="${GPHOME}/lib/pkgconfig" ${CONFIGURE_FLAGS}
150150

151151
popd
152152
}

concourse/scripts/ic_gpdb_resgroup.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ run_resgroup_test() {
6363
export CPPFLAGS="-I\${GPHOME}/include"
6464
6565
cd /home/gpadmin/gpdb_src
66-
PYTHON=python3.9 ./configure --prefix=/usr/local/greenplum-db-devel \
66+
PYTHON=python3.11 ./configure --prefix=/usr/local/greenplum-db-devel \
6767
--without-zlib --without-rt --without-libcurl \
6868
--without-libedit-preferred --without-readline \
6969
--disable-gpcloud --disable-gpfdist --disable-orca \

concourse/scripts/ic_gpdb_resgroup_v2.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ run_resgroup_test() {
3737
export CPPFLAGS="-I\${GPHOME}/include"
3838
3939
cd /home/gpadmin/gpdb_src
40-
PYTHON=python3.9 ./configure --prefix=/usr/local/greenplum-db-devel \
40+
PYTHON=python3.11 ./configure --prefix=/usr/local/greenplum-db-devel \
4141
--without-zlib --without-rt --without-libcurl \
4242
--without-libedit-preferred --without-readline \
4343
--disable-gpcloud --disable-gpfdist --disable-orca \

concourse/scripts/ic_resgroup.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ run_resgroup_icw_test() {
9292
./configure --prefix=/usr/local/greenplum-db-devel --disable-orca --enable-gpfdist \
9393
--enable-gpcloud --enable-orafce --enable-tap-tests \
9494
--with-gssapi --with-libxml --with-openssl --with-perl --with-python \
95-
--with-uuid=e2fs --with-llvm --with-zstd PYTHON=python3.9 PKG_CONFIG_PATH="${GPHOME}/lib/pkgconfig" ${CONFIGURE_FLAGS}
95+
--with-uuid=e2fs --with-llvm --with-zstd PYTHON=python3.11 PKG_CONFIG_PATH="${GPHOME}/lib/pkgconfig" ${CONFIGURE_FLAGS}
9696
9797
LANG=en_US.utf8 make create-demo-cluster WITH_MIRRORS=${WITH_MIRRORS:-true}
9898
source /home/gpadmin/gpdb_src/gpAux/gpdemo/gpdemo-env.sh

gpAux/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ endif
139139

140140

141141
ifneq (false, ${PG_LANG})
142-
CONFIGFLAGS+= --with-perl --with-python PYTHON=python3.9
142+
CONFIGFLAGS+= --with-perl --with-python PYTHON=python3.11
143143
ifdef TCL_CFG
144144
CONFIGFLAGS+= --with-tcl-config=${TCL_CFG}
145145
endif

gpdb-doc/markdown/analytics/pl_python.html.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ PL/Python is a loadable procedural language. With the Greenplum Database PL/Pyth
1818

1919
You can run PL/Python code blocks as anonymous code blocks. See the [DO](../ref_guide/sql_commands/DO.html) command in the *Greenplum Database Reference Guide*.
2020

21-
The Greenplum Database PL/Python extension is installed by default with Greenplum Database. `plpython3u` supports developing functions using Python 3.9. The VMware Greenplum installation process installs a Python 3.9 environment to your system as one of its dependencies.
21+
The Greenplum Database PL/Python extension is installed by default with Greenplum Database. `plpython3u` supports developing functions using Python 3.11. The VMware Greenplum installation process installs a Python 3.11 environment to your system as one of its dependencies.
2222

2323
### <a id="topic3"></a>Greenplum Database PL/Python Limitations
2424

@@ -34,7 +34,7 @@ The PL/Python language is installed with Greenplum Database. To create and run a
3434

3535
For each database that requires its use, register the PL/Python language with the SQL command `CREATE EXTENSION`. Because PL/Python is an untrusted language, only superusers can register PL/Python with a database.
3636

37-
Run this command as the `gpadmin` user to register PL/Python with Python 3.9 support:
37+
Run this command as the `gpadmin` user to register PL/Python with Python 3.11 support:
3838

3939
```
4040
$ psql -d testdb -c 'CREATE EXTENSION plpython3u;'
@@ -45,7 +45,7 @@ PL/Python is registered as an untrusted language.
4545
### <a id="topic6"></a>Removing PL/Python Support
4646

4747

48-
Run this command as the `gpadmin` user to remove support for PL/Python for Python 3.9:
48+
Run this command as the `gpadmin` user to remove support for PL/Python for Python 3.11:
4949

5050
```
5151
$ psql -d testdb -c 'DROP EXTENSION plpython3u;'
@@ -332,41 +332,41 @@ A transaction cannot be ended when an explicit subtransaction is active.
332332

333333
When you install a Python module for development with PL/Python, the Greenplum Database Python environment must have the module added to it across all segment hosts and mirror hosts in the cluster. When expanding Greenplum Database, you must add the Python modules to the new segment hosts.
334334

335-
Greenplum Database provides a collection of data science-related Python modules that you can use to easily develop PL/Python functions in Greenplum. The modules are provided as two `.gppkg` format files that can be installed into a Greenplum cluster using the `gppkg` utility, with one package supporting development with Python 3.9. See [Python Data Science Module Packages](/oss/install_guide/install_python_dsmod.html) for installation instructions and descriptions of the provided modules.
335+
Greenplum Database provides a collection of data science-related Python modules that you can use to easily develop PL/Python functions in Greenplum. The modules are provided as two `.gppkg` format files that can be installed into a Greenplum cluster using the `gppkg` utility, with one package supporting development with Python 3.11. See [Python Data Science Module Packages](/oss/install_guide/install_python_dsmod.html) for installation instructions and descriptions of the provided modules.
336336

337337
To develop with modules that are not part of the Python Data Science Module packages, you can use Greenplum utilities such as `gpssh` and `gpsync` to run commands or copy files to all hosts in the Greenplum cluster. These sections describe how to use those utilities to install and use additional Python modules:
338338

339339
- [Verifying the Python Environment](#about_python_env)
340340
- [Installing Python pip](#topic_yx3_yjq_rt)
341-
- [Installing Python Packages for Python 3.9](#pip39)
341+
- [Installing Python Packages for Python 3.11](#pip311)
342342
- [Building and Installing Python Modules Locally](#topic_j53_5jq_rt)
343343
- [Testing Installed Python Modules](#topic_e4p_gcw_vt)
344344

345345
### <a id="about_python_env"></a>Verifying the Python Environment
346346

347-
The plpython3u is built with Python 3.9. To check the Python environment, you can use the `which` command:
347+
The plpython3u is built with Python 3.11. To check the Python environment, you can use the `which` command:
348348

349349
```
350-
which python3.9
350+
which python3.11
351351
```
352352

353353
When running shell commands on remote hosts with `gpssh`, specify the `-s` option to source the `greenplum_path.sh` file before running commands on the remote hosts. For example, this command should display the Python installed with Greenplum Database on each host specified in the `gpdb_hosts` file.
354354

355355
```
356-
gpssh -s -f gpdb_hosts which python3.9
356+
gpssh -s -f gpdb_hosts which python3.11
357357
```
358358

359359
To display the list of currently installed Python modules, run this command.
360360

361361
```
362-
python3.9 -c "help('modules')"
362+
python3.11 -c "help('modules')"
363363
```
364364

365365
You can optionally run `gpssh` in interactive mode to display Python modules on remote hosts. This example starts `gpssh` in interactive mode and lists the Python modules on the Greenplum Database host `sdw1`.
366366

367367
```
368368
$ gpssh -s -h sdw1
369-
=> python3.9 -c "help('modules')"
369+
=> python3.11 -c "help('modules')"
370370
. . .
371371
=> exit
372372
$
@@ -376,24 +376,24 @@ $
376376

377377
The Python utility `pip` installs Python packages that contain Python modules and other resource files from versioned archive files.
378378

379-
For Python 3.9, use:
379+
For Python 3.11, use:
380380
```
381-
python3.9 -m ensurepip --default-pip
381+
python3.11 -m ensurepip --default-pip
382382
```
383383

384384
The command runs the `ensurepip` module to bootstrap \(install and configure\) the `pip` utility from the local Python installation.
385385

386386
You can run this command to ensure the `pip`, `setuptools` and `wheel` projects are current. Current Python projects ensure that you can install Python packages from source distributions or pre-built distributions \(wheels\).
387387

388388
```
389-
python3.9 -m pip install --upgrade pip setuptools wheel
389+
python3.11 -m pip install --upgrade pip setuptools wheel
390390
```
391391

392392
You can use `gpssh` to run the commands on the Greenplum Database hosts. This example runs `gpssh` in interactive mode to install `pip` on the hosts listed in the file `gpdb_hosts`.
393393

394394
```
395395
$ gpssh -s -f gpdb_hosts
396-
=> python3.9 -m ensurepip --default-pip
396+
=> python3.11 -m ensurepip --default-pip
397397
[centos6-cdw1] Ignoring indexes: https://pypi.python.org/simple
398398
[centos6-cdw1] Collecting setuptools
399399
[centos6-cdw1] Collecting pip
@@ -422,7 +422,7 @@ For more information about installing Python packages, see [https://packaging.py
422422

423423

424424
```
425-
python3.9 -m pip install --user numpy scipy
425+
python3.11 -m pip install --user numpy scipy
426426
```
427427

428428
The `--user` option attempts to avoid conflicts when installing Python packages.
@@ -431,15 +431,15 @@ You can use `gpssh` to run the command on the Greenplum Database hosts.
431431

432432
For information about these and other Python packages, see [References](#topic12).
433433

434-
### <a id="pip39"></a>Installing Python Packages to a Non-Standard Location
434+
### <a id="pip311"></a>Installing Python Packages to a Non-Standard Location
435435

436-
You can optionally install Python 3.9 modules to a non-standard location by using the `--prefix` option with `pip`. For example:
436+
You can optionally install Python 3.11 modules to a non-standard location by using the `--prefix` option with `pip`. For example:
437437

438438
```
439439
gpssh -s -f gpdb_hosts
440440
=> unset PYTHONHOME
441441
=> unset PYTHONPATH
442-
=> $GPHOME/ext/python3.9 -m pip install --prefix=/home/gpadmin/my_python numpy scipy
442+
=> $GPHOME/ext/python3.11 -m pip install --prefix=/home/gpadmin/my_python numpy scipy
443443
```
444444

445445
If you use this option, keep in mind that the `PYTHONPATH` environment variable setting is cleared before initializing or executing functions using `plpython3u`. If you want to use modules installed to a custom location, you must configure the paths to those modules using the Greenplum configuration parameter `plpython3.python_path` instead of `PYTHONPATH`. For example:
@@ -512,14 +512,14 @@ If `FAILURE` is returned, these are some possible causes:
512512
Make sure you get no errors when running command on the segment host as the `gpadmin` user. This `gpssh` command tests importing the numpy module on the segment host `cdw1`.
513513

514514
```
515-
gpssh -s -h cdw1 python3.9 -c "import numpy"
515+
gpssh -s -h cdw1 python3.11 -c "import numpy"
516516
```
517517
518518
- The `plpython3.python_path` has not been set to the correct location.
519519
520520
## <a id="topic11"></a>Examples
521521
522-
This PL/Python function example uses Python 3.9 and returns the value of pi using the `numpy` module:
522+
This PL/Python function example uses Python 3.11 and returns the value of pi using the `numpy` module:
523523
524524
```
525525
CREATE OR REPLACE FUNCTION testpi()

gpdb-doc/markdown/install_guide/install_python_dsmod.html.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ Greenplum Database provides a collection of data science-related Python modules
66

77
This section contains the following information:
88

9-
- [Data Science Package for Python 3.9 Modules](#topic_pydatascimod3)
9+
- [Data Science Package for Python 3.11 Modules](#topic_pydatascimod3)
1010
- [Installing a Data Science Package for Python](#topic_instpdsm)
1111
- [Uninstalling a Data Science Package for Python](#topic_removepdsm)
1212

1313
For information about the Greenplum Database PL/Python Language, see [Greenplum PL/Python Language Extension](../analytics/pl_python.html).
1414

1515
**Parent topic:** [Installing Optional Extensions \(VMware Greenplum\)](data_sci_pkgs.html)
1616

17-
## <a id="topic_pydatascimod3"></a>Data Science Package for Python 3.9 Modules
17+
## <a id="topic_pydatascimod3"></a>Data Science Package for Python 3.11 Modules
1818

19-
The following table lists the modules that are provided in the Data Science Package for Python 3.9.
19+
The following table lists the modules that are provided in the Data Science Package for Python 3.11.
2020

2121
|Module Name|Description/Used For|
2222
|-----------|--------------------|
@@ -193,14 +193,14 @@ $ sudo yum install tk
193193

194194
1. Locate the Data Science Package for Python that you built or downloaded.
195195

196-
The file name format of the package is `DataSciencePython<pythonversion>-gp7-rhel<n>-x86_64.gppkg`. For example: `DataSciencePython3.9-3.0.0-gp7-rhel8_x86_64.gppkg`.
196+
The file name format of the package is `DataSciencePython<pythonversion>-<data-science-bundle-version>-gp7-rhel<n>-x86_64.gppkg`. For example: `DataSciencePython3.11-3.0.0-gp7-rhel8_x86_64.gppkg`.
197197

198198
2. Copy the package to the Greenplum Database coordinator host.
199199
3. Follow the instructions in [Verifying the Greenplum Database Software Download](../install_guide/verify_sw.html) to verify the integrity of the *Greenplum Procedural Languages Python Data Science Package* software.
200200
4. Use the `gppkg` command to install the package. For example:
201201

202202
```
203-
$ gppkg install DataSciencePython3.9-1.2.0-gp7-el8_x86_64.gppkg
203+
$ gppkg install DataSciencePython3.11-1.2.0-gp7-el8_x86_64.gppkg
204204
```
205205
206206
`gppkg` installs the Data Science Package for Python modules on all nodes in your Greenplum Database cluster. The command also updates the `PYTHONPATH`, `PATH`, and `LD_LIBRARY_PATH` environment variables in your `greenplum_path.sh` file.
@@ -216,7 +216,7 @@ $ sudo yum install tk
216216
The Data Science Package for Python modules are installed in the following directory:
217217
218218
```
219-
$GPHOME/ext/DataSciencePython/lib/python3.9/site-packages/
219+
$GPHOME/ext/DataSciencePython/lib/python3.11/site-packages/
220220
```
221221
222222
## <a id="topic_removepdsm"></a>Uninstalling a Data Science Package for Python

gpdb-doc/markdown/install_guide/platform-requirements-overview.html.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ Greenplum Database 7 requires the following software packages on RHEL systems. T
4646
- python3-psycopg2
4747
- python3-psutil
4848
- python3-pyyaml
49-
- python39
49+
- python3.11
50+
- python3.11-devel
5051
- readline
5152
- rsync
5253
- sed
@@ -83,12 +84,12 @@ Greenplum Databased 7 supports these Java versions for PL/Java and PXF:
8384

8485
#### <a id="topic_xbl_mkx_python"></a>Python
8586

86-
Greenplum Database uses the system default `python3` for the Greenplum management utilities, and `python3.9` for the [PL/Python module](../analytics/pl_python.html). For most of the supported OS versions, the system default `python3` is `python3.9`. If you are installing Greenplum Database on Rocky Linux 8, the default `python3` version included is `python3.6`. You may want to unify the `python3` versions to `python3.9` by running the following commands:
87+
Greenplum Database uses the system default `python3` for the Greenplum management utilities, and `python3.11` for the [PL/Python module](../analytics/pl_python.html). For most of the supported OS versions, the system default `python3` is `python3.9`. If you are installing Greenplum Database on Rocky Linux 8, the default `python3` version included is `python3.6`. You may want to unify the `python3` versions to `python3.11` by running the following commands:
8788

8889
```
89-
sudo yum install python39-psycopg2 python39-pyyaml python39-psutil
90-
sudo update-alternatives set python3 /usr/bin/python39
91-
sudo update-alternatives set python /usr/bin/python39
90+
sudo yum install python3.11 python3.11-devel python3.11-psycopg2 python3.11-pyyaml python3.11-psutil
91+
sudo update-alternatives set python3 /usr/bin/python3.11
92+
sudo update-alternatives set python /usr/bin/python3.11
9293
```
9394

9495
## <a id="topic31"></a>VMware Greenplum Tools and Extensions Compatibility
@@ -126,7 +127,7 @@ This table lists the versions of the Greenplum Extensions that are compatible wi
126127
<td class="entry cell-norowborder" style="vertical-align:top;" headers="d78288e689 ">Supports Java 8 and 11.</td>
127128
</tr>
128129
<tr class="row">
129-
<td class="entry nocellnorowborder" style="vertical-align:top;" headers="d78288e683 "><a class="xref" href="../install_guide/install_python_dsmod.html">Python 3.9 Data Science Module Package</a></td>
130+
<td class="entry nocellnorowborder" style="vertical-align:top;" headers="d78288e683 "><a class="xref" href="../install_guide/install_python_dsmod.html">Python 3.11 Data Science Module Package</a></td>
130131
<td class="entry nocellnorowborder" style="vertical-align:top;" headers="d78288e686 ">1.2</td>
131132
<td class="entry cell-norowborder" style="vertical-align:top;" headers="d78288e689 "> </td>
132133
</tr>

gpdb-doc/markdown/ref_guide/modules/postgresml.html.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ The `postgresml` module provides PostgresML functions for using tens of thousand
66

77
## <a id="prereqs"></a>Before Registering the `postgresml` Module
88

9-
Before registering the `postgresml` module, you must install the Data Science bundle for Python3.9, add the `pgml` library to the set of libraries the VMware Greenplum server loads at startup, and set the Python virtual environment:
9+
Before registering the `postgresml` module, you must install the Data Science bundle for Python3.11, add the `pgml` library to the set of libraries the VMware Greenplum server loads at startup, and set the Python virtual environment:
1010

11-
1. Install the Data Science bundle for Python 3.9.
11+
1. Install the Data Science bundle for Python 3.11.
1212

1313
For example:
1414

1515
```
16-
gppkg install DataSciencePython3.9-x.x.x-gp7-el8_x86_64.gppkg
16+
gppkg install DataSciencePython3.11-x.x.x-gp7-el8_x86_64.gppkg
1717
```
1818
1919
where x.x.x is the version string.
@@ -33,13 +33,13 @@ Before registering the `postgresml` module, you must install the Data Science bu
3333
At the session level:
3434
3535
```
36-
SET pgml.venv='$GPHOME/ext/DataSciencePython3.9';
36+
SET pgml.venv='$GPHOME/ext/DataSciencePython3.11';
3737
```
3838
3939
To last beyond a session:
4040
4141
```
42-
gpconfig -c pgml.venv -v '$GPHOME/ext/DataSciencePython3.9'
42+
gpconfig -c pgml.venv -v '$GPHOME/ext/DataSciencePython3.11'
4343
gpstop -u
4444
```
4545

0 commit comments

Comments
 (0)