Skip to content

[multi-python] Support python3.11 on ubuntu22 #4116

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions tools/cloudera/build_hue_cloudera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function install_prerequisite() {
elif [[ $1 == "redhat9" ]]; then
redhat9_install
elif [[ $1 == "ubuntu22" ]]; then
ubuntu22_install
ubuntu22_install $2
elif [[ $1 == "redhat8-arm64" ]]; then
redhat8_arm64_install
fi
Expand Down Expand Up @@ -110,7 +110,7 @@ for PYTHON_VER in "${PYTHON_VERSIONS[@]}"; do
export SYS_PYTHON="$PYTHON39_PATH/bin/python3.9"
export SYS_PIP="$PYTHON39_PATH/bin/pip3.9"
export VIRTUAL_ENV_VERSION="20.19.0"
elif [[ $PYTHON_VER == "python3.11" && ( $DOCKEROS == "redhat9" || $DOCKEROS == "redhat8" || $DOCKEROS == "sles15" || $DOCKEROS == "redhat8-arm64" ) ]]; then
elif [[ $PYTHON_VER == "python3.11" && ( $DOCKEROS == "redhat9" || $DOCKEROS == "redhat8" || $DOCKEROS == "sles15" || $DOCKEROS == "redhat8-arm64" || $DOCKEROS == "ubuntu22" ) ]]; then
check_python311_path
export PATH="$PYTHON311_PATH/bin:$PATH"
export SYS_PYTHON="$PYTHON311_PATH/bin/python3.11"
Expand All @@ -121,7 +121,7 @@ for PYTHON_VER in "${PYTHON_VERSIONS[@]}"; do
fi

big_console_header "Hue PreRequisite Start for" $PYTHON_VER "$@"
install_prerequisite $DOCKEROS
install_prerequisite $DOCKEROS $PYTHON_VER
big_console_header "Hue PreRequisite End for" $PYTHON_VER "$@"

HUE_SRC=$(realpath "$WORK_DIR/../..")
Expand Down
20 changes: 11 additions & 9 deletions tools/cloudera/build_hue_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ function ubuntu20_install() {
}

function ubuntu22_install() {
local PYTHON_VERSION=${1:-"python3.11"} # Default to Python 3.11 if not provided

if [[ $FORCEINSTALL -eq 1 ]]; then
sudo -- sh -c 'apt update'
# Add deadsnakes PPA for Python 3.8
Expand All @@ -531,11 +533,11 @@ function ubuntu22_install() {
krb5-kdc \
krb5-config \
libkrb5-dev'
sudo -- sh -c 'apt -y install \
sudo -- sh -c "apt -y install \
ldap-utils \
libpython3.8-dev \
libpython3.8-minimal \
libpython3.8-stdlib \
lib${PYTHON_VERSION}-dev \
lib${PYTHON_VERSION}-minimal \
lib${PYTHON_VERSION}-stdlib \
libxmlsec1 \
libxmlsec1-openssl \
libpq-dev \
Expand All @@ -547,11 +549,11 @@ function ubuntu22_install() {
python3-psycopg2 \
python3-setuptools \
python3-wheel \
python3.8-venv \
${PYTHON_VERSION}-venv \
openssl \
sudo \
tar \
util-linux'
util-linux"
# Ensure pg_config is available
export PG_CONFIG=$(which pg_config)
if [ -z "$PG_CONFIG" ]; then
Expand All @@ -570,9 +572,9 @@ function ubuntu22_install() {
sudo pip_bin=${pip_bin} -- sh -c '${pip_bin} install psycopg2==2.9.6 --global-option=build_ext --global-option="--pg-config=$PG_CONFIG"'
sudo pip_bin=${pip_bin} -- sh -c 'ln -fs ${pip_bin} $(dirname ${pip_bin})/pip'
# sqlite3 install
sudo -- sh -c 'curl -o sqlite-autoconf-3350500.tar.gz https://sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
tar zxvf sqlite-autoconf-3350500.tar.gz && \
cd sqlite-autoconf-3350500 && \
sudo -- sh -c 'curl -o sqlite-autoconf-3450000.tar.gz https://sqlite.org/2024/sqlite-autoconf-3450000.tar.gz && \
tar zxvf sqlite-autoconf-3450000.tar.gz && \
cd sqlite-autoconf-3450000 && \
./configure --prefix=/usr/local/ && make && make install'
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
fi
Expand Down