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

rickyma pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git


The following commit(s) were added to refs/heads/master by this push:
     new f9411584a [#1966] improvement(script): Move rss-env.sh to conf folder 
(#1962)
f9411584a is described below

commit f9411584aca9b07579313f470c66c54ce71db435
Author: maobaolong <baoloong...@tencent.com>
AuthorDate: Fri Jul 26 14:57:50 2024 +0800

    [#1966] improvement(script): Move rss-env.sh to conf folder (#1962)
    
    ### What changes were proposed in this pull request?
    
    Move rss-env.sh to conf folder.
    
    ### Why are the changes needed?
    
    Fix #1966
    
    `rss-env.sh` is a part of config file, it is mutable, we should maintain it 
within config server rather than `bin` folder
    
    ### Does this PR introduce _any_ user-facing change?
    
    `rss-env.sh` is moved to `conf` folder.
    
    ### How was this patch tested?
    
    Start all components successfully.
---
 README.md                           |  4 ++--
 bin/utils.sh                        | 12 ++++++------
 {bin => conf}/rss-env.sh            | 12 +++++++++++-
 deploy/kubernetes/docker/Dockerfile |  4 ++--
 deploy/kubernetes/docker/rss-env.sh | 12 +++++++++++-
 docs/coordinator_guide.md           |  2 +-
 docs/server_guide.md                |  2 +-
 7 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/README.md b/README.md
index 26733eaba..f0a9e2ed2 100644
--- a/README.md
+++ b/README.md
@@ -151,7 +151,7 @@ If you have packaged tgz with hadoop jars, the env of 
`HADOOP_HOME` is needn't s
 ### Deploy Coordinator
 
 1. unzip package to RSS_HOME
-2. update RSS_HOME/bin/rss-env.sh, e.g.,
+2. update RSS_HOME/conf/rss-env.sh, e.g.,
    ```
      JAVA_HOME=<java_home>
      HADOOP_HOME=<hadoop home>
@@ -202,7 +202,7 @@ Shuffle Server use GRPC to transfer data)
 
 Deploy Steps:
 1. unzip package to RSS_HOME
-2. update RSS_HOME/bin/rss-env.sh, e.g.,
+2. update RSS_HOME/conf/rss-env.sh, e.g.,
    ```
      JAVA_HOME=<java_home>
      HADOOP_HOME=<hadoop home>
diff --git a/bin/utils.sh b/bin/utils.sh
index f30df831f..7398e2599 100644
--- a/bin/utils.sh
+++ b/bin/utils.sh
@@ -159,6 +159,12 @@ function load_rss_env {
 
   # find rss-env.sh
   set +o nounset
+  if [ -z "$RSS_HOME" ]; then
+    RSS_HOME="$(cd "$(dirname "$0")/.."; pwd)"
+  fi
+  if [ -z "$RSS_CONF_DIR" ]; then
+    RSS_CONF_DIR="${RSS_HOME}/conf"
+  fi
   if [ -f "${RSS_CONF_DIR}/rss-env.sh" ]; then
      RSS_ENV_SH="${RSS_CONF_DIR}/rss-env.sh"
   elif [ -f "${RSS_HOME}/bin/rss-env.sh" ]; then
@@ -180,12 +186,6 @@ function load_rss_env {
 
   # export default value
   set +o nounset
-  if [ -z "$RSS_HOME" ]; then
-    RSS_HOME="$(cd "$(dirname "$0")/.."; pwd)"
-  fi
-  if [ -z "$RSS_CONF_DIR" ]; then
-    RSS_CONF_DIR="${RSS_HOME}/conf"
-  fi
   if [ -z "$HADOOP_CONF_DIR" ] && [ "$HADOOP_HOME" ]; then
     HADOOP_CONF_DIR="${HADOOP_HOME}/etc/hadoop"
   fi
diff --git a/bin/rss-env.sh b/conf/rss-env.sh
similarity index 82%
rename from bin/rss-env.sh
rename to conf/rss-env.sh
index f67efdcd3..fb577e5d1 100644
--- a/bin/rss-env.sh
+++ b/conf/rss-env.sh
@@ -25,7 +25,17 @@ set -o errexit   # exit the script if any statement returns 
a non-true return va
 # HADOOP_HOME=<hadoop_home_dir>
 XMX_SIZE="80g" # Shuffle Server JVM XMX size
 
-# RSS_HOME, RSS home directory (Default: parent directory of the script)
+# RSS_HOME, RSS home directory (Default: parent directory of the script).
+# If you want to set it to another place, please make sure the RSS_HOME
+# specified externally is respected, by defining it as follows:
+#
+# RSS_HOME=${RSS_HOME:-{another_rss_home_path}}
+#
+# RSS_CONF_DIR, RSS configuration directory (Default: ${RSS_HOME}/conf)
+# Similar with RSS_HOME, RSS_CONF_DIR should respect external env variable.
+#
+# RSS_CONF_DIR=${RSS_CONF_DIR:-{another_rss_conf_dir}}
+
 # RSS_CONF_DIR, RSS configuration directory (Default: ${RSS_HOME}/conf)
 # HADOOP_CONF_DIR, Hadoop configuration directory (Default: 
${HADOOP_HOME}/etc/hadoop)
 # RSS_PID_DIR, Where the pid file is stored (Default: ${RSS_HOME})
diff --git a/deploy/kubernetes/docker/Dockerfile 
b/deploy/kubernetes/docker/Dockerfile
index 6f665ac09..21c0d62f0 100644
--- a/deploy/kubernetes/docker/Dockerfile
+++ b/deploy/kubernetes/docker/Dockerfile
@@ -37,10 +37,10 @@ USER rssadmin
 COPY rss-${RSS_VERSION}-hadoop${HADOOP_SHORT_VERSION}.tgz /data/rssadmin
 RUN tar -xvf 
/data/rssadmin/rss-${RSS_VERSION}-hadoop${HADOOP_SHORT_VERSION}.tgz -C 
/data/rssadmin
 RUN mv /data/rssadmin/rss-${RSS_VERSION}-hadoop${HADOOP_SHORT_VERSION} 
/data/rssadmin/rss
-RUN rm /data/rssadmin/rss/bin/rss-env.sh
+RUN rm /data/rssadmin/rss/conf/rss-env.sh
 RUN rm -rf /data/rssadmin/rss-${RSS_VERSION}-hadoop${HADOOP_SHORT_VERSION}.tgz
 
-COPY rss-env.sh /data/rssadmin/rss/bin
+COPY rss-env.sh /data/rssadmin/rss/conf
 
 COPY start.sh /data/rssadmin/rss/bin
 
diff --git a/deploy/kubernetes/docker/rss-env.sh 
b/deploy/kubernetes/docker/rss-env.sh
index 26fd6a737..7c8715331 100644
--- a/deploy/kubernetes/docker/rss-env.sh
+++ b/deploy/kubernetes/docker/rss-env.sh
@@ -25,7 +25,17 @@ HADOOP_HOME="/data/rssadmin/hadoop"
 RUNNER="${JAVA_HOME}/bin/java"
 JPS="${JAVA_HOME}/bin/jps"
 
-# RSS_HOME, RSS home directory (Default: parent directory of the script)
+# RSS_HOME, RSS home directory (Default: parent directory of the script).
+# If you want to set it to another place, please make sure the RSS_HOME
+# specified externally is respected, by defining it as follows:
+#
+# RSS_HOME=${RSS_HOME:-{another_rss_home_path}}
+#
+# RSS_CONF_DIR, RSS configuration directory (Default: ${RSS_HOME}/conf)
+# Similar with RSS_HOME, RSS_CONF_DIR should respect external env variable.
+#
+# RSS_CONF_DIR=${RSS_CONF_DIR:-{another_rss_conf_dir}}
+
 # RSS_CONF_DIR, RSS configuration directory (Default: ${RSS_HOME}/conf)
 # HADOOP_CONF_DIR, Hadoop configuration directory (Default: 
${HADOOP_HOME}/etc/hadoop)
 # RSS_PID_DIR, Where the pid file is stored (Default: ${RSS_HOME})
diff --git a/docs/coordinator_guide.md b/docs/coordinator_guide.md
index b91dcc325..c098ff1bc 100644
--- a/docs/coordinator_guide.md
+++ b/docs/coordinator_guide.md
@@ -30,7 +30,7 @@ This document will introduce how to deploy Uniffle 
coordinators.
 
 ### Steps
 1. unzip package to RSS_HOME
-2. update RSS_HOME/bin/rss-env.sh, eg,
+2. update RSS_HOME/conf/rss-env.sh, eg,
    ```
      JAVA_HOME=<java_home>
      HADOOP_HOME=<hadoop home>
diff --git a/docs/server_guide.md b/docs/server_guide.md
index 988007f60..b6408e3ec 100644
--- a/docs/server_guide.md
+++ b/docs/server_guide.md
@@ -26,7 +26,7 @@ This document will introduce how to deploy Uniffle shuffle 
servers.
 
 ### Steps
 1. unzip package to RSS_HOME
-2. update RSS_HOME/bin/rss-env.sh, eg,
+2. update RSS_HOME/conf/rss-env.sh, eg,
    ```
      JAVA_HOME=<java_home>
      HADOOP_HOME=<hadoop home>

Reply via email to