You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by rm...@apache.org on 2022/05/17 15:44:46 UTC

[ranger] 04/04: RANGER-3760 Make trino-plugin configurable when trino running in docker

This is an automated email from the ASF dual-hosted git repository.

rmani pushed a commit to branch ranger-2.3
in repository https://gitbox.apache.org/repos/asf/ranger.git

commit 8ed0d334ae1fd5ee05b96564499ef407da940244
Author: Aakash Nand <aa...@gmail.com>
AuthorDate: Tue May 17 01:12:28 2022 +0900

    RANGER-3760 Make trino-plugin configurable when trino running in docker
    
    Trino uses different directory location when running in docker as
    compared to non-docker installation. This commit will make it
    configurable through install.properties where users can set
    INSTALL_ENV=docker when running trino in docker
    
    Signed-off-by: Ramesh Mani <rm...@cloudera.com>
---
 agents-common/scripts/enable-agent.sh   | 10 ++++++++++
 plugin-trino/scripts/install.properties |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/agents-common/scripts/enable-agent.sh b/agents-common/scripts/enable-agent.sh
index 4fdd32cd0..1302ac19c 100755
--- a/agents-common/scripts/enable-agent.sh
+++ b/agents-common/scripts/enable-agent.sh
@@ -125,6 +125,8 @@ PROJ_LIB_PLUGIN_DIR=${PROJ_INSTALL_DIR}/${PLUGIN_DEPENDENT_LIB_DIR}
 
 HCOMPONENT_INSTALL_DIR_NAME=$(getInstallProperty 'COMPONENT_INSTALL_DIR_NAME')
 
+# Install Environment property used for trino plugin.
+INSTALL_ENV=$(getInstallProperty 'INSTALL_ENV')
 
 CUSTOM_USER=$(getInstallProperty 'CUSTOM_USER')
 CUSTOM_USER=${CUSTOM_USER// }
@@ -220,6 +222,11 @@ elif [ "${HCOMPONENT_NAME}" = "presto" ]; then
     fi
 elif [ "${HCOMPONENT_NAME}" = "trino" ]; then
     HCOMPONENT_LIB_DIR=${HCOMPONENT_INSTALL_DIR}/plugin/ranger
+	#Configure ranger plugin location for trino docker environment
+    if [ "${INSTALL_ENV}" = "docker" ];then
+	   HCOMPONENT_LIB_DIR=/usr/lib/trino/plugin/ranger
+    fi
+
     if [ ! -d "${HCOMPONENT_LIB_DIR}" ]; then
         echo "INFO: Creating ${HCOMPONENT_LIB_DIR}"
         mkdir -p ${HCOMPONENT_LIB_DIR}
@@ -256,6 +263,9 @@ elif [ "${HCOMPONENT_NAME}" = "presto" ]; then
     HCOMPONENT_CONF_DIR=${HCOMPONENT_INSTALL_DIR}/etc
 elif [ "${HCOMPONENT_NAME}" = "trino" ]; then
     HCOMPONENT_CONF_DIR=${HCOMPONENT_INSTALL_DIR}/etc
+	if [ "${INSTALL_ENV}" = "docker" ];then
+	   HCOMPONENT_CONF_DIR=${HCOMPONENT_INSTALL_DIR}
+    fi
 fi
 
 HCOMPONENT_ARCHIVE_CONF_DIR=${HCOMPONENT_CONF_DIR}/.archive
diff --git a/plugin-trino/scripts/install.properties b/plugin-trino/scripts/install.properties
index 3685ed6b4..469b098c5 100644
--- a/plugin-trino/scripts/install.properties
+++ b/plugin-trino/scripts/install.properties
@@ -29,6 +29,8 @@ POLICY_MGR_URL=
 #
 REPOSITORY_NAME=
 
+# Configure INSTALL_ENV=docker if running trino in docker environment
+#INSTALL_ENV=docker
 #
 # Name of the directory where the component's lib and conf directory exist.
 # This location should be relative to the parent of the directory containing