Skip to content

Commit b26cd94

Browse files
harismsophokles73
authored andcommitted
[#3555] Device Registry JDBC native build
1 parent 94ba665 commit b26cd94

File tree

5 files changed

+44
-13
lines changed

5 files changed

+44
-13
lines changed

.github/workflows/native-images-tests.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
mvn install -B -e -DskipTests -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
4646
-Dquarkus.native.remote-container-build=false -Dquarkus.native.container-build=true \
4747
-Pbuild-native-image,metrics-prometheus -am \
48-
-pl :hono-service-auth,:hono-service-command-router,:hono-service-device-registry-mongodb,\
48+
-pl :hono-service-auth,:hono-service-command-router,:hono-service-device-registry-mongodb,:hono-service-device-registry-jdbc,\
4949
:hono-adapter-mqtt,:hono-adapter-amqp,:hono-adapter-coap,:hono-adapter-http,:hono-adapter-lora,\
5050
:hono-tests
5151
- name: "Run integration tests with Mongo DB and Kafka"
@@ -54,10 +54,12 @@ jobs:
5454
-Dhono.components.type=quarkus-native -Dhono.deviceregistry.type=mongodb \
5555
-Dhono.messaging-infra.type=kafka -Dhono.commandrouting.cache=server \
5656
-Prun-tests,jaeger
57-
- name: "Build JDBC registry image"
57+
- name: "Run integration tests with PostgreSQL DB and Kafka"
5858
run: |
59-
mvn install -B -e -DskipTests -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
60-
-Pbuild-docker-image,metrics-prometheus -am -pl :hono-service-device-registry-jdbc
59+
mvn verify -pl :hono-tests -B -e -DCI=$CI \
60+
-Dhono.components.type=quarkus-native -Dhono.deviceregistry.type=jdbc \
61+
-Dhono.messaging-infra.type=kafka -Dhono.commandrouting.cache=server \
62+
-Prun-tests,jaeger
6163
- name: "Run integration tests with Sandbox-like configuration"
6264
run: |
6365
mvn verify -pl :hono-tests -B -e -DCI=$CI \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2023 Contributors to the Eclipse Foundation
2+
#
3+
# See the NOTICE file(s) distributed with this work for additional
4+
# information regarding copyright ownership.
5+
#
6+
# This program and the accompanying materials are made available under the
7+
# terms of the Eclipse Public License 2.0 which is available at
8+
# http://www.eclipse.org/legal/epl-2.0
9+
#
10+
# SPDX-License-Identifier: EPL-2.0
11+
12+
Args = -H:ResourceConfigurationResources=${.}/resources-config.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"resources": {
3+
"includes": [
4+
{ "pattern": "org\\/eclipse\\/hono\\/service\\/base\\/jdbc\\/store\\/.*\\.yaml$" },
5+
{ "pattern": "sql\\/.*\\.sql$" }
6+
]
7+
}
8+
}

services/device-registry-jdbc/pom.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,14 @@
191191

192192
<profile>
193193
<id>build-native-image</id>
194-
<!--
195-
Currently we do not support compiling a native executable because it does not work with
196-
H2 in embedded mode. We can either drop support for H2 in embedded mode in the native image
197-
or always use the JVM based version.
198-
-->
199-
<properties>
200-
<quarkus.package.type>jar</quarkus.package.type>
201-
</properties>
194+
<build>
195+
<plugins>
196+
<plugin>
197+
<groupId>io.fabric8</groupId>
198+
<artifactId>docker-maven-plugin</artifactId>
199+
</plugin>
200+
</plugins>
201+
</build>
202202
</profile>
203203

204204
</profiles>

tests/pom.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,13 @@
117117
<hono.deviceregistry.mongodb.native-image-args></hono.deviceregistry.mongodb.native-image-args>
118118

119119
<hono.deviceregistry.jdbc.disabled>true</hono.deviceregistry.jdbc.disabled>
120+
<hono.deviceregistry.jdbc.image>hono-service-device-registry-jdbc</hono.deviceregistry.jdbc.image>
120121
<hono.deviceregistry.jdbc.max-mem>400000000</hono.deviceregistry.jdbc.max-mem>
121122
<hono.deviceregistry.jdbc.java-options>
122123
${default.java-options}
123124
-Dorg.eclipse.hono.service.base.jdbc.store.skipDumpingStatementConfiguration=true
124125
</hono.deviceregistry.jdbc.java-options>
126+
<hono.deviceregistry.jdbc.native-image-args></hono.deviceregistry.jdbc.native-image-args>
125127

126128
<!-- accept requests with a body size of up to 2000 bytes -->
127129
<hono.deviceregistry.maxPayloadSize>2000</hono.deviceregistry.maxPayloadSize>
@@ -636,6 +638,8 @@
636638
<hono.command-router.max-mem>100000000</hono.command-router.max-mem>
637639
<hono.deviceregistry.mongodb.image>hono-service-device-registry-mongodb-native</hono.deviceregistry.mongodb.image>
638640
<hono.deviceregistry.mongodb.max-mem>150000000</hono.deviceregistry.mongodb.max-mem>
641+
<hono.deviceregistry.jdbc.image>hono-service-device-registry-jdbc-native</hono.deviceregistry.jdbc.image>
642+
<hono.deviceregistry.jdbc.max-mem>150000000</hono.deviceregistry.jdbc.max-mem>
639643
</properties>
640644
</profile>
641645
<profile>
@@ -1425,7 +1429,7 @@
14251429
<build>
14261430
<skip>${hono.deviceregistry.jdbc.disabled}</skip>
14271431
<imagePullPolicy>IfNotPresent</imagePullPolicy>
1428-
<from>${docker.repository}/hono-service-device-registry-jdbc:${project.version}</from>
1432+
<from>${docker.repository}/${hono.deviceregistry.jdbc.image}:${project.version}</from>
14291433
<assembly>
14301434
<mode>dir</mode>
14311435
<basedir>/</basedir>
@@ -1465,6 +1469,11 @@
14651469
<name>${custom.network.name}</name>
14661470
<alias>${hono.registration.host}</alias>
14671471
</network>
1472+
<cmd>
1473+
<exec>
1474+
<arg>${hono.deviceregistry.jdbc.native-image-args}</arg>
1475+
</exec>
1476+
</cmd>
14681477
<memorySwap>${hono.deviceregistry.jdbc.max-mem}</memorySwap>
14691478
<memory>${hono.deviceregistry.jdbc.max-mem}</memory>
14701479
<env>

0 commit comments

Comments
 (0)