blob: 0559af586425dec4e4836ebd4073a276512493d9 [file] [log] [blame]
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -ex
. `dirname $0`/bigtop.bom
# Zeppelin doesn't support Scala 2.12+ as of v0.9.0,
# so we use Scala 2.11 here.
# Though Zeppelin itself will be built with Scala 2.11,
# it works with other components built with Scala 2.12,
# e.g., Spark 3.x, through corresponding interpreters.
ZEPPELIN_SCALA_BINARY_VERSION=2.11
./dev/change_scala_version.sh ${ZEPPELIN_SCALA_BINARY_VERSION}
# We build Zeppelin with minimal interpreters here
# so as to reduce artifact size (cf. BIGTOP-2269).
# If we include all of these interpreters into
# the artifact, its size is 1.5GB as of v0.9.0,
# while it's around 750MB without them.
# Users can install them later via Zeppelin's "netinst" feature.
EXCLUDE_INTERPRETERS=!beam,!hbase,!pig,!jdbc,!flink,!ignite,!kylin,!lens,!cassandra,!elasticsearch,!bigquery,!alluxio,!scio,!groovy,!sap,!java,!geode,!neo4j,!hazelcastjet,!submarine,!sparql,!mongodb,!ksql,!scalding
# We don't specify scala.version or spark.version here,
# because Zeppelin builds shims for all of Spark 1.x (w/ Scala 2.10),
# Spark 2.x (w/ Scala 2.11), and Spark 3.x (w/ Scala 2.12) by default.
# Rather, explicitly specifying their version seems to cause build failure.
ZEPPELIN_LIVY_VERSION=${LIVY_VERSION}-incubating
BUILD_OPTS="-Dhadoop3.2.version=${HADOOP_VERSION} \
-Dlivy.version=${ZEPPELIN_LIVY_VERSION} \
-Pscala-${ZEPPELIN_SCALA_BINARY_VERSION} \
-Phadoop3 \
-Pbuild-distr"
if [ $HOSTTYPE = "powerpc64le" ] ; then
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.5.0 \
-Dclassifier=linux-ppcle_64 -Dpackaging=exe -Dfile=/usr/local/protobuf-3.5.1.1/bin/protoc
mvn install:install-file -DgroupId=io.grpc -DartifactId=protoc-gen-grpc-java -Dversion=1.28.0 -Dclassifier=linux-ppcle_64 -Dpackaging=exe -Dfile=/usr/src/grpc-java-1.28.0/compiler/build/exe/java_plugin/protoc-gen-grpc-java
sed -i "s|<node.version>v12.3.1</node.version>|<node.version>v12.22.1</node.version>|" pom.xml
sed -i "s|<npm.version>6.9.0</npm.version>|<npm.version>6.14.12</npm.version>|" pom.xml
fi
if [ "$ZEPPELIN_RUN_TESTS" = "true" ]; then
BUILD_OPTS="$BUILD_OPTS -DskipTests=false"
else
BUILD_OPTS="$BUILD_OPTS -DskipTests"
fi
export MAVEN_OPTS="-Xmx1500m -Xms1500m"
# BIGTOP-2742:
# The default zeppelin PIDFILE includes the literal $(hostname) string, which is carried into the init script's pidfile declaration.
# But pidfile does not subshell out to generate the expected string.
# The zeppelin process does indeed start up, but systemctl reports a failure because it's looking for a non-existent pidfile.
#
# Workaround:
# Remove unnecessary $HOSTNAME from zeppelin-daemon.sh and also make the same adjustment to zeppelin.svc.
# TODO:
# Request the issue to zeppelin upstream, If accepted, remove this workaround.
sed -i "s/^.*ZEPPELIN_PID=.*$/ZEPPELIN_PID=\"\$\{ZEPPELIN_PID_DIR\}\/zeppelin\-\$\{ZEPPELIN_IDENT_STRING\}\.pid\"/" bin/zeppelin-daemon.sh
mvn $BUILD_OPTS clean package -pl ''$EXCLUDE_INTERPRETERS'' -am
mkdir -p build/dist
tar -C build/dist --strip-components=1 -xzf zeppelin-distribution/target/zeppelin-*.tar.gz