From e786c9c4c9e1189e23a0e5f4db35d0aa3eff9852 Mon Sep 17 00:00:00 2001 From: David Colburn Date: Tue, 19 Mar 2024 18:24:33 -0400 Subject: [PATCH 1/3] go 1.22 --- .github/workflows/publish-egress.yaml | 2 +- .github/workflows/test-integration.yaml | 2 +- build/egress/Dockerfile | 4 ++-- build/test/Dockerfile | 8 ++++---- go.mod | 9 +++------ go.sum | 10 ++++------ 6 files changed, 15 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..8120857a 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 ) @@ -75,7 +73,6 @@ require ( github.com/klauspost/cpuid/v2 v2.2.6 // indirect github.com/lithammer/shortuuid/v4 v4.0.0 // indirect github.com/livekit/mediatransportutil v0.0.0-20231213075826-cccbf2b93d3f // indirect - github.com/mackerelio/go-osstat v0.2.4 // indirect github.com/magefile/mage v1.15.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-ieproxy v0.0.1 // indirect diff --git a/go.sum b/go.sum index 32f548e4..851444e1 100644 --- a/go.sum +++ b/go.sum @@ -176,14 +176,12 @@ 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= github.com/livekit/server-sdk-go/v2 v2.0.1/go.mod h1:l9mRrCvR7H2AAJjs/624duhvuKUTjtVddjqiIQ6YcZw= -github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs= -github.com/mackerelio/go-osstat v0.2.4/go.mod h1:Zy+qzGdZs3A9cuIqmgbJvwbmLQH9dJvtio5ZjJTbdlQ= github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= @@ -480,8 +478,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= From f225f4842eb40d219ec24c17bcbfc86000ed365b Mon Sep 17 00:00:00 2001 From: David Colburn Date: Tue, 19 Mar 2024 18:26:08 -0400 Subject: [PATCH 2/3] hwstats --- pkg/stats/monitor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 } From 48085e73259ad35647effd21bd1b71af92bb3f00 Mon Sep 17 00:00:00 2001 From: David Colburn Date: Tue, 19 Mar 2024 18:36:44 -0400 Subject: [PATCH 3/3] tidy --- go.mod | 1 + go.sum | 2 ++ 2 files changed, 3 insertions(+) diff --git a/go.mod b/go.mod index 8120857a..09f41bae 100644 --- a/go.mod +++ b/go.mod @@ -73,6 +73,7 @@ require ( github.com/klauspost/cpuid/v2 v2.2.6 // indirect github.com/lithammer/shortuuid/v4 v4.0.0 // indirect github.com/livekit/mediatransportutil v0.0.0-20231213075826-cccbf2b93d3f // indirect + github.com/mackerelio/go-osstat v0.2.4 // indirect github.com/magefile/mage v1.15.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-ieproxy v0.0.1 // indirect diff --git a/go.sum b/go.sum index 851444e1..d73d268d 100644 --- a/go.sum +++ b/go.sum @@ -182,6 +182,8 @@ github.com/livekit/psrpc v0.5.3-0.20240312110212-61ab09477c30 h1:3GEU6vP+KLTTOEq 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= github.com/livekit/server-sdk-go/v2 v2.0.1/go.mod h1:l9mRrCvR7H2AAJjs/624duhvuKUTjtVddjqiIQ6YcZw= +github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs= +github.com/mackerelio/go-osstat v0.2.4/go.mod h1:Zy+qzGdZs3A9cuIqmgbJvwbmLQH9dJvtio5ZjJTbdlQ= github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=