Skip to content

Commit

Permalink
Add support for 'collectd-master' container
Browse files Browse the repository at this point in the history
'collectd-master' contains development versions of collectd
with the latest features. It is based on master branch from
collect repository.

Change-Id: I720b5e5938b402281674ee73851c5f611e4d1178
Signed-off-by: Radoslaw Jablonski <[email protected]>
  • Loading branch information
rjablonx committed Sep 7, 2018
1 parent 1db7418 commit b20fa77
Show file tree
Hide file tree
Showing 24 changed files with 2,180 additions and 17 deletions.
55 changes: 42 additions & 13 deletions docker/barometer-collectd/README → docker/README_collectd
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,73 @@ 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

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

Expand Down
29 changes: 29 additions & 0 deletions docker/barometer-collectd-master/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
15 changes: 15 additions & 0 deletions docker/barometer-collectd-master/run_collectd.sh
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit b20fa77

Please sign in to comment.