diff --git a/deployment/executor/templates/deployment.yaml b/deployment/executor/templates/deployment.yaml index abd30ade56f..0e98fa9afa5 100644 --- a/deployment/executor/templates/deployment.yaml +++ b/deployment/executor/templates/deployment.yaml @@ -88,8 +88,6 @@ spec: {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName }} {{- end }} - tolerations: - {{- toYaml .Values.tolerations | nindent 8 }} volumes: - name: user-config secret: diff --git a/go.mod b/go.mod index a650830b832..c2623ca95ce 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,6 @@ require ( github.com/golang/protobuf v1.5.4 github.com/google/go-cmp v0.6.0 // indirect github.com/google/uuid v1.6.0 - github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hashicorp/go-memdb v1.3.4 @@ -72,6 +71,8 @@ require ( github.com/go-playground/validator/v10 v10.15.4 github.com/gogo/status v1.1.1 github.com/goreleaser/goreleaser v1.24.0 + github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 + github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.2.0 github.com/jackc/pgx/v5 v5.5.4 github.com/jessevdk/go-flags v1.5.0 github.com/magefile/mage v1.14.0 diff --git a/go.sum b/go.sum index ac75f1140ad..1491cc31df8 100644 --- a/go.sum +++ b/go.sum @@ -73,7 +73,6 @@ github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuP github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/immutable v0.4.3 h1:GYHcksoJ9K6HyAUpGxwZURrbTkXA0Dh4otXGqbhdrjA= github.com/benbjohnson/immutable v0.4.3/go.mod h1:qJIKKSmdqz1tVzNtst1DZzvaqOU1onk1rc03IeM3Owk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -170,8 +169,6 @@ github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -208,7 +205,6 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.15.4 h1:zMXza4EpOdooxPel5xDqXEdXG5r+WggpvnAKMsalBjs= github.com/go-playground/validator/v10 v10.15.4/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= @@ -298,8 +294,10 @@ github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= -github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= +github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.2.0 h1:kQ0NI7W1B3HwiN5gAYtY+XFItDPbLBwYRxAqbFTyDes= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.2.0/go.mod h1:zrT2dxOAjNFPRGjTUe2Xmb4q4YdUwVvQFV6xiCSf+z0= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= @@ -369,7 +367,6 @@ github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8 github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -462,7 +459,6 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pborman/getopt v0.0.0-20180729010549-6fdd0a2c7117/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= @@ -475,7 +471,6 @@ github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.8 h1:ieHkV+i2BRzngO4Wd/3HGowuZStgq6QkPsD1eolNAO4= github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -521,7 +516,6 @@ github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11 github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= @@ -541,7 +535,6 @@ github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -609,16 +602,12 @@ go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -712,7 +701,6 @@ golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -734,7 +722,6 @@ golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -776,7 +763,6 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -832,7 +818,6 @@ google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -851,7 +836,6 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= @@ -898,7 +882,6 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/common/armadacontext/armada_context.go b/internal/common/armadacontext/armada_context.go index 665c19c51f9..30fb2b466c9 100644 --- a/internal/common/armadacontext/armada_context.go +++ b/internal/common/armadacontext/armada_context.go @@ -4,7 +4,6 @@ import ( "context" "time" - "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus" "github.com/sirupsen/logrus" "golang.org/x/sync/errgroup" ) @@ -39,8 +38,10 @@ func FromGrpcCtx(ctx context.Context) *Context { if ok { return armadaCtx } - log := ctxlogrus.Extract(ctx) - return New(ctx, log) + logger := logrus.NewEntry(logrus.StandardLogger()). + WithField("user", ctx.Value("user")). + WithField("requestId", ctx.Value("requestId")) + return New(ctx, logger) } // New returns an armada context that encapsulates both a go context and a logger diff --git a/internal/common/armadacontext/armada_context_test.go b/internal/common/armadacontext/armada_context_test.go index 4cda401c1b1..ef7c84aa705 100644 --- a/internal/common/armadacontext/armada_context_test.go +++ b/internal/common/armadacontext/armada_context_test.go @@ -5,8 +5,6 @@ import ( "testing" "time" - "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus" - "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" ) @@ -19,13 +17,6 @@ func TestNew(t *testing.T) { require.Equal(t, context.Background(), ctx.Context) } -func TestFromGrpcContext(t *testing.T) { - grpcCtx := ctxlogrus.ToContext(context.Background(), defaultLogger) - ctx := FromGrpcCtx(grpcCtx) - require.Equal(t, grpcCtx, ctx.Context) - require.Equal(t, defaultLogger, ctx.FieldLogger) -} - func TestBackground(t *testing.T) { ctx := Background() require.Equal(t, ctx.Context, context.Background()) diff --git a/internal/common/armadaerrors/errors_test.go b/internal/common/armadaerrors/errors_test.go index fa70cf43e32..da72a6458c0 100644 --- a/internal/common/armadaerrors/errors_test.go +++ b/internal/common/armadaerrors/errors_test.go @@ -9,7 +9,7 @@ import ( "time" "github.com/apache/pulsar-client-go/pulsar" - grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" + grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware/v2" "github.com/pkg/errors" "github.com/redis/go-redis/v9" "github.com/stretchr/testify/assert" diff --git a/internal/common/auth/common.go b/internal/common/auth/common.go index f3bd468cffd..604487bdffd 100644 --- a/internal/common/auth/common.go +++ b/internal/common/auth/common.go @@ -4,11 +4,9 @@ import ( "context" "net/http" + "github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata" "golang.org/x/exp/slices" - grpc_ctxtags "github.com/grpc-ecosystem/go-grpc-middleware/tags" - "github.com/grpc-ecosystem/go-grpc-middleware/util/metautils" - "github.com/armadaproject/armada/internal/common/util" ) @@ -120,16 +118,13 @@ type AuthService interface { // request context for logging purposes. func CreateGrpcMiddlewareAuthFunction(authService AuthService) func(ctx context.Context) (context.Context, error) { return func(ctx context.Context) (context.Context, error) { - authHeader := metautils.ExtractIncoming(ctx).Get("authorization") + authHeader := metadata.ExtractIncoming(ctx).Get("authorization") principal, err := authService.Authenticate(ctx, authHeader) if err != nil { return nil, err } - // record username for request logging - grpc_ctxtags.Extract(ctx).Set("user", principal.GetName()) - grpc_ctxtags.Extract(ctx).Set("authService", principal.GetAuthMethod()) - + ctx = context.WithValue(ctx, "user", principal.GetName()) return WithPrincipal(ctx, principal), nil } } @@ -150,11 +145,6 @@ func CreateHttpMiddlewareAuthFunction(authService AuthService) func(w http.Respo http.Error(w, "auth error:"+err.Error(), http.StatusInternalServerError) return nil, err } - - // record username for request logging - grpc_ctxtags.Extract(ctx).Set("user", principal.GetName()) - grpc_ctxtags.Extract(ctx).Set("authService", principal.GetAuthMethod()) - return WithPrincipal(ctx, principal), nil } } diff --git a/internal/common/auth/kubernetes_test.go b/internal/common/auth/kubernetes_test.go index 01da9d02b1b..d29ceb4c17b 100644 --- a/internal/common/auth/kubernetes_test.go +++ b/internal/common/auth/kubernetes_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/grpc-ecosystem/go-grpc-middleware/util/metautils" + grpc_metadata "github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata" "github.com/patrickmn/go-cache" "github.com/stretchr/testify/assert" authv1 "k8s.io/api/authentication/v1" @@ -151,7 +151,7 @@ func TestAuthenticateKubernetes(t *testing.T) { // Create authentication context payload := createKubernetesAuthPayload(testToken, testCA) ctx := context.Background() - metadata := metautils.ExtractIncoming(ctx) + metadata := grpc_metadata.ExtractIncoming(ctx) metadata.Set("authorization", payload) ctx = metadata.ToIncoming(ctx) diff --git a/internal/common/grpc/grpc.go b/internal/common/grpc/grpc.go index c4f858f3ba1..1139e04a427 100644 --- a/internal/common/grpc/grpc.go +++ b/internal/common/grpc/grpc.go @@ -1,6 +1,7 @@ package grpc import ( + "context" "crypto/tls" "fmt" "net" @@ -8,12 +9,12 @@ import ( "sync" "time" - grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" - grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth" - grpc_logrus "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" - grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" - grpc_ctxtags "github.com/grpc-ecosystem/go-grpc-middleware/tags" - grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" + grpc_prometheus "github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus" + grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/auth" + grpc_logging "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging" + grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/recovery" + + "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -37,77 +38,47 @@ func CreateGrpcServer( keepaliveEnforcementPolicy keepalive.EnforcementPolicy, authServices []auth.AuthService, tlsConfig configuration.TlsConfig, - logrusOptions ...grpc_logrus.Option, + loggerOpts ...grpc_logging.Option, ) *grpc.Server { - // Logging, authentication, etc. are implemented via gRPC interceptors - // (i.e., via functions that are called before handling the actual request). - // There are separate interceptors for unary and streaming gRPC calls. - unaryInterceptors := []grpc.UnaryServerInterceptor{} - streamInterceptors := []grpc.StreamServerInterceptor{} - - // Automatically recover from panics - // NOTE This must be the first interceptor, so it can handle panics in any subsequently added interceptor - recovery := grpc_recovery.WithRecoveryHandler(panicRecoveryHandler) - unaryInterceptors = append(unaryInterceptors, grpc_recovery.UnaryServerInterceptor(recovery)) - streamInterceptors = append(streamInterceptors, grpc_recovery.StreamServerInterceptor(recovery)) - - // Logging (using logrus) - // By default, information contained in the request context is logged - // tagsExtractor pulls information out of the request payload (a protobuf) and stores it in - // the context, such that it is logged. - messageDefault := log.NewEntry(log.StandardLogger()) - tagsExtractor := grpc_ctxtags.WithFieldExtractor(grpc_ctxtags.CodeGenRequestFieldExtractor) - unaryInterceptors = append(unaryInterceptors, - grpc_ctxtags.UnaryServerInterceptor(tagsExtractor), - requestid.UnaryServerInterceptor(false), - armadaerrors.UnaryServerInterceptor(2000), - grpc_logrus.UnaryServerInterceptor(messageDefault, logrusOptions...), - ) - streamInterceptors = append(streamInterceptors, - grpc_ctxtags.StreamServerInterceptor(tagsExtractor), - requestid.StreamServerInterceptor(false), - armadaerrors.StreamServerInterceptor(2000), - grpc_logrus.StreamServerInterceptor(messageDefault, logrusOptions...), - ) - - // Authentication - // The provided authServices represents a list of services that can be used to authenticate - // the client (e.g., username/password and OpenId). authFunction is a combination of these. authFunction := auth.CreateGrpcMiddlewareAuthFunction(auth.NewMultiAuthService(authServices)) - unaryInterceptors = append(unaryInterceptors, grpc_auth.UnaryServerInterceptor(authFunction)) - streamInterceptors = append(streamInterceptors, grpc_auth.StreamServerInterceptor(authFunction)) + srvMetrics := setupPromMetrics() - // Prometheus timeseries collection integration - grpc_prometheus.EnableHandlingTimeHistogram() - unaryInterceptors = append(unaryInterceptors, grpc_prometheus.UnaryServerInterceptor) - streamInterceptors = append(streamInterceptors, grpc_prometheus.StreamServerInterceptor) + loggerOpts = append( + loggerOpts, + grpc_logging.WithLogOnEvents(grpc_logging.StartCall, grpc_logging.FinishCall)) - serverOptions := []grpc.ServerOption{ + return grpc.NewServer( grpc.KeepaliveParams(keepaliveParams), grpc.KeepaliveEnforcementPolicy(keepaliveEnforcementPolicy), - grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(streamInterceptors...)), - grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(unaryInterceptors...)), - } - - if tlsConfig.Enabled { - cachedCertificateService := certs.NewCachedCertificateService(tlsConfig.CertPath, tlsConfig.KeyPath, time.Minute) - go func() { - cachedCertificateService.Run(armadacontext.Background()) - }() - tlsCreds := credentials.NewTLS(&tls.Config{ - GetCertificate: func(info *tls.ClientHelloInfo) (*tls.Certificate, error) { - cert := cachedCertificateService.GetCertificate() - if cert == nil { - return nil, fmt.Errorf("unexpectedly received nil from certificate cache") - } - return cert, nil - }, - }) - serverOptions = append(serverOptions, grpc.Creds(tlsCreds)) - } + setupTls(tlsConfig), + grpc.ChainUnaryInterceptor( + srvMetrics.UnaryServerInterceptor(), + requestid.UnaryServerInterceptor(false), + grpc_auth.UnaryServerInterceptor(authFunction), + grpc_logging.UnaryServerInterceptor(InterceptorLogger(), loggerOpts...), + armadaerrors.UnaryServerInterceptor(2000), + grpc_recovery.UnaryServerInterceptor(grpc_recovery.WithRecoveryHandler(panicRecoveryHandler)), + ), + grpc.ChainStreamInterceptor( + srvMetrics.StreamServerInterceptor(), + requestid.StreamServerInterceptor(false), + grpc_auth.StreamServerInterceptor(authFunction), + grpc_logging.StreamServerInterceptor(InterceptorLogger(), loggerOpts...), + armadaerrors.StreamServerInterceptor(2000), + grpc_recovery.StreamServerInterceptor(grpc_recovery.WithRecoveryHandler(panicRecoveryHandler)), + ), + ) +} - // Interceptors are registered at server creation - return grpc.NewServer(serverOptions...) +func setupPromMetrics() *grpc_prometheus.ServerMetrics { + srvMetrics := grpc_prometheus.NewServerMetrics( + grpc_prometheus.WithServerHandlingTimeHistogram( + grpc_prometheus.WithHistogramBuckets([]float64{0.001, 0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120}), + ), + ) + reg := prometheus.NewRegistry() + reg.MustRegister(srvMetrics) + return srvMetrics } // TODO We don't need this function. Just do this at the caller. @@ -143,8 +114,55 @@ func CreateShutdownHandler(ctx *armadacontext.Context, gracePeriod time.Duration } } +func setupTls(tlsConfig configuration.TlsConfig) grpc.ServerOption { + if !tlsConfig.Enabled { + return grpc.EmptyServerOption{} + } + + cachedCertificateService := certs.NewCachedCertificateService(tlsConfig.CertPath, tlsConfig.KeyPath, time.Minute) + go func() { + cachedCertificateService.Run(armadacontext.Background()) + }() + tlsCreds := credentials.NewTLS(&tls.Config{ + GetCertificate: func(info *tls.ClientHelloInfo) (*tls.Certificate, error) { + cert := cachedCertificateService.GetCertificate() + if cert == nil { + return nil, fmt.Errorf("unexpectedly received nil from certificate cache") + } + return cert, nil + }, + }) + return grpc.Creds(tlsCreds) +} + // This function is called whenever a gRPC handler panics. func panicRecoveryHandler(p interface{}) (err error) { log.Errorf("Request triggered panic with cause %v \n%s", p, string(debug.Stack())) return status.Errorf(codes.Internal, "Internal server error caused by %v", p) } + +func InterceptorLogger() grpc_logging.Logger { + return grpc_logging.LoggerFunc(func(ctx context.Context, lvl grpc_logging.Level, msg string, fields ...any) { + logFields := make(map[string]any, len(fields)/2+2) + logFields["user"] = ctx.Value("user") + logFields["requestId"] = ctx.Value("requestId") + i := grpc_logging.Fields(fields).Iterator() + for i.Next() { + k, v := i.At() + logFields[k] = v + } + l := log.WithFields(logFields) + switch lvl { + case grpc_logging.LevelDebug: + l.Debug(msg) + case grpc_logging.LevelInfo: + l.Info(msg) + case grpc_logging.LevelWarn: + l.Warn(msg) + case grpc_logging.LevelError: + l.Error(msg) + default: + panic(fmt.Sprintf("unknown level %v", lvl)) + } + }) +} diff --git a/internal/common/logging/interceptors.go b/internal/common/logging/interceptors.go deleted file mode 100644 index 33b4ed48889..00000000000 --- a/internal/common/logging/interceptors.go +++ /dev/null @@ -1,50 +0,0 @@ -package logging - -import ( - "context" - "fmt" - - "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus" - "github.com/sirupsen/logrus" - "google.golang.org/grpc" - - "github.com/armadaproject/armada/internal/common/requestid" -) - -// UnaryServerInterceptor returns an interceptor that adds the request id as a -// field to the logrus logger embedded in the context. If an error occurs in the handler, -// it also adds a stack trace. -func UnaryServerInterceptor() grpc.UnaryServerInterceptor { - return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { - if id, ok := requestid.FromContext(ctx); ok { - ctxlogrus.AddFields(ctx, logrus.Fields{requestid.MetadataKey: id}) - } - rv, err := handler(ctx, req) - if err != nil { - // %+v prints a stack trace for pkg/errors errors - ctxlogrus.AddFields(ctx, logrus.Fields{"errorVerbose": fmt.Sprintf("%+v", err)}) - } - return rv, err - } -} - -// StreamServerInterceptor returns an interceptor that adds the request id as a -// field to the logrus logger embedded in the context. If an error occurs in the handler, -// it also adds a stack trace. -func StreamServerInterceptor() grpc.StreamServerInterceptor { - return func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { - ctx := stream.Context() - if id, ok := requestid.FromContext(ctx); ok { - ctxlogrus.AddFields(ctx, logrus.Fields{requestid.MetadataKey: id}) - } - // The logrus logger only logs at the end of the call. As streaming calls may last a long time - // We also log here which will produce a log line at the start of the call - ctxlogrus.Extract(ctx).Infof("started streaming call") - err := handler(srv, stream) - if err != nil { - // %+v prints a stack trace for pkg/errors errors - ctxlogrus.AddFields(ctx, logrus.Fields{"errorVerbose": fmt.Sprintf("%+v", err)}) - } - return err - } -} diff --git a/internal/common/logging/interceptors_test.go b/internal/common/logging/interceptors_test.go deleted file mode 100644 index 2d3f76ff159..00000000000 --- a/internal/common/logging/interceptors_test.go +++ /dev/null @@ -1,70 +0,0 @@ -package logging - -import ( - "context" - "testing" - - grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" - "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus" - "github.com/renstrom/shortuuid" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" - "google.golang.org/grpc" - "google.golang.org/grpc/metadata" - - "github.com/armadaproject/armada/internal/common/requestid" -) - -func TestUnaryServerInterceptor(t *testing.T) { - ctx := context.Background() - ctx = metadata.NewIncomingContext(ctx, metadata.New(map[string]string{})) - id := shortuuid.New() - ctx, ok := requestid.AddToIncomingContext(ctx, id) - require.True(t, ok, "error adding request id to context") - logger := logrus.New() - entry := logrus.NewEntry(logger) - ctx = ctxlogrus.ToContext(ctx, entry) - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - entry := ctxlogrus.Extract(ctx) - for _, field := range entry.Data { - if s, ok := field.(string); ok && s == id { - return nil, nil - } - } - t.Fatal("request id was not added as a logger field") - return nil, nil - } - - f := UnaryServerInterceptor() - _, err := f(ctx, nil, nil, handler) - require.NoError(t, err) -} - -func TestStreamServerInterceptor(t *testing.T) { - ctx := context.Background() - ctx = metadata.NewIncomingContext(ctx, metadata.New(map[string]string{})) - id := shortuuid.New() - ctx, ok := requestid.AddToIncomingContext(ctx, id) - require.True(t, ok, "error adding request id to context") - - logger := logrus.New() - entry := logrus.NewEntry(logger) - ctx = ctxlogrus.ToContext(ctx, entry) - stream := &grpc_middleware.WrappedServerStream{} - stream.WrappedContext = ctx - handler := func(srv interface{}, stream grpc.ServerStream) error { - ctx := stream.Context() - entry := ctxlogrus.Extract(ctx) - for _, field := range entry.Data { - if s, ok := field.(string); ok && s == id { - return nil - } - } - t.Fatal("request id was not added as a logger field") - return nil - } - - f := StreamServerInterceptor() - err := f(nil, stream, nil, handler) - require.NoError(t, err) -} diff --git a/internal/common/requestid/interceptors.go b/internal/common/requestid/interceptors.go index b5ee03cd058..bd7dd1e7202 100644 --- a/internal/common/requestid/interceptors.go +++ b/internal/common/requestid/interceptors.go @@ -3,7 +3,7 @@ package requestid import ( "context" - grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" + grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware/v2" "github.com/renstrom/shortuuid" "google.golang.org/grpc" "google.golang.org/grpc/metadata" @@ -43,6 +43,7 @@ func FromContextOrMissing(ctx context.Context) string { // The second return value is true if the operation was successful. func AddToIncomingContext(ctx context.Context, id string) (context.Context, bool) { if md, ok := metadata.FromIncomingContext(ctx); ok { + ctx = context.WithValue(ctx, "requestId", id) md.Set(MetadataKey, id) return metadata.NewIncomingContext(ctx, md), true } diff --git a/internal/common/requestid/interceptors_test.go b/internal/common/requestid/interceptors_test.go index 30cbd63dffa..584bf8798f5 100644 --- a/internal/common/requestid/interceptors_test.go +++ b/internal/common/requestid/interceptors_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" + grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware/v2" "github.com/renstrom/shortuuid" "github.com/stretchr/testify/require" "google.golang.org/grpc" diff --git a/internal/executor/service/lease_requester.go b/internal/executor/service/lease_requester.go index c95f31b4725..c9451962b89 100644 --- a/internal/executor/service/lease_requester.go +++ b/internal/executor/service/lease_requester.go @@ -4,7 +4,7 @@ import ( "fmt" "io" - grpcretry "github.com/grpc-ecosystem/go-grpc-middleware/retry" + grpcretry "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/retry" "github.com/pkg/errors" log "github.com/sirupsen/logrus" "google.golang.org/grpc" diff --git a/internal/scheduler/nodedb/nodedb_test.go b/internal/scheduler/nodedb/nodedb_test.go index 368fdae6277..e8258d140c8 100644 --- a/internal/scheduler/nodedb/nodedb_test.go +++ b/internal/scheduler/nodedb/nodedb_test.go @@ -727,7 +727,8 @@ func benchmarkUpsert(nodes []*internaltypes.Node, b *testing.B) { for i, node := range nodes { err = nodeDb.CreateAndInsertWithJobDbJobsWithTxn(txn, nil, node) require.NoError(b, err) - entry, err := nodeDb.GetNode(node.GetId()) + entry, err := nodeDb.GetNodeWithTxn(txn, node.GetId()) + require.NotNil(b, entry) require.NoError(b, err) entries[i] = entry } diff --git a/internal/scheduler/schedulerapp.go b/internal/scheduler/schedulerapp.go index 7482c38ffa7..9bbd0a01b53 100644 --- a/internal/scheduler/schedulerapp.go +++ b/internal/scheduler/schedulerapp.go @@ -10,7 +10,7 @@ import ( "github.com/apache/pulsar-client-go/pulsar" "github.com/google/uuid" - grpc_logrus "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" + grpc_logging "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" @@ -183,7 +183,7 @@ func Run(config schedulerconfig.Configuration) error { if err != nil { return errors.WithMessage(err, "error creating auth services") } - grpcServer := grpcCommon.CreateGrpcServer(config.Grpc.KeepaliveParams, config.Grpc.KeepaliveEnforcementPolicy, authServices, config.Grpc.Tls, createLogrusLoggingOption()) + grpcServer := grpcCommon.CreateGrpcServer(config.Grpc.KeepaliveParams, config.Grpc.KeepaliveEnforcementPolicy, authServices, config.Grpc.Tls, createGrpcLoggingOption()) defer grpcServer.GracefulStop() lis, err := net.Listen("tcp", fmt.Sprintf(":%d", config.Grpc.Port)) if err != nil { @@ -369,13 +369,13 @@ func loadClusterConfig(ctx *armadacontext.Context) (*rest.Config, error) { // - We only care about failures, so lets only log failures // - We normally use these logs to work out who is calling us, however the Executor API is not public // and is only called by other Armada components -func createLogrusLoggingOption() grpc_logrus.Option { - return grpc_logrus.WithLevels(func(code codes.Code) log.Level { +func createGrpcLoggingOption() grpc_logging.Option { + return grpc_logging.WithLevels(func(code codes.Code) grpc_logging.Level { switch code { case codes.OK: - return log.TraceLevel + return grpc_logging.LevelDebug default: - return grpc_logrus.DefaultCodeToLevel(code) + return grpc_logging.DefaultServerCodeToLevel(code) } }) } diff --git a/internal/testsuite/eventwatcher/eventwatcher.go b/internal/testsuite/eventwatcher/eventwatcher.go index 51d619d4050..c39f1d100c0 100644 --- a/internal/testsuite/eventwatcher/eventwatcher.go +++ b/internal/testsuite/eventwatcher/eventwatcher.go @@ -12,7 +12,7 @@ import ( "strings" "time" - "github.com/grpc-ecosystem/go-grpc-middleware/util/backoffutils" + "github.com/grpc-ecosystem/go-grpc-middleware/v2/util/backoffutils" "github.com/pkg/errors" "golang.org/x/exp/maps" "golang.org/x/sync/errgroup" diff --git a/pkg/client/connection.go b/pkg/client/connection.go index 64e3b5dfed5..a9b086b93f6 100644 --- a/pkg/client/connection.go +++ b/pkg/client/connection.go @@ -6,7 +6,7 @@ import ( "strings" "time" - grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" + grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/retry" "github.com/pkg/errors" "google.golang.org/grpc" "google.golang.org/grpc/credentials"