You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by se...@apache.org on 2021/09/19 14:19:01 UTC

[bigtop] branch master updated: Fix zeppelin build on ppc64le - JIRA BIGTOP-3560 (#813)

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

sekikn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git


The following commit(s) were added to refs/heads/master by this push:
     new 84da675  Fix zeppelin build on ppc64le - JIRA BIGTOP-3560 (#813)
84da675 is described below

commit 84da675c85ccbcb7717b28ea833e4cb8ffc5a09d
Author: afsanjar <af...@gmail.com>
AuthorDate: Sun Sep 19 09:18:55 2021 -0500

    Fix zeppelin build on ppc64le - JIRA BIGTOP-3560 (#813)
---
 .travis.yml                                        |  3 ++
 .../src/common/zeppelin/do-component-build         | 10 +++++
 .../src/common/zeppelin/patch2-ppc64le.diff        | 25 ++++++++++++
 .../grpc-java-1.28.0-add-support-for-ppc64le.patch | 12 ++++++
 bigtop_toolchain/manifests/grpc.pp                 | 47 ++++++++++++++++++++++
 bigtop_toolchain/manifests/installer.pp            |  1 +
 6 files changed, 98 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 05789c2..8e3c53c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,3 +20,6 @@ install:
 
 script:
 - mvn test -B
+
+arch:
+  - ppc64le
diff --git a/bigtop-packages/src/common/zeppelin/do-component-build b/bigtop-packages/src/common/zeppelin/do-component-build
index dc170b4..0559af5 100644
--- a/bigtop-packages/src/common/zeppelin/do-component-build
+++ b/bigtop-packages/src/common/zeppelin/do-component-build
@@ -45,6 +45,16 @@ BUILD_OPTS="-Dhadoop3.2.version=${HADOOP_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
diff --git a/bigtop-packages/src/common/zeppelin/patch2-ppc64le.diff b/bigtop-packages/src/common/zeppelin/patch2-ppc64le.diff
new file mode 100644
index 0000000..fabfe33
--- /dev/null
+++ b/bigtop-packages/src/common/zeppelin/patch2-ppc64le.diff
@@ -0,0 +1,25 @@
+diff --git a/zeppelin-web/package.json b/zeppelin-web/package.json
+index de83a629d..619a04d0c 100644
+--- a/zeppelin-web/package.json
++++ b/zeppelin-web/package.json
+@@ -7,7 +7,7 @@
+   },
+   "scripts": {
+     "clean": "rimraf dist && rimraf .tmp",
+-    "postinstall": "bower install --silent",
++    "postinstall": "bower install --silent --allow-root",
+     "prebuild": "npm-run-all clean lint:once",
+     "build:dist": "npm-run-all prebuild && grunt pre-webpack-dist && webpack && grunt post-webpack-dist",
+     "build:ci": "npm-run-all prebuild && grunt pre-webpack-ci && webpack && grunt post-webpack-dist",
+diff --git a/zeppelin-web/pom.xml b/zeppelin-web/pom.xml
+index 54e97053d..2433addd5 100644
+--- a/zeppelin-web/pom.xml
++++ b/zeppelin-web/pom.xml
+@@ -83,7 +83,7 @@
+             </goals>
+             <configuration>
+               <skip>${web.e2e.enabled}</skip>
+-              <arguments>install --no-lockfile</arguments>
++              <arguments>install --no-lockfile --unsafe-perm</arguments>
+             </configuration>
+           </execution>
diff --git a/bigtop_toolchain/files/grpc-java-1.28.0-add-support-for-ppc64le.patch b/bigtop_toolchain/files/grpc-java-1.28.0-add-support-for-ppc64le.patch
new file mode 100644
index 0000000..e40fd3a
--- /dev/null
+++ b/bigtop_toolchain/files/grpc-java-1.28.0-add-support-for-ppc64le.patch
@@ -0,0 +1,12 @@
+diff --git a/compiler/build.gradle b/compiler/build.gradle
+index 60d3a43..55acee0 100644
+--- a/compiler/build.gradle
++++ b/compiler/build.gradle
+@@ -105,7 +105,6 @@ model {
+                     // Link other (system) libraries dynamically.
+                     // Clang under OSX doesn't support these options.
+                     linker.args "-Wl,-Bstatic", "-lprotoc", "-lprotobuf", "-static-libgcc",
+-                            "-static-libstdc++",
+                             "-Wl,-Bdynamic", "-lpthread", "-s"
+                 }
+                 addEnvArgs("LDFLAGS", linker.args)
diff --git a/bigtop_toolchain/manifests/grpc.pp b/bigtop_toolchain/manifests/grpc.pp
new file mode 100644
index 0000000..bb7f2f8
--- /dev/null
+++ b/bigtop_toolchain/manifests/grpc.pp
@@ -0,0 +1,47 @@
+# 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.
+
+class bigtop_toolchain::grpc {
+
+  require bigtop_toolchain::jdk
+  require bigtop_toolchain::protobuf
+
+  $grpc_version = '1.28.0'
+  $proto_version = '3.5.1.1'
+  $proto_home = "/usr/local/protobuf-3.5.1.1"
+
+  if ($architecture == 'ppc64le') {
+
+  exec { "download grpc-java ${grpc_version}":
+      cwd  => "/usr/src",
+      command => "/usr/bin/wget https://github.com/grpc/grpc-java/archive/refs/tags/v${grpc_version}.tar.gz && mkdir -p grpc-java-${grpc_version} && /bin/tar -xvzf v${grpc_version}.tar.gz -C grpc-java-${grpc_version} --strip-components=1",
+      creates => "/usr/src/grpc-java-${grpc_version}",
+  }
+
+    file { "/usr/src/grpc-java-${grpc_version}/grpc-java-${grpc_version}-add-support-for-ppc64le.patch":
+      source => "puppet:///modules/bigtop_toolchain/grpc-java-${grpc_version}-add-support-for-ppc64le.patch",
+      require => Exec["download grpc-java ${grpc_version}"],
+    }
+
+  exec { "build grpc-java ${grpc_version}":
+      cwd => "/usr/src/grpc-java-${grpc_version}",
+      command => "/usr/bin/patch -p1 < grpc-java-${grpc_version}-add-support-for-ppc64le.patch && export LDFLAGS=-L/${proto_home}/lib && export CXXFLAGS=-I/${proto_home}/include && export LD_LIBRARY_PATH=/${proto_home}/lib && cd compiler && ../gradlew java_pluginExecutable -PskipAndroid=true",
+      creates => "/usr/local/grpc-java-${grpc_version}",
+      require => File["/usr/src/grpc-java-${grpc_version}/grpc-java-${grpc_version}-add-support-for-ppc64le.patch"],
+      timeout => 3000
+    }
+  }
+
+}
diff --git a/bigtop_toolchain/manifests/installer.pp b/bigtop_toolchain/manifests/installer.pp
index 8a09490..bcf9ee7 100644
--- a/bigtop_toolchain/manifests/installer.pp
+++ b/bigtop_toolchain/manifests/installer.pp
@@ -23,6 +23,7 @@ class bigtop_toolchain::installer {
   include bigtop_toolchain::env
   include bigtop_toolchain::user
   include bigtop_toolchain::renv
+  include bigtop_toolchain::grpc
 
   stage { 'last':
     require => Stage['main'],