Przeglądaj źródła

[Core] Adding support for Redhat9 PPC (#3404)

Ayush Goyal 2 lat temu
rodzic
commit
03510df34c

+ 3 - 3
Makefile

@@ -191,9 +191,9 @@ ifeq ($(PYTHON_VER),python3.9)
 	@touch $@
 	@echo '--- Installing PIP_MODULES in 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'; \
+	  echo '--- Installing $(REQUIREMENT_PPC64LE_FILE_PY39) into virtual-env via $(ENV_PIP)'; \
+	  $(ENV_PIP) install -r $(REQUIREMENT_PPC64LE_FILE_PY39); \
+	  echo '--- Finished $(REQUIREMENT_PPC64LE_FILE_PY39) into virtual-env'; \
 	 else \
 	  echo '--- Installing $(REQUIREMENT_FILE) into virtual-env via $(ENV_PIP)'; \
 	  $(ENV_PIP) install -r $(REQUIREMENT_FILE); \

+ 1 - 0
Makefile.vars

@@ -144,6 +144,7 @@ PYBABEL := $(ROOT)/build/env/bin/pybabel
 ##############################
 REQUIREMENT_FILE := $(ROOT)/desktop/core/requirements.txt
 REQUIREMENT_PPC64LE_FILE := $(ROOT)/desktop/core/requirements_ppc64le.txt
+REQUIREMENT_PPC64LE_FILE_PY39 := $(ROOT)/desktop/core/requirements_ppc64le_py39.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

+ 0 - 1
desktop/core/base_requirements.txt

@@ -56,7 +56,6 @@ python-pam==2.0.2
 pytidylib==0.3.2
 pytz==2021.3
 PyJWT==2.4.0
-PyYAML==5.4.1
 requests-kerberos==0.12.0
 rsa==4.7
 sasl==0.3.1  # Move to https://pypi.org/project/sasl3/ ?

+ 1 - 0
desktop/core/requirements.txt

@@ -2,5 +2,6 @@ cryptography==41.0.1
 numpy==1.23.1
 pandas==1.4.2
 lxml==4.9.1
+PyYAML==5.4.1
 -r ${ROOT}/desktop/core/base_requirements.txt
 

+ 1 - 1
desktop/core/src/desktop/loglistener.py

@@ -1,4 +1,4 @@
-#!/usr/bin/env python3.8
+#!/usr/bin/env python
 # Licensed to Cloudera, Inc. under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information

+ 7 - 3
tools/cloudera/build_hue_cloudera.sh

@@ -34,7 +34,11 @@ function find_home() {
 }
 
 function install_prerequisite() {
-  if [[ $1 == "redhat8_ppc" ]]; then
+  if [[ $1 == "redhat9_ppc" ]]; then
+    export FORCEINSTALL=0
+    export SQLITE3_PATH="$TOOLS_HOME/sqlite/bin/sqlite3"
+    redhat9_ppc_install
+  elif [[ $1 == "redhat8_ppc" ]]; then
     export FORCEINSTALL=0
     export SQLITE3_PATH="$TOOLS_HOME/sqlite/bin/sqlite3"
     redhat8_ppc_install
@@ -46,7 +50,7 @@ function install_prerequisite() {
   fi
 
   export SQLITE3_PATH=${SQLITE3_PATH:-"$TOOLS_HOME/sqlite/sqlite3"}
-  if [[ $1 != "redhat9" ]]; then
+  if [[ $1 != "redhat9" && $1 != "redhat9_ppc" ]]; then
     check_python38_path
   else
     check_python39_path
@@ -94,7 +98,7 @@ export LD_LIBRARY_PATH=/usr/local/lib:$ORACLE_INSTANTCLIENT19_PATH:$LD_LIBRARY_P
 export LD_RUN_PATH=/usr/local/lib:$ORACLE_INSTANTCLIENT19_PATH:$LD_RUN_PATH
 export PATH=$HOME/.local/bin:$PYTHON38_PATH/bin:${TOOLS_HOME}/sqlite:/usr/bin:$PATH
 
-if [[ $DOCKEROS == "redhat9" ]]; then
+if [[ $DOCKEROS == "redhat9" || $DOCKEROS == "redhat9_ppc" ]]; then
   export PYTHON_H=$PYTHON39_PATH/include/python3.9/Python.h
   export PYTHON_VER=python3.9
   export SYS_PYTHON=$PYTHON39_PATH/bin/python3.9

+ 30 - 0
tools/cloudera/build_hue_common.sh

@@ -121,6 +121,36 @@ function redhat8_ppc_install() {
   fi
 }
 
+function redhat9_ppc_install() {
+  if [[ $FORCEINSTALL -eq 1 ]]; then
+    # pre-req install
+    sudo -- sh -c 'yum install -y \
+      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 pip39_bin=${pip39_bin} -- sh -c '${pip39_bin} install virtualenv virtualenv-make-relocatable mysqlclient==2.1.1'
+    sudo pip39_bin=${pip39_bin} -- sh -c 'ln -fs ${pip39_bin} $(dirname ${pip39_bin})/pip'
+    # 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