summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/Installation/Installation.rst59
-rw-r--r--pom.xml137
-rw-r--r--src/main/resources/docker/Dockerfile29
3 files changed, 130 insertions, 95 deletions
diff --git a/docs/Installation/Installation.rst b/docs/Installation/Installation.rst
index 83f5b6f..53d9fd2 100644
--- a/docs/Installation/Installation.rst
+++ b/docs/Installation/Installation.rst
@@ -61,3 +61,62 @@ Testing
Note: You will only receive messages which have been published after
you have subscribed to a topic.
+
+
+Steps for local development and test
+------------------------
+On Intel dev machine, in terminal (> indicates prompt) :
+1) Build kafka11aaf
+ > git clone https://gerrit.onap.org/r/dmaap/kafka
+ > cd kafka11aaf
+ > mvn clean install -Pdocker
+2) Build messageservice
+ > git clone https://gerrit.onap.org/r/dmaap/messagerouter/messageservice
+ - anonymous http, can't push changes
+ > cd messageservice
+ > mvn clean install -Pdocker
+3) Run tests
+ > cp bundleconfig-local/etc/appprops/MsgRtrApi.properties /var/tmp/
+ - edit /var/tmp/MsgRtrApi.properties
+ config.zk.servers=zookeeper
+ kafka.metadata.broker.list=kafka:9092
+ - docker-compose network maps service name(zookeeper, kafka) to IP
+ - set docker preferences/file sharing to access /var/tmp
+ > cd src/main/resources/docker-compose
+ - edit docker-compose.yml
+ - remove "nexus3.onap.org:10001/" from kafka and dmaap image names to
+ use local images
+ > docker-compose up -d
+ - create sample.txt file (as above)(content of file not important)
+ > curl -H "Content-Type:text/plain" -X POST -d @sample.txt http://localhost:3904/events/TestTopic1
+
+On Arm:
+1) Build kafka11aaf
+ > git clone https://gerrit.onap.org/r/dmaap/kafka
+ > cd kafka11aaf
+ > mvn clean install -Pdocker -Ddocker.pull.registry=docker.io
+ - ensure we pull Arm version of base image
+2) Build messageservice
+ > git clone https://gerrit.onap.org/r/dmaap/messagerouter/messageservice
+ - anonymous http, can't push changes
+ > cd messageservice
+ > mvn clean install -Pdocker -Ddocker.pull.registry=docker.io
+ - ensure we pull Arm version of base image
+3) Run tests
+ > cp bundleconfig-local/etc/appprops/MsgRtrApi.properties /var/tmp/
+ - edit /var/tmp/MsgRtrApi.properties
+ config.zk.servers=zookeeper
+ kafka.metadata.broker.list=kafka:9092
+ - docker-compose network maps service name(zookeeper, kafka) to IP
+ - set docker preferences/file sharing to access /var/tmp
+ > cd src/main/resources/docker-compose
+ - edit docker-compose.yml
+ - remove "nexus3.onap.org:10001/" from from kafka and dmaap image names to
+ use local images
+ - replace 'nexus3.onap.org:10001/onap/dmaap/zookeeper:1.0.0' with
+ multi-platform 'zookeeper'
+ > docker-compose up -d
+ - create sample.txt file (as above)(content of file not important)
+ > curl -H "Content-Type:text/plain" -X POST -d @sample.txt http://localhost:3904/events/TestTopic1
+
+
diff --git a/pom.xml b/pom.xml
index 2a2956e..d66c6e4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,6 +47,7 @@
<build>
<plugins>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
@@ -100,97 +101,9 @@
</dependency>
</dependencies>
</plugin>
+
<plugin>
- <groupId>com.spotify</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <version>1.0.0</version>
- <configuration>
- <imageName>onap/dmaap/dmaap-mr</imageName>
- <dockerDirectory>${dockerLocation}</dockerDirectory>
- <serverId>docker-hub</serverId>
- <imageTags>
- <imageTag>${dockertag1}</imageTag>
- <imageTag>${dockertag2}</imageTag>
- </imageTags>
- <forceTags>true</forceTags>
- <resources>
- <resource>
- <targetPath>/</targetPath>
- <directory>${dockerLocation}</directory>
- <include>${project.build.finalName}.jar</include>
- </resource>
- <resource>
- <targetPath>/</targetPath>
- <directory>${project.build.directory}</directory>
- <include>**/**</include>
- </resource>
- </resources>
- </configuration>
- <executions>
- <execution>
- <id>build-image</id>
- <phase>install</phase>
- <goals>
- <goal>build</goal>
- </goals>
- <configuration>
- <skipDockerBuild>${skip.docker.build}</skipDockerBuild>
- </configuration>
- </execution>
-
- <execution>
- <id>tag-image-project-version</id>
- <phase>install</phase>
- <goals>
- <goal>tag</goal>
- </goals>
- <configuration>
- <image>onap/dmaap/dmaap-mr</image>
- <newName>${docker.push.registry}/onap/dmaap/dmaap-mr:${dockertag2}</newName>
- <skipDockerTag>${skip.docker.push}</skipDockerTag>
- </configuration>
- </execution>
-
- <execution>
- <id>tag-image-latest</id>
- <phase>install</phase>
- <goals>
- <goal>tag</goal>
- </goals>
- <configuration>
- <image>onap/dmaap/dmaap-mr</image>
- <newName>${docker.push.registry}/onap/dmaap/dmaap-mr:${dockertag1}</newName>
- <skipDockerTag>${skip.docker.push}</skipDockerTag>
- </configuration>
- </execution>
-
- <execution>
- <id>push-image-latest</id>
- <phase>deploy</phase>
- <goals>
- <goal>push</goal>
- </goals>
- <configuration>
- <imageName>${docker.push.registry}/onap/dmaap/dmaap-mr:${dockertag2}</imageName>
- <skipDockerPush>${skip.docker.push}</skipDockerPush>
- </configuration>
- </execution>
-
- <execution>
- <id>push-image</id>
- <phase>deploy</phase>
- <goals>
- <goal>push</goal>
- </goals>
- <configuration>
- <imageName>${docker.push.registry}/onap/dmaap/dmaap-mr:${dockertag1}</imageName>
- <skipDockerPush>${skip.docker.push}</skipDockerPush>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
<groupId>com.blackducksoftware.integration</groupId>
<artifactId>hub-maven-plugin</artifactId>
<version>1.0.4</version>
@@ -267,6 +180,7 @@
<camel.version>2.21.1</camel.version>
<sitePath>/content/sites/site/org/onap/dmaap/messagerouter/messageservice/${project.artifactId}/${project.version}</sitePath>
<skip.docker.build>true</skip.docker.build>
+ <skip.docker.tag>true</skip.docker.tag>
<skip.docker.push>true</skip.docker.push>
<nexusproxy>https://nexus.onap.org</nexusproxy>
<docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
@@ -763,8 +677,49 @@
</execution>
</executions>
</plugin>
- </plugins>
- </build>
+ <plugin>
+ <groupId>io.fabric8</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>0.28.0</version>
+ <configuration>
+ <verbose>${docker.verbose}</verbose>
+ <apiVersion>${docker.apiVersion}</apiVersion>
+ <pullRegistry>${docker.pull.registry}</pullRegistry>
+ <pushRegistry>${docker.push.registry}</pushRegistry>
+ <images>
+ <image>
+ <name>onap/dmaap/dmaap-mr</name>
+ <build>
+ <cleanup>try</cleanup>
+ <dockerFileDir>${dockerLocation}</dockerFileDir>
+ <dockerFile>Dockerfile</dockerFile>
+ <tags>
+ <tag>${dockertag1}</tag>
+ <tag>${dockertag2}</tag>
+ </tags>
+ </build>
+ </image>
+ </images>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-images</id>
+ <phase>install</phase>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>push-images</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>push</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</profile>
<profile>
diff --git a/src/main/resources/docker/Dockerfile b/src/main/resources/docker/Dockerfile
index e6356f9..2639cea 100644
--- a/src/main/resources/docker/Dockerfile
+++ b/src/main/resources/docker/Dockerfile
@@ -1,6 +1,27 @@
-FROM openjdk:8-jdk
-ADD appl /appl/
-ADD startup.sh /startup.sh
+#########
+# ============LICENSE_START====================================================
+# org.onap.dmaap
+# ===========================================================================
+# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright (C) 2018 Nokia. All rights reserved.
+# ===========================================================================
+# Licensed 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.
+# ============LICENSE_END====================================================
+#
+FROM openjdk:8-alpine
+MAINTAINER DMAAP Team
+COPY appl /appl/
+COPY startup.sh /
RUN chmod 700 /startup.sh
-ENTRYPOINT ./startup.sh
EXPOSE 3904 3905
+ENTRYPOINT ["sh", "./startup.sh"]