Add documentation for Docker usage
[nonrtric.git] / test / usecases / linkfailure / README.md
index dbdaa3c..f9e0248 100644 (file)
@@ -4,7 +4,7 @@
 The Link Failure use case test provides a python script that regularly polls DMaaP Message Router (MR) for "CUS Link Failure"
 messages.
 
-When such a message appears with the "eventSeverity" set to "CRITICAL" a configuration change message with the
+When such a message appears with the "eventSeverity" set to anything but "NORMAL", a configuration change message with the
 "administrative-state" set to "UNLOCKED" will be sent to the O-DU mapped to the O-RU that sent the alarm.
 
 When such a message appears with the "eventSeverity" set to "NORMAL" a printout will be made to signal that the
@@ -17,13 +17,42 @@ the `app` folder: `pip install -r requirements.txt`
 Also, the MR needs to be up and running with a topic created for the alarms and there must be an endpoint for the
 configuration change event that will accept these.
 
+The host names and the ports to the MR and SDNR services can be provided when the container is started if the default
+values are not correct. The topic can also be changed.
+
+The mapping from O-RU ID to O-DU ID is specified in the file `o-ru-to-o-du-map.txt`. This can be replaced by providing
+a different file when starting the application.
+
 For convenience, a message generator and a change event endpoint simulator are provided.
 
-# How to run
+# How to run from command line
 Go to the `app/` folder and run `python3 main.py`. The script will start and run until stopped. Use the `-h` option to
 see the options available for the script.
 
 
+# How to run in Docker
+Go to the `app/` folder and run `docker build -t oru-app .`.
+
+The container must be connected to the same network as the MR and SDNR 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 oru-app -e VERBOSE=on -e MR-HOST=[HOST NAME OF MR] -e MR-PORT=[PORT OF MR] -e SDNR-HOST=[HOST NAME OF SDNR] -e SDNR-PORT=[PORT OF SDNR] oru-app`.
+
+To build the image for the message generator, run the following command from the `simulators` folder:
+`docker build -f Dockerfile-message-generator -t message-generator .`
+
+The message generator's container must be connected to the same network as 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 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 .`
+
+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`.
+
 ## License
 
 Copyright (C) 2021 Nordix Foundation.