From 9940f56ebb162756f954437c54b4ad70bd53eaeb Mon Sep 17 00:00:00 2001 From: David Colburn Date: Tue, 19 Mar 2024 21:14:46 -0400 Subject: [PATCH] go 1.22 (#636) * go 1.22 * hwstats * tidy --- .github/workflows/publish-egress.yaml | 2 +- .github/workflows/test-integration.yaml | 2 +- build/egress/Dockerfile | 4 ++-- build/test/Dockerfile | 8 ++++---- go.mod | 8 +++----- go.sum | 8 ++++---- pkg/stats/monitor.go | 6 +++--- 7 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/publish-egress.yaml b/.github/workflows/publish-egress.yaml index 0295ebce..0b87f447 100644 --- a/.github/workflows/publish-egress.yaml +++ b/.github/workflows/publish-egress.yaml @@ -48,7 +48,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21.6 + go-version: 1.22.1 - name: Download Go modules run: go mod download diff --git a/.github/workflows/test-integration.yaml b/.github/workflows/test-integration.yaml index 9d4d6857..1fe89858 100644 --- a/.github/workflows/test-integration.yaml +++ b/.github/workflows/test-integration.yaml @@ -68,7 +68,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21.6 + go-version: 1.22.1 - name: Download Go modules run: go mod download diff --git a/build/egress/Dockerfile b/build/egress/Dockerfile index e40a2831..da29a665 100644 --- a/build/egress/Dockerfile +++ b/build/egress/Dockerfile @@ -20,9 +20,9 @@ WORKDIR /workspace # install go RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then GOARCH=arm64; else GOARCH=amd64; fi && \ - wget https://go.dev/dl/go1.21.6.linux-${GOARCH}.tar.gz && \ + wget https://go.dev/dl/go1.22.1.linux-${GOARCH}.tar.gz && \ rm -rf /usr/local/go && \ - tar -C /usr/local -xzf go1.21.6.linux-${GOARCH}.tar.gz + tar -C /usr/local -xzf go1.22.1.linux-${GOARCH}.tar.gz ENV PATH="/usr/local/go/bin:${PATH}" diff --git a/build/test/Dockerfile b/build/test/Dockerfile index fc73f32e..391f1586 100644 --- a/build/test/Dockerfile +++ b/build/test/Dockerfile @@ -20,9 +20,9 @@ ARG TARGETPLATFORM # install go RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then GOARCH=arm64; else GOARCH=amd64; fi && \ - wget https://go.dev/dl/go1.21.6.linux-${GOARCH}.tar.gz && \ + wget https://go.dev/dl/go1.22.1.linux-${GOARCH}.tar.gz && \ rm -rf /usr/local/go && \ - tar -C /usr/local -xzf go1.21.6.linux-${GOARCH}.tar.gz + tar -C /usr/local -xzf go1.22.1.linux-${GOARCH}.tar.gz ENV PATH="/usr/local/go/bin:${PATH}" # download go modules @@ -67,9 +67,9 @@ RUN apt-get update && \ # install go RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then GOARCH=arm64; else GOARCH=amd64; fi && \ - wget https://go.dev/dl/go1.21.6.linux-${GOARCH}.tar.gz && \ + wget https://go.dev/dl/go1.22.1.linux-${GOARCH}.tar.gz && \ rm -rf /usr/local/go && \ - tar -C /usr/local -xzf go1.21.6.linux-${GOARCH}.tar.gz + tar -C /usr/local -xzf go1.22.1.linux-${GOARCH}.tar.gz ENV PATH="/usr/local/go/bin:${PATH}" # install chrome diff --git a/go.mod b/go.mod index eb8b0c58..09f41bae 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/livekit/egress -go 1.21 - -toolchain go1.21.6 +go 1.22 require ( cloud.google.com/go/storage v1.36.0 @@ -19,7 +17,7 @@ require ( github.com/gorilla/websocket v1.5.1 github.com/livekit/livekit-server v1.5.1-0.20231026153736-8b16db227070 github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 - github.com/livekit/protocol v1.11.1-0.20240311233654-34e705a573b5 + github.com/livekit/protocol v1.12.0 github.com/livekit/psrpc v0.5.3-0.20240312110212-61ab09477c30 github.com/livekit/server-sdk-go/v2 v2.0.1 github.com/pion/rtp v1.8.3 @@ -35,7 +33,7 @@ require ( golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 google.golang.org/api v0.162.0 google.golang.org/grpc v1.62.0 - google.golang.org/protobuf v1.32.0 + google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 32f548e4..d73d268d 100644 --- a/go.sum +++ b/go.sum @@ -176,8 +176,8 @@ github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 h1:jm09419p0lqTkD github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ= github.com/livekit/mediatransportutil v0.0.0-20231213075826-cccbf2b93d3f h1:XHrwGwLNGQB3ZqolH1YdMH/22hgXKr4vm+2M7JKMMGg= github.com/livekit/mediatransportutil v0.0.0-20231213075826-cccbf2b93d3f/go.mod h1:GBzn9xL+mivI1pW+tyExcKgbc0VOc29I9yJsNcAVaAc= -github.com/livekit/protocol v1.11.1-0.20240311233654-34e705a573b5 h1:nvLX0rpWyWO1A2LUuvqxNhgnDkOe7kxTQ8Y3P0g/BLc= -github.com/livekit/protocol v1.11.1-0.20240311233654-34e705a573b5/go.mod h1:znZpBU024XvKIpC9jkFzfrJMDuucDb4B1ON9lbUJMGA= +github.com/livekit/protocol v1.12.0 h1:B7qsqq5xf9MmyG9WEk9/gMsfMVXuyLNxX5cO6TQil6s= +github.com/livekit/protocol v1.12.0/go.mod h1:G7Pa985GhZv2MCC3UnUocBhZfi3DsWA6WmlSkkpQYTM= github.com/livekit/psrpc v0.5.3-0.20240312110212-61ab09477c30 h1:3GEU6vP+KLTTOEqsFKW+PgIUp+i+s0jaUqogQc/hb7M= github.com/livekit/psrpc v0.5.3-0.20240312110212-61ab09477c30/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0= github.com/livekit/server-sdk-go/v2 v2.0.1 h1:qwuMK7WUd30DM7IJ2sOqpQcZcHqP02tzs5Y6CRsV4Lg= @@ -480,8 +480,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/pkg/stats/monitor.go b/pkg/stats/monitor.go index 9fc550ae..8db37128 100644 --- a/pkg/stats/monitor.go +++ b/pkg/stats/monitor.go @@ -28,7 +28,7 @@ import ( "github.com/livekit/egress/pkg/types" "github.com/livekit/protocol/logger" "github.com/livekit/protocol/rpc" - "github.com/livekit/protocol/utils" + "github.com/livekit/protocol/utils/hwstats" ) type Monitor struct { @@ -37,7 +37,7 @@ type Monitor struct { promCPULoad prometheus.Gauge requestGauge *prometheus.GaugeVec - cpuStats *utils.CPUStats + cpuStats *hwstats.CPUStats requests atomic.Int32 mu sync.Mutex @@ -82,7 +82,7 @@ func (m *Monitor) Start( ) error { m.killProcess = killProcess - procStats, err := utils.NewProcCPUStats(m.updateEgressStats) + procStats, err := hwstats.NewProcCPUStats(m.updateEgressStats) if err != nil { return err }