diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 12309ac4..81ae99d8 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,7 +1,7 @@ name: Integration testing env: PROJECT_ROOT: /root/go/src/github.com/infrawatch/sg-core - OPSTOOLS_REPO: https://git.centos.org/rpms/centos-release-opstools/raw/c8s-sig-opstools/f/SOURCES/CentOS-OpsTools.repo + OPSTOOLS_REPO: https://raw.githubusercontent.com/infrawatch/sg-core/04dcb34edd2c234b378222d2f9a17e15c0dad936/build/repos/opstools.repo QDR_IMAGE: quay.io/interconnectedcloud/qdrouterd:1.17.0 QDR_VOLUME: "--volume=${{ github.workspace }}/ci/service_configs/qdr:/etc/qpid-dispatch:ro" @@ -25,7 +25,7 @@ jobs: PROMETHEUS_IMAGE: prom/prometheus:latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.3 - name: Prepare environment run: | mkdir -p /opt/stack/ @@ -75,7 +75,7 @@ jobs: run: | docker run --name=sgbridge --network host $BRIDGE_VOLUME -d -uroot \ -e GITHUB_REF -e BRIDGE_SOCKET -e QDR_CHANNEL -e OPSTOOLS_REPO \ - --workdir=$(dirname $BRIDGE_SOCKET) \ + --workdir=$(dirname $BRIDGE_SOCKET) --volume ${{ github.workspace }}:$PROJECT_ROOT:z \ $TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/run_bridge.sh - name: Install collectd run: | @@ -102,6 +102,8 @@ jobs: docker logs qdr echo "========================= sg-core =======================" && \ docker logs sgcore + echo "========================= sg-bridge =======================" && \ + docker logs sgbridge echo "======================== prometheus =====================" && \ docker logs prometheus - name: Validate metrics processing @@ -119,7 +121,7 @@ jobs: PROMETHEUS_IMAGE: prom/prometheus:latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.3 - name: Prepare environment run: | mkdir -p /opt/stack/ @@ -169,7 +171,7 @@ jobs: run: | docker run --name=sgbridge --network host $BRIDGE_VOLUME -d -uroot \ -e GITHUB_REF -e BRIDGE_SOCKET -e QDR_CHANNEL -e OPSTOOLS_REPO \ - --workdir=$(dirname $BRIDGE_SOCKET) \ + --workdir=$(dirname $BRIDGE_SOCKET) --volume ${{ github.workspace }}:$PROJECT_ROOT:z \ $TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/run_bridge.sh - name: Set Ceilometer pipelines to QDR output and restart notification agent run: | @@ -200,6 +202,8 @@ jobs: docker logs qdr echo "========================= sg-core =======================" && \ docker logs sgcore + echo "========================= sg-bridge =======================" && \ + docker logs sgbridge echo "========================= ceilometer ====================" && \ sudo journalctl -xu devstack@ceilometer-anotification.service echo "======================== prometheus =====================" && \ @@ -217,7 +221,7 @@ jobs: PROMETHEUS_IMAGE: prom/prometheus:latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.3 - name: Prepare environment run: | mkdir -p /opt/stack/ @@ -283,6 +287,10 @@ jobs: $TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/ceilometer/run_validation.sh #------------------------------------------------------------------------------- logging: + # Disable Logging CI job, because it's failing. This functionality was never + # used in the downstream product. We can re-enable and fix the job if we + # determine the functionality is useful. + if: false name: "[logging] handler: logs; application: elasticsearch, loki" runs-on: ubuntu-22.04 env: @@ -299,7 +307,7 @@ jobs: RSYSLOG_VOLUME: "--volume ${{ github.workspace }}/ci/service_configs/rsyslog/rsyslog_config.conf:/etc/rsyslog.d/integration.conf:z" steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.3 # start data store services - name: Start Elasticsearch service run: | @@ -326,7 +334,7 @@ jobs: if: steps.bridge_branch.outcome == 'success' run: | docker run --name=sgbridge $BRIDGE_VOLUME -d -uroot --network host -e OPSTOOLS_REPO \ - -e GITHUB_REF -e BRIDGE_SOCKET --workdir=$(dirname $BRIDGE_SOCKET) \ + -e GITHUB_REF -e BRIDGE_SOCKET --workdir=$(dirname $BRIDGE_SOCKET) --volume ${{ github.workspace }}:$PROJECT_ROOT:z \ $TEST_IMAGE bash $PROJECT_ROOT/ci/integration/logging/run_bridge.sh - name: Run rsyslog to produce log messages run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d1a34cff..a3cef223 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,7 +1,7 @@ name: CI env: PROJECT_ROOT: /root/go/src/github.com/infrawatch/sg-core - OPSTOOLS_REPO: https://git.centos.org/rpms/centos-release-opstools/raw/c8s-sig-opstools/f/SOURCES/CentOS-OpsTools.repo + OPSTOOLS_REPO: https://raw.githubusercontent.com/infrawatch/sg-core/04dcb34edd2c234b378222d2f9a17e15c0dad936/build/repos/opstools.repo LOKI_IMAGE: quay.io/infrawatch/loki:2.4.2 LOKI_VOLUME: "--volume=${{ github.workspace }}/ci/service_configs/loki:/etc/loki:ro" @@ -19,12 +19,11 @@ jobs: golangci: name: Linting runs-on: ubuntu-20.04 - container: 'quay.io/plmr/sg-core-ci' steps: - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: go-version: '1.20' - - uses: actions/checkout@v3 + - uses: actions/checkout@v4.1.3 #- name: download libraries # run: go mod download - name: golangci-lint @@ -39,7 +38,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4.1.3 # start services - name: Start Elasticsearch service run: | @@ -68,15 +67,15 @@ jobs: --volume ${{ github.workspace }}:$PROJECT_ROOT:z --workdir $PROJECT_ROOT \ $TEST_IMAGE bash $PROJECT_ROOT/ci/unit/run_tests.sh - name: Send coverage - uses: shogo82148/actions-goveralls@v1 + uses: shogo82148/actions-goveralls@v1.8.0 with: path-to-profile: ${{ github.workspace }}/profile.cov image-build: name: Image build runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v4.1.3 + - uses: actions/setup-go@v5 with: go-version: '1.20' - name: Verify image builds diff --git a/.github/workflows/updates.yml b/.github/workflows/updates.yml index 24e3b89e..7cad2c5a 100644 --- a/.github/workflows/updates.yml +++ b/.github/workflows/updates.yml @@ -19,12 +19,12 @@ jobs: runs-on: ubuntu-20.04 steps: - name: update PR with coveralls badge - uses: actions/github-script@v3 + uses: actions/github-script@v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | var BRANCH_NAME = process.env.BRANCH_NAME; - github.issues.createComment({ + github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, diff --git a/build/repos/opstools.repo b/build/repos/opstools.repo index aee21884..2d95a92d 100644 --- a/build/repos/opstools.repo +++ b/build/repos/opstools.repo @@ -11,8 +11,8 @@ enabled=0 [centos-opstools] name=CentOS-OpsTools - collectd -mirrorlist=http://mirrorlist.centos.org/?arch=$basearch&release=$releasever-stream&repo=opstools-collectd-5 -#baseurl=http://mirror.centos.org/$contentdir/$releasever-stream/opstools/$basearch/collectd-5/ +#mirrorlist=http://mirrorlist.centos.org/?arch=$basearch&release=$releasever-stream&repo=opstools-collectd-5 +baseurl=http://vault.centos.org/$releasever-stream/opstools/$basearch/collectd-5/ gpgcheck=0 enabled=1 skip_if_unavailable=1 diff --git a/ci/integration/logging/run_bridge.sh b/ci/integration/logging/run_bridge.sh index d6a5f241..59edfa7a 100644 --- a/ci/integration/logging/run_bridge.sh +++ b/ci/integration/logging/run_bridge.sh @@ -8,7 +8,7 @@ set -ex 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 gcc make qpid-proton-c-devel +dnf install -y git gcc make qpid-proton-c-devel redhat-rpm-config # install and start sg-bridge BRANCH="$(echo ${GITHUB_REF#refs/heads/})" @@ -18,4 +18,4 @@ git checkout $BRANCH || true make touch $BRIDGE_SOCKET -./bridge --amqp_url amqp://localhost:5666/rsyslog/logs --gw_unix=$BRIDGE_SOCKET +./bridge --amqp_url amqp://localhost:5666/rsyslog/logs --gw_unix=$BRIDGE_SOCKET --stat_period 1 diff --git a/ci/integration/logging/run_sg.sh b/ci/integration/logging/run_sg.sh index c6160aad..eb23fe19 100644 --- a/ci/integration/logging/run_sg.sh +++ b/ci/integration/logging/run_sg.sh @@ -7,6 +7,9 @@ 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 +# Update to use the vault mirror since Centos 8s is EOL +sed -i 's/^#baseurl.*$/baseurl=http:\/\/vault.centos.org\/$releasever-stream\/opstools\/$basearch\/collectd-5/g' /etc/yum.repos.d/CentOS-OpsTools.repo +sed -i 's/^mirror/#mirror/g' /etc/yum.repos.d/CentOS-OpsTools.repo dnf install -y git golang gcc make qpid-proton-c-devel diff --git a/ci/integration/metrics/run_bridge.sh b/ci/integration/metrics/run_bridge.sh index fa0e0b68..0c73d1da 100644 --- a/ci/integration/metrics/run_bridge.sh +++ b/ci/integration/metrics/run_bridge.sh @@ -10,7 +10,7 @@ CHANNEL=$QDR_CHANNEL 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 gcc make qpid-proton-c-devel +dnf install -y git gcc make qpid-proton-c-devel redhat-rpm-config # install and start sg-bridge BRANCH="$(echo ${GITHUB_REF#refs/heads/})" @@ -20,4 +20,4 @@ git checkout $BRANCH || true make touch $BRIDGE_SOCKET -./bridge --amqp_url amqp://localhost:5666/$CHANNEL --gw_unix=$BRIDGE_SOCKET +./bridge --amqp_url amqp://localhost:5666/$CHANNEL --gw_unix=$BRIDGE_SOCKET --stat_period 1 diff --git a/go.mod b/go.mod index b6de7703..36ae83c3 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( github.com/smartystreets/goconvey v1.7.2 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect golang.org/x/sys v0.1.0 // indirect - google.golang.org/protobuf v1.27.1 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.63.2 // indirect ) diff --git a/go.sum b/go.sum index 1f0c38a8..b9a0dfed 100644 --- a/go.sum +++ b/go.sum @@ -511,8 +511,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=