Skip to content

Commit

Permalink
Split ci/metrics to ceilometer and collectd
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzigold committed Sep 5, 2023
1 parent 46e935d commit b3962c0
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 10 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ jobs:
run: |
sudo apt-get install collectd
sudo systemctl stop collectd && sudo systemctl disable collectd
sudo cp ci/integration/metrics/collectd.conf /etc/collectd/collectd.conf
sudo cp ci/integration/metrics/collectd/collectd.conf /etc/collectd/collectd.conf
sudo touch /var/log/collectd.log && sudo chmod a+rw /var/log/collectd.log
sudo collectd -C ci/integration/metrics/collectd.conf
sudo collectd -C ci/integration/metrics/collectd/collectd.conf
- name: Run sg-core to process metrics
run: |
docker run --name=sgcore -d -uroot --network host $BRIDGE_VOLUME -e OPSTOOLS_REPO \
--volume ${{ github.workspace }}:$PROJECT_ROOT:z --workdir $PROJECT_ROOT \
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/run_sg_collectd_bridge.sh
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/collectd/run_sg.sh
- name: Run Prometheus to store metrics
run: |
docker run --name=prometheus -d --network host \
Expand All @@ -102,15 +102,13 @@ jobs:
docker logs qdr
echo "========================= sg-core =======================" && \
docker logs sgcore
echo "========================= ceilometer ====================" && \
sudo journalctl -xu [email protected]
echo "======================== prometheus =====================" && \
docker logs prometheus
- name: Validate metrics processing
run: |
docker run --name=validate -uroot --network host \
--volume ${{ github.workspace }}:$PROJECT_ROOT:z --workdir $PROJECT_ROOT \
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/run_validation.sh
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/collectd/run_validation.sh
#-------------------------------------------------------------------------------
ceilometer-metrics-bridge:
name: "[metrics] transport: socket(sg-bridge); handler: ceilometer-metrics; application: prometheus"
Expand Down Expand Up @@ -180,15 +178,15 @@ jobs:
echo pseudo_vhost=true | crudini --merge /etc/ceilometer/ceilometer.conf oslo_messaging_amqp
echo rpc_address_prefix="" | crudini --merge /etc/ceilometer/ceilometer.conf oslo_messaging_amqp
echo notify_address_prefix="" | crudini --merge /etc/ceilometer/ceilometer.conf oslo_messaging_amqp
cp ci/integration/metrics/*pipeline.yaml /etc/ceilometer/.
cp ci/integration/metrics/ceilometer/*pipeline.yaml /etc/ceilometer/.
cat /etc/ceilometer/*
sudo pip install pyngus
sudo systemctl restart [email protected]
- name: Run sg-core to process metrics
run: |
docker run --name=sgcore -d -uroot --network host $BRIDGE_VOLUME -e OPSTOOLS_REPO \
--volume ${{ github.workspace }}:$PROJECT_ROOT:z --workdir $PROJECT_ROOT \
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/run_sg_ceilometer_bridge.sh
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/ceilometer/run_sg_with_bridge.sh
- name: Run Prometheus to store metrics
run: |
docker run --name=prometheus -d --network host \
Expand All @@ -210,7 +208,7 @@ jobs:
run: |
docker run --name=validate -uroot --network host \
--volume ${{ github.workspace }}:$PROJECT_ROOT:z --workdir $PROJECT_ROOT \
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/run_validation.sh
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/ceilometer/run_validation.sh
#-------------------------------------------------------------------------------
logging:
name: "[logging] handler: logs; application: elasticsearch, loki"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ go1.19 download
mkdir -p /usr/lib64/sg-core
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.19 BUILD_ARGS=-buildvcs=false ./build.sh

./sg-core -config ./ci/integration/metrics/sg_config_ceilometer_bridge.yaml
./sg-core -config ./ci/integration/metrics/sg_config_bridge.yaml
23 changes: 23 additions & 0 deletions ci/integration/metrics/ceilometer/run_sg_with_tcp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/env bash
# CI script for UBI8 job
# purpose: spawn sg-core to process messages sent by rsyslog

set -ex

# enable required repo(s)
curl -o /etc/yum.repos.d/CentOS-OpsTools.repo $OPSTOOLS_REPO
sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/CentOS-OpsTools.repo

dnf install -y git golang gcc make qpid-proton-c-devel

export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN

go install golang.org/dl/go1.19@latest
go1.19 download

# install sg-core and start sg-core
mkdir -p /usr/lib64/sg-core
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.19 BUILD_ARGS=-buildvcs=false ./build.sh

./sg-core -config ./ci/integration/metrics/sg_config_tcp.yaml
17 changes: 17 additions & 0 deletions ci/integration/metrics/ceilometer/sg_config_tcp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---

pluginDir: /usr/lib64/sg-core
logLevel: debug

transports:
- name: socket
config:
type: tcp
handlers:
- name: ceilometer-metrics

applications:
- name: prometheus
config:
host: 0.0.0.0
port: 3000
File renamed without changes.
File renamed without changes.

0 comments on commit b3962c0

Please sign in to comment.