`docker run --network [NETWORK NAME] --name message-generator -e MR-HOST=[HOST NAME OF MR] -e MR-PORT=[PORT OF MR] message-generator`.
To build the image for the SDNR simulator, run the following command from the `simulators` folder:
-`docker build -f Dockerfile-sdnr-sim -t message-generator .`
+`docker build -f Dockerfile-sdnr-sim -t sdnr-simulator .`
The SDNR simulator's container must be connected to the same network as the the other components are running in. Some of the
parameters to the application can be provided with the `-e PARAM_NAME=PARAM_VALUE` notation. Start the container by
using the command, with available params listed:
`docker run --network [NETWORK NAME] --name sdnr-simulator -e MR-HOST=[HOST NAME OF MR] -e MR-PORT=[PORT OF MR] sdnr-simulator`.
+# Use docker-compose
+Go to the `docker-compose/` folder and run `bash start.sh`.
+
+This scripts will start up four components:
+dmaap-mr
+oru-app
+sdnr-simulator
+message-generator
+
+
## License
Copyright (C) 2021 Nordix Foundation.
--- /dev/null
+# Copyright (C) 2021 Nordix Foundation. 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=================================================
+#
+version: '3.5'
+
+networks:
+ default:
+ driver: bridge
+ name: nonrtric-docker-net
+
+services:
+ message-generator:
+ image: message-generator
+ container_name: message-generator
+ networks:
+ default:
+ aliases:
+ - message-generator
+ environment:
+ - MR-HOST=http://dmaap-mr
+ - MR-PORT=3904
+
+ sdnr-simulator:
+ image: sdnr-simulator
+ container_name: sdnr-simulator
+ networks:
+ default:
+ aliases:
+ - sdnr-simulator
+ ports:
+ - 9990:9990
+ environment:
+ - MR-HOST=http://dmaap-mr
+ - MR-PORT=3904
+
+ oru-app:
+ image: oru-app
+ container_name: oru-app
+ networks:
+ default:
+ aliases:
+ - oru-app
+ environment:
+ - MR-HOST=http://dmaap-mr
+ - MR-PORT=3904
+ - SDNR-HOST=http://sdnr-simulator
+ - SDNR-PORT=9990
+ - VERBOSE=on
\ No newline at end of file
--- /dev/null
+# Copyright (C) 2021 Nordix Foundation. 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=================================================
+#
+
+SHELL_FOLDER=$(cd "$(dirname "$0")";pwd)
+docker stop $(docker ps -aq)
+docker system prune -f
+
+# build o-ru application image
+cd ${SHELL_FOLDER}/../app/
+docker build -t oru-app .
+
+# build simulator image of sdnr
+cd ${SHELL_FOLDER}/../simulators/
+docker build -f Dockerfile-sdnr-sim -t sdnr-simulator .
+
+# build message generator image
+docker build -f Dockerfile-message-generator -t message-generator .
+
+# start up dmaap message router
+cd ${SHELL_FOLDER}/../../../../docker-compose/
+docker-compose -f docker-compose.yaml -f mr/docker-compose.yml up -d
+
+# wait until mr up & running
+for i in {1..60}; do
+ res=$(curl -o /dev/null -sw %{http_code} http://localhost:3904/topics)
+ echo "$res"
+ expect="200"
+ if [ "$res" == "$expect" ]; then
+ echo -e "dmaap-mr is alive!\n"
+ break;
+ else
+ sleep $i
+ fi
+done
+
+# start up oru, message-generator and sdnr-simulator
+cd ${SHELL_FOLDER}
+docker-compose up -d
\ No newline at end of file