From 9eb686b850cc30566ada659d9bc71e2862c6cb6a Mon Sep 17 00:00:00 2001 From: Victoria Martinez de la Cruz Date: Tue, 16 Apr 2024 15:59:43 +0200 Subject: [PATCH 1/3] Bump golang to 1.21 --- .github/workflows/tests.yml | 4 ++-- build/Dockerfile | 2 +- ci/integration/logging/run_sg.sh | 6 +++--- ci/integration/metrics/ceilometer/bridge/run_sg.sh | 6 +++--- ci/integration/metrics/ceilometer/tcp/run_sg.sh | 6 +++--- ci/integration/metrics/collectd/run_sg.sh | 6 +++--- ci/unit/run_tests.sh | 6 +++--- go.mod | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a3cef223..c79a5926 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: '1.20' + go-version: '1.21' - uses: actions/checkout@v4.1.3 #- name: download libraries # run: go mod download @@ -77,7 +77,7 @@ jobs: - uses: actions/checkout@v4.1.3 - uses: actions/setup-go@v5 with: - go-version: '1.20' + go-version: '1.21' - name: Verify image builds run: | docker build --tag infrawatch/sg-core:latest --file build/Dockerfile . diff --git a/build/Dockerfile b/build/Dockerfile index c11c13b9..ae4354b1 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -10,7 +10,7 @@ COPY . $D/ COPY build/repos/opstools.repo /etc/yum.repos.d/opstools.repo RUN dnf install golang git qpid-proton-c-devel -y --setopt=tsflags=nodocs -RUN go install golang.org/dl/go1.20@latest && /go/bin/go1.20 download && PRODUCTION_BUILD=false CONTAINER_BUILD=true GOCMD=/go/bin/go1.20 ./build.sh +RUN go install golang.org/dl/go1.21@latest && /go/bin/go1.21 download && PRODUCTION_BUILD=false CONTAINER_BUILD=true GOCMD=/go/bin/go1.21 ./build.sh # --- end build, create smart gateway layer --- FROM registry.access.redhat.com/ubi8-minimal:latest diff --git a/ci/integration/logging/run_sg.sh b/ci/integration/logging/run_sg.sh index eb23fe19..5da68f2c 100644 --- a/ci/integration/logging/run_sg.sh +++ b/ci/integration/logging/run_sg.sh @@ -16,11 +16,11 @@ 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.20@latest -go1.20 download +go install golang.org/dl/go1.21@latest +go1.21 download # install sg-core and start sg-core mkdir -p /usr/lib64/sg-core -PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.20 BUILD_ARGS=-buildvcs=false ./build.sh +PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.21 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 747d3362..05a13097 100644 --- a/ci/integration/metrics/ceilometer/bridge/run_sg.sh +++ b/ci/integration/metrics/ceilometer/bridge/run_sg.sh @@ -13,11 +13,11 @@ 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.20@latest -go1.20 download +go install golang.org/dl/go1.21@latest +go1.21 download # install sg-core and start sg-core mkdir -p /usr/lib64/sg-core -PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.20 BUILD_ARGS=-buildvcs=false ./build.sh +PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.21 BUILD_ARGS=-buildvcs=false ./build.sh ./sg-core -config ./ci/integration/metrics/ceilometer/bridge/sg_config.yaml diff --git a/ci/integration/metrics/ceilometer/tcp/run_sg.sh b/ci/integration/metrics/ceilometer/tcp/run_sg.sh index 1ef16839..23fb4c9e 100644 --- a/ci/integration/metrics/ceilometer/tcp/run_sg.sh +++ b/ci/integration/metrics/ceilometer/tcp/run_sg.sh @@ -13,11 +13,11 @@ 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.20@latest -go1.20 download +go install golang.org/dl/go1.21@latest +go1.21 download # install sg-core and start sg-core mkdir -p /usr/lib64/sg-core -PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.20 BUILD_ARGS=-buildvcs=false ./build.sh +PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.21 BUILD_ARGS=-buildvcs=false ./build.sh ./sg-core -config ./ci/integration/metrics/ceilometer/tcp/sg_config.yaml diff --git a/ci/integration/metrics/collectd/run_sg.sh b/ci/integration/metrics/collectd/run_sg.sh index ea1cd4cc..aa63963e 100644 --- a/ci/integration/metrics/collectd/run_sg.sh +++ b/ci/integration/metrics/collectd/run_sg.sh @@ -13,11 +13,11 @@ 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.20@latest -go1.20 download +go install golang.org/dl/go1.21@latest +go1.21 download # install sg-core and start sg-core mkdir -p /usr/lib64/sg-core -PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.20 BUILD_ARGS=-buildvcs=false ./build.sh +PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.21 BUILD_ARGS=-buildvcs=false ./build.sh ./sg-core -config ./ci/integration/metrics/collectd/sg_config.yaml diff --git a/ci/unit/run_tests.sh b/ci/unit/run_tests.sh index 83a4c92e..15c5b683 100644 --- a/ci/unit/run_tests.sh +++ b/ci/unit/run_tests.sh @@ -14,8 +14,8 @@ yum install -y git golang gcc make glibc-langpack-en qpid-proton-c-devel export GOBIN=$GOPATH/bin export PATH=$PATH:$GOBIN -go install golang.org/dl/go1.20@latest -go1.20 download +go install golang.org/dl/go1.21@latest +go1.21 download -go1.20 test -v -coverprofile=profile.cov ./... +go1.21 test -v -coverprofile=profile.cov ./... diff --git a/go.mod b/go.mod index d42be7bc..d865f674 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/infrawatch/sg-core -go 1.20 +go 1.21 require ( collectd.org v0.5.0 From ce90a64beae6fc0d0b7ee95444f8614913b52d97 Mon Sep 17 00:00:00 2001 From: Victoria Martinez de la Cruz Date: Tue, 30 Apr 2024 10:52:23 +0200 Subject: [PATCH 2/3] Update run-golangci-lint version Bump run-golangci-lint action to v5.1.0 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c79a5926..738feb7e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: #- name: download libraries # run: go mod download - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v5.1.0 with: # Caching conflicts happen in GHA, so just disable for now skip-cache: true From fb50fac643d3165fb97b6ef944a9808cd636460e Mon Sep 17 00:00:00 2001 From: Victoria Martinez de la Cruz Date: Mon, 5 Aug 2024 13:21:44 +0200 Subject: [PATCH 3/3] Use golang 1.21.0 and OpenStack RDO repos Use golang 1.21.0 instead of golang 1.21. Since 1.21 golang added the .z version, so it is now required to point to a z version Use OpenStack RDO Caracal repos to fetch dependencies --- build/Dockerfile | 12 ++++++------ build/repos/opstools.repo | 27 +++++++++++++-------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index ae4354b1..b776e9c5 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,19 +1,19 @@ # --- build smart gateway --- -FROM registry.access.redhat.com/ubi8:latest AS builder +FROM registry.access.redhat.com/ubi9:latest AS builder ENV GOPATH=/go -ENV D=/go/src/github.com/infrawatch/sg-core +ENV SGCORE_DIR=/go/src/github.com/infrawatch/sg-core -WORKDIR $D -COPY . $D/ +WORKDIR $SGCORE_DIR +COPY . $SGCORE_DIR/ # dependencies for qpid-proton-c COPY build/repos/opstools.repo /etc/yum.repos.d/opstools.repo RUN dnf install golang git qpid-proton-c-devel -y --setopt=tsflags=nodocs -RUN go install golang.org/dl/go1.21@latest && /go/bin/go1.21 download && PRODUCTION_BUILD=false CONTAINER_BUILD=true GOCMD=/go/bin/go1.21 ./build.sh +RUN go install golang.org/dl/go1.21.0@latest && /go/bin/go1.21.0 download && PRODUCTION_BUILD=false CONTAINER_BUILD=true GOCMD=/go/bin/go1.21.0 ./build.sh # --- end build, create smart gateway layer --- -FROM registry.access.redhat.com/ubi8-minimal:latest +FROM registry.access.redhat.com/ubi9-minimal:latest LABEL io.k8s.display-name="Smart Gateway" \ io.k8s.description="A component of the Service Telemetry Framework on the server side that ingests data from AMQP 1.x and provides a metrics scrape endpoint for Prometheus, and forwards events to ElasticSearch" \ diff --git a/build/repos/opstools.repo b/build/repos/opstools.repo index 2d95a92d..f00fa338 100644 --- a/build/repos/opstools.repo +++ b/build/repos/opstools.repo @@ -1,19 +1,18 @@ -# CentOS-OpsTools.repo +# CentOS 9 OpenStack repos # -# Please see http://wiki.centos.org/SpecialInterestGroup/OpsTools for more -# information +# Please see https://trunk.rdoproject.org/ and +# https://trunk.rdoproject.org/centos9-caracal/report.html for more information -[centos-opstools-testing] -name=CentOS-OpsTools - testing repo -baseurl=https://buildlogs.centos.org/centos/$releasever-stream/opstools/$basearch/collectd-5/ +[delorean-caracal-testing] +name=dlrn-caracal-testing +baseurl=https://trunk.rdoproject.org/centos9-caracal/deps/latest/ +enabled=1 gpgcheck=0 -enabled=0 +module_hotfixes=1 -[centos-opstools] -name=CentOS-OpsTools - collectd -#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 +[centos9-opstools] +name=centos9-opstools +baseurl=http://mirror.stream.centos.org/SIGs/9-stream/opstools/$basearch/collectd-5/ enabled=1 -skip_if_unavailable=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-OpsTools +gpgcheck=0 +module_hotfixes=1