...
1) build and test as-is on local machine
2) migrate base images to alpine on Intel
3) build and test alpine based images on Arm machine
4) test using ONAP OOM (K8s/Helm) on Intel
5) test using ONAP OOM (K8s/Helm) on Arm
6) patch repo with changes
...
### build local images
- open terminal
$ git clone ssh://sandovalfrOAM@gerrit.onap.org:29418/dmaap/messagerouter/messageservice
$ cd messageservice
- per docs/installation/installation.rst
- edit bundleconfig-local/etc/appprops/MsgRtrApi.properties
config.zk.servers=zookeeper
kafka.metadata.broker.list=kafka:9092
> $ cp bundleconfig-local/etc/appprops/MsgRtrApi.properties /var/tmp
- configure Docker engine: 'docker->properties->file sharing' to include /var/tmp
$ mvn clean install -DskipTests -Pdocker
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
...
onap/dmaap/dmaap-mr latest ec37060b0ef0 4 minutes ago 782MB
...
openjdk 8-jdk 5f8e49b0a018 3 weeks ago 624MB
...
### start containers
$ cd src/main/resources/docker-compose
$ cp docker-compose.yml docker-compose-local.yml
- edit docker-compose-local.yml
image: onap/dmaap/zookeeper:latest
image: onap/dmaap/kafka01101:latest
image: onap/dmaap/dmaap-mr:latest
$ docker-compose -f docker-compose-local.yml up -d
### Test
See https://docs.onap.org/en/latest/submodules/dmaap/messagerouter/messageservice.git/docs/offeredapis/offeredapis.html
- create sample file (any arbitrary content,e g "sample data")
e.g. $ echo "sample data" > sample.txt
$ curl -H "Content-Type:text/plain" -X POST -d @sample.txt http://localhost:3904/events/TestTopic1
{"serverTimeMs": 645, ...
- give it some time....
$ curl -H "Content-Type:text/plain" -X GET http://localhost:3904/events/TestTopic1/CG1/C1?timeout=1000
["sample data"]
- view topics
$ curl -H "Content-Type:text/plain" -X GET http://10.233.38.121:3904/topics
- scratch
curl -v -H "Content-Type:text/plain" -X POST -d @sample-body.txt http://10.233.38.121:3904/events/TestTopic1
curl -H "Content-Type:text/plain" -X GET http://10.233.102.148:3904/events/TestTopic1/CG1/C1/timeout=1000
curl -H "Content-Type:text/plain" -X GET http://10.233.102.148:3904/topics
## Step 2: migrate base images to alpine
### edit messageservice/src/main/resources/Dockerfile
- from openjdk:8-jdk to openjdk:8-alpine, etc (atp-get to ## Step 2: migrate base images to alpine on Intel
### edit messageservice/src/main/resources/Dockerfile
- from openjdk:8-jdk to openjdk:8-alpine, etc (atp-get to apk, ...)
$ mvn clean install -DskipTests -Pdocker
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
...
onap/dmaap/dmaap-mr latest e8fbf3bebd9b 46 seconds ago 244MB
...
openjdk 8-jre-alpine 1b46cc2ba839 4 weeks ago 85MB
...
### edit messageservice/pom.xml
- migrate from spotify to fabric8 docker-maven-plugin
- add variables to control pull/push docker repos from cmd line
- Note: spotify docker-maven-plugin does not run on Arm
- See: https://github.com/spotify/docker-maven-plugin/issues/233
- spotify dockerfile-maven-plugin is alternate to fabric8, but other ONAP teams are using fabric8 so there
appears to be no compelling reason to stick w spotify
- Note: default docker registry nexus3.onap.org:10001 does not support manifest images, i.e. no multi-platform support
- invoke mvn with appropriate pull repo if building on non-Intel machine, e.g. on Arm
> - push to local registry to test. To run local docker registry, see here: https://docs.docker.com/registry/deploying/
$ mvn install -DskipTests -Pdocker -Ddocker.pull.registry=docker.io
- push to local registry to test
$ mvn install -DskipTests -Pdocker
...
### Test on Arm
- access Arm server, i.e Platform bare-metal
- terminal on Arm machine
$ git clone https://gerrit.onap.org/r/dmaap/messagerouter/messageservice
- copy modified files from workstation to Arm server
$ scp pom.xml root@147.75.94.202:/root/onap/dmaap/messageservice
$ scp src/main/resources/docker/Dockerfile root@147.75.94.202:/root/onap/dmaap/messageservice/src/main/resources/docker
$ scp src/main/resources/docker-compose/docker-compose-local.yml root@147.75.94.202:/root/onap/dmaap/messageservice/src/main/resources/docker- compose
$ scp src/main/resources/docker-compose/MsgRtrApi.properties root@147.75.94.202:/root/onap/dmaap/messageservice/src/main/resources/docker-compose
$ mvn clean install -DskipTests -Pdocker -Ddocker.pull.registry=docker.io
...