From 39333d49377b61734089093636078205b1d0d4d3 Mon Sep 17 00:00:00 2001 From: Pablo Gonzalez Granados Date: Sun, 8 Oct 2023 17:20:11 +0200 Subject: [PATCH] Add support to Native compilation --- .github/workflows/ci.yml | 58 ++++++++++++++++++------------------ .github/workflows/daily.yaml | 31 ++++++++++++++++++- pom.xml | 13 +++++--- runtime/pom.xml | 10 +++---- 4 files changed, 72 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 561afe3..23ad7ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,33 +74,33 @@ jobs: run: tar -xzf maven-repo.tgz -C ~ - name: Build with Maven run: mvn -V -B -am clean verify -# TODO there is an error under investigation on Native mode -# linux-build-native: -# name: PR - Linux - Native build - Latest Version -# runs-on: ubuntu-latest -# timeout-minutes: 60 -# needs: validate-format -# strategy: -# matrix: -# java: [ 11 ] -# steps: -# - uses: actions/checkout@v4 -# - name: Install JDK {{ matrix.java }} -# # Uses sha for added security since tags can be updated -# uses: actions/setup-java@v3 -# with: -# distribution: 'temurin' -# java-version: ${{ matrix.java }} -# check-latest: true -# cache: 'maven' -# - name: Download Maven Repo -# uses: actions/download-artifact@v3 -# with: -# name: maven-repo -# path: . -# - name: Extract Maven Repo -# shell: bash -# run: tar -xzf maven-repo.tgz -C ~ -# - name: Build with Maven -# run: mvn -V -B -am clean verify -Dnative + linux-build-native: + name: PR - Linux - Native build - Latest Version + runs-on: ubuntu-latest + timeout-minutes: 60 + needs: validate-format + strategy: + matrix: + java: [ 11, 17 ] + image: [ "ubi-quarkus-native-image:22.3-java17", "ubi-quarkus-mandrel:22.3-java17", "ubi-quarkus-graalvmce-builder-image:22.3-java17" ] + steps: + - uses: actions/checkout@v4 + - name: Install JDK {{ matrix.java }} + # Uses sha for added security since tags can be updated + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + check-latest: true + cache: 'maven' + - name: Download Maven Repo + uses: actions/download-artifact@v3 + with: + name: maven-repo + path: . + - name: Extract Maven Repo + shell: bash + run: tar -xzf maven-repo.tgz -C ~ + - name: Build with Maven + run: mvn -V -B -am clean verify -Dnative -Dquarkus.native.builder-image=quay.io/quarkus/${{ matrix.image }} diff --git a/.github/workflows/daily.yaml b/.github/workflows/daily.yaml index 69252a7..1ffd761 100644 --- a/.github/workflows/daily.yaml +++ b/.github/workflows/daily.yaml @@ -54,4 +54,33 @@ jobs: shell: bash run: tar -xzf maven-repo.tgz -C ~ - name: Build with Maven - run: mvn -V -B -am clean verify \ No newline at end of file + run: mvn -V -B -am clean verify + linux-build-native: + name: PR - Linux - Native build - Latest Version + runs-on: ubuntu-latest + timeout-minutes: 60 + needs: validate-format + strategy: + matrix: + java: [ 11, 17 ] + image: [ "ubi-quarkus-native-image:22.3-java17", "ubi-quarkus-mandrel:22.3-java17", "ubi-quarkus-graalvmce-builder-image:22.3-java17" ] + steps: + - uses: actions/checkout@v4 + - name: Install JDK {{ matrix.java }} + # Uses sha for added security since tags can be updated + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + check-latest: true + cache: 'maven' + - name: Download Maven Repo + uses: actions/download-artifact@v3 + with: + name: maven-repo + path: . + - name: Extract Maven Repo + shell: bash + run: tar -xzf maven-repo.tgz -C ~ + - name: Build with Maven + run: mvn -V -B -am clean verify -Dnative -Dquarkus.native.builder-image=quay.io/quarkus/${{ matrix.image }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 7af2b6c..77a343b 100644 --- a/pom.xml +++ b/pom.xml @@ -29,15 +29,14 @@ 11 UTF-8 UTF-8 - 4.10.1 - 3.0 - 5.0.1 + 3.22.1 + 1.0.1 + 3.0.1 1.9.0 2.23.0 3.3.0 format sort - 1.9.0 1.3.3 10.12.4 2.16.10.Final @@ -137,6 +136,12 @@ + + native + + native + + it diff --git a/runtime/pom.xml b/runtime/pom.xml index edc2ee3..5db33d0 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -16,14 +16,13 @@ ${hivemq.client.version} - io.smallrye.reactive - smallrye-reactive-messaging-mqtt - ${smallrye-reactive-messaging-mqtt.version} + io.netty + netty-transport-native-epoll + linux-x86_64 io.smallrye.reactive - mutiny - ${mutiny-rxjava.version} + smallrye-reactive-messaging-mqtt io.smallrye.reactive @@ -32,7 +31,6 @@ org.eclipse.microprofile.reactive-streams-operators microprofile-reactive-streams-operators-api - ${microprofile-reactive-streams.version} org.eclipse.microprofile.metrics