Skip to content

Commit

Permalink
Refresh (#14)
Browse files Browse the repository at this point in the history
This patch makes sensubility to work with lastest apputils and fixes
few minor things such as:
  - better logging level overriding
  - send messages asynchronously
  - make program react on signals
  - makes CI run again
  • Loading branch information
paramite authored Feb 17, 2023
1 parent 7e7ce6e commit 6cd254d
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 81 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
- name: Run integration tests
run: |
export PROJECT_ROOT=/root/go/src/github.com/infrawatch/collectd-sensubility
docker run -uroot --network host --volume $PWD:$PROJECT_ROOT:z --workdir $PROJECT_ROOT centos:8 bash ci/run_ci.sh
docker run -uroot --network host --volume $PWD:$PROJECT_ROOT:z --workdir $PROJECT_ROOT -e GITHUB_HEAD_REF quay.io/centos/centos:stream8 bash ci/run_ci.sh
6 changes: 6 additions & 0 deletions ci/qdrouterd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ listener {
authenticatePeer: no
saslMechanisms: ANONYMOUS
}

log {
module: DEFAULT
enable: info
timestamp: yes
}
24 changes: 20 additions & 4 deletions ci/run_ci.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/env bash
# CI script for CentOS7 jobs
# CI script for CentOS8 jobs
set -ex

# enable required repo(s)
Expand All @@ -13,16 +13,32 @@ yum install -y golang
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN

# install sensubility dependencies
yum install -y qpid-proton-c-devel git
# install RPM dependencies
yum install -y qpid-proton-c-devel python3-qpid-proton git /usr/bin/pkill

# qpid-proton is pinned because latest version makes electron panic with:
# cannot marshal string: overflow: not enough space to encode
dnf downgrade -y https://cbs.centos.org/kojifiles/packages/qpid-proton/0.35.0/3.el8s/x86_64/qpid-proton-c-0.35.0-3.el8s.x86_64.rpm https://cbs.centos.org/kojifiles/packages/qpid-proton/0.35.0/3.el8s/x86_64/qpid-proton-c-devel-0.35.0-3.el8s.x86_64.rpm https://cbs.centos.org/kojifiles/packages/qpid-proton/0.35.0/3.el8s/x86_64/python3-qpid-proton-0.35.0-3.el8s.x86_64.rpm

# install go.mod dependencies
go mod tidy

# check if apputils repository has same topic branch
BRANCH="$(echo ${GITHUB_HEAD_REF#refs/heads/})"
if git ls-remote --exit-code --heads https://github.com/infrawatch/apputils.git $BRANCH; then
pushd ..
git clone -b $BRANCH https://github.com/infrawatch/apputils.git
popd
echo $(grep -m1 github.com/infrawatch/apputils go.mod | awk '{print "replace ", $1, " ", $2, " => ../apputils"}') >> go.mod
fi

# install collectd-sensubility
go build -o $GOBIN/collectd-sensubility main/main.go

# install Python part of CI
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
yum install -y python3 python3-pip python3-qpid-proton
yum install -y python3 python3-pip
pip3 install Cython
pip3 install -r ci/mocks/sensu/requirements.txt
pip3 install -r ci/mocks/amqp1/requirements.txt
Expand Down
Loading

0 comments on commit 6cd254d

Please sign in to comment.