Skip to content

Commit

Permalink
Adding PPC platform support
Browse files Browse the repository at this point in the history
  • Loading branch information
ranade1 committed Sep 17, 2022
1 parent 5b37987 commit f69478b
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 6 deletions.
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
# Global variables
###################################
ROOT := $(realpath .)
PPC64LE := $(shell uname -m)

include $(ROOT)/Makefile.vars.priv

Expand Down Expand Up @@ -138,7 +139,11 @@ ifeq ($(PYTHON_VER),python2.7)
else ifeq ($(PYTHON_VER),python3.8)
@$(SYS_PYTHON) -m pip install --upgrade pip
@$(SYS_PIP) install virtualenv
@virtualenv -p $(PYTHON_VER) $(BLD_DIR_ENV)
@if [[ "ppc64le" == $(PPC64LE) ]]; then \
$(SYS_PYTHON) -m venv $(BLD_DIR_ENV); \
else \
virtualenv -p $(PYTHON_VER) $(BLD_DIR_ENV); \
fi
endif
@echo "--- Virtual environment $(BLD_DIR_ENV) ready"
@touch $@
Expand All @@ -149,9 +154,15 @@ ifeq ($(PYTHON_VER),python2.7)
@$(ENV_PIP) install --upgrade --force-reinstall $(PIP_MODULES)
@echo "--- done installing PIP_MODULES in virtual-env"
else ifeq ($(PYTHON_VER),python3.8)
@echo '--- Installing $(REQUIREMENT_FILE) into virtual-env via $(ENV_PIP)'
@$(ENV_PIP) install -r $(REQUIREMENT_FILE)
@echo '--- Finished $(REQUIREMENT_FILE) into virtual-env'
@if [[ "ppc64le" == $(PPC64LE) ]]; then \
echo '--- Installing $(REQUIREMENT_PPC64LE_FILE) into virtual-env via $(ENV_PIP)'; \
$(ENV_PIP) install -r $(REQUIREMENT_PPC64LE_FILE); \
echo '--- Finished $(REQUIREMENT_PPC64LE_FILE) into virtual-env'; \
else \
echo '--- Installing $(REQUIREMENT_FILE) into virtual-env via $(ENV_PIP)'; \
$(ENV_PIP) install -r $(REQUIREMENT_FILE); \
echo '--- Finished $(REQUIREMENT_FILE) into virtual-env'; \
fi
@$(ENV_PIP) install $(NAVOPTAPI_WHL)
@echo '--- Finished $(NAVOPTAPI_WHL) into virtual-env'
@touch $(REQUIREMENT_DOT_FILE)
Expand Down
1 change: 1 addition & 0 deletions Makefile.vars
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ PYBABEL := $(ROOT)/build/env/bin/pybabel
# Path to files for pip requirements
##############################
REQUIREMENT_FILE := $(ROOT)/desktop/core/requirements.txt
REQUIREMENT_PPC64LE_FILE := $(ROOT)/desktop/core/requirements_ppc64le.txt
REQUIREMENT_DOT_FILE := $(ROOT)/desktop/core/.requirements
NAVOPTAPI_WHL := $(ROOT)/desktop/core/wheels/navoptapi-1.0.0-py3-none-any.whl
BOTO_PKG := $(ROOT)/desktop/core/ext-py3/boto-2.49.0
Expand Down
4 changes: 4 additions & 0 deletions desktop/devtools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ PYPI_MIRROR ?= https://pypi.python.org/simple/
# Install/download dev tools for SDK into the virtual environment
.PHONY: $(DEVTOOLS)
$(DEVTOOLS):
ifeq ($(PYTHON_VER),python2.7)
@echo "--- Installing development tool: $@"
$(ENV_PIP) \
install $(subst ],,$(subst [,==,$@))
endif
@echo


$(BLD_DIR):
@mkdir -p $@
Expand Down
14 changes: 12 additions & 2 deletions tools/cloudera/build_hue_cloudera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,18 @@ function find_home() {
}

