diff --git a/.github/workflows/dockers-agent-faiss-image.yaml b/.github/workflows/dockers-agent-faiss-image.yaml index 153ee05a14..d691b4f0fa 100644 --- a/.github/workflows/dockers-agent-faiss-image.yaml +++ b/.github/workflows/dockers-agent-faiss-image.yaml @@ -265,4 +265,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: agent-faiss + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-agent-image.yaml b/.github/workflows/dockers-agent-image.yaml index f1311bf7fb..960768a228 100644 --- a/.github/workflows/dockers-agent-image.yaml +++ b/.github/workflows/dockers-agent-image.yaml @@ -71,4 +71,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: agent + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-agent-ngt-image.yaml b/.github/workflows/dockers-agent-ngt-image.yaml index 4610cb8399..13d2764da2 100644 --- a/.github/workflows/dockers-agent-ngt-image.yaml +++ b/.github/workflows/dockers-agent-ngt-image.yaml @@ -269,4 +269,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: agent-ngt + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-agent-sidecar-image.yaml b/.github/workflows/dockers-agent-sidecar-image.yaml index a3a0f6a68e..1870d99d64 100644 --- a/.github/workflows/dockers-agent-sidecar-image.yaml +++ b/.github/workflows/dockers-agent-sidecar-image.yaml @@ -295,4 +295,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: agent-sidecar + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-benchmark-job-image.yaml b/.github/workflows/dockers-benchmark-job-image.yaml index 9202808fe5..ad9d86e0c6 100644 --- a/.github/workflows/dockers-benchmark-job-image.yaml +++ b/.github/workflows/dockers-benchmark-job-image.yaml @@ -261,4 +261,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: benchmark-job + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-benchmark-operator-image.yaml b/.github/workflows/dockers-benchmark-operator-image.yaml index 403d2bb82a..68b26b13cb 100644 --- a/.github/workflows/dockers-benchmark-operator-image.yaml +++ b/.github/workflows/dockers-benchmark-operator-image.yaml @@ -255,4 +255,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: benchmark-operator + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-dev-container-image.yaml b/.github/workflows/dockers-dev-container-image.yaml index 2a55c83da2..85a4e76788 100644 --- a/.github/workflows/dockers-dev-container-image.yaml +++ b/.github/workflows/dockers-dev-container-image.yaml @@ -55,4 +55,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: dev-container + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-discoverer-k8s-image.yaml b/.github/workflows/dockers-discoverer-k8s-image.yaml index 048bebc47d..e594e1be8f 100644 --- a/.github/workflows/dockers-discoverer-k8s-image.yaml +++ b/.github/workflows/dockers-discoverer-k8s-image.yaml @@ -259,4 +259,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: discoverer-k8s + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-example-client-image.yaml b/.github/workflows/dockers-example-client-image.yaml index b529a4bc25..f3db763d4f 100644 --- a/.github/workflows/dockers-example-client-image.yaml +++ b/.github/workflows/dockers-example-client-image.yaml @@ -65,4 +65,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: example-client + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-gateway-filter-image.yaml b/.github/workflows/dockers-gateway-filter-image.yaml index cc361b2435..f092f303aa 100644 --- a/.github/workflows/dockers-gateway-filter-image.yaml +++ b/.github/workflows/dockers-gateway-filter-image.yaml @@ -259,4 +259,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: gateway-filter + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-gateway-lb-image.yaml b/.github/workflows/dockers-gateway-lb-image.yaml index 9a28c196e0..c13ab8971c 100644 --- a/.github/workflows/dockers-gateway-lb-image.yaml +++ b/.github/workflows/dockers-gateway-lb-image.yaml @@ -257,4 +257,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: gateway-lb + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-gateway-mirror-image.yaml b/.github/workflows/dockers-gateway-mirror-image.yaml index 4f6e0c485c..1c68964e8c 100644 --- a/.github/workflows/dockers-gateway-mirror-image.yaml +++ b/.github/workflows/dockers-gateway-mirror-image.yaml @@ -261,4 +261,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: gateway-mirror + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-helm-operator-image.yaml b/.github/workflows/dockers-helm-operator-image.yaml index 9b62139dbe..f2818cfa3d 100644 --- a/.github/workflows/dockers-helm-operator-image.yaml +++ b/.github/workflows/dockers-helm-operator-image.yaml @@ -65,4 +65,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: helm-operator + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-index-correction-image.yaml b/.github/workflows/dockers-index-correction-image.yaml index f8f65b969f..a98b0a26c0 100644 --- a/.github/workflows/dockers-index-correction-image.yaml +++ b/.github/workflows/dockers-index-correction-image.yaml @@ -249,4 +249,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: index-correction + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-index-creation-image.yaml b/.github/workflows/dockers-index-creation-image.yaml index 0436b46a0d..d750782597 100644 --- a/.github/workflows/dockers-index-creation-image.yaml +++ b/.github/workflows/dockers-index-creation-image.yaml @@ -243,4 +243,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: index-creation + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-index-deletion-image.yaml b/.github/workflows/dockers-index-deletion-image.yaml index 653763aad7..6cb1b50bc6 100644 --- a/.github/workflows/dockers-index-deletion-image.yaml +++ b/.github/workflows/dockers-index-deletion-image.yaml @@ -243,4 +243,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: index-deletion + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-index-operator-image.yaml b/.github/workflows/dockers-index-operator-image.yaml index 6e33ad364a..a7c62e7737 100644 --- a/.github/workflows/dockers-index-operator-image.yaml +++ b/.github/workflows/dockers-index-operator-image.yaml @@ -241,4 +241,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: index-operator + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-index-save-image.yaml b/.github/workflows/dockers-index-save-image.yaml index 4506c14dc3..9883165aa9 100644 --- a/.github/workflows/dockers-index-save-image.yaml +++ b/.github/workflows/dockers-index-save-image.yaml @@ -243,4 +243,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: index-save + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-manager-index-image.yaml b/.github/workflows/dockers-manager-index-image.yaml index 580fbfbbcd..17dec7f2fa 100644 --- a/.github/workflows/dockers-manager-index-image.yaml +++ b/.github/workflows/dockers-manager-index-image.yaml @@ -263,4 +263,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: manager-index + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/dockers-readreplica-rotate-image.yaml b/.github/workflows/dockers-readreplica-rotate-image.yaml index ab1bc9b67e..c542eee184 100644 --- a/.github/workflows/dockers-readreplica-rotate-image.yaml +++ b/.github/workflows/dockers-readreplica-rotate-image.yaml @@ -239,4 +239,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: readreplica-rotate + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/dockers/agent/core/agent/Dockerfile b/dockers/agent/core/agent/Dockerfile index caf56e6e0e..c77f010b4a 100644 --- a/dockers/agent/core/agent/Dockerfile +++ b/dockers/agent/core/agent/Dockerfile @@ -94,4 +94,4 @@ LABEL maintainer="vdaas.org vald team " COPY --from=builder /usr/bin/agent /usr/bin/agent # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/agent"] +ENTRYPOINT ["/usr/bin/agent"] \ No newline at end of file diff --git a/dockers/agent/core/faiss/Dockerfile b/dockers/agent/core/faiss/Dockerfile index c369c9f429..5aa69be82b 100644 --- a/dockers/agent/core/faiss/Dockerfile +++ b/dockers/agent/core/faiss/Dockerfile @@ -96,4 +96,4 @@ COPY --from=builder /usr/bin/faiss /usr/bin/faiss COPY cmd/agent/core/faiss/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/faiss"] +ENTRYPOINT ["/usr/bin/faiss"] \ No newline at end of file diff --git a/dockers/agent/core/ngt/Dockerfile b/dockers/agent/core/ngt/Dockerfile index 8d4186b5af..e49057c923 100644 --- a/dockers/agent/core/ngt/Dockerfile +++ b/dockers/agent/core/ngt/Dockerfile @@ -95,4 +95,4 @@ COPY --from=builder /usr/bin/ngt /usr/bin/ngt COPY cmd/agent/core/ngt/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/ngt"] +ENTRYPOINT ["/usr/bin/ngt"] \ No newline at end of file diff --git a/dockers/agent/sidecar/Dockerfile b/dockers/agent/sidecar/Dockerfile index 5fdb77154c..48074a4bf0 100644 --- a/dockers/agent/sidecar/Dockerfile +++ b/dockers/agent/sidecar/Dockerfile @@ -85,4 +85,4 @@ LABEL maintainer="vdaas.org vald team " COPY --from=builder /usr/bin/sidecar /usr/bin/sidecar # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/sidecar"] +ENTRYPOINT ["/usr/bin/sidecar"] \ No newline at end of file diff --git a/dockers/binfmt/Dockerfile b/dockers/binfmt/Dockerfile index 0be93ba3d9..f63da8d40a 100644 --- a/dockers/binfmt/Dockerfile +++ b/dockers/binfmt/Dockerfile @@ -17,4 +17,4 @@ # # DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go -FROM tonistiigi/binfmt:master AS builder +FROM tonistiigi/binfmt:master AS builder \ No newline at end of file diff --git a/dockers/buildbase/Dockerfile b/dockers/buildbase/Dockerfile index 5dde4958c7..85d2385659 100644 --- a/dockers/buildbase/Dockerfile +++ b/dockers/buildbase/Dockerfile @@ -17,4 +17,4 @@ # # DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go -FROM ubuntu:devel AS builder +FROM ubuntu:devel AS builder \ No newline at end of file diff --git a/dockers/buildkit/Dockerfile b/dockers/buildkit/Dockerfile index 43a5a5b0b3..e63c6f5ebc 100644 --- a/dockers/buildkit/Dockerfile +++ b/dockers/buildkit/Dockerfile @@ -17,4 +17,4 @@ # # DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go -FROM moby/buildkit:master AS builder +FROM moby/buildkit:master AS builder \ No newline at end of file diff --git a/dockers/buildkit/syft/scanner/Dockerfile b/dockers/buildkit/syft/scanner/Dockerfile index 87be4558e9..b840429bf4 100644 --- a/dockers/buildkit/syft/scanner/Dockerfile +++ b/dockers/buildkit/syft/scanner/Dockerfile @@ -17,4 +17,4 @@ # # DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go -FROM docker/buildkit-syft-scanner:edge AS scanner +FROM docker/buildkit-syft-scanner:edge AS scanner \ No newline at end of file diff --git a/dockers/ci/base/Dockerfile b/dockers/ci/base/Dockerfile index ebaf45a89f..cbcfc5b3af 100644 --- a/dockers/ci/base/Dockerfile +++ b/dockers/ci/base/Dockerfile @@ -128,4 +128,4 @@ RUN --mount=type=bind,target=.,rw \ && rm -rf ${GOPATH}/src/github.com/${ORG}/${REPO}/* # skipcq: DOK-DL3002 USER root:root -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/bin/bash"] \ No newline at end of file diff --git a/dockers/dev/Dockerfile b/dockers/dev/Dockerfile index 290b99c402..01397c4620 100644 --- a/dockers/dev/Dockerfile +++ b/dockers/dev/Dockerfile @@ -141,4 +141,4 @@ RUN --mount=type=bind,target=.,rw \ && make faiss/install \ && rm -rf ${GOPATH}/src/github.com/${ORG}/${REPO}/* # skipcq: DOK-DL3002 -USER root:root +USER root:root \ No newline at end of file diff --git a/dockers/discoverer/k8s/Dockerfile b/dockers/discoverer/k8s/Dockerfile index 090b7ddc7e..55d8ce48b8 100644 --- a/dockers/discoverer/k8s/Dockerfile +++ b/dockers/discoverer/k8s/Dockerfile @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/discoverer /usr/bin/discoverer COPY cmd/discoverer/k8s/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/discoverer"] +ENTRYPOINT ["/usr/bin/discoverer"] \ No newline at end of file diff --git a/dockers/example/client/Dockerfile b/dockers/example/client/Dockerfile index 7f1811198d..ceb3dada97 100644 --- a/dockers/example/client/Dockerfile +++ b/dockers/example/client/Dockerfile @@ -93,4 +93,4 @@ LABEL maintainer="vdaas.org vald team " COPY --from=builder /usr/bin/client /usr/bin/client # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/client"] +ENTRYPOINT ["/usr/bin/client"] \ No newline at end of file diff --git a/dockers/gateway/filter/Dockerfile b/dockers/gateway/filter/Dockerfile index cfdcee9020..493b7205b9 100644 --- a/dockers/gateway/filter/Dockerfile +++ b/dockers/gateway/filter/Dockerfile @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/filter /usr/bin/filter COPY cmd/gateway/filter/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/filter"] +ENTRYPOINT ["/usr/bin/filter"] \ No newline at end of file diff --git a/dockers/gateway/lb/Dockerfile b/dockers/gateway/lb/Dockerfile index 73478fa5ab..ce2b8148dc 100644 --- a/dockers/gateway/lb/Dockerfile +++ b/dockers/gateway/lb/Dockerfile @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/lb /usr/bin/lb COPY cmd/gateway/lb/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/lb"] +ENTRYPOINT ["/usr/bin/lb"] \ No newline at end of file diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile index 2c9e11874e..9c0f667851 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/mirror /usr/bin/mirror COPY cmd/gateway/mirror/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/mirror"] +ENTRYPOINT ["/usr/bin/mirror"] \ No newline at end of file diff --git a/dockers/index/job/correction/Dockerfile b/dockers/index/job/correction/Dockerfile index d43c312fb7..882996b0d4 100644 --- a/dockers/index/job/correction/Dockerfile +++ b/dockers/index/job/correction/Dockerfile @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/index-correction /usr/bin/index-correction COPY cmd/index/job/correction/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/index-correction"] +ENTRYPOINT ["/usr/bin/index-correction"] \ No newline at end of file diff --git a/dockers/index/job/creation/Dockerfile b/dockers/index/job/creation/Dockerfile index 7b56415884..6b49fc6fc1 100644 --- a/dockers/index/job/creation/Dockerfile +++ b/dockers/index/job/creation/Dockerfile @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/index-creation /usr/bin/index-creation COPY cmd/index/job/creation/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/index-creation"] +ENTRYPOINT ["/usr/bin/index-creation"] \ No newline at end of file diff --git a/dockers/index/job/deletion/Dockerfile b/dockers/index/job/deletion/Dockerfile index 71590aacff..0058f6561a 100644 --- a/dockers/index/job/deletion/Dockerfile +++ b/dockers/index/job/deletion/Dockerfile @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/index-deletion /usr/bin/index-deletion COPY cmd/index/job/deletion/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/index-deletion"] +ENTRYPOINT ["/usr/bin/index-deletion"] \ No newline at end of file diff --git a/dockers/index/job/readreplica/rotate/Dockerfile b/dockers/index/job/readreplica/rotate/Dockerfile index 41861347e0..509d576eab 100644 --- a/dockers/index/job/readreplica/rotate/Dockerfile +++ b/dockers/index/job/readreplica/rotate/Dockerfile @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/readreplica-rotate /usr/bin/readreplica-rotate COPY cmd/index/job/readreplica/rotate/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/readreplica-rotate"] +ENTRYPOINT ["/usr/bin/readreplica-rotate"] \ No newline at end of file diff --git a/dockers/index/job/save/Dockerfile b/dockers/index/job/save/Dockerfile index 76723d1f64..7f97509feb 100644 --- a/dockers/index/job/save/Dockerfile +++ b/dockers/index/job/save/Dockerfile @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/index-save /usr/bin/index-save COPY cmd/index/job/save/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/index-save"] +ENTRYPOINT ["/usr/bin/index-save"] \ No newline at end of file diff --git a/dockers/index/operator/Dockerfile b/dockers/index/operator/Dockerfile index 4195fff32a..3b19aa3b91 100644 --- a/dockers/index/operator/Dockerfile +++ b/dockers/index/operator/Dockerfile @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/index-operator /usr/bin/index-operator COPY cmd/index/operator/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/index-operator"] +ENTRYPOINT ["/usr/bin/index-operator"] \ No newline at end of file diff --git a/dockers/manager/index/Dockerfile b/dockers/manager/index/Dockerfile index 0212228172..c75f4b61f8 100644 --- a/dockers/manager/index/Dockerfile +++ b/dockers/manager/index/Dockerfile @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/index /usr/bin/index COPY cmd/manager/index/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/index"] +ENTRYPOINT ["/usr/bin/index"] \ No newline at end of file diff --git a/dockers/operator/helm/Dockerfile b/dockers/operator/helm/Dockerfile index b40530fc31..0bdbd4ae13 100644 --- a/dockers/operator/helm/Dockerfile +++ b/dockers/operator/helm/Dockerfile @@ -107,4 +107,4 @@ COPY --from=builder /opt/helm/charts/vald /opt/helm/charts/vald COPY --from=builder /opt/helm/charts/vald-helm-operator /opt/helm/charts/vald-helm-operator # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/helm-operator", "run", "--watches-file=/opt/helm/watches.yaml"] +ENTRYPOINT ["/usr/bin/helm-operator", "run", "--watches-file=/opt/helm/watches.yaml"] \ No newline at end of file diff --git a/dockers/tools/benchmark/job/Dockerfile b/dockers/tools/benchmark/job/Dockerfile index 260f95034e..e3a32f57e2 100644 --- a/dockers/tools/benchmark/job/Dockerfile +++ b/dockers/tools/benchmark/job/Dockerfile @@ -94,4 +94,4 @@ COPY --from=builder /usr/bin/job /usr/bin/job COPY cmd/tools/benchmark/job/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/job"] +ENTRYPOINT ["/usr/bin/job"] \ No newline at end of file diff --git a/dockers/tools/benchmark/operator/Dockerfile b/dockers/tools/benchmark/operator/Dockerfile index 966ccf289f..592a67e2d3 100644 --- a/dockers/tools/benchmark/operator/Dockerfile +++ b/dockers/tools/benchmark/operator/Dockerfile @@ -86,4 +86,4 @@ COPY --from=builder /usr/bin/operator /usr/bin/operator COPY cmd/tools/benchmark/operator/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/operator"] +ENTRYPOINT ["/usr/bin/operator"] \ No newline at end of file diff --git a/dockers/tools/cli/loadtest/Dockerfile b/dockers/tools/cli/loadtest/Dockerfile index e972744e1c..25d72f78a9 100644 --- a/dockers/tools/cli/loadtest/Dockerfile +++ b/dockers/tools/cli/loadtest/Dockerfile @@ -94,4 +94,4 @@ COPY --from=builder /usr/bin/loadtest /usr/bin/loadtest COPY cmd/tools/cli/loadtest/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/loadtest"] +ENTRYPOINT ["/usr/bin/loadtest"] \ No newline at end of file diff --git a/hack/docker/gen/main.go b/hack/docker/gen/main.go index 811f7d12ff..6c0a39c35e 100644 --- a/hack/docker/gen/main.go +++ b/hack/docker/gen/main.go @@ -1024,6 +1024,9 @@ jobs: workflow.On.PullRequest.Paths = slices.Compact(workflow.On.PullRequest.Paths) workflow.On.PullRequestTarget.Paths = workflow.On.PullRequest.Paths + if data.BuildPlatforms == "" { + data.BuildPlatforms = multiPlatforms + } workflow.Jobs.Build.With.Platforms = data.BuildPlatforms workflowYamlTmp, err := yaml.Marshal(workflow) diff --git a/internal/net/grpc/client.go b/internal/net/grpc/client.go index 78fc51448b..fd154566cb 100644 --- a/internal/net/grpc/client.go +++ b/internal/net/grpc/client.go @@ -90,7 +90,7 @@ type Client interface { GetCallOption() []CallOption GetBackoff() backoff.Backoff SetDisableResolveDNSAddr(addr string, disabled bool) - ConnectedAddrs() []string + ConnectedAddrs(context.Context) []string Close(ctx context.Context) error } @@ -249,7 +249,7 @@ func (g *gRPCClient) StartConnectionMonitor(ctx context.Context) (<-chan error, return ctx.Err() case <-prTick.C: if g.enablePoolRebalance { - err = g.rangeConns(func(addr string, p pool.Conn) bool { + err = g.rangeConns(ctx, func(addr string, p pool.Conn) bool { // if addr or pool is nil or empty the registration of conns is invalid let's disconnect them if addr == "" || p == nil { disconnectTargets = append(disconnectTargets, addr) @@ -286,7 +286,7 @@ func (g *gRPCClient) StartConnectionMonitor(ctx context.Context) (<-chan error, }) } case <-hcTick.C: - err = g.rangeConns(func(addr string, p pool.Conn) bool { + err = g.rangeConns(ctx, func(addr string, p pool.Conn) bool { // if addr or pool is nil or empty the registration of conns is invalid let's disconnect them if addr == "" || p == nil { disconnectTargets = append(disconnectTargets, addr) @@ -415,7 +415,7 @@ func (g *gRPCClient) Range( if g.conns.Len() == 0 { return errors.ErrGRPCClientConnNotFound("*") } - err = g.rangeConns(func(addr string, p pool.Conn) bool { + err = g.rangeConns(ctx, func(addr string, p pool.Conn) bool { ssctx, sspan := trace.StartSpan(sctx, apiName+"/Client.Range/"+addr) defer func() { if sspan != nil { @@ -478,7 +478,7 @@ func (g *gRPCClient) RangeConcurrent( if g.conns.Len() == 0 { return errors.ErrGRPCClientConnNotFound("*") } - err = g.rangeConns(func(addr string, p pool.Conn) bool { + err = g.rangeConns(ctx, func(addr string, p pool.Conn) bool { eg.Go(safety.RecoverFunc(func() (err error) { ssctx, sspan := trace.StartSpan(egctx, apiName+"/Client.RangeConcurrent/"+addr) defer func() { @@ -565,7 +565,7 @@ func (g *gRPCClient) OrderedRange( return nil default: p, ok := g.conns.Load(addr) - if !ok || p == nil { + if !ok || p == nil || !p.IsHealthy(sctx) { g.crl.Store(addr, true) log.Warnf("gRPCClient.OrderedRange operation failed, gRPC connection pool for %s is invalid,\terror: %v", addr, errors.ErrGRPCClientConnNotFound(addr)) continue @@ -634,7 +634,7 @@ func (g *gRPCClient) OrderedRangeConcurrent( addr := order eg.Go(safety.RecoverFunc(func() (err error) { p, ok := g.conns.Load(addr) - if !ok || p == nil { + if !ok || p == nil || !p.IsHealthy(sctx) { g.crl.Store(addr, true) log.Warnf("gRPCClient.OrderedRangeConcurrent operation failed, gRPC connection pool for %s is invalid,\terror: %v", addr, errors.ErrGRPCClientConnNotFound(addr)) return nil @@ -701,7 +701,7 @@ func (g *gRPCClient) RoundRobin( } do := func() (data any, err error) { - cerr := g.rangeConns(func(addr string, p pool.Conn) bool { + cerr := g.rangeConns(ctx, func(addr string, p pool.Conn) bool { select { case <-ctx.Done(): err = ctx.Err() @@ -879,14 +879,14 @@ func (g *gRPCClient) connectWithBackoff( errors.Is(err, context.DeadlineExceeded) { return nil, false, err } - return nil, err != nil, err + return nil, p.IsHealthy(ctx), err } status.Log(st.Code(), err) switch st.Code() { case codes.Internal, codes.Unavailable, codes.ResourceExhausted: - return nil, err != nil, err + return nil, p.IsHealthy(ctx), err } return nil, false, err } @@ -1066,7 +1066,7 @@ func (g *gRPCClient) Disconnect(ctx context.Context, addr string) error { atomic.AddUint64(&g.clientCount, ^uint64(0)) if p != nil { log.Debugf("gRPC client connection pool addr = %s will disconnect soon...", addr) - return nil, p.Disconnect() + return nil, p.Disconnect(ctx) } return nil, nil }) @@ -1085,10 +1085,10 @@ func (g *gRPCClient) Disconnect(ctx context.Context, addr string) error { return nil } -func (g *gRPCClient) ConnectedAddrs() (addrs []string) { +func (g *gRPCClient) ConnectedAddrs(ctx context.Context) (addrs []string) { addrs = make([]string, 0, g.conns.Len()) - err := g.rangeConns(func(addr string, p pool.Conn) bool { - if p != nil && p.IsHealthy(context.Background()) { + err := g.rangeConns(ctx, func(addr string, p pool.Conn) bool { + if p != nil && p.IsHealthy(ctx) { addrs = append(addrs, addr) } return true @@ -1104,18 +1104,34 @@ func (g *gRPCClient) Close(ctx context.Context) (err error) { g.stopMonitor() } g.conns.Range(func(addr string, p pool.Conn) bool { - derr := g.Disconnect(ctx, addr) - if derr != nil && !errors.Is(derr, errors.ErrGRPCClientConnNotFound(addr)) { - err = errors.Join(err, derr) + select { + case <-ctx.Done(): + return false + default: + derr := g.Disconnect(ctx, addr) + if derr != nil && !errors.Is(derr, errors.ErrGRPCClientConnNotFound(addr)) { + err = errors.Join(err, derr) + } + return true } - return true }) return err } -func (g *gRPCClient) rangeConns(fn func(addr string, p pool.Conn) bool) error { +func (g *gRPCClient) rangeConns(ctx context.Context, fn func(addr string, p pool.Conn) bool) error { var cnt int g.conns.Range(func(addr string, p pool.Conn) bool { + if p == nil || !p.IsHealthy(ctx) { + pc, err := p.Connect(ctx) + if pc == nil || err != nil || !pc.IsHealthy(ctx) { + if pc != nil { + pc.Disconnect(ctx) + } + log.Debugf("Unhealthy connection detected for %s during gRPC Connection Range over Loop:\t%s", addr, p.String()) + return true + } + p = pc + } cnt++ return fn(addr, p) }) diff --git a/internal/net/grpc/client_test.go b/internal/net/grpc/client_test.go index 0d073ce858..935ae07681 100644 --- a/internal/net/grpc/client_test.go +++ b/internal/net/grpc/client_test.go @@ -3107,7 +3107,7 @@ package grpc // stopMonitor: test.fields.stopMonitor, // } // -// gotAddrs := g.ConnectedAddrs() +// gotAddrs := g.ConnectedAddrs(context.Background) // if err := checkFunc(test.want, gotAddrs); err != nil { // tt.Errorf("error = %v", err) // } @@ -3303,6 +3303,7 @@ package grpc // // func Test_gRPCClient_rangeConns(t *testing.T) { // type args struct { +// ctx context.Context // fn func(addr string, p pool.Conn) bool // } // type fields struct { diff --git a/internal/net/grpc/pool/pool.go b/internal/net/grpc/pool/pool.go index 1af0edb867..39e77a2c28 100644 --- a/internal/net/grpc/pool/pool.go +++ b/internal/net/grpc/pool/pool.go @@ -45,9 +45,9 @@ type ( type Conn interface { Connect(context.Context) (Conn, error) - Disconnect() error + Disconnect(context.Context) error Do(ctx context.Context, f func(*ClientConn) error) error - Get(ctx context.Context) (conn *ClientConn, ok bool) + Get(context.Context) (conn *ClientConn, ok bool) IsHealthy(context.Context) bool IsIPConn() bool Len() uint64 @@ -437,8 +437,7 @@ func (p *pool) singleTargetConnect(ctx context.Context) (c Conn, err error) { return p, nil } -func (p *pool) Disconnect() (err error) { - ctx := context.Background() +func (p *pool) Disconnect(ctx context.Context) (err error) { p.closing.Store(true) defer p.closing.Store(false) emap := make(map[string]error, p.len()) @@ -618,7 +617,7 @@ func (p *pool) getHealthyConn( if retry <= 0 || retry > math.MaxUint64-pl || pl <= 0 { if p.isIP { log.Warnf("failed to find gRPC IP connection pool for %s.\tlen(pool): %d,\tretried: %d,\tseems IP %s is unhealthy will going to disconnect...", p.addr, pl, cnt, p.addr) - if err := p.Disconnect(); err != nil { + if err := p.Disconnect(ctx); err != nil { log.Debugf("failed to disconnect gRPC IP direct connection for %s,\terr: %v", p.addr, err) } return 0, nil, false @@ -757,8 +756,8 @@ func (p *pool) String() (str string) { func (pc *poolConn) Close(ctx context.Context, delay time.Duration) error { tdelay := delay / 10 - if tdelay < time.Millisecond*200 { - tdelay = time.Millisecond * 200 + if tdelay < time.Millisecond*5 { + tdelay = time.Millisecond * 5 } else if tdelay > time.Minute { tdelay = time.Second * 5 } diff --git a/internal/net/grpc/pool/pool_test.go b/internal/net/grpc/pool/pool_test.go index 1cc4cccd43..b970fe9485 100644 --- a/internal/net/grpc/pool/pool_test.go +++ b/internal/net/grpc/pool/pool_test.go @@ -2344,7 +2344,7 @@ package pool // reconnectHash: test.fields.reconnectHash, // } // -// err := p.Disconnect() +// err := p.Disconnect(context.Background) // if err := checkFunc(test.want, err); err != nil { // tt.Errorf("error = %v", err) // } diff --git a/internal/test/mock/grpc/grpc_client_mock.go b/internal/test/mock/grpc/grpc_client_mock.go index 078a409d9d..89cf2f75d1 100644 --- a/internal/test/mock/grpc/grpc_client_mock.go +++ b/internal/test/mock/grpc/grpc_client_mock.go @@ -51,7 +51,7 @@ func (gc *GRPCClientMock) OrderedRangeConcurrent( } // ConnectedAddrs calls the ConnectedAddrsFunc object. -func (gc *GRPCClientMock) ConnectedAddrs() []string { +func (gc *GRPCClientMock) ConnectedAddrs(_ context.Context) []string { return gc.ConnectedAddrsFunc() } diff --git a/internal/test/mock/grpc_testify_mock.go b/internal/test/mock/grpc_testify_mock.go index 20e215d29f..ce55e6923f 100644 --- a/internal/test/mock/grpc_testify_mock.go +++ b/internal/test/mock/grpc_testify_mock.go @@ -199,7 +199,7 @@ func (c *ClientInternal) GetBackoff() backoff.Backoff { return v } -func (c *ClientInternal) ConnectedAddrs() []string { +func (c *ClientInternal) ConnectedAddrs(ctx context.Context) []string { args := c.Called() v, ok := args.Get(0).([]string) if !ok { diff --git a/pkg/gateway/lb/handler/grpc/aggregation.go b/pkg/gateway/lb/handler/grpc/aggregation.go index 24ad0925cd..0a5a04a235 100644 --- a/pkg/gateway/lb/handler/grpc/aggregation.go +++ b/pkg/gateway/lb/handler/grpc/aggregation.go @@ -101,6 +101,7 @@ func (s *server) aggregationSearch( target + " canceled: " + err.Error())...) sspan.SetStatus(trace.StatusError, err.Error()) } + log.Debug(err) return nil case errors.Is(err, context.DeadlineExceeded), errors.Is(err, errors.ErrRPCCallFailed(target, context.DeadlineExceeded)): @@ -112,6 +113,7 @@ func (s *server) aggregationSearch( target + " deadline_exceeded: " + err.Error())...) sspan.SetStatus(trace.StatusError, err.Error()) } + log.Debug(err) return nil default: st, msg, err := status.ParseError(err, codes.Unknown, "failed to parse search gRPC error response", @@ -168,6 +170,7 @@ func (s *server) aggregationSearch( target + " canceled: " + err.Error())...) sspan.SetStatus(trace.StatusError, err.Error()) } + log.Debug(err) return nil case errors.Is(err, context.DeadlineExceeded), errors.Is(err, errors.ErrRPCCallFailed(target, context.DeadlineExceeded)): @@ -179,6 +182,7 @@ func (s *server) aggregationSearch( target + " deadline_exceeded: " + err.Error())...) sspan.SetStatus(trace.StatusError, err.Error()) } + log.Debug(err) return nil default: st, msg, err := status.ParseError(err, codes.Unknown, "failed to parse search gRPC error response", diff --git a/pkg/gateway/mirror/service/mirror.go b/pkg/gateway/mirror/service/mirror.go index dbd76572d4..959c555248 100644 --- a/pkg/gateway/mirror/service/mirror.go +++ b/pkg/gateway/mirror/service/mirror.go @@ -160,7 +160,7 @@ func (m *mirr) Start(ctx context.Context) <-chan error { // skipcq: GO-R1005 } } } - log.Debugf("[mirror]: connected mirror gateway targets: %v", m.gateway.GRPCClient().ConnectedAddrs()) + log.Debugf("[mirror]: connected mirror gateway targets: %v", m.gateway.GRPCClient().ConnectedAddrs(ctx)) } } })