Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Java 11 #451

Merged
merged 2 commits into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .prow/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ presubmits:
always_run: true
spec:
containers:
- image: maven:3.6-jdk-8
- image: maven:3.6-jdk-11
command: [".prow/scripts/test-core-ingestion.sh"]
resources:
requests:
Expand All @@ -78,15 +78,15 @@ presubmits:
always_run: true
spec:
containers:
- image: maven:3.6-jdk-8
- image: maven:3.6-jdk-11
command: [".prow/scripts/test-serving.sh"]

- name: test-java-sdk
decorate: true
always_run: true
spec:
containers:
- image: maven:3.6-jdk-8
- image: maven:3.6-jdk-11
command: [".prow/scripts/test-java-sdk.sh"]

- name: test-python-sdk
Expand All @@ -110,7 +110,7 @@ presubmits:
always_run: true
spec:
containers:
- image: maven:3.6-jdk-8
- image: maven:3.6-jdk-11
command: [".prow/scripts/test-end-to-end.sh"]
resources:
requests:
Expand All @@ -126,7 +126,7 @@ presubmits:
secret:
secretName: feast-service-account
containers:
- image: maven:3.6-jdk-8
- image: maven:3.6-jdk-11
command: [".prow/scripts/test-end-to-end-batch.sh"]
resources:
requests:
Expand Down Expand Up @@ -167,7 +167,7 @@ postsubmits:
decorate: true
spec:
containers:
- image: maven:3.6-jdk-8
- image: maven:3.6-jdk-11
command:
- bash
- -c
Expand Down
6 changes: 6 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,5 +197,11 @@
<artifactId>spring-boot-test-autoconfigure</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>

</dependencies>
</project>
16 changes: 10 additions & 6 deletions core/src/main/java/feast/core/util/PipelineUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class PipelineUtil {

Expand All @@ -45,12 +47,7 @@ public class PipelineUtil {
public static List<String> detectClassPathResourcesToStage(ClassLoader classLoader)
throws IOException {
if (!(classLoader instanceof URLClassLoader)) {
String message =
String.format(
"Unable to use ClassLoader to detect classpath elements. "
+ "Current ClassLoader is %s, only URLClassLoaders are supported.",
classLoader);
throw new IllegalArgumentException(message);
return getClasspathFiles();
}

List<String> files = new ArrayList<>();
Expand All @@ -69,4 +66,11 @@ public static List<String> detectClassPathResourcesToStage(ClassLoader classLoad
}
return files;
}

private static List<String> getClasspathFiles() {
return Arrays.stream(System.getProperty("java.class.path").split(File.pathSeparator))
.map(entry -> new File(entry).getPath())
.collect(Collectors.toList());
}

}
6 changes: 6 additions & 0 deletions datatypes/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,11 @@
<groupId>io.grpc</groupId>
<artifactId>grpc-services</artifactId>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>
</dependencies>

</project>
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The main components of Feast are:

**Pre-requisites**

* Java SDK version 8
* Java SE Development Kit 11
* Python version 3.6 \(or above\) and pip
* Access to Postgres database \(version 11 and above\)
* Access to [Redis](https://redis.io/topics/quickstart) instance \(tested on version 5.x\)
Expand Down
6 changes: 3 additions & 3 deletions infra/docker/core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# Build stage 1: Builder
# ============================================================

FROM maven:3.6-jdk-8-slim as builder
FROM maven:3.6-jdk-11-slim as builder
ARG REVISION=dev
COPY . /build
WORKDIR /build
#
# Setting Maven repository .m2 directory relative to /build folder gives the
# Setting Maven repository .m2 directory relative to /build folder gives the
# user to optionally use cached repository when building the image by copying
# the existing .m2 directory to $FEAST_REPO_ROOT/.m2
#
Expand All @@ -29,7 +29,7 @@ RUN apt-get -qq update && apt-get -y install unar && \
# Build stage 2: Production
# ============================================================

FROM openjdk:8-jre as production
FROM openjdk:11-jre as production
ARG REVISION=dev
COPY --from=builder /build/core/target/feast-core-$REVISION.jar /opt/feast/feast-core.jar
COPY --from=builder /build/core/target/feast-core-$REVISION /opt/feast/feast-core
Expand Down
2 changes: 1 addition & 1 deletion infra/docker/core/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:8-jre
FROM openjdk:11-jre
ARG REVISION=dev
ADD $PWD/core/target/feast-core-$REVISION.jar /opt/feast/feast-core.jar
CMD ["java",\
Expand Down
8 changes: 4 additions & 4 deletions infra/docker/serving/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# Build stage 1: Builder
# ============================================================

FROM maven:3.6-jdk-8-slim as builder
FROM maven:3.6-jdk-11-slim as builder
ARG REVISION=dev
COPY . /build
WORKDIR /build
#
# Setting Maven repository .m2 directory relative to /build folder gives the
# Setting Maven repository .m2 directory relative to /build folder gives the
# user to optionally use cached repository when building the image by copying
# the existing .m2 directory to $FEAST_REPO_ROOT/.m2
#
Expand All @@ -19,10 +19,10 @@ RUN mvn --also-make --projects serving -Drevision=$REVISION \
# Build stage 2: Production
# ============================================================

FROM openjdk:8-jre-alpine as production
FROM openjdk:11-jre-alpine as production
ARG REVISION=dev
#
# Download grpc_health_probe to run health check for Feast Serving
# Download grpc_health_probe to run health check for Feast Serving
# https://kubernetes.io/blog/2018/10/01/health-checking-grpc-servers-on-kubernetes/
#
RUN wget -q https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.3.1/grpc_health_probe-linux-amd64 \
Expand Down
4 changes: 2 additions & 2 deletions infra/docker/serving/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM openjdk:8-jre-alpine as production
FROM openjdk:11-jre-alpine as production
ARG REVISION=dev
#
# Download grpc_health_probe to run health check for Feast Serving
# Download grpc_health_probe to run health check for Feast Serving
# https://kubernetes.io/blog/2018/10/01/health-checking-grpc-servers-on-kubernetes/
#
RUN wget -q https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.3.1/grpc_health_probe-linux-amd64 \
Expand Down
26 changes: 22 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,18 @@
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>

</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -378,8 +390,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>11</release>
<compilerArgs>
<arg>-Xlint:all</arg>
<!-- -Xdoclint:all breaks on a false positive in JDK < 9 -->
Expand All @@ -392,6 +403,13 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>valid-build-environment</id>
Expand All @@ -401,10 +419,10 @@
<configuration>
<rules>
<requireMavenVersion>
<version>[3.5,4.0)</version>
<version>[3.6,4.0)</version>
</requireMavenVersion>
<requireJavaVersion>
<version>[1.8,1.9)</version>
<version>[1.8,11.1)</version>
</requireJavaVersion>
<reactorModuleConvergence />
</rules>
Expand Down