function install_prerequisite() {
export SQLITE3_PATH="$TOOLS_HOME/sqlite/sqlite3"
if [[ $1 == "redhat8_ppc" ]]; then
export FORCEINSTALL=0
export SQLITE3_PATH="$TOOLS_HOME/sqlite/bin/sqlite3"
redhat8_ppc_install
elif [[ $1 == "redhat7_ppc" ]]; then
export FORCEINSTALL=0
export SQLITE3_PATH="$TOOLS_HOME/sqlite/bin/sqlite3"
redhat7_ppc_install
source /opt/rh/rh-nodejs14/enable
fi

export SQLITE3_PATH=${SQLITE3_PATH:-"$TOOLS_HOME/sqlite/sqlite3"}
check_python_path
check_sqlite3
if [[ $1 == "centos7" ]]; then
Expand All @@ -52,7 +63,6 @@ function install_prerequisite() {
elif [[ $1 == "ubuntu20" ]]; then
ubuntu20_install
fi
ls -lR /usr/local/lib

}

Expand Down
79 changes: 79 additions & 0 deletions tools/cloudera/build_hue_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,85 @@ function check_sqlite3() {
fi
}

function redhat7_ppc_install() {
if [[ $FORCEINSTALL -eq 1 ]]; then
# pre-req install
sudo -- sh -c 'yum install -y cyrus-sasl-gssapi \
cyrus-sasl-plain \
java-11-openjdk \
java-11-openjdk-devel \
java-11-openjdk-headless \
krb5-workstation \
libpcap \
ncurses-devel \
nmap-ncat \
xmlsec1 \
xmlsec1-openssl \
unzip'
# NODEJS 14 install
sudo -- sh -c 'yum install -y rh-nodejs14-runtime-3.6-1.el7.ppc64le.rpm \
rh-nodejs14-npm-6.14.15-14.18.2.1.el7.ppc64le.rpm \
rh-nodejs14-nodejs-14.18.2-1.el7.ppc64le.rpm'
# sqlite3 install
sudo TOOLS_HOME=${TOOLS_HOME} -- sh -c 'mkdir -p ${TOOLS_HOME} && \
cd ${TOOLS_HOME} && \
curl -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
tar zxvf sqlite-autoconf-3350500.tar.gz && \
cd sqlite-autoconf-3350500 && \
./configure --prefix=${TOOLS_HOME}/sqlite && make && make install'
export LD_LIBRARY_PATH=${TOOLS_HOME}/sqlite/lib:/usr/local/lib:$LD_LIBRARY_PATH
# python3.8 re install for sqlite3 3.35.5 or higher version
sudo LD_LIBRARY_PATH=/usr/local/lib:$ORACLE_INSTANTCLIENT19_PATH:$LD_LIBRARY_PATH \
LD_RUN_PATH=/usr/local/lib:$ORACLE_INSTANTCLIENT19_PATH:$LD_RUN_PATH \
-- sh -c 'curl -o Python-3.8.13.tgz https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tgz && \
tar zxvf Python-3.8.13.tgz && \
cd Python-3.8.13 && \
./configure --enable-shared --prefix=/opt/cloudera/cm-agent && \
make install'
# Pip modules install
sudo pip38_bin=${pip38_bin} -- sh -c '${pip38_bin} install virtualenv virtualenv-make-relocatable'
fi
}

function redhat8_ppc_install() {
if [[ $FORCEINSTALL -eq 1 ]]; then
# pre-req install
sudo -- sh -c 'yum install -y \
python38 \
python38-libs \
python38-devel \
python38-numpy \
python38-PyMySQL \
python38-cryptography \
python38-cffi \
python38-psycopg2 \
python38-Cython \
python38-lxml \
java-11-openjdk-devel \
java-11-openjdk-headless \
krb5-workstation \
nmap-ncat \
xmlsec1 \
xmlsec1-openssl \
libss \
ncurses-devel'
# MySQLdb install
sudo -- sh -c 'yum install -y python3-mysqlclient'
# NODEJS 14 install
sudo -- sh -c 'yum install -y nodejs npm'
# Pip modules install
sudo pip38_bin=${pip38_bin} -- sh -c '${pip38_bin} install virtualenv virtualenv-make-relocatable mysqlclient'
# sqlite3 install
sudo TOOLS_HOME=${TOOLS_HOME} -- sh -c 'mkdir -p ${TOOLS_HOME} && \
cd ${TOOLS_HOME} && \
curl -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
tar zxvf sqlite-autoconf-3350500.tar.gz && \
cd sqlite-autoconf-3350500 && \
./configure --prefix=${TOOLS_HOME}/sqlite && make && make install'
export LD_LIBRARY_PATH=${TOOLS_HOME}/sqlite/lib:/usr/local/lib:$LD_LIBRARY_PATH
fi
}

function sles12_install() {
if [[ $FORCEINSTALL -eq 1 ]]; then
# pre-req install
Expand Down

0 comments on commit f69478b

Please sign in to comment.