From 989c4f4bf1e099a866147535a6b2b1f7226511e3 Mon Sep 17 00:00:00 2001 From: sandovalfr Date: Thu, 14 Mar 2019 17:39:55 -0600 Subject: [PATCH] build multi-platform images Issue-ID: INT-932 Change-Id: I1be60a467bf4b6ac44b9b5b2c4982feec9eee208 Signed-off-by: sandovalfr --- docs/Installation/Installation.rst | 59 +++++++++++++++ pom.xml | 137 ++++++++++++----------------------- src/main/resources/docker/Dockerfile | 29 +++++++- 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 @@ + org.apache.maven.plugins maven-site-plugin @@ -100,96 +101,8 @@ + - - com.spotify - docker-maven-plugin - 1.0.0 - - onap/dmaap/dmaap-mr - ${dockerLocation} - docker-hub - - ${dockertag1} - ${dockertag2} - - true - - - / - ${dockerLocation} - ${project.build.finalName}.jar - - - / - ${project.build.directory} - **/** - - - - - - build-image - install - - build - - - ${skip.docker.build} - - - - - tag-image-project-version - install - - tag - - - onap/dmaap/dmaap-mr - ${docker.push.registry}/onap/dmaap/dmaap-mr:${dockertag2} - ${skip.docker.push} - - - - - tag-image-latest - install - - tag - - - onap/dmaap/dmaap-mr - ${docker.push.registry}/onap/dmaap/dmaap-mr:${dockertag1} - ${skip.docker.push} - - - - - push-image-latest - deploy - - push - - - ${docker.push.registry}/onap/dmaap/dmaap-mr:${dockertag2} - ${skip.docker.push} - - - - - push-image - deploy - - push - - - ${docker.push.registry}/onap/dmaap/dmaap-mr:${dockertag1} - ${skip.docker.push} - - - - com.blackducksoftware.integration hub-maven-plugin @@ -267,6 +180,7 @@ 2.21.1 /content/sites/site/org/onap/dmaap/messagerouter/messageservice/${project.artifactId}/${project.version} true + true true https://nexus.onap.org nexus3.onap.org:10003 @@ -763,8 +677,49 @@ - - + + io.fabric8 + docker-maven-plugin + 0.28.0 + + ${docker.verbose} + ${docker.apiVersion} + ${docker.pull.registry} + ${docker.push.registry} + + + onap/dmaap/dmaap-mr + + try + ${dockerLocation} + Dockerfile + + ${dockertag1} + ${dockertag2} + + + + + + + + generate-images + install + + build + + + + push-images + deploy + + push + + + + + + 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"] -- 2.16.6