From 95c0803a3c42680bc2d074f52c5f1fcc265f0eb6 Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Fri, 20 Dec 2024 15:43:19 +0100 Subject: [PATCH 1/8] Use common function to add message to ILP encoder --- sinks/httpSink.go | 64 +------------------------------------------ sinks/metricSink.go | 56 +++++++++++++++++++++++++++++++++++++ sinks/natsSink.go | 67 +++++++-------------------------------------- 3 files changed, 67 insertions(+), 120 deletions(-) diff --git a/sinks/httpSink.go b/sinks/httpSink.go index 44d6dea..67dd85a 100644 --- a/sinks/httpSink.go +++ b/sinks/httpSink.go @@ -51,11 +51,6 @@ type HttpSinkConfig struct { Precision string `json:"precision,omitempty"` } -type key_value_pair struct { - key string - value string -} - type HttpSink struct { sink client *http.Client @@ -84,64 +79,7 @@ func (s *HttpSink) Write(msg lp.CCMessage) error { // Lock for encoder usage s.encoderLock.Lock() - // Encode measurement name - s.encoder.StartLine(m.Name()) - - // copy tags and meta data which should be used as tags - s.extended_tag_list = s.extended_tag_list[:0] - for key, value := range m.Tags() { - s.extended_tag_list = - append( - s.extended_tag_list, - key_value_pair{ - key: key, - value: value, - }, - ) - } - // for _, key := range s.config.MetaAsTags { - // if value, ok := m.GetMeta(key); ok { - // s.extended_tag_list = - // append( - // s.extended_tag_list, - // key_value_pair{ - // key: key, - // value: value, - // }, - // ) - // } - // } - - // Encode tags (they musts be in lexical order) - slices.SortFunc( - s.extended_tag_list, - func(a key_value_pair, b key_value_pair) int { - if a.key < b.key { - return -1 - } - if a.key > b.key { - return +1 - } - return 0 - }, - ) - for i := range s.extended_tag_list { - s.encoder.AddTag( - s.extended_tag_list[i].key, - s.extended_tag_list[i].value, - ) - } - - // Encode fields - for key, value := range m.Fields() { - s.encoder.AddField(key, influx.MustNewValue(value)) - } - - // Encode time stamp - s.encoder.EndLine(m.Time()) - - // Check for encoder errors - err := s.encoder.Err() + err = EncoderAdd(&s.encoder, m) // Unlock encoder usage s.encoderLock.Unlock() diff --git a/sinks/metricSink.go b/sinks/metricSink.go index 4cac04b..f3e95a3 100644 --- a/sinks/metricSink.go +++ b/sinks/metricSink.go @@ -5,6 +5,8 @@ import ( lp "github.com/ClusterCockpit/cc-energy-manager/pkg/cc-message" mp "github.com/ClusterCockpit/cc-metric-collector/pkg/messageProcessor" + influx "github.com/influxdata/line-protocol/v2/lineprotocol" + "golang.org/x/exp/slices" ) type defaultSinkConfig struct { @@ -30,3 +32,57 @@ type Sink interface { func (s *sink) Name() string { return s.name } + +type key_value_pair struct { + key string + value string +} + +func EncoderAdd(encoder *influx.Encoder, msg lp.CCMessage) error { + // Encode measurement name + encoder.StartLine(msg.Name()) + + tag_list := make([]key_value_pair, 0, 10) + + // copy tags and meta data which should be used as tags + for key, value := range msg.Tags() { + tag_list = + append( + tag_list, + key_value_pair{ + key: key, + value: value, + }, + ) + } + // Encode tags (they musts be in lexical order) + slices.SortFunc( + tag_list, + func(a key_value_pair, b key_value_pair) int { + if a.key < b.key { + return -1 + } + if a.key > b.key { + return +1 + } + return 0 + }, + ) + for i := range tag_list { + encoder.AddTag( + tag_list[i].key, + tag_list[i].value, + ) + } + + // Encode fields + for key, value := range msg.Fields() { + encoder.AddField(key, influx.MustNewValue(value)) + } + + // Encode time stamp + encoder.EndLine(msg.Time()) + + // Return encoder errors + return encoder.Err() +} diff --git a/sinks/natsSink.go b/sinks/natsSink.go index 1982bfe..b2f0b18 100644 --- a/sinks/natsSink.go +++ b/sinks/natsSink.go @@ -30,19 +30,16 @@ type NatsSinkConfig struct { Precision string `json:"precision,omitempty"` } - type NatsSink struct { sink - client *nats.Conn - encoder influx.Encoder - buffer *bytes.Buffer - config NatsSinkConfig + client *nats.Conn + encoder influx.Encoder + encoderLock sync.Mutex + config NatsSinkConfig - lock sync.Mutex flushDelay time.Duration flushTimer *time.Timer - - extended_tag_list []key_value_pair + //timerLock sync.Mutex } func (s *NatsSink) connect() error { @@ -78,54 +75,11 @@ func (s *NatsSink) connect() error { func (s *NatsSink) Write(m lp.CCMessage) error { msg, err := s.mp.ProcessMessage(m) if err == nil && msg != nil { - s.lock.Lock() - // Encode measurement name - s.encoder.StartLine(msg.Name()) + s.encoderLock.Lock() - // copy tags and meta data which should be used as tags - s.extended_tag_list = s.extended_tag_list[:0] - for key, value := range m.Tags() { - s.extended_tag_list = - append( - s.extended_tag_list, - key_value_pair{ - key: key, - value: value, - }, - ) - } - // Encode tags (they musts be in lexical order) - slices.SortFunc( - s.extended_tag_list, - func(a key_value_pair, b key_value_pair) int { - if a.key < b.key { - return -1 - } - if a.key > b.key { - return +1 - } - return 0 - }, - ) - for i := range s.extended_tag_list { - s.encoder.AddTag( - s.extended_tag_list[i].key, - s.extended_tag_list[i].value, - ) - } + err = EncoderAdd(&s.encoder, msg) - // Encode fields - for key, value := range msg.Fields() { - s.encoder.AddField(key, influx.MustNewValue(value)) - } - - // Encode time stamp - s.encoder.EndLine(msg.Time()) - - // Check for encoder errors - err := s.encoder.Err() - - s.lock.Unlock() + s.encoderLock.Unlock() if err != nil { cclog.ComponentError(s.name, "Write:", err.Error()) return err @@ -146,10 +100,10 @@ func (s *NatsSink) Write(m lp.CCMessage) error { } func (s *NatsSink) Flush() error { - s.lock.Lock() + s.encoderLock.Lock() buf := slices.Clone(s.encoder.Bytes()) s.encoder.Reset() - s.lock.Unlock() + s.encoderLock.Unlock() if len(buf) == 0 { return nil @@ -233,7 +187,6 @@ func NewNatsSink(name string, config json.RawMessage) (Sink, error) { return nil, err } } - s.extended_tag_list = make([]key_value_pair, 0) return s, nil } From d0af494149fc742e449b676171b3c4c834590590 Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Fri, 20 Dec 2024 17:06:50 +0100 Subject: [PATCH 2/8] httpSink: remove unused extended tag list --- sinks/httpSink.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sinks/httpSink.go b/sinks/httpSink.go index 67dd85a..8e1a8fd 100644 --- a/sinks/httpSink.go +++ b/sinks/httpSink.go @@ -56,8 +56,7 @@ type HttpSink struct { client *http.Client // influx line protocol encoder encoder influx.Encoder - // List of tags and meta data tags which should be used as tags - extended_tag_list []key_value_pair + // Flush() runs in another goroutine and accesses the influx line protocol encoder, // so this encoderLock has to protect the encoder encoderLock sync.Mutex @@ -302,7 +301,6 @@ func NewHttpSink(name string, config json.RawMessage) (Sink, error) { // Configure influx line protocol encoder s.encoder.SetPrecision(precision) - s.extended_tag_list = make([]key_value_pair, 0) return s, nil } From 708e145020640aea7a3196bbabc0f55e571415ed Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Fri, 20 Dec 2024 17:07:16 +0100 Subject: [PATCH 3/8] natsSink: Use flush timer handling from httpSink and some comments --- sinks/natsSink.go | 82 +++++++++++++++++++++++++++++++++-------------- sinks/natsSink.md | 2 +- 2 files changed, 59 insertions(+), 25 deletions(-) diff --git a/sinks/natsSink.go b/sinks/natsSink.go index b2f0b18..08cb4d1 100644 --- a/sinks/natsSink.go +++ b/sinks/natsSink.go @@ -25,6 +25,7 @@ type NatsSinkConfig struct { User string `json:"user,omitempty"` Password string `json:"password,omitempty"` FlushDelay string `json:"flush_delay,omitempty"` + flushDelay time.Duration NkeyFile string `json:"nkey_file,omitempty"` // Timestamp precision Precision string `json:"precision,omitempty"` @@ -37,9 +38,8 @@ type NatsSink struct { encoderLock sync.Mutex config NatsSinkConfig - flushDelay time.Duration flushTimer *time.Timer - //timerLock sync.Mutex + timerLock sync.Mutex } func (s *NatsSink) connect() error { @@ -75,39 +75,67 @@ func (s *NatsSink) connect() error { func (s *NatsSink) Write(m lp.CCMessage) error { msg, err := s.mp.ProcessMessage(m) if err == nil && msg != nil { + // Lock for encoder usage s.encoderLock.Lock() - err = EncoderAdd(&s.encoder, msg) + // Add message to encoder + err = EncoderAdd(&s.encoder, m) + // Unlock encoder usage s.encoderLock.Unlock() + + // Check that encoding worked if err != nil { cclog.ComponentError(s.name, "Write:", err.Error()) return err } } - if s.flushDelay == 0 { - s.Flush() - } else if s.flushTimer == nil { - s.flushTimer = time.AfterFunc(s.flushDelay, func() { - s.Flush() - }) - } else { - s.flushTimer.Reset(s.flushDelay) + if s.config.flushDelay == 0 { + // Directly flush if no flush delay is configured + return s.Flush() + } else if s.timerLock.TryLock() { + // Setup flush timer when flush delay is configured + // and no other timer is already running + if s.flushTimer != nil { + + // Restarting existing flush timer + cclog.ComponentDebug(s.name, "Write(): Restarting flush timer") + s.flushTimer.Reset(s.config.flushDelay) + } else { + + // Creating and starting flush timer + cclog.ComponentDebug(s.name, "Write(): Starting new flush timer") + s.flushTimer = time.AfterFunc( + s.config.flushDelay, + func() { + defer s.timerLock.Unlock() + cclog.ComponentDebug(s.name, "Starting flush triggered by flush timer") + if err := s.Flush(); err != nil { + cclog.ComponentError(s.name, "Flush triggered by flush timer: flush failed:", err) + } + }) + } } return nil } func (s *NatsSink) Flush() error { + // Lock for encoder usage + // Own lock for as short as possible: the time it takes to clone the buffer. s.encoderLock.Lock() + buf := slices.Clone(s.encoder.Bytes()) s.encoder.Reset() + + // Unlock encoder usage s.encoderLock.Unlock() if len(buf) == 0 { return nil } + if err := s.client.Publish(s.config.Subject, buf); err != nil { cclog.ComponentError(s.name, "Flush:", err.Error()) return err @@ -116,14 +144,21 @@ func (s *NatsSink) Flush() error { } func (s *NatsSink) Close() { - cclog.ComponentDebug(s.name, "Close") + // Stop existing timer and immediately flush + if s.flushTimer != nil { + if ok := s.flushTimer.Stop(); ok { + s.timerLock.Unlock() + } + } + cclog.ComponentDebug(s.name, "Close NATS connection") s.client.Close() } func NewNatsSink(name string, config json.RawMessage) (Sink, error) { s := new(NatsSink) s.name = fmt.Sprintf("NatsSink(%s)", name) - s.flushDelay = 10 * time.Second + s.config.flushDelay = 5 * time.Second + s.config.FlushDelay = "5s" s.config.Port = "4222" s.config.Precision = "s" if len(config) > 0 { @@ -139,21 +174,25 @@ func NewNatsSink(name string, config json.RawMessage) (Sink, error) { len(s.config.Subject) == 0 { return nil, errors.New("not all configuration variables set required by NatsSink") } + // Create a new message processor p, err := mp.NewMessageProcessor() if err != nil { return nil, fmt.Errorf("initialization of message processor failed: %v", err.Error()) } s.mp = p + // Read config related to message processor if len(s.config.MessageProcessor) > 0 { err = s.mp.FromConfigJSON(s.config.MessageProcessor) if err != nil { return nil, fmt.Errorf("failed parsing JSON for message processor: %v", err.Error()) } } - // Create lookup map to use meta infos as tags in the output metric + // Add meta_as_tags list to message processor for _, k := range s.config.MetaAsTags { s.mp.AddMoveMetaToTags("true", k, k) } + + // Setup Influx line protocol encoder precision := influx.Second if len(s.config.Precision) > 0 { switch s.config.Precision { @@ -168,11 +207,6 @@ func NewNatsSink(name string, config json.RawMessage) (Sink, error) { } } - // s.meta_as_tags = make(map[string]bool) - // for _, k := range s.config.MetaAsTags { - // s.meta_as_tags[k] = true - // } - // Setup Influx line protocol s.encoder.SetPrecision(precision) // Setup infos for connection if err := s.connect(); err != nil { @@ -180,11 +214,11 @@ func NewNatsSink(name string, config json.RawMessage) (Sink, error) { } s.flushTimer = nil - if len(s.config.FlushDelay) != 0 { - var err error - s.flushDelay, err = time.ParseDuration(s.config.FlushDelay) - if err != nil { - return nil, err + if len(s.config.FlushDelay) > 0 { + t, err := time.ParseDuration(s.config.FlushDelay) + if err == nil { + s.config.flushDelay = t + cclog.ComponentDebug(s.name, "Init(): flushDelay", t) } } diff --git a/sinks/natsSink.md b/sinks/natsSink.md index 8bafbb0..ef536d4 100644 --- a/sinks/natsSink.md +++ b/sinks/natsSink.md @@ -31,7 +31,7 @@ The `nats` sink publishes all metrics into a NATS network. The publishing key is - `user`: Username for basic authentication - `password`: Password for basic authentication - `nkey_file`: Path to credentials file with NKEY -- `flush_delay`: Maximum time until metrics are sent out +- `flush_delay`: Maximum time until metrics are sent out (default '5s') - `precision`: Precision of the timestamp. Valid values are 's', 'ms', 'us' and 'ns'. (default is 's') - `process_messages`: Process messages with given rules before progressing or dropping, see [here](../pkg/messageProcessor/README.md) (optional) - `meta_as_tags`: print all meta information as tags in the output (deprecated, optional) From 1e2e43742fc702d37b9aa2125464c0062d1450e7 Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Fri, 20 Dec 2024 18:28:32 +0100 Subject: [PATCH 4/8] Remove go-toolkit as build requirement for RPM builds if run in CI --- scripts/cc-metric-collector.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/cc-metric-collector.spec b/scripts/cc-metric-collector.spec index 6a5e219..008f190 100644 --- a/scripts/cc-metric-collector.spec +++ b/scripts/cc-metric-collector.spec @@ -6,7 +6,9 @@ Summary: Metric collection daemon from the ClusterCockpit suite License: MIT Source0: %{name}-%{version}.tar.gz +%if "%{getenv:CI}" != "1" BuildRequires: go-toolset +%endif BuildRequires: systemd-rpm-macros # for header downloads BuildRequires: wget From 4fd8c8715766a7f9bf17e12fdd926978aebc349c Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Fri, 20 Dec 2024 18:43:21 +0100 Subject: [PATCH 5/8] Remove condition around BuildRequires and use go-toolkit for RPM builds --- .github/workflows/Release.yml | 36 +++++++++++++++++++------------- scripts/cc-metric-collector.spec | 2 -- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 219ea0d..0029f37 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -41,10 +41,12 @@ jobs: submodules: recursive fetch-depth: 0 + # - name: Setup Golang + # uses: actions/setup-go@v5 + # with: + # go-version: 'stable' - name: Setup Golang - uses: actions/setup-go@v5 - with: - go-version: 'stable' + run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit - name: RPM build MetricCollector id: rpmbuild @@ -110,10 +112,12 @@ jobs: submodules: recursive fetch-depth: 0 + # - name: Setup Golang + # uses: actions/setup-go@v5 + # with: + # go-version: 'stable' - name: Setup Golang - uses: actions/setup-go@v5 - with: - go-version: 'stable' + run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit - name: RPM build MetricCollector id: rpmbuild @@ -176,10 +180,12 @@ jobs: submodules: recursive fetch-depth: 0 + # - name: Setup Golang + # uses: actions/setup-go@v5 + # with: + # go-version: 'stable' - name: Setup Golang - uses: actions/setup-go@v5 - with: - go-version: 'stable' + run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit - name: RPM build MetricCollector id: rpmbuild @@ -211,7 +217,7 @@ jobs: # Use dnf to install development packages - name: Install development packages - run: dnf --assumeyes --disableplugin=subscription-manager install rpm-build go-srpm-macros gcc make python39 git wget openssl-devel diffutils delve + run: dnf --assumeyes --disableplugin=subscription-manager install rpm-build go-srpm-macros gcc make python39 git wget openssl-devel diffutils delve go-toolkit # Checkout git repository and submodules # fetch-depth must be 0 to use git describe @@ -223,10 +229,12 @@ jobs: fetch-depth: 0 # See: https://github.com/marketplace/actions/setup-go-environment + # - name: Setup Golang + # uses: actions/setup-go@v5 + # with: + # go-version: 'stable' - name: Setup Golang - uses: actions/setup-go@v5 - with: - go-version: 'stable' + run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit - name: RPM build MetricCollector id: rpmbuild @@ -310,7 +318,7 @@ jobs: - name: Install development packages run: | apt update && apt --assume-yes upgrade - apt --assume-yes install build-essential sed git wget bash + apt --assume-yes install build-essential sed git wget bash go # Checkout git repository and submodules # fetch-depth must be 0 to use git describe # See: https://github.com/marketplace/actions/checkout diff --git a/scripts/cc-metric-collector.spec b/scripts/cc-metric-collector.spec index 008f190..6a5e219 100644 --- a/scripts/cc-metric-collector.spec +++ b/scripts/cc-metric-collector.spec @@ -6,9 +6,7 @@ Summary: Metric collection daemon from the ClusterCockpit suite License: MIT Source0: %{name}-%{version}.tar.gz -%if "%{getenv:CI}" != "1" BuildRequires: go-toolset -%endif BuildRequires: systemd-rpm-macros # for header downloads BuildRequires: wget From d00b14f3e822f95a6e92bcbf550a78f2902ceca9 Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Fri, 20 Dec 2024 18:49:28 +0100 Subject: [PATCH 6/8] use go-toolkit for RPM builds --- .github/workflows/runonce.yml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/runonce.yml b/.github/workflows/runonce.yml index 4d7b596..e4a27d6 100644 --- a/.github/workflows/runonce.yml +++ b/.github/workflows/runonce.yml @@ -115,10 +115,12 @@ jobs: fetch-depth: 0 # See: https://github.com/marketplace/actions/setup-go-environment + # - name: Setup Golang + # uses: actions/setup-go@v5 + # with: + # go-version: 'stable' - name: Setup Golang - uses: actions/setup-go@v5 - with: - go-version: 'stable' + run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit - name: RPM build MetricCollector id: rpmbuild @@ -153,10 +155,12 @@ jobs: fetch-depth: 0 # See: https://github.com/marketplace/actions/setup-go-environment + # - name: Setup Golang + # uses: actions/setup-go@v5 + # with: + # go-version: 'stable' - name: Setup Golang - uses: actions/setup-go@v5 - with: - go-version: 'stable' + run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit - name: RPM build MetricCollector id: rpmbuild @@ -189,10 +193,12 @@ jobs: fetch-depth: 0 # See: https://github.com/marketplace/actions/setup-go-environment + # - name: Setup Golang + # uses: actions/setup-go@v5 + # with: + # go-version: 'stable' - name: Setup Golang - uses: actions/setup-go@v5 - with: - go-version: 'stable' + run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit - name: RPM build MetricCollector id: rpmbuild @@ -224,10 +230,12 @@ jobs: fetch-depth: 0 # See: https://github.com/marketplace/actions/setup-go-environment + # - name: Setup Golang + # uses: actions/setup-go@v5 + # with: + # go-version: 'stable' - name: Setup Golang - uses: actions/setup-go@v5 - with: - go-version: 'stable' + run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit - name: RPM build MetricCollector id: rpmbuild From 482ae046cb3f7b47954b5486c7ed32227432cfba Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Fri, 20 Dec 2024 20:12:03 +0100 Subject: [PATCH 7/8] Install go-toolkit to fulfill build requirements for RPM --- .github/workflows/Release.yml | 28 ++++++++++++++++++++++++---- .github/workflows/runonce.yml | 28 ++++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 0029f37..b08f703 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -46,7 +46,12 @@ jobs: # with: # go-version: 'stable' - name: Setup Golang - run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit + run: | + dnf --assumeyes --disableplugin=subscription-manager install \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/go-toolset-1.22.9-1.module_el8.10.0+3938+8c723e16.x86_64.rpm \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/golang-1.22.9-1.module_el8.10.0+3938+8c723e16.x86_64.rpm \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/golang-bin-1.22.9-1.module_el8.10.0+3938+8c723e16.x86_64.rpm \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/golang-src-1.22.9-1.module_el8.10.0+3938+8c723e16.noarch.rpm - name: RPM build MetricCollector id: rpmbuild @@ -117,7 +122,12 @@ jobs: # with: # go-version: 'stable' - name: Setup Golang - run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit + run: | + dnf --assumeyes --disableplugin=subscription-manager install \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/go-toolset-1.22.7-2.el9_5.x86_64.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-1.22.7-2.el9_5.x86_64.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-bin-1.22.7-2.el9_5.x86_64.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-src-1.22.7-2.el9_5.noarch.rpm - name: RPM build MetricCollector id: rpmbuild @@ -185,7 +195,12 @@ jobs: # with: # go-version: 'stable' - name: Setup Golang - run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit + run: | + dnf --assumeyes --disableplugin=subscription-manager install \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/go-toolset-1.22.9-1.module_el8.10.0+3938+8c723e16.x86_64.rpm \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/golang-1.22.9-1.module_el8.10.0+3938+8c723e16.x86_64.rpm \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/golang-bin-1.22.9-1.module_el8.10.0+3938+8c723e16.x86_64.rpm \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/golang-src-1.22.9-1.module_el8.10.0+3938+8c723e16.noarch.rpm - name: RPM build MetricCollector id: rpmbuild @@ -234,7 +249,12 @@ jobs: # with: # go-version: 'stable' - name: Setup Golang - run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit + run: | + dnf --assumeyes --disableplugin=subscription-manager install \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/go-toolset-1.22.7-2.el9_5.x86_64.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-1.22.7-2.el9_5.x86_64.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-bin-1.22.7-2.el9_5.x86_64.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-src-1.22.7-2.el9_5.noarch.rpm - name: RPM build MetricCollector id: rpmbuild diff --git a/.github/workflows/runonce.yml b/.github/workflows/runonce.yml index e4a27d6..869e294 100644 --- a/.github/workflows/runonce.yml +++ b/.github/workflows/runonce.yml @@ -120,7 +120,12 @@ jobs: # with: # go-version: 'stable' - name: Setup Golang - run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit + run: | + dnf --assumeyes --disableplugin=subscription-manager install \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/go-toolset-1.22.9-1.module_el8.10.0+3938+8c723e16.x86_64.rpm \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/golang-1.22.9-1.module_el8.10.0+3938+8c723e16.x86_64.rpm \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/golang-bin-1.22.9-1.module_el8.10.0+3938+8c723e16.x86_64.rpm \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/golang-src-1.22.9-1.module_el8.10.0+3938+8c723e16.noarch.rpm - name: RPM build MetricCollector id: rpmbuild @@ -160,7 +165,12 @@ jobs: # with: # go-version: 'stable' - name: Setup Golang - run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit + run: | + dnf --assumeyes --disableplugin=subscription-manager install \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/go-toolset-1.22.7-2.el9_5.x86_64.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-1.22.7-2.el9_5.x86_64.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-bin-1.22.7-2.el9_5.x86_64.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-src-1.22.7-2.el9_5.noarch.rpm - name: RPM build MetricCollector id: rpmbuild @@ -198,7 +208,12 @@ jobs: # with: # go-version: 'stable' - name: Setup Golang - run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit + run: | + dnf --assumeyes --disableplugin=subscription-manager install \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/go-toolset-1.22.9-1.module_el8.10.0+3938+8c723e16.x86_64.rpm \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/golang-1.22.9-1.module_el8.10.0+3938+8c723e16.x86_64.rpm \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/golang-bin-1.22.9-1.module_el8.10.0+3938+8c723e16.x86_64.rpm \ + https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/Packages/golang-src-1.22.9-1.module_el8.10.0+3938+8c723e16.noarch.rpm - name: RPM build MetricCollector id: rpmbuild @@ -235,7 +250,12 @@ jobs: # with: # go-version: 'stable' - name: Setup Golang - run: dnf --assumeyes --disableplugin=subscription-manager install go-toolkit + run: | + dnf --assumeyes --disableplugin=subscription-manager install \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/go-toolset-1.22.7-2.el9_5.x86_64.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-1.22.7-2.el9_5.x86_64.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-bin-1.22.7-2.el9_5.x86_64.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-src-1.22.7-2.el9_5.noarch.rpm - name: RPM build MetricCollector id: rpmbuild From e7d76dd0d8f6b94620223dae5e31bd6573d35ec5 Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Fri, 20 Dec 2024 20:15:59 +0100 Subject: [PATCH 8/8] Add golang-race for UBI9 and Alma9 --- .github/workflows/Release.yml | 6 ++++-- .github/workflows/runonce.yml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index b08f703..4d65cb6 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -127,7 +127,8 @@ jobs: https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/go-toolset-1.22.7-2.el9_5.x86_64.rpm \ https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-1.22.7-2.el9_5.x86_64.rpm \ https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-bin-1.22.7-2.el9_5.x86_64.rpm \ - https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-src-1.22.7-2.el9_5.noarch.rpm + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-src-1.22.7-2.el9_5.noarch.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-race-1.22.7-2.el9_5.x86_64.rpm - name: RPM build MetricCollector id: rpmbuild @@ -254,7 +255,8 @@ jobs: https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/go-toolset-1.22.7-2.el9_5.x86_64.rpm \ https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-1.22.7-2.el9_5.x86_64.rpm \ https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-bin-1.22.7-2.el9_5.x86_64.rpm \ - https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-src-1.22.7-2.el9_5.noarch.rpm + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-src-1.22.7-2.el9_5.noarch.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-race-1.22.7-2.el9_5.x86_64.rpm - name: RPM build MetricCollector id: rpmbuild diff --git a/.github/workflows/runonce.yml b/.github/workflows/runonce.yml index 869e294..ffa6c19 100644 --- a/.github/workflows/runonce.yml +++ b/.github/workflows/runonce.yml @@ -170,7 +170,8 @@ jobs: https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/go-toolset-1.22.7-2.el9_5.x86_64.rpm \ https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-1.22.7-2.el9_5.x86_64.rpm \ https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-bin-1.22.7-2.el9_5.x86_64.rpm \ - https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-src-1.22.7-2.el9_5.noarch.rpm + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-src-1.22.7-2.el9_5.noarch.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-race-1.22.7-2.el9_5.x86_64.rpm - name: RPM build MetricCollector id: rpmbuild @@ -255,7 +256,8 @@ jobs: https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/go-toolset-1.22.7-2.el9_5.x86_64.rpm \ https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-1.22.7-2.el9_5.x86_64.rpm \ https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-bin-1.22.7-2.el9_5.x86_64.rpm \ - https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-src-1.22.7-2.el9_5.noarch.rpm + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-src-1.22.7-2.el9_5.noarch.rpm \ + https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/golang-race-1.22.7-2.el9_5.x86_64.rpm - name: RPM build MetricCollector id: rpmbuild