Skip to content

Commit

Permalink
[mini-cluster] fix on building mini-cluster JAR
Browse files Browse the repository at this point in the history
Prior to this patch, build_mini_cluster_binaries.sh script didn't
properly handle the case of running in the same workspace that
was used to build the mini-cluster JAR for prior releases.  That
might result in not building the required JAR, so no binary
content would be uploaded by running publish_mini_cluster_binaries.sh
script later on.

This patch fixes the issue: by default, the build directory
is re-created upon every run of the build_mini_cluster_binaries.sh
script unless MINI_CLUSTER_NO_FRESH_BUILD environment variable is set.
Also, even if MINI_CLUSTER_NO_FRESH_BUILD is set and the build directory
is not re-created, the script now warns on ambiguity when multiple
artifact directories are present.

Change-Id: Ic2d5c2a83e2a0ab959e2eb7898d47ab736cd1e1f
Reviewed-on: http://gerrit.cloudera.org:8080/14702
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <[email protected]>
(cherry picked from commit 6406123)
Reviewed-on: http://gerrit.cloudera.org:8080/14728
Tested-by: Alexey Serbin <[email protected]>
Reviewed-by: Alexey Serbin <[email protected]>
  • Loading branch information
alexeyserbin committed Nov 16, 2019
1 parent e9d4701 commit 069f181
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion build-support/mini-cluster/build_mini_cluster_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ BUILD_ROOT=$SOURCE_ROOT/build/mini-cluster
MINI_CLUSTER_SRCDIR=$SOURCE_ROOT/build-support/mini-cluster
TARGETS="kudu kudu-tserver kudu-master"

# Remove leftovers from previous releases/builds: rename the existing directory.
# To skip this step, set the MINI_CLUSTER_NO_FRESH_BUILD environment variable.
if [ -n "$MINI_CLUSTER_NO_FRESH_BUILD" ]; then
echo "WARNING: using existing build directory"
else
suffix=$(date "+%Y%m%d.%H%M%S")
echo "Moving existing $BUILD_ROOT into $BUILD_ROOT.$suffix"
mv $BUILD_ROOT $BUILD_ROOT.$suffix
fi

cd $SOURCE_ROOT
if [ -n "$NO_REBUILD_THIRDPARTY" ]; then
echo Skipping thirdparty because NO_REBUILD_THIRDPARTY is not empty
Expand Down Expand Up @@ -120,7 +130,14 @@ make -j$NUM_PROCS $TARGETS
# Relocate the binaries.
$MINI_CLUSTER_SRCDIR/relocate_binaries_for_mini_cluster.py $BUILD_ROOT $TARGETS

ARTIFACT_NAME=$(ls -d kudu-binary* | sed 's#/##' | head -1)
ARTIFACT_NAME="$(ls -dF kudu-binary-* | egrep '.*/$' | sed 's#/##')"
if [ $(echo $ARTIFACT_NAME | wc -w) -ne 1 ]; then
echo "ERROR: this script can handle only single kudu-binary artifact, but"
echo " multiple kudu-binary-* directories found under $BUILD_ROOT:"
echo " $ARTIFACT_NAME"
echo " Remove extra kudu-binary-* directories"
exit 1
fi

# Strip everything to minimize the size of the tarball we generate.
echo Stripping symbols...
Expand Down

0 comments on commit 069f181

Please sign in to comment.