aboutsummaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/README_collectd (renamed from docker/barometer-collectd/README)55
-rw-r--r--docker/barometer-collectd-master/Dockerfile29
-rw-r--r--docker/barometer-collectd-master/run_collectd.sh15
3 files changed, 86 insertions, 13 deletions
diff --git a/docker/barometer-collectd/README b/docker/README_collectd
index 4936ad8c..c922ab64 100644
--- a/docker/barometer-collectd/README
+++ b/docker/README_collectd
@@ -8,13 +8,20 @@ deployment collectd in docker container
Table of content:
1. DESCRIPTION
2. SYSTEM REQUIREMENTS
-3. INSTALLATION NOTES
-4. ADDITIONAL STEPS
+3. INSTALLATION NOTES - barometer-collectd
+4. INSTALLATION NOTES - barometer-collectd-master
+5. ADDITIONAL STEPS
------------------------------------------------------------------------------
1. DESCRIPTION
-This Dockerfile provides instruction for building collect in isolated container
+This Dockerfile provides instruction for building collect in isolated container.
+There are currently two variants of collectd container:
+ - barometer-collectd - it is based on stable collect release
+ - barometer-collectd-master - development container that is based on
+ latest 'master' branch for collectd project. It contains all available
+ collectd plugins and features that are available on 'master' branch but
+ some issues with configuration or stability may occur
------------------------------------------------------------------------------
2. SYSTEM REQUIREMENTS
@@ -22,30 +29,52 @@ This Dockerfile provides instruction for building collect in isolated container
Docker >= 17.06.0-ce
------------------------------------------------------------------------------
-3. INSTALLATION NOTES
+3. INSTALLATION NOTES: barometer-collectd (stable container)
-To build docker container run
-sudo docker build -f ./docker/barometer-collectd/Dockerfile .
+To build docker container, that is based on stable collectd release, run:
+sudo docker build -f ./docker/barometer-collectd/Dockerfile ./docker/barometer-collectd
from barometer folder.
+sudo docker images # get docker image id
+sudo docker run -ti --net=host -v `pwd`/src/collectd/collectd_sample_configs:/opt/collectd/etc/collectd.conf.d \
+-v /var/run:/var/run -v /tmp:/tmp --privileged <image id>
+
+To make some changes run
+sudo docker run -ti --net=host -v `pwd`/src/collectd/collectd_sample_configs:/opt/collectd/etc/collectd.conf.d \
+-v /var/run:/var/run -v /tmp:/tmp --privileged --entrypoint=/bin/bash <image id>
+
+/opt/collectd/sbin/collectd -f
+
+------------------------------------------------------------------------------
+4. INSTALLATION NOTES: barometer-collectd-master (development container)
+
+To build docker barometer-collectd-master container run (it is based on master branch from collectd):
+sudo docker build -f ./docker/barometer-collectd-master/Dockerfile .
+from root barometer folder.
+
To run builded image run
-sudo docker images
-Get docker image id
-sudo docker run -ti --net=host -v `pwd`/../src/collectd_sample_configs:/opt/collectd/etc/collectd.d \
--v /var/run:/var/run -v /tmp:/tmp --privileged <image id> /run_collectd.sh
+sudo docker images # get docker image id
+sudo docker run -ti --net=host -v `pwd`/src/collectd/collectd_sample_configs-master:/opt/collectd/etc/collectd.conf.d \
+-v /var/run:/var/run -v /tmp:/tmp --privileged <image id>
+
+NOTE: barometer-collectd-master container uses a different sample configurations files
+compared to regular barometer-collectd container (src/collectd/collectd_sample_configs-master)
To make some changes run
-sudo docker run -ti --net=host -v `pwd`/../collectd_sample_configs:/opt/collectd/etc/collectd.d \
- -v /var/run:/var/run --privileged <image id> /bin/bash
+sudo docker run -ti --net=host -v `pwd`/src/collectd/collectd_sample_configs-master:/opt/collectd/etc/collectd.conf.d \
+-v /var/run:/var/run -v /tmp:/tmp --privileged --entrypoint=/bin/bash <image id>
/opt/collectd/sbin/collectd -f
------------------------------------------------------------------------------
-4. ADDITIONAL STEPS
+5. ADDITIONAL STEPS
To check if container works properly additional packages should be installed
on host system.
+DEVELOPMENT TOOLS
+sudo yum group install "Development Tools"
+
MCELOG
To simulate mcelog message use instruction in http://artifacts.opnfv.org/barometer/docs/index.html#mcelog-plugin
diff --git a/docker/barometer-collectd-master/Dockerfile b/docker/barometer-collectd-master/Dockerfile
new file mode 100644
index 00000000..a1c957f3
--- /dev/null
+++ b/docker/barometer-collectd-master/Dockerfile
@@ -0,0 +1,29 @@
+FROM centos:7
+RUN yum update -y && \
+ yum install -y which sudo git && \
+ yum clean all && \
+ git config --global http.sslVerify false
+
+ENV DOCKER y
+ENV COLLECTD_USE_MASTER y
+ENV repos_dir /src
+ENV openstack_plugins /src/barometer/src/collectd-openstack-plugins
+
+WORKDIR ${repos_dir}
+RUN mkdir -p ${repos_dir}/barometer
+COPY . ${repos_dir}/barometer
+
+WORKDIR ${repos_dir}/barometer/systems
+RUN sh ./build_base_machine.sh && \
+ useradd -ms /bin/bash collectd_exec && \
+ echo "collectd_exec ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
+
+WORKDIR ${openstack_plugins}
+RUN make && \
+ pip install --upgrade pip && \
+ pip install -r ${openstack_plugins}/collectd-openstack-plugins/requirements.txt
+
+COPY docker/barometer-collectd-master/run_collectd.sh /run_collectd.sh
+RUN chmod +x /run_collectd.sh
+
+ENTRYPOINT ["/run_collectd.sh"]
diff --git a/docker/barometer-collectd-master/run_collectd.sh b/docker/barometer-collectd-master/run_collectd.sh
new file mode 100644
index 00000000..001cce1a
--- /dev/null
+++ b/docker/barometer-collectd-master/run_collectd.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Copyright 2017 OPNFV
+#
+# 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.
+/opt/collectd/sbin/collectd -f