From 0b96faa9f1d309e34e5c30c99a2b7b156557ccf1 Mon Sep 17 00:00:00 2001 From: "vimartin@redhat.com" Date: Mon, 19 Aug 2024 12:05:13 +0200 Subject: [PATCH] Use correct repo naming 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 --- .github/workflows/integration.yml | 16 ++++++++-------- .github/workflows/tests.yml | 4 ++-- build/Dockerfile | 2 +- .../{opstools.repo => centos9-caracal.repo} | 0 ci/integration/logging/run_bridge.sh | 3 +-- ci/integration/logging/run_sg.sh | 14 +++++--------- .../metrics/ceilometer/bridge/run_sg.sh | 2 +- ci/integration/metrics/ceilometer/tcp/run_sg.sh | 2 +- ci/integration/metrics/collectd/run_sg.sh | 2 +- ci/integration/metrics/run_bridge.sh | 2 +- ci/unit/run_tests.sh | 2 +- 11 files changed, 22 insertions(+), 27 deletions(-) rename build/repos/{opstools.repo => centos9-caracal.repo} (100%) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index e561347d..ab41bc33 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://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" @@ -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 @@ -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 @@ -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 @@ -186,7 +186,7 @@ jobs: sudo systemctl restart devstack@ceilometer-anotification.service - 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 @@ -263,7 +263,7 @@ jobs: sudo systemctl restart devstack@ceilometer-anotification.service - 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 @@ -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 @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4ce75a06..53f8b0e4 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://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" @@ -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 diff --git a/build/Dockerfile b/build/Dockerfile index 413b2fe8..0f472bf2 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -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 diff --git a/build/repos/opstools.repo b/build/repos/centos9-caracal.repo similarity index 100% rename from build/repos/opstools.repo rename to build/repos/centos9-caracal.repo diff --git a/ci/integration/logging/run_bridge.sh b/ci/integration/logging/run_bridge.sh index 30b94fc8..f6131695 100644 --- a/ci/integration/logging/run_bridge.sh +++ b/ci/integration/logging/run_bridge.sh @@ -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 diff --git a/ci/integration/logging/run_sg.sh b/ci/integration/logging/run_sg.sh index 1df29af1..8a91070b 100644 --- a/ci/integration/logging/run_sg.sh +++ b/ci/integration/logging/run_sg.sh @@ -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 diff --git a/ci/integration/metrics/ceilometer/bridge/run_sg.sh b/ci/integration/metrics/ceilometer/bridge/run_sg.sh index ccb56691..eb284ff3 100644 --- a/ci/integration/metrics/ceilometer/bridge/run_sg.sh +++ b/ci/integration/metrics/ceilometer/bridge/run_sg.sh @@ -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 diff --git a/ci/integration/metrics/ceilometer/tcp/run_sg.sh b/ci/integration/metrics/ceilometer/tcp/run_sg.sh index a6998918..730deb8f 100644 --- a/ci/integration/metrics/ceilometer/tcp/run_sg.sh +++ b/ci/integration/metrics/ceilometer/tcp/run_sg.sh @@ -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 diff --git a/ci/integration/metrics/collectd/run_sg.sh b/ci/integration/metrics/collectd/run_sg.sh index 18acf056..14f478fe 100644 --- a/ci/integration/metrics/collectd/run_sg.sh +++ b/ci/integration/metrics/collectd/run_sg.sh @@ -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 diff --git a/ci/integration/metrics/run_bridge.sh b/ci/integration/metrics/run_bridge.sh index 99fef65f..8201a600 100644 --- a/ci/integration/metrics/run_bridge.sh +++ b/ci/integration/metrics/run_bridge.sh @@ -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 diff --git a/ci/unit/run_tests.sh b/ci/unit/run_tests.sh index a75cd512..b223b0cd 100644 --- a/ci/unit/run_tests.sh +++ b/ci/unit/run_tests.sh @@ -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