aboutsummaryrefslogtreecommitdiffstats
path: root/docker/barometer-collectd-experimental
diff options
context:
space:
mode:
authorMatthias Runge <mrunge@redhat.com>2019-05-08 11:55:38 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-05-08 11:55:38 +0000
commitd9737cbfef39c0f45fa21c7fc28035039c9d17a6 (patch)
treead74a4ce61d1428be8163652637af2aa58ec9b28 /docker/barometer-collectd-experimental
parent46832aaa20b6ca7963e7230928d329383687c56e (diff)
parent48bd4b945262edf8558abd9c0dacdd18fe8ef84b (diff)
Merge "docker: Add support for experimental collectd container"
Diffstat (limited to 'docker/barometer-collectd-experimental')
-rw-r--r--docker/barometer-collectd-experimental/Dockerfile37
-rwxr-xr-xdocker/barometer-collectd-experimental/collectd_apply_pull_request.sh39
-rw-r--r--docker/barometer-collectd-experimental/experimental-configs/README1
-rw-r--r--docker/barometer-collectd-experimental/experimental-configs/logparser.conf74
-rw-r--r--docker/barometer-collectd-experimental/run_collectd.sh15
5 files changed, 166 insertions, 0 deletions
diff --git a/docker/barometer-collectd-experimental/Dockerfile b/docker/barometer-collectd-experimental/Dockerfile
new file mode 100644
index 00000000..e505d2e2
--- /dev/null
+++ b/docker/barometer-collectd-experimental/Dockerfile
@@ -0,0 +1,37 @@
+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_FLAVOR experimental
+ENV WITH_DPDK 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
+COPY docker/barometer-collectd-experimental/collectd_apply_pull_request.sh \
+ ${repos_dir}/barometer/src/collectd/
+
+# copying additional experimental configs on top of configs for 'master'
+# branch release
+COPY docker/barometer-collectd-experimental/experimental-configs/* \
+ ${repos_dir}/barometer/src/collectd/collectd_sample_configs-master/
+
+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-experimental/run_collectd.sh /run_collectd.sh
+RUN chmod +x /run_collectd.sh
+
+ENTRYPOINT ["/run_collectd.sh"]
diff --git a/docker/barometer-collectd-experimental/collectd_apply_pull_request.sh b/docker/barometer-collectd-experimental/collectd_apply_pull_request.sh
new file mode 100755
index 00000000..dcea33a3
--- /dev/null
+++ b/docker/barometer-collectd-experimental/collectd_apply_pull_request.sh
@@ -0,0 +1,39 @@
+#! /bin/bash
+# Copyright 2019 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.
+
+# This files contains list of pull requests to be applied on top
+# of master branch before building collectd included in docker
+# collectd-experimental container
+
+# Space/newline separated list of pull requests IDs
+# for example:
+# PULL_REQUESTS=(3027 #reimplement delay rate
+# 3028 #other PR
+# )
+
+PULL_REQUESTS=(
+ 3045 #logparser
+ #insert another PR ID here
+ )
+
+# during rebasing/merging git requires email & name to be set
+git config user.email "barometer-experimental@container"
+git config user.name "BarometerExperimental"
+
+for PR_ID in "${PULL_REQUESTS[@]}"
+do
+ echo "Applying pull request $PR_ID"
+ git pull --rebase origin pull/$PR_ID/head
+done
diff --git a/docker/barometer-collectd-experimental/experimental-configs/README b/docker/barometer-collectd-experimental/experimental-configs/README
new file mode 100644
index 00000000..e4386358
--- /dev/null
+++ b/docker/barometer-collectd-experimental/experimental-configs/README
@@ -0,0 +1 @@
+Place here configuration files that are required by experimental pull requests
diff --git a/docker/barometer-collectd-experimental/experimental-configs/logparser.conf b/docker/barometer-collectd-experimental/experimental-configs/logparser.conf
new file mode 100644
index 00000000..3802768b
--- /dev/null
+++ b/docker/barometer-collectd-experimental/experimental-configs/logparser.conf
@@ -0,0 +1,74 @@
+# Copyright 2019 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.
+
+LoadPlugin logparser
+
+<Plugin logparser>
+ <Logfile "/var/log/syslog">
+ FirstFullRead false
+ <Message "pcie_errors">
+ DefaultType "pcie_error"
+ DefaultSeverity "warning"
+ <Match "aer error">
+ Regex "AER:.*error received"
+ SubmatchIdx -1
+ </Match>
+ <Match "incident time">
+ Regex "(... .. ..:..:..) .* pcieport.*AER"
+ SubmatchIdx 1
+ IsMandatory false
+ </Match>
+ <Match "root port">
+ Regex "pcieport (.*): AER:"
+ SubmatchIdx 1
+ IsMandatory true
+ </Match>
+ <Match "device">
+ PluginInstance true
+ Regex " ([0-9a-fA-F:\\.]*): PCIe Bus Error"
+ SubmatchIdx 1
+ IsMandatory false
+ </Match>
+ <Match "severity_mandatory">
+ Regex "severity="
+ SubMatchIdx -1
+ </Match>
+ <Match "nonfatal">
+ Regex "severity=.*\\([nN]on-[fF]atal"
+ TypeInstance "non_fatal"
+ IsMandatory false
+ </Match>
+ <Match "fatal">
+ Regex "severity=.*\\([fF]atal"
+ Severity "failure"
+ TypeInstance "fatal"
+ IsMandatory false
+ </Match>
+ <Match "corrected">
+ Regex "severity=Corrected"
+ TypeInstance "correctable"
+ IsMandatory false
+ </Match>
+ <Match "error type">
+ Regex "type=(.*),"
+ SubmatchIdx 1
+ IsMandatory false
+ </Match>
+ <Match "id">
+ Regex ", id=(.*)"
+ SubmatchIdx 1
+ </Match>
+ </Message>
+ </Logfile>
+</Plugin>
diff --git a/docker/barometer-collectd-experimental/run_collectd.sh b/docker/barometer-collectd-experimental/run_collectd.sh
new file mode 100644
index 00000000..b45711e1
--- /dev/null
+++ b/docker/barometer-collectd-experimental/run_collectd.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Copyright 2019 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