diff --git a/.dockerignore b/.dockerignore index a4794d41..706bc056 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,3 +3,6 @@ # except these: !/target/ + +# but ignore the reports in /target +/target/reports/ diff --git a/Dockerfile.native b/Dockerfile.native new file mode 100644 index 00000000..122a7074 --- /dev/null +++ b/Dockerfile.native @@ -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"] diff --git a/Makefile b/Makefile index d4b2e05f..17a78899 100644 --- a/Makefile +++ b/Makefile @@ -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" @@ -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 @@ -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 . diff --git a/pom.xml b/pom.xml index c235d7ca..e26f419a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ io.radanalytics operator-parent-pom - 0.3.22 + 0.3.23-SNAPDHOT 4.0.0 io.radanalytics @@ -19,7 +19,7 @@ UTF-8 - 0.6.8 + 0.6.9-SNAPSHOT @@ -44,11 +44,29 @@ io.quarkus quarkus-core - 0.18.0 + 0.19.1 + + + io.quarkus + quarkus-core-deployment + 0.19.1 + + org.apache.maven.plugins + maven-compiler-plugin + + + + io.quarkus + quarkus-extension-processor + 0.19.1 + + + + org.apache.maven.plugins maven-jar-plugin