Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Commit 1476076

Browse files
thinker0nwangtw
andauthored
Java 11 support (#3454)
* Support Java 11 * config travis to use oracle jdk 11 * Java 11 support (#3399) * Support Java 11 * config travis to use oracle jdk 11 * Add check jdk version * Fix command arguments. Change insert gc_options Update list Fix gc-logging * Add missing parameter * typo * Add pause time * Add python3 for docker files * Revert "config travis to use oracle jdk 11" This reverts commit edaa84f. * Update unitest * Update unittest * Add JDK11 UnitTest * Add Unittest using Docker. * Add full test * Change JDK11 * Ignore PowerMock used for testing is not compatible with Java 11. * Change JDK11 for travis.yml * Update python * Update library requests, pylint * Revert "Update library requests, pylint" This reverts commit 7706d34. * Add ignore * Refactoring ReflectionUtils Co-authored-by: Ning Wang <[email protected]>
1 parent 0a6cecb commit 1476076

File tree

61 files changed

+764
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+764
-165
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dist: trusty
77
language: java
88

99
jdk:
10-
- oraclejdk8
10+
- oraclejdk11
1111

1212
addons:
1313
apt:

WORKSPACE

+12-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ maven_jar(
258258

259259
maven_jar(
260260
name = "javax_annotation_javax_annotation_api",
261-
artifact = "javax.annotation:javax.annotation-api:1.2",
261+
artifact = "javax.annotation:javax.annotation-api:1.3.2",
262262
)
263263

264264
maven_jar(
@@ -735,6 +735,17 @@ maven_jar(
735735
artifact = "org.apache.commons:commons-compress:1.14",
736736
)
737737

738+
maven_jar(
739+
name = "javax_xml_bind_jaxb",
740+
artifact = "javax.xml.bind:jaxb-api:2.3.0",
741+
)
742+
743+
maven_jar(
744+
name = "javax_activation_activation",
745+
artifact = "javax.activation:activation:1.1.1",
746+
)
747+
748+
738749
# bookkeeper & distributedlog dependencies
739750
maven_jar(
740751
name = "org_apache_distributedlog_core",

docker/compile/Dockerfile.centos7

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ RUN yum -y install \
3535
libtool \
3636
make \
3737
patch \
38-
python \
3938
python-devel \
40-
python-setuptools \
39+
python3-devel \
40+
python3-setuptools \
4141
zip \
4242
unzip \
4343
wget \
4444
which \
4545
tree \
46-
java-1.8.0-openjdk \
47-
java-1.8.0-openjdk-devel
46+
java-11-openjdk \
47+
java-11-openjdk-devel
4848

49-
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0
49+
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk
5050

5151
RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
5252
&& chmod +x /tmp/bazel.sh \

docker/compile/Dockerfile.debian9

+7-4
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@ RUN apt-get update && apt-get -y install \
3030
git \
3131
libtool \
3232
libtool-bin \
33-
python \
34-
python2.7-dev \
33+
python-dev \
34+
python3-dev \
3535
software-properties-common \
36-
python-setuptools \
36+
python3-setuptools \
3737
tree \
3838
zip \
3939
unzip \
40-
wget
40+
wget \
41+
openjdk-11-jdk-headless
42+
43+
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
4144

4245
RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
4346
&& chmod +x /tmp/bazel.sh \

docker/compile/Dockerfile.ubuntu14.04

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ RUN apt-get update && apt-get -y install \
3333
libssl-dev \
3434
git \
3535
libtool \
36-
python \
37-
python2.7-dev \
38-
python-software-properties \
39-
python-setuptools \
36+
python-dev \
37+
python3-dev \
38+
python3-software-properties \
39+
python3-setuptools \
4040
zip \
4141
unzip \
4242
wget \
4343
cmake \
4444
tree \
45-
openjdk-8-jdk-headless
45+
openjdk-11-jdk-headless
4646

47-
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
47+
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
4848

4949
RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
5050
&& chmod +x /tmp/bazel.sh \

docker/compile/Dockerfile.ubuntu16.04

+7-8
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,18 @@ RUN apt-get update && apt-get -y install \
3131
libtool-bin \
3232
libunwind8 \
3333
libunwind-setjmp0-dev \
34-
python \
35-
python2.7-dev \
36-
python-software-properties \
34+
python-dev \
35+
python3-dev \
36+
python3-software-properties \
3737
software-properties-common \
38-
python-setuptools \
38+
python3-setuptools \
3939
tree \
4040
zip \
4141
unzip \
42-
wget
42+
wget \
43+
openjdk-11-jdk-headless
4344

44-
RUN apt-get update && apt-get -y install openjdk-8-jdk-headless
45-
46-
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
45+
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
4746

4847
RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
4948
&& chmod +x /tmp/bazel.sh \

docker/compile/Dockerfile.ubuntu18.04

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ RUN apt-get update && apt-get -y install \
2929
libunwind8 \
3030
patch \
3131
python-dev \
32+
python3-dev \
3233
wget \
3334
zip \
3435
virtualenv \
3536
unzip \
3637
git \
3738
curl \
3839
tree \
39-
openjdk-8-jdk-headless
40+
openjdk-11-jdk-headless
4041

41-
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
42+
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
4243

4344
RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
4445
&& chmod +x /tmp/bazel.sh \

docker/dist/Dockerfile.dist.centos7

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ RUN yum -y install unzip; yum clean all
2323
RUN yum -y install which; yum clean all
2424
RUN yum -y install curl; yum clean all
2525
RUN yum -y install nmap-ncat; yum clean all
26-
RUN yum -y install python-setuptools; yum clean all
26+
RUN yum -y install python python3-setuptools; yum clean all
2727
RUN easy_install supervisor
2828
RUN echo_supervisord_conf > /etc/supervisord.conf
2929

30-
RUN yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel; yum clean all
30+
RUN yum -y install java-11-openjdk java-11-openjdk-devel; yum clean all
3131

32-
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0
32+
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk
3333

3434
ADD artifacts /heron
3535

docker/dist/Dockerfile.dist.debian9

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ FROM openjdk:8-jdk-slim
2020
RUN apt-get -y update && apt-get -y install \
2121
netcat-openbsd \
2222
python \
23+
python3 \
2324
unzip \
2425
curl \
2526
vim \
26-
supervisor && \
27+
supervisor \
28+
openjdk-11-jdk-headless && \
2729
apt-get clean all && \
2830
rm -rf /var/lib/apt/lists/*
2931

docker/dist/Dockerfile.dist.ubuntu14.04

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ FROM ubuntu:14.04
1919

2020
RUN apt-get -y update && apt-get -y install \
2121
python \
22+
python3 \
2223
unzip \
2324
software-properties-common \
2425
supervisor \
2526
curl
2627

2728
RUN add-apt-repository ppa:openjdk-r/ppa && apt-get -y update && \
28-
apt-get -y install openjdk-8-jdk
29+
apt-get -y install openjdk-11-jdk-headless
2930

30-
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
31+
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
3132
RUN update-ca-certificates -f
3233

3334
ADD artifacts /heron

docker/dist/Dockerfile.dist.ubuntu16.04

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ RUN apt-get update
2121

2222
RUN apt-get -y install \
2323
python \
24+
python3 \
2425
unzip \
2526
software-properties-common \
2627
curl \
2728
supervisor \
28-
openjdk-8-jdk-headless
29+
openjdk-11-jdk-headless
2930

30-
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
31+
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
3132
RUN update-ca-certificates -f
3233

3334
ADD artifacts /heron

docker/dist/Dockerfile.dist.ubuntu18.04

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ FROM ubuntu:18.04
1919

2020
RUN apt-get update
2121
RUN apt-get -y install \
22-
unzip software-properties-common curl supervisor openjdk-8-jdk-headless
22+
unzip software-properties-common curl python python3 supervisor openjdk-11-jdk-headless
2323

24-
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
24+
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
2525
RUN update-ca-certificates -f
2626

2727
ADD artifacts /heron

docker/scripts/test-docker.sh

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
set -o nounset
19+
set -o errexit
20+
21+
realpath() {
22+
echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
23+
}
24+
25+
DOCKER_DIR=$(dirname $(dirname $(realpath $0)))
26+
PROJECT_DIR=$(dirname $DOCKER_DIR)
27+
28+
verify_dockerfile_exists() {
29+
if [ ! -f $1 ]; then
30+
echo "The Dockerfiler $1 does not exist"
31+
exit 1
32+
fi
33+
}
34+
35+
dockerfile_path_for_platform() {
36+
echo "$SCRATCH_DIR/test/Dockerfile.$1"
37+
}
38+
39+
copy_bazel_rc_to() {
40+
cp $PROJECT_DIR/tools/docker/bazel.rc $1
41+
}
42+
43+
DOCKER_FILE=$(dockerfile_path_for_platform $TARGET_PLATFORM)
44+
verify_dockerfile_exists $DOCKER_FILE
45+
copy_bazel_rc_to $SCRATCH_DIR/bazelrc
46+
47+
echo "Building heron-compiler container"
48+
docker build -t heron-compiler:$TARGET_PLATFORM -f $DOCKER_FILE $SCRATCH_DIR
49+
50+
echo "Running build in container"
51+
docker run \
52+
--rm \
53+
-e TARGET_PLATFORM=$TARGET_PLATFORM \
54+
-e SCRATCH_DIR="/scratch" \
55+
-e SOURCE_TARBALL="/src.tar.gz" \
56+
-e HERON_VERSION=$HERON_VERSION \
57+
-e HERON_GIT_REV="${HERON_GIT_REV}" \
58+
-e HERON_BUILD_VERSION="${HERON_BUILD_VERSION}" \
59+
-e HERON_BUILD_HOST="${HERON_BUILD_HOST}" \
60+
-e HERON_BUILD_USER="${HERON_BUILD_USER}" \
61+
-e HERON_BUILD_TIME="${HERON_BUILD_TIME}" \
62+
-e HERON_TREE_STATUS="${HERON_TREE_STATUS}" \
63+
-v "$SOURCE_TARBALL:/src.tar.gz:ro" \
64+
-t heron-compiler:$TARGET_PLATFORM /test-platform.sh

docker/scripts/test-platform.sh

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/bash
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
set -o nounset
19+
set -o errexit
20+
21+
# By default bazel creates files with mode 0555 which means they are only able to be read and not written to. This
22+
# causes cp to fail when trying to overwrite the file. This makes sure that if the file exists we can overwrite it.
23+
function copyFileToDest() {
24+
if [ -f $2 ]; then
25+
chmod 755 $2
26+
fi
27+
28+
cp $1 $2
29+
}
30+
31+
echo "Building heron with version $HERON_VERSION for platform $TARGET_PLATFORM"
32+
33+
mkdir -p $SCRATCH_DIR
34+
cd $SCRATCH_DIR
35+
36+
echo "Extracting source"
37+
tar -C . -xzf $SOURCE_TARBALL
38+
39+
if [[ "$TARGET_PLATFORM" =~ "ubuntu" ]]; then
40+
CONFIG_PLATFORM=ubuntu
41+
elif [[ "$TARGET_PLATFORM" =~ "centos" ]]; then
42+
CONFIG_PLATFORM=centos
43+
elif [[ "$TARGET_PLATFORM" =~ "darwin" ]]; then
44+
CONFIG_PLATFORM=darwin
45+
elif [[ "$TARGET_PLATFORM" =~ "debian" ]]; then
46+
CONFIG_PLATFORM=debian
47+
elif [[ "$TARGET_PLATFORM" =~ "ubuntu_nostyle" ]]; then
48+
CONFIG_PLATFORM=ubuntu
49+
elif [[ "$TARGET_PLATFORM" =~ "centos_nostyle" ]]; then
50+
CONFIG_PLATFORM=centos
51+
elif [[ "$TARGET_PLATFORM" =~ "darwin_nostyle" ]]; then
52+
CONFIG_PLATFORM=darwin
53+
elif [[ "$TARGET_PLATFORM" =~ "debian_nostyle" ]]; then
54+
CONFIG_PLATFORM=debian
55+
else
56+
echo "Unknown platform: $TARGET_PLATFORM"
57+
exit 1
58+
fi
59+
60+
bazel version
61+
./bazel_configure.py
62+
bazel clean
63+
64+
echo "UnitTest"
65+
bazel test -c opt --jobs 25 \
66+
--config=$CONFIG_PLATFORM \
67+
--test_output=all \
68+
--test_summary=detailed \
69+
heron/... \
70+
heronpy/... \
71+
examples/... \
72+
storm-compatibility-examples/... \
73+
eco-storm-examples/... \
74+
eco-heron-examples/... \
75+
contrib/...
76+

0 commit comments

Comments
 (0)