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

[wip] native-image #242

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# except these:
!/target/

# but ignore the reports in /target
/target/reports/
9 changes: 9 additions & 0 deletions Dockerfile.native
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM quay.io/radanalyticsio/ubi-graalvm

ENV JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=2 -XshowSettings:vm"

LABEL BASE_IMAGE_2="registry.access.redhat.com/ubi8-minimal:8.0"

ADD target/spark-operator-*-runner /spark-operator

CMD ["/spark-operator", "-Djava.library.path=/lib"]
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ IMAGE?=radanalyticsio/spark-operator
.PHONY: build
build: package image-build

.PHONY: build-native
build: package-native image-build-native

.PHONY: build-travis
build-travis:
echo -e "travis_fold:start:mvn\033[33;1mMaven and container build\033[0m"
Expand All @@ -21,6 +24,10 @@ install-lib: install-parent
package:
MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw clean package -DskipTests

.PHONY: package-native
package:
MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw -Pnative -Dnative-image.docker-build=true -DskipTests

.PHONY: test
test:
MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw clean test
Expand All @@ -30,6 +37,11 @@ image-build:
docker build -t $(IMAGE):ubi -f Dockerfile.ubi .
docker tag $(IMAGE):ubi $(IMAGE):latest

.PHONY: image-build-native
image-build-native:
docker build -t $(IMAGE):native -f Dockerfile.native .
docker tag $(IMAGE):native $(IMAGE):latest-native

.PHONY: image-build-alpine
image-build-alpine:
docker build -t $(IMAGE):alpine -f Dockerfile.alpine .
Expand Down
24 changes: 21 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.radanalytics</groupId>
<artifactId>operator-parent-pom</artifactId>
<version>0.3.22</version>
<version>0.3.23-SNAPDHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>io.radanalytics</groupId>
Expand All @@ -19,7 +19,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<abstract-operator.version>0.6.8</abstract-operator.version>
<abstract-operator.version>0.6.9-SNAPSHOT</abstract-operator.version>
</properties>

<dependencies>
Expand All @@ -44,11 +44,29 @@
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-core</artifactId>
<version>0.18.0</version> <!-- todo: move to parent pom -->
<version>0.19.1</version> <!-- todo: move to parent pom -->
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-core-deployment</artifactId>
<version>0.19.1</version> <!-- todo: move to parent pom -->
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-extension-processor</artifactId>
<version>0.19.1</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down