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

roryqi 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 d5cb8ccf [MINOR] Tagged spark hadoop version in release package (#149)
d5cb8ccf is described below

commit d5cb8ccf47fec2e90ed24d97e4fd687d07f0bcd4
Author: Chen Zhang <[email protected]>
AuthorDate: Wed Aug 10 17:37:31 2022 +0800

    [MINOR] Tagged spark hadoop version in release package (#149)
    
    ### What changes were proposed in this pull request?
    
    Tag Spark and Hadoop version in release package.
    
    1. ~~Add version information to client jar name~~
    2. Add version information in RELEASE file
    
    
    An example:
    
    ```
    ./build_distribution.sh --spark3-profile 'spark3.0' --spark3-mvn '-Dx.x1=1 
-Dspark.version=3.0.2' -Dhadoop.version=2.8.0 -Dx.x2=2
    ```
    
    Before PR:
    
    ```
    $ cat RELEASE
    RSS 0.6.0-snapshot (git revision 04cbdbb) built
    Build flags: -Dhadoop.version=2.8.0 -Dx.x3=3
    ```
    
    After PR:
    
    ```
    $ cat RELEASE
    RSS 0.6.0-snapshot (git revision 27032c1) built for Hadoop 2.8.0 Spark2 
2.4.6 Spark3 3.0.2
    Build flags: --spark2-profile 'spark2' --spark2-mvn '' --spark3-profile 
'spark3.0' --spark3-mvn '-Dx.x1=1 -Dspark.version=3.0.2' -Dhadoop.version=2.8.0 
-Dx.x2=2
    ```
    
    ### Why are the changes needed?
    
    Unable to determine spark and hadoop version of release package, which may 
cause confusion in usage.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ~~Changed client jar name.~~
    
    
    ### How was this patch tested?
    
    local test
    
    Co-authored-by: zhangchen351 <[email protected]>
---
 build_distribution.sh | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/build_distribution.sh b/build_distribution.sh
index 75e227ac..2561807c 100755
--- a/build_distribution.sh
+++ b/build_distribution.sh
@@ -102,6 +102,20 @@ VERSION=$("$MVN" help:evaluate 
-Dexpression=project.version $@ 2>/dev/null |
   grep -v "WARNING" |
   tail -n 1)
 
+# Dependencies version
+HADOOP_VERSION=$("$MVN" help:evaluate -Dexpression=hadoop.version $@ 
2>/dev/null\
+    | grep -v "INFO"\
+    | grep -v "WARNING"\
+    | tail -n 1)
+SPARK2_VERSION=$("$MVN" help:evaluate -Dexpression=spark.version 
-P$SPARK2_PROFILE_ID $@ $SPARK2_MVN_OPTS 2>/dev/null\
+    | grep -v "INFO"\
+    | grep -v "WARNING"\
+    | tail -n 1)
+SPARK3_VERSION=$("$MVN" help:evaluate -Dexpression=spark.version 
-P$SPARK3_PROFILE_ID $@ $SPARK3_MVN_OPTS 2>/dev/null\
+    | grep -v "INFO"\
+    | grep -v "WARNING"\
+    | tail -n 1)
+
 echo "RSS version is $VERSION"
 
 export MAVEN_OPTS="${MAVEN_OPTS:--Xmx2g -XX:ReservedCodeCacheSize=1g}"
@@ -122,8 +136,8 @@ echo -e "\$ ${BUILD_COMMAND[@]}\n"
 DISTDIR="rss-$VERSION"
 rm -rf "$DISTDIR"
 mkdir -p "${DISTDIR}/jars"
-echo "RSS ${VERSION}${GITREVSTRING} built" >"${DISTDIR}/RELEASE"
-echo "Build flags: $@" >>"$DISTDIR/RELEASE"
+echo "RSS ${VERSION}${GITREVSTRING} built for Hadoop ${HADOOP_VERSION} Spark2 
${SPARK2_VERSION} Spark3 ${SPARK3_VERSION}" >"${DISTDIR}/RELEASE"
+echo "Build flags: --spark2-profile '$SPARK2_PROFILE_ID' --spark2-mvn 
'$SPARK2_MVN_OPTS' --spark3-profile '$SPARK3_PROFILE_ID' --spark3-mvn 
'$SPARK3_MVN_OPTS' $@" >>"$DISTDIR/RELEASE"
 mkdir -p "${DISTDIR}/logs"
 
 SERVER_JAR_DIR="${DISTDIR}/jars/server"

Reply via email to