Skip to content
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
29 changes: 19 additions & 10 deletions docker/src/main/docker/docker-compose-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,43 @@
version: '2.4'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.28
volumes: # Persist ES data in seperate "esdata" volume
- esdata1:/usr/share/elasticsearch/data
image: docker.elastic.co/elasticsearch/elasticsearch:9.1.3
volumes:
- unomi-3-elasticsearch-data:/usr/share/elasticsearch/data
environment:
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1G -Xmx1G"
- discovery.type=single-node
- xpack.security.enabled=false
- cluster.name=contextElasticSearch
ports: # Expose Elasticsearch ports
- "9200:9200"
networks:
- unomi-3
ports:
- 9200:9200

unomi:
node-1:
build: .
image: apache/unomi:${project.version}
container_name: unomi
environment:
- UNOMI_ELASTICSEARCH_ADDRESSES=elasticsearch:9200
ports:
- 8181:8181
- 9443:9443
- 8102:8102
networks:
- unomi-3
links:
- elasticsearch
depends_on:
- elasticsearch


volumes: # Define seperate volume for Elasticsearch data
esdata1:
volumes:
unomi-3-elasticsearch-data:
driver: local

networks:
unomi-3:
name: unomi-3
ipam:
config:
- subnet: 172.24.32.0/24
81 changes: 81 additions & 0 deletions docker/src/main/docker/docker-compose-cluster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
################################################################################
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
version: '2.4'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:9.1.3
volumes:
- unomi-3-elasticsearch-data:/usr/share/elasticsearch/data
environment:
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1G -Xmx1G"
- discovery.type=single-node
- xpack.security.enabled=false
- cluster.name=contextElasticSearch
networks:
- unomi-3
ports:
- 9200:9200

node-1:
image: apache/unomi:${project.version}
environment:
- UNOMI_ELASTICSEARCH_ADDRESSES=elasticsearch:9200
- UNOMI_CLUSTER_NODEID=unomi-3-node-1
ports:
- 8181:8181
- 9443:9443
- 8102:8102
networks:
- unomi-3
links:
- elasticsearch
depends_on:
- elasticsearch

wait-for-node-1:
image: alpine:latest
command: sh -c "echo 'Wait 3 minutes before starting unomi-3-node-2...' && sleep 180"
depends_on:
- node-1

node-2:
image: apache/unomi:${project.version}
environment:
- UNOMI_ELASTICSEARCH_ADDRESSES=elasticsearch:9200
- UNOMI_CLUSTER_NODEID=unomi-3-node-2
ports:
- 8182:8181
- 9444:9443
- 8103:8102
networks:
- unomi-3
links:
- elasticsearch
depends_on:
- wait-for-node-1

volumes:
unomi-3-elasticsearch-data:
driver: local

networks:
unomi-3:
name: unomi-3
ipam:
config:
- subnet: 172.24.32.0/24
29 changes: 19 additions & 10 deletions docker/src/main/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,42 @@
version: '2.4'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.28
volumes: # Persist ES data in separate "esdata" volume
- esdata1:/usr/share/elasticsearch/data
image: docker.elastic.co/elasticsearch/elasticsearch:9.1.3
volumes:
- unomi-3-elasticsearch-data:/usr/share/elasticsearch/data
environment:
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1G -Xmx1G"
- discovery.type=single-node
- xpack.security.enabled=false
- cluster.name=contextElasticSearch
ports: # Expose Elasticsearch ports
- "9200:9200"
networks:
- unomi-3
ports:
- 9200:9200

unomi:
node-1:
image: apache/unomi:${project.version}
container_name: unomi
environment:
- UNOMI_ELASTICSEARCH_ADDRESSES=elasticsearch:9200
ports:
- 8181:8181
- 9443:9443
- 8102:8102
networks:
- unomi-3
links:
- elasticsearch
depends_on:
- elasticsearch


volumes: # Define separate volume for Elasticsearch data
esdata1:
volumes:
unomi-3-elasticsearch-data:
driver: local

networks:
unomi-3:
name: unomi-3
ipam:
config:
- subnet: 172.24.32.0/24
11 changes: 4 additions & 7 deletions kar/src/main/feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
<feature>feature</feature>
<feature>spifly</feature>
<feature>shell-compat</feature>
<feature>jackson</feature>
<feature>jackson-jaxrs</feature>
<configfile finalname="/etc/org.apache.unomi.web.cfg">mvn:org.apache.unomi/unomi-wab/${project.version}/cfg/unomicfg</configfile>
<configfile finalname="/etc/org.apache.unomi.persistence.elasticsearch.cfg">mvn:org.apache.unomi/unomi-persistence-elasticsearch-core/${project.version}/cfg/elasticsearchcfg</configfile>
<configfile finalname="/etc/org.apache.unomi.services.cfg">mvn:org.apache.unomi/unomi-services/${project.version}/cfg/servicescfg</configfile>
Expand All @@ -54,21 +56,16 @@
<bundle start-level="55">mvn:org.apache.httpcomponents/httpcore-osgi/${httpcore-osgi.version}</bundle>
<bundle start-level="55">mvn:org.apache.httpcomponents/httpclient-osgi/${httpclient-osgi.version}</bundle>
<bundle start-level="55">mvn:javax.validation/validation-api/${javax-validation.version}</bundle>
<bundle start-level="55">mvn:com.fasterxml.jackson.core/jackson-core/${jackson.version}</bundle>
<bundle start-level="55">mvn:com.fasterxml.jackson.core/jackson-databind/${jackson.version}</bundle>
<bundle start-level="55">mvn:com.fasterxml.jackson.core/jackson-annotations/${jackson.version}</bundle>
<bundle start-level="55">mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/${jackson.version}</bundle>
<!-- Jackson bundles not included in any karaf feature -->
<bundle start-level="55">mvn:com.fasterxml.jackson.datatype/jackson-datatype-jsr310/${jackson.version}</bundle>
<bundle start-level="55">mvn:com.fasterxml.jackson.module/jackson-module-jaxb-annotations/${jackson.version}</bundle>
<bundle start-level="55">mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/${jackson.version}</bundle>
<bundle start-level="55">mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/${jackson.version}</bundle>

