Skip to content

Commit

Permalink
Use correct repo naming
Browse files Browse the repository at this point in the history
We are now consuming centos9-caracal repos
(OpenStack repos) to get the required dependencies,
so update the repo to centos9-caracal and all the
references in the Github actions and integration
scripts

Add some other cleanups when setting up the repo

Also fix logging integration scripts missing
golang 1.22 microversion
  • Loading branch information
vkmc committed Aug 19, 2024
1 parent 90820a1 commit 0b96faa
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 27 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Integration testing
env:
PROJECT_ROOT: /root/go/src/github.com/infrawatch/sg-core
OPSTOOLS_REPO: https://trunk.rdoproject.org/centos9-caracal/delorean-deps.repo
OPENSTACK_REPO: https://trunk.rdoproject.org/centos9-caracal/delorean-deps.repo

QDR_IMAGE: quay.io/interconnectedcloud/qdrouterd:1.17.0
QDR_VOLUME: "--volume=${{ github.workspace }}/ci/service_configs/qdr:/etc/qpid-dispatch:ro"
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
if: steps.bridge_branch.outcome == 'success'
run: |
docker run --name=sgbridge --network host $BRIDGE_VOLUME -d -uroot \
-e GITHUB_HEAD_REF -e BRIDGE_SOCKET -e QDR_CHANNEL -e OPSTOOLS_REPO \
-e GITHUB_HEAD_REF -e BRIDGE_SOCKET -e QDR_CHANNEL -e OPENSTACK_REPO \
--workdir=$(dirname $BRIDGE_SOCKET) --volume ${{ github.workspace }}:$PROJECT_ROOT:z \
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/run_bridge.sh
- name: Install collectd
Expand All @@ -86,7 +86,7 @@ jobs:
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 \
docker run --name=sgcore -d -uroot --network host $BRIDGE_VOLUME -e OPENSTACK_REPO \
--volume ${{ github.workspace }}:$PROJECT_ROOT:z --workdir $PROJECT_ROOT \
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/collectd/run_sg.sh
- name: Run Prometheus to store metrics
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
if: steps.bridge_branch.outcome == 'success'
run: |
docker run --name=sgbridge --network host $BRIDGE_VOLUME -d -uroot \
-e GITHUB_HEAD_REF -e BRIDGE_SOCKET -e QDR_CHANNEL -e OPSTOOLS_REPO \
-e GITHUB_HEAD_REF -e BRIDGE_SOCKET -e QDR_CHANNEL -e OPENSTACK_REPO \
--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
Expand All @@ -186,7 +186,7 @@ jobs:
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 \
docker run --name=sgcore -d -uroot --network host $BRIDGE_VOLUME -e OPENSTACK_REPO \
--volume ${{ github.workspace }}:$PROJECT_ROOT:z --workdir $PROJECT_ROOT \
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/ceilometer/bridge/run_sg.sh
- name: Run Prometheus to store metrics
Expand Down Expand Up @@ -263,7 +263,7 @@ jobs:
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 \
docker run --name=sgcore -d -uroot --network host $BRIDGE_VOLUME -e OPENSTACK_REPO \
--volume ${{ github.workspace }}:$PROJECT_ROOT:z --workdir $PROJECT_ROOT \
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/ceilometer/tcp/run_sg.sh
- name: Run Prometheus to store metrics
Expand Down Expand Up @@ -333,7 +333,7 @@ jobs:
- name: Start sg-bridge with same branch
if: steps.bridge_branch.outcome == 'success'
run: |
docker run --name=sgbridge $BRIDGE_VOLUME -d -uroot --network host -e OPSTOOLS_REPO \
docker run --name=sgbridge $BRIDGE_VOLUME -d -uroot --network host -e OPENSTACK_REPO \
-e GITHUB_HEAD_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
Expand Down Expand Up @@ -395,7 +395,7 @@ jobs:
# run integration tests
- name: Run sg-core to process log messages
run: |
docker run --name=sgcore -d -uroot --network host $TEST_PORT $BRIDGE_VOLUME -e OPSTOOLS_REPO \
docker run --name=sgcore -d -uroot --network host $TEST_PORT $BRIDGE_VOLUME -e OPENSTACK_REPO \
--volume ${{ github.workspace }}:$PROJECT_ROOT:z --workdir $PROJECT_ROOT \
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/logging/run_sg.sh
- name: sg-core debug output
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI
env:
PROJECT_ROOT: /root/go/src/github.com/infrawatch/sg-core
OPSTOOLS_REPO: https://trunk.rdoproject.org/centos9-caracal/delorean-deps.repo
OPENSTACK_REPO: https://trunk.rdoproject.org/centos9-caracal/delorean-deps.repo

