Skip to content

Commit

Permalink
CLD-4642 Add support for SLO metric checks while in soaking state (#25)
Browse files Browse the repository at this point in the history
* CLD-4642 Add support for SLO metric checks while in soaking state

* CLD-4642 Fix error

* CLD-4642 Fix log message

* CLD-4642 Fix sqlite go version

* CLD-4642 Upgrade golang to 1.19

* CLD-4642 Fix depdendencies

* CLD-4642 Upgrade golang to 1.19

* CLD-4642 Fix kube-openai version

* CLD-4642 Fix kube-openai version

* CLD-4642 Fix dependencies

* CLD-4642 Upgrade golang to 1.20

---------

Co-authored-by: Stylianos Rigas <[email protected]>
  • Loading branch information
stylianosrigas and Stylianos Rigas authored Sep 12, 2023
1 parent 72e38c7 commit 00160c3
Show file tree
Hide file tree
Showing 10 changed files with 1,439 additions and 182 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
check-style:
runs-on: ubuntu-latest
container:
image: golang:1.18.0-bullseye
image: golang:1.20.0-bullseye
steps:
- name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
Expand All @@ -23,7 +23,7 @@ jobs:
test:
runs-on: ubuntu-latest
container:
image: golang:1.18.0-bullseye
image: golang:1.20.0-bullseye
steps:
- name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################

## Docker Build Versions
DOCKER_BUILD_IMAGE = golang:1.18.1
DOCKER_BUILD_IMAGE = golang:1.20
DOCKER_BASE_IMAGE = alpine:3.15.4

################################################################################
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the Mattermost Elrond
ARG DOCKER_BUILD_IMAGE=golang:1.18.1
ARG DOCKER_BUILD_IMAGE=golang:1.20
ARG DOCKER_BASE_IMAGE=alpine:3.16.2

FROM ${DOCKER_BUILD_IMAGE} AS build
Expand Down
7 changes: 7 additions & 0 deletions cmd/elrond/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func init() {
serverCmd.PersistentFlags().Int("provisioner-group-release-timeout", 3600, "The provisioner group release timeout")
serverCmd.PersistentFlags().String("grafana-url", "", "The Grafana url for the Grafana intergration.")
serverCmd.PersistentFlags().StringSlice("grafana-token", []string{""}, "The grafana token registered with Grafana Org. You can pass multiple entries.")
serverCmd.PersistentFlags().String("thanos-url", "", "The Thanos url for the SLO checks while Soaking. If not added SLO metric checks are ignored")

// Supervisors
serverCmd.PersistentFlags().Int("poll", 30, "The interval in seconds to poll for background work.")
Expand Down Expand Up @@ -99,6 +100,11 @@ var serverCmd = &cobra.Command{
logger.Warn("The grafana-tokens flag was empty; no Grafana integration configured")
}

thanosURL, _ := command.Flags().GetString("thanos-url")
if len(thanosURL) == 0 {
logger.Warn("The thanos-url flag was empty; no Thanos integration configured for SLO checks during Soak time")
}

ringSupervisor, _ := command.Flags().GetBool("ring-supervisor")
installationGroupSupervisor, _ := command.Flags().GetBool("installationgroup-supervisor")
if !ringSupervisor && !installationGroupSupervisor {
Expand All @@ -125,6 +131,7 @@ var serverCmd = &cobra.Command{
ProvisionerGroupReleaseTimeout: provisionerGroupReleaseTimeout,
GrafanaURL: grafanaURL,
GrafanaTokens: grafanaTokens,
ThanosURL: thanosURL,
}

// Setup the provisioner.
Expand Down
105 changes: 53 additions & 52 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,87 +1,88 @@
module github.com/mattermost/elrond

go 1.18
go 1.20

exclude github.com/mattn/go-sqlite3 v2.0.3+incompatible

require (
github.com/Masterminds/squirrel v1.5.2
github.com/Masterminds/squirrel v1.5.4
github.com/blang/semver v3.5.1+incompatible
github.com/docker/docker v20.10.17+incompatible
github.com/golang/mock v1.6.0
github.com/gorilla/mux v1.8.0
github.com/grafana/grafana-api-golang-client v0.23.0
github.com/jmoiron/sqlx v1.3.5
github.com/lib/pq v1.10.5
github.com/mattermost/mattermost-cloud v0.57.0
github.com/mattn/go-sqlite3 v2.0.3+incompatible
github.com/lib/pq v1.10.9
github.com/mattermost/mattermost-cloud v0.48.0
github.com/mattn/go-sqlite3 v1.14.6
github.com/olekukonko/tablewriter v0.0.5
github.com/pborman/uuid v1.2.1
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.4.0
github.com/stretchr/testify v1.7.1
github.com/prometheus/client_golang v1.15.1
github.com/prometheus/common v0.42.0
github.com/sirupsen/logrus v1.9.2
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.4
)

replace (
k8s.io/api => k8s.io/api v0.26.3
k8s.io/apimachinery => k8s.io/apimachinery v0.26.3
k8s.io/client-go => k8s.io/client-go v0.26.3
)

require (
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/aws/aws-sdk-go v1.42.16 // indirect
github.com/aws/aws-sdk-go v1.44.274 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/emicklei/go-restful v2.11.2+incompatible // indirect
github.com/go-logr/logr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.15 // indirect
github.com/emicklei/go-restful/v3 v3.10.2 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/grafana/grafana-api-golang-client v0.23.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mattermost/mattermost-operator v1.18.0 // indirect
github.com/mattermost/rotator v0.2.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattermost/mattermost-operator v1.21.0-rc.1 // indirect
github.com/mattermost/rotator v0.2.1-0.20230830064954-61490ed26761 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gotest.tools/v3 v3.3.0 // indirect
k8s.io/api v0.23.0 // indirect
k8s.io/apimachinery v0.23.0 // indirect
k8s.io/client-go v0.23.0 // indirect
k8s.io/klog/v2 v2.30.0 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect
sigs.k8s.io/controller-runtime v0.11.0 // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.27.2 // indirect
k8s.io/apimachinery v0.27.2 // indirect
k8s.io/client-go v0.27.2 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230524182850-78281498afbb // indirect
k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
sigs.k8s.io/controller-runtime v0.14.6 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit 00160c3

Please sign in to comment.