<bundle start-level="55">mvn:com.github.java-json-tools/btf/${btf.version}</bundle>
<bundle start-level="55">mvn:com.github.java-json-tools/msg-simple/${msg-simple.version}</bundle>
<bundle start-level="55">mvn:com.github.java-json-tools/jackson-coreutils/${jackson-coreutils.version}</bundle>
<bundle start-level="55">mvn:com.github.java-json-tools/json-patch/${json-patch.version}</bundle>
<bundle start-level="55">mvn:com.google.guava/guava/${guava.version}</bundle>
<bundle start-level="55">mvn:org.json/json/${org-json.version}</bundle>
<bundle start-level="55">mvn:org.yaml/snakeyaml/${snakeyaml.version}</bundle>
<bundle start-level="55">mvn:joda-time/joda-time/${joda-time.version}</bundle>
<bundle start-level="55">mvn:jakarta.annotation/jakarta.annotation-api/${jakarta-annotation-api.version}</bundle>
<bundle start-level="55">mvn:com.google.code.findbugs/jsr305/${jsr305.version}</bundle>
Expand Down
48 changes: 48 additions & 0 deletions package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

<properties>
<appendedResourcesDirectory>${basedir}/../etc/appended-resources</appendedResourcesDirectory>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
</properties>

<dependencies>
Expand Down Expand Up @@ -134,6 +135,53 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<shortRevisionLength>8</shortRevisionLength>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>process-resources</id>
<goals>
<goal>resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>BUILD</include>
</includes>
</resource>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>BUILD</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand Down
3 changes: 3 additions & 0 deletions package/src/main/resources/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: ${project.version}
Build tag: ${buildNumber}
Build timestamp: ${maven.build.timestamp}
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<maven.compiler.release>${java.version}</maven.compiler.release>

<karaf.version>4.4.8</karaf.version>
<elasticsearch.version>9.0.3</elasticsearch.version>
<elasticsearch.version>9.1.3</elasticsearch.version>
<elasticsearch.test.version>9.1.3</elasticsearch.test.version>
<javax-validation.version>1.1.0.Final</javax-validation.version>
<commons-lang3.version>3.18.0</commons-lang3.version>
Expand All @@ -73,7 +73,7 @@
<commons-beanutils.version>1.11.0</commons-beanutils.version>
<commons-collections.version>3.2.2</commons-collections.version>
<mvel2.version>2.5.2.Final</mvel2.version>
<snakeyaml.version>2.4</snakeyaml.version>
<snakeyaml.version>2.3</snakeyaml.version>
<opencsv.version>3.10</opencsv.version>
<log4j.version>2.19.0</log4j.version>
<lucene.version>9.12.2</lucene.version>
Expand All @@ -92,7 +92,7 @@
<jakarta-annotation-api.version>3.0.0</jakarta-annotation-api.version>
<jakarta-json-api.version>2.1.2</jakarta-json-api.version>
<swagger-ui.version>5.27.1</swagger-ui.version>
<cxf.version>3.6.5</cxf.version>
<cxf.version>3.6.8</cxf.version>
<rs-api.version>2.1</rs-api.version>
<groovy.version>4.0.28</groovy.version>
<httpclient-osgi.version>4.5.14</httpclient-osgi.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.apache.cxf.jaxrs.openapi.OpenApiCustomizer;
import org.apache.cxf.jaxrs.openapi.OpenApiFeature;
import org.apache.cxf.jaxrs.security.SimpleAuthorizingFilter;
import org.apache.cxf.jaxrs.swagger.ui.SwaggerUiConfig;
import org.apache.cxf.message.Message;
import org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter;
import org.apache.unomi.api.ContextRequest;
Expand Down Expand Up @@ -236,6 +237,8 @@ public void run() {
openApiFeature.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
openApiFeature.setScan(false);
openApiFeature.setUseContextBasedConfig(true);
SwaggerUiConfig swaggerUiConfig = new SwaggerUiConfig().url("openapi.json").deepLinking(true).queryConfigEnabled(false);
openApiFeature.setSwaggerUiConfig(swaggerUiConfig);
OpenApiCustomizer customizer = new OpenApiCustomizer();
customizer.setDynamicBasePath(true);
openApiFeature.setCustomizer(customizer);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
window.onload = function() {
window.ui = SwaggerUIBundle({
url: "/openapi.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});
};
Loading