Skip to content

Conversation

@afsanjar
Copy link
Contributor

// Link other (system) libraries dynamically.
// Clang under OSX doesn't support these options.
linker.args "-Wl,-Bstatic", "-lprotoc", "-lprotobuf", "-static-libgcc",
- "-static-libstdc++",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of removing this, adding libstdc++-static to the packages to be installed seemed to resolve the compiling issue on CentOS 7.
sekikn@b94539c#diff-9337fb34935804ab7b56cd89ae94e14491ad4c64804daa9b1843eeec336772edR67

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that would work on Ubuntu. But the fix is a backport of an upstream patch grpc/grpc-java#8141


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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think setting environment variables in the environment attribute is better for code simplicity.
sekikn@b94539c#diff-f2963d87c19d71d34863fb0039c7b3d3d0e3699b77bfd7bd57009ca568f51da6R78

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I am not a PP expert. My first time, I used https://github.com/apache/bigtop/blob/master/bigtop_toolchain/manifests/gradle.pp as a guide. Let me know if you need me to change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh got it:
environment => ['CXXFLAGS=-I/usr/local/protobuf-3.5.1.1/include', 'LDFLAGS=-L/usr/local/protobuf-3.5.1.1/lib'],

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sekikn, were you able to try to run the PR with all distros? If not, let me know. I'll try to do it over the weekend. Thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@afsanjar Sorry, I couldn't have enough time to do it. It's really helpful if you could try it on this weekend!

@sekikn
Copy link
Contributor

sekikn commented Aug 25, 2021

Hi @afsanjar, thank you so much for working on this! I've also tried this issue, so let me share my findings in addition to the comments above.
(Just for reference, my patch is sekikn@b94539c. But I only made sure it worked with CentOS 7, so I'm going to try your PR with all distros instead)

@sekikn
Copy link
Contributor

sekikn commented Sep 15, 2021

@afsanjar I've just tried the current PR and found two problems.

  1. I tried to create the Debian 10 image, but came across the following error. It seems that we have to ensure installing JDK precedes grpc-java.
jenkins@bigtop1slave:~/bigtop/docker/bigtop-slaves$ ./build.sh trunk-debian-10                                      

...

Step 4/6 : RUN if [ -f ~/.bash_profile ]; then . ~/.bash_profile; fi &&     apt-get clean && apt-get update &&     puppet apply -e "include bigtop_toolchain::installer" || if [ $? -ne 2 ]; then exit 1; fi                           
 ---> Running in 4b9c42c8296a                                                                                      
Hit:1 http://deb.debian.org/debian buster InRelease                                                                

...

Notice: /Stage[main]/Bigtop_toolchain::Grpc/Exec[download grpc-java 1.28.0]/returns: executed successfully
Notice: /Stage[main]/Bigtop_toolchain::Grpc/File[/usr/src/grpc-java-1.28.0/grpc-java-1.28.0-add-support-for-ppc64le.patch]/ensure: defined content as '{md5}a2fb2f8169fd1d1b1c973c2e6fb0bd1d'
Notice: /Stage[main]/Bigtop_toolchain::Grpc/Exec[build grpc-java 1.28.0]/returns: patching file compiler/build.gradle
Notice: /Stage[main]/Bigtop_toolchain::Grpc/Exec[build grpc-java 1.28.0]/returns: 
Notice: /Stage[main]/Bigtop_toolchain::Grpc/Exec[build grpc-java 1.28.0]/returns: ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Notice: /Stage[main]/Bigtop_toolchain::Grpc/Exec[build grpc-java 1.28.0]/returns: 
Notice: /Stage[main]/Bigtop_toolchain::Grpc/Exec[build grpc-java 1.28.0]/returns: Please set the JAVA_HOME variable in your environment to match the
Notice: /Stage[main]/Bigtop_toolchain::Grpc/Exec[build grpc-java 1.28.0]/returns: location of your Java installation.
Error: '/usr/bin/patch -p1 < grpc-java-1.28.0-add-support-for-ppc64le.patch && export LDFLAGS=-L//usr/local/protobuf-3.5.1.1/lib && export CXXFLAGS=-I//usr/local/protobuf-3.5.1.1/include && export LD_LIBRARY_PATH=//usr/local/protob
uf-3.5.1.1/lib && cd compiler && ../gradlew java_pluginExecutable -PskipAndroid=true' returned 1 instead of one of [0]
Error: /Stage[main]/Bigtop_toolchain::Grpc/Exec[build grpc-java 1.28.0]/returns: change from 'notrun' to ['0'] failed: '/usr/bin/patch -p1 < grpc-java-1.28.0-add-support-for-ppc64le.patch && export LDFLAGS=-L//usr/local/protobuf-3.
5.1.1/lib && export CXXFLAGS=-I//usr/local/protobuf-3.5.1.1/include && export LD_LIBRARY_PATH=//usr/local/protobuf-3.5.1.1/lib && cd compiler && ../gradlew java_pluginExecutable -PskipAndroid=true' returned 1 instead of one of [0]

...

Notice: /Stage[main]/Apt/Apt::Setting[conf-update-stamp]/File[/etc/apt/apt.conf.d/15update-stamp]/ensure: defined content as '{md5}0962d70c4ec78bbfa6f3544ae0c41974'
Notice: /Stage[main]/Bigtop_toolchain::Jdk/Apt::Source[adoptopenjdk]/Apt::Key[Add key: 8ED17AF5D7E675EB3EE3BCE98AC3B29174885C03 from Apt::Source adoptopenjdk]/Apt_key[Add key: 8ED17AF5D7E675EB3EE3BCE98AC3B29174885C03 from Apt::Source adoptopenjdk]/ensure: created
Notice: /Stage[main]/Bigtop_toolchain::Jdk/Apt::Source[adoptopenjdk]/Apt::Setting[list-adoptopenjdk]/File[/etc/apt/sources.list.d/adoptopenjdk.list]/ensure: defined content as '{md5}838e14e546e87e023031dc31717d86e9'
Notice: /Stage[main]/Apt::Update/Exec[apt_update]: Triggered 'refresh' from 1 event
Notice: /Stage[main]/Bigtop_toolchain::Jdk/Package[adoptopenjdk-8-hotspot]/ensure: created
Notice: /Stage[last]/Bigtop_toolchain::Cleanup/Exec[remove archives]: Dependency Exec[build grpc-java 1.28.0] has failures: true
Warning: /Stage[last]/Bigtop_toolchain::Cleanup/Exec[remove archives]: Skipping because of failed dependencies
Warning: /Stage[last]/Bigtop_toolchain::Cleanup/Exec[clean packages]: Skipping because of failed dependencies
Notice: Applied catalog in 5591.91 seconds
  1. The CentOS 7 image was successfully built, but I got the following error when building Zeppelin with it. This should be fixed by upgrading node and npm as I mentioned above.
jenkins@bigtop1slave:~/bigtop$ docker run -it -v $PWD:/bigtop bigtop/slaves:trunk-centos-7-ppc64le 
[root@23fed65f4b12 /]# cd bigtop
[root@23fed65f4b12 bigtop]# ./gradlew allclean zeppelin-pkg repo

...

[INFO] --- frontend-maven-plugin:1.6:npm (npm install) @ zeppelin-web ---                                                                                                                                                     [61/1976]
[INFO] Running 'npm install --no-lockfile' in /bigtop/build/zeppelin/rpm/BUILD/zeppelin-0.9.0/zeppelin-web
[ERROR] /bigtop/build/zeppelin/rpm/BUILD/zeppelin-0.9.0/zeppelin-web/node/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /bigtop/build/zeppelin/rpm/BUILD/zeppelin-0.9.0/zeppelin-web/node/node)
[ERROR] /bigtop/build/zeppelin/rpm/BUILD/zeppelin-0.9.0/zeppelin-web/node/node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /bigtop/build/zeppelin/rpm/BUILD/zeppelin-0.9.0/zeppelin-web/node/node)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Zeppelin 0.9.0:                                                                         
[INFO]                                                                                                             
[INFO] Zeppelin ........................................... SUCCESS [ 18.555 s]

