Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Iot device registry backed with infinispan #2498

Merged
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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ DOCKER_DIRS = \
iot/iot-tenant-service \
iot/iot-auth-service \
iot/iot-device-registry-file \
iot/iot-device-registry-infinispan \
iot/iot-http-adapter \
iot/iot-mqtt-adapter \

Expand Down
1 change: 1 addition & 0 deletions Makefile.env.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ CONTROLLER_MANAGER_IMAGE ?= $(DOCKER_REGISTRY_PREFIX)$(DOCKER_ORG)/controller-

IOT_AUTH_SERVICE_IMAGE ?= $(DOCKER_REGISTRY_PREFIX)$(DOCKER_ORG)/iot-auth-service:$(IMAGE_VERSION)
IOT_DEVICE_REGISTRY_FILE_IMAGE ?= $(DOCKER_REGISTRY_PREFIX)$(DOCKER_ORG)/iot-device-registry-file:$(IMAGE_VERSION)
IOT_DEVICE_REGISTRY_INFINISPAN_IMAGE ?= $(DOCKER_REGISTRY_PREFIX)$(DOCKER_ORG)/iot-device-registry-infinispan:$(IMAGE_VERSION)
IOT_GC_IMAGE ?= $(DOCKER_REGISTRY_PREFIX)$(DOCKER_ORG)/iot-gc:$(IMAGE_VERSION)
IOT_HTTP_ADAPTER_IMAGE ?= $(DOCKER_REGISTRY_PREFIX)$(DOCKER_ORG)/iot-http-adapter:$(IMAGE_VERSION)
IOT_MQTT_ADAPTER_IMAGE ?= $(DOCKER_REGISTRY_PREFIX)$(DOCKER_ORG)/iot-mqtt-adapter:$(IMAGE_VERSION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DeviceRegistryServiceConfig extends ServiceConfig {
private FileBasedDeviceRegistry file;
private InfinispanDeviceRegistry infinispan;

public FileBasedDeviceRegistry getFile() {
return file;
}
public void setFile(FileBasedDeviceRegistry file) {
this.file = file;
}

public InfinispanDeviceRegistry getInfinispan(){ return infinispan;}
public void setInfinispan(InfinispanDeviceRegistry infinispan) {
this.infinispan = infinispan;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright 2019, EnMasse authors.
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
*/

package io.enmasse.iot.model.v1;

import com.fasterxml.jackson.annotation.JsonInclude;
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
import io.fabric8.kubernetes.api.model.Doneable;
import io.sundr.builder.annotations.Buildable;
import io.sundr.builder.annotations.Inline;

@Buildable(
editableEnabled = false,
generateBuilderPackage = false,
builderPackage = "io.fabric8.kubernetes.api.builder",
inline = @Inline(
type = Doneable.class,
prefix = "Doneable",
value = "done"
)
)
@JsonInclude(NON_NULL)
public class InfinispanDeviceRegistry {

private ContainerConfig container;
private String infinispanServerAddress;

public ContainerConfig getContainer() {
return container;
}
public void setContainer(ContainerConfig container) {
this.container = container;
}

public String getInfinispanServerAddress() {
return infinispanServerAddress;
}
public void setInfinispanServerAddress(String infinispanServerAddress) {
this.infinispanServerAddress = infinispanServerAddress;
}
}
1 change: 1 addition & 0 deletions controller-manager/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ build/operatorImageMap.yaml:

echo "iot-auth-service: $(IOT_AUTH_SERVICE_IMAGE)" >> "$@"
echo "iot-device-registry-file: $(IOT_DEVICE_REGISTRY_FILE_IMAGE)" >> "$@"
echo "iot-device-registry-infinispan: $(IOT_DEVICE_REGISTRY_INFINISPAN_IMAGE)" >> "$@"
echo "iot-gc: $(IOT_GC_IMAGE)" >> "$@"
echo "iot-http-adapter: $(IOT_HTTP_ADAPTER_IMAGE)" >> "$@"
echo "iot-mqtt-adapter: $(IOT_MQTT_ADAPTER_IMAGE)" >> "$@"
Expand Down
10 changes: 10 additions & 0 deletions iot/iot-device-registry-infinispan/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM enmasseproject/java-base:11-1

ARG version
ARG maven_version
ARG commit
ENV VERSION=${version} COMMIT=${commit} MAVEN_VERSION=${maven_version}

ADD target/iot-device-registry-infinispan-${MAVEN_VERSION}.jar /iot-device-registry-infinispan.jar

CMD ["/opt/run-java/launch_java.sh", "/iot-device-registry-infinispan.jar"]
1 change: 1 addition & 0 deletions iot/iot-device-registry-infinispan/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../Makefile.java.mk
112 changes: 112 additions & 0 deletions iot/iot-device-registry-infinispan/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.enmasse</groupId>
<artifactId>iot-application-base</artifactId>
<version>0.29-SNAPSHOT</version>
<relativePath>../iot-application-base</relativePath>
</parent>

<artifactId>iot-device-registry-infinispan</artifactId>


<dependencies>
<dependency>
<groupId>org.eclipse.hono</groupId>
<artifactId>hono-service-device-registry</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.hono</groupId>
<artifactId>hono-service-base</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-query</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-client-hotrod</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-remote-query-client</artifactId>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-unit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.hono</groupId>
<artifactId>hono-service-base</artifactId>
<classifier>tests</classifier>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-server-hotrod</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-remote-query-server</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>io.enmasse.iot.registry.infinispan.InfinispanRegistry</mainClass>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit4</artifactId>
<version>2.22.0</version>
</dependency>
</dependencies>
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<excludes>
<include>**/application.yml</include>
</excludes>
</configuration>
</plugin>

</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2019, EnMasse authors.
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
*/

/*******************************************************************************
* Copyright (c) 2019 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package io.enmasse.iot.registry.infinispan;

/**
* Configuration properties for Hono's Infinispan Credential service.
*
*/
public class CacheCredentialConfigProperties {
}
Loading