Skip to content

Commit

Permalink
Fix to comment out JAVA SHIM code for ppc64le arch
Browse files Browse the repository at this point in the history
The JAVA SHIM is currently broken on architectures
other than x86_64. Hence commenting it out as an interim fix.
Also, using hyperledger/fabric-baseimage as base image for javaenv
as it is generally applicacable to all platforms.

Change-Id: If95385b790a6d874ff04480fbf713a5bd6d9ba1d
Signed-off-by: Srirama Sharma <sriramsh@in.ibm.com>
  • Loading branch information
SriramaSharma committed Nov 29, 2016
1 parent e4a9b47 commit c1fc31f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
16 changes: 13 additions & 3 deletions core/chaincode/shim/java/javabuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,17 @@
#
set -e
PARENTDIR=$(pwd)
ARCH=`uname -m`

gradle -q -b ${PARENTDIR}/core/chaincode/shim/java/build.gradle clean
gradle -q -b ${PARENTDIR}/core/chaincode/shim/java/build.gradle build
cp -r ${PARENTDIR}/core/chaincode/shim/java/build/libs /root/
if [ x$ARCH != xx86_64 ]
then
apt-get update && apt-get install openjdk-8-jdk -y
echo "FIXME: Java Shim code needs work on ppc64le. Commenting it for now."
else
add-apt-repository ppa:openjdk-r/ppa -y
apt-get update && apt-get install openjdk-8-jdk -y
update-java-alternatives -s java-1.8.0-openjdk-amd64
gradle -q -b ${PARENTDIR}/core/chaincode/shim/java/build.gradle clean
gradle -q -b ${PARENTDIR}/core/chaincode/shim/java/build.gradle build
cp -r ${PARENTDIR}/core/chaincode/shim/java/build/libs /root/
fi
2 changes: 1 addition & 1 deletion images/javaenv/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:8
FROM hyperledger/fabric-baseimage
RUN wget https://services.gradle.org/distributions/gradle-2.12-bin.zip -P /tmp --quiet
RUN unzip -qo /tmp/gradle-2.12-bin.zip -d /opt && rm /tmp/gradle-2.12-bin.zip
RUN ln -s /opt/gradle-2.12/bin/gradle /usr/bin
Expand Down
8 changes: 8 additions & 0 deletions scripts/goUnitTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ GO_LDFLAGS=$2

BASEIMAGE="hyperledger/fabric-peer"
IMAGE=$BASEIMAGE
ARCH=`uname -m`

if [ "$TAG" != "" ]
then
Expand All @@ -25,6 +26,13 @@ PKGS=`go list github.com/hyperledger/fabric/... | grep -v /vendor/ | \
grep -v /examples/chaincode/go/asset_management | \
grep -v /examples/chaincode/go/utxo | \
grep -v /examples/chaincode/go/rbac_tcerts_no_attrs`

if [ x$ARCH == xppc64le -o x$ARCH == xs390x ]
then
PKGS=`echo $PKGS | sed 's@'github.com/hyperledger/fabric/core/chaincode/platforms/java/test'@@g'`
PKGS=`echo $PKGS | sed 's@'github.com/hyperledger/fabric/core/chaincode/platforms/java'@@g'`
fi

echo "DONE!"

echo -n "Starting peer.."
Expand Down
7 changes: 7 additions & 0 deletions scripts/provision/host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ apt-get install --yes tcl tclx tcllib
apt-get install --yes npm

# Install JDK 1.8 for Java chaincode development
ARCH=`uname -m`
if [ x$ARCH == xx86_64 ]
then
add-apt-repository ppa:openjdk-r/ppa -y
fi
apt-get update && apt-get install openjdk-8-jdk -y

# Download Gradle and create sym link
Expand All @@ -54,5 +58,8 @@ curl -fsSL http://apache.osuosl.org/maven/maven-3/$MAVEN_VERSION/binaries/apache
| tar -xzC /usr/share/maven --strip-components=1 \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

if [ x$ARCH == xx86_64 ]
then
# Set the default JDK to 1.8
update-java-alternatives -s java-1.8.0-openjdk-amd64
fi

0 comments on commit c1fc31f

Please sign in to comment.