...

[INFO] Zeppelin: Client Examples .......................... SUCCESS [  1.790 s]
[INFO] Zeppelin: web Application .......................... FAILURE [  7.872 s]

...

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  09:58 min
[INFO] Finished at: 2021-09-15T08:54:42Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:npm (npm install) on project zeppelin-web: Failed to run task: 'npm install --no-lockfile' failed. org.apache.commons.exec.ExecuteException: Process exite
d with an error: 1 (Exit value: 1) -> [Help 1]

Without the problems above, I succeeded in building Zeppelin on CentOS 8. Would you update the PR?

@sekikn
Copy link
Contributor

sekikn commented Sep 15, 2021

Or, if it's OK with you, I can merge the current PR since it works with CentOS 8 (and probably all of other distros except for CentOS 7 and Debian 10) and address the remaining issues as follow-up.

@afsanjar
Copy link
Contributor Author

Hi @sekikn, I fixed those issues (i.e., debain10 with JAVA_HOME issue) last weekend and merged your fixes zeppelin-web (i.e., root-access ). But have been swapped. I'll merge the fixes this weekend, is that okay?

@afsanjar
Copy link
Contributor Author

done

@sekikn
Copy link
Contributor

sekikn commented Sep 17, 2021

Great, thanks for the update! I confirmed the Debian 10 problem was fixed with the latest commit.

I think the CentOS 7 issue still remains, right? Would you add that commit to the PR too?
Just adding the following lines to the ppc64-specific section in do-component-build should work, just like #793.

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

@afsanjar
Copy link
Contributor Author

done

@sekikn
Copy link
Contributor

sekikn commented Sep 19, 2021

+1, confirmed the build on CentOS 7 also succeeded. Thanks a lot @afsanjar!

@sekikn sekikn merged commit 84da675 into apache:master Sep 19, 2021
sekikn pushed a commit that referenced this pull request Sep 19, 2021
@sekikn
Copy link
Contributor

sekikn commented Sep 19, 2021

Merged into branch-3.0 and master.

@afsanjar
Copy link
Contributor Author

thanks @sekikn . you did most of the work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants