docker: update ves image to load yaml and config files 51/50851/3
authorGordon Kelly <gordon.kelly@intel.com>
Fri, 19 Jan 2018 16:13:45 +0000 (16:13 +0000)
committerMaryam Tahhan <maryam.tahhan@intel.com>
Tue, 23 Jan 2018 11:50:02 +0000 (11:50 +0000)
Update ves image to load yaml and config files from /opt/ves/ directory
and rename host yaml file.

Change-Id: I3caf51150d10db08b8ef1c20a53c320b27a6acb8
Signed-off-by: gordonkelly <gordon.kelly@intel.com>
3rd_party/collectd-ves-app/ves_app/yaml/host.yaml [moved from 3rd_party/collectd-ves-app/ves_app/yaml/native.yaml with 100% similarity]
docker/barometer-ves/Dockerfile
docker/barometer-ves/start_ves_app.sh

index 869a587..e36ef84 100644 (file)
@@ -22,14 +22,18 @@ RUN yum install -y python-pip
 RUN pip install pyyaml \
                 kafka-python
 
-ENV repos_dir /src
-ENV ves_dir barometer/3rd_party/collectd-ves-app/ves_app
 
-WORKDIR ${repos_dir}
+ENV VES_DIR /opt/ves
+ENV REPOS_DIR /src
+
+RUN mkdir -p ${VES_DIR}/yaml
+RUN mkdir -p ${VES_DIR}/config
+WORKDIR ${REPOS_DIR}
 RUN git clone https://gerrit.opnfv.org/gerrit/barometer
-WORKDIR ${ves_dir}
-COPY start_ves_app.sh ${ves_dir}/start_ves_app.sh
-RUN chmod +x ${ves_dir}/start_ves_app.sh
+COPY ./start_ves_app.sh ${VES_DIR}/
+RUN cp -rf barometer/3rd_party/collectd-ves-app/ves_app/* ${VES_DIR}
+WORKDIR ${VES_DIR}
+RUN chmod 755 ${VES_DIR}/start_ves_app.sh
 
-ENTRYPOINT ["./barometer/3rd_party/collectd-ves-app/ves_app/start_ves_app.sh"]
+ENTRYPOINT ["./start_ves_app.sh"]
 CMD ["host.yaml"]
index d61078d..f859bc4 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 2018 OPNFV and Intel Corporation
+#Copyright 2018 OPNFV and Intel Corporation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 
 YAML_FILE="$1"
 
+if [ -z "${ves_kafka_host}" ]
+then
+  ves_kafka_host=localhost
+fi
+
 #wait for kafka service to be available
-while ! nc localhost  9092  < /dev/null; do sleep 1;  done
+while ! nc $ves_kafka_host  9092  < /dev/null; do sleep 1;  done
 
-python ves_app.py --events-schema="$YAML_FILE" --config=ves_app_config.conf
+python ves_app.py --events-schema="./yaml/$YAML_FILE" --config="./config/ves_app_config.conf"