LOKI_IMAGE: quay.io/infrawatch/loki:2.4.2
LOKI_VOLUME: "--volume=${{ github.workspace }}/ci/service_configs/loki:/etc/loki:ro"
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
docker logs loki
- name: Run sg-core unit test suite
run: |
docker run --name=testsuite -uroot --network host -e COVERALLS_REPO_TOKEN -e OPSTOOLS_REPO \
docker run --name=testsuite -uroot --network host -e COVERALLS_REPO_TOKEN -e OPENSTACK_REPO \
--volume ${{ github.workspace }}:$PROJECT_ROOT:z --workdir $PROJECT_ROOT \
$TEST_IMAGE bash $PROJECT_ROOT/ci/unit/run_tests.sh
- name: Send coverage
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR $SGCORE_DIR
COPY . $SGCORE_DIR/

# dependencies for qpid-proton-c
COPY build/repos/opstools.repo /etc/yum.repos.d/opstools.repo
COPY build/repos/centos9-caracal.repo /etc/yum.repos.d/centos9-caracal.repo

RUN dnf install golang git qpid-proton-c-devel -y --setopt=tsflags=nodocs
RUN go install golang.org/dl/go1.22.6@latest && /go/bin/go1.22.6 download && PRODUCTION_BUILD=false CONTAINER_BUILD=true GOCMD=/go/bin/go1.22.6 ./build.sh
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions ci/integration/logging/run_bridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
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
curl -o /etc/yum.repos.d/centos9-caracal.repo $OPENSTACK_REPO

dnf install -y git gcc make qpid-proton-c-devel redhat-rpm-config

Expand Down
14 changes: 5 additions & 9 deletions ci/integration/logging/run_sg.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
#!/bin/env bash
# CI script for UBI8 job
# CI script for UBI9 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
# 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
curl -o /etc/yum.repos.d/centos9-caracal.repo $OPENSTACK_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.22@latest
go1.22 download
go install golang.org/dl/go1.22.6@latest
go1.22.6 download

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

./sg-core -config ./ci/integration/logging/sg_config.yaml
2 changes: 1 addition & 1 deletion ci/integration/metrics/ceilometer/bridge/run_sg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -ex

# enable required repo(s)
curl -o /etc/yum.repos.d/CentOS-OpsTools.repo $OPSTOOLS_REPO
curl -o /etc/yum.repos.d/centos9-caracal.repo $OPENSTACK_REPO

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

Expand Down
2 changes: 1 addition & 1 deletion ci/integration/metrics/ceilometer/tcp/run_sg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -ex

# enable required repo(s)
curl -o /etc/yum.repos.d/CentOS-OpsTools.repo $OPSTOOLS_REPO
curl -o /etc/yum.repos.d/centos9-caracal.repo $OPENSTACK_REPO

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

Expand Down
2 changes: 1 addition & 1 deletion ci/integration/metrics/collectd/run_sg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -ex

# enable required repo(s)
curl -o /etc/yum.repos.d/CentOS-OpsTools.repo $OPSTOOLS_REPO
curl -o /etc/yum.repos.d/centos9-caracal.repo $OPENSTACK_REPO

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

Expand Down
2 changes: 1 addition & 1 deletion ci/integration/metrics/run_bridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -ex
CHANNEL=$QDR_CHANNEL

# enable required repo(s)
curl -o /etc/yum.repos.d/CentOS-OpsTools.repo $OPSTOOLS_REPO
curl -o /etc/yum.repos.d/centos9-caracal.repo $OPENSTACK_REPO

dnf install -y git gcc make qpid-proton-c-devel redhat-rpm-config

Expand Down
2 changes: 1 addition & 1 deletion ci/unit/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -ex

# enable required repo(s)
curl -o /etc/yum.repos.d/CentOS-OpsTools.repo $OPSTOOLS_REPO
curl -o /etc/yum.repos.d/centos9-caracal.repo $OPENSTACK_REPO

# without glibc-langpack-en locale setting in CentOS8 is broken without this package
yum install -y git golang gcc make glibc-langpack-en qpid-proton-c-devel
Expand Down

0 comments on commit 0b96faa

Please sign in to comment.