diff --git a/dockers/agent/core/faiss/Dockerfile b/dockers/agent/core/faiss/Dockerfile index 0fc2308a2a3..a23c3ba890c 100644 --- a/dockers/agent/core/faiss/Dockerfile +++ b/dockers/agent/core/faiss/Dockerfile @@ -25,8 +25,8 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS -ENV ARCH=${TARGETARCH} ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive ENV INITRD No @@ -66,9 +66,9 @@ COPY .git . COPY go.mod . COPY go.sum . -RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${ARCH}" \ - --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${ARCH}" \ - make go/download +RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ + --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . @@ -92,9 +92,9 @@ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} RUN update-alternatives --set libblas.so-x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libmkl_rt.so \ && make faiss/install -RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${ARCH}" \ - --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${ARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ +RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ + --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} diff --git a/dockers/agent/core/ngt/Dockerfile b/dockers/agent/core/ngt/Dockerfile index 293b819988b..b14096fa774 100644 --- a/dockers/agent/core/ngt/Dockerfile +++ b/dockers/agent/core/ngt/Dockerfile @@ -25,6 +25,7 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -69,7 +70,7 @@ COPY go.sum . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make go/download + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . @@ -91,9 +92,10 @@ COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} RUN make ngt/install + RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} diff --git a/dockers/agent/sidecar/Dockerfile b/dockers/agent/sidecar/Dockerfile index 7784edf21a0..ad7a7cd5fa4 100644 --- a/dockers/agent/sidecar/Dockerfile +++ b/dockers/agent/sidecar/Dockerfile @@ -25,6 +25,7 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV GOPATH /go @@ -62,7 +63,7 @@ COPY go.sum . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make go/download + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . @@ -85,7 +86,7 @@ COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} diff --git a/dockers/ci/base/Dockerfile b/dockers/ci/base/Dockerfile index 0221d64b2b0..b70ff6d4791 100644 --- a/dockers/ci/base/Dockerfile +++ b/dockers/ci/base/Dockerfile @@ -24,6 +24,7 @@ FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder LABEL maintainer="${MAINTAINER}" ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -83,7 +84,7 @@ COPY versions versions RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make deps ROOTDIR=${ROOTDIR} GO_CLEAN_DEPS=false \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} deps ROOTDIR=${ROOTDIR} GO_CLEAN_DEPS=false \ && make ngt/install \ && make faiss/install \ && make helm/install \ @@ -93,8 +94,8 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ && make kubelinter/install \ && make yq/install \ && make tparse/install \ - && make gotestfmt/install \ - && make golangci-lint/install \ + && make GOARCH=${TARGETARCH} GOOS=${TARGETOS} gotestfmt/install \ + && make GOARCH=${TARGETARCH} GOOS=${TARGETOS} golangci-lint/install \ && make reviewdog/install \ && make kubectl/install \ && make buf/install \ diff --git a/dockers/dev/Dockerfile b/dockers/dev/Dockerfile index f2e2b4bd119..423f5b63a90 100644 --- a/dockers/dev/Dockerfile +++ b/dockers/dev/Dockerfile @@ -22,6 +22,7 @@ FROM --platform=${BUILDPLATFORM} mcr.microsoft.com/vscode/devcontainers/go:1 AS LABEL maintainer="${MAINTAINER}" ARG TARGETARCH +ARG TARGETOS SHELL ["/bin/bash", "-o", "pipefail", "-c"] # skipcq: DOK-DL3008 @@ -58,14 +59,14 @@ COPY example/client/go.mod.default example/client/go.mod.default # basic deps RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make deps GO_CLEAN_DEPS=false \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} deps GO_CLEAN_DEPS=false \ && make ngt/install \ && make faiss/install \ && make helm/install \ && make helm-docs/install \ && make valdcli/install \ && make yq/install \ - && make golangci-lint/install \ + && make GOARCH=${TARGETARCH} GOOS=${TARGETOS} golangci-lint/install \ && make reviewdog/install \ && make kubectl/install \ && make k3d/install \ diff --git a/dockers/discoverer/k8s/Dockerfile b/dockers/discoverer/k8s/Dockerfile index 7de2fd243ae..4bb2e17309f 100644 --- a/dockers/discoverer/k8s/Dockerfile +++ b/dockers/discoverer/k8s/Dockerfile @@ -25,6 +25,7 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -62,7 +63,7 @@ COPY go.sum . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make go/download + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . @@ -82,7 +83,7 @@ COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} diff --git a/dockers/gateway/filter/Dockerfile b/dockers/gateway/filter/Dockerfile index 2ca5eb63017..7cfb950745e 100644 --- a/dockers/gateway/filter/Dockerfile +++ b/dockers/gateway/filter/Dockerfile @@ -25,6 +25,7 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -61,7 +62,7 @@ COPY go.sum . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make go/download + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . @@ -81,7 +82,7 @@ COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} diff --git a/dockers/gateway/lb/Dockerfile b/dockers/gateway/lb/Dockerfile index 7d67100c8c7..2f0dbcc4ea8 100644 --- a/dockers/gateway/lb/Dockerfile +++ b/dockers/gateway/lb/Dockerfile @@ -25,6 +25,7 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -61,7 +62,7 @@ COPY go.sum . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make go/download + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . @@ -81,7 +82,7 @@ COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile index 58d41d32f15..67d61c45b24 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -24,6 +24,7 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -83,7 +84,7 @@ COPY .git . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} diff --git a/dockers/index/job/correction/Dockerfile b/dockers/index/job/correction/Dockerfile index b230baa3e8e..7d5b5530fa1 100644 --- a/dockers/index/job/correction/Dockerfile +++ b/dockers/index/job/correction/Dockerfile @@ -25,6 +25,7 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -61,7 +62,7 @@ COPY go.sum . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make go/download + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . @@ -81,7 +82,7 @@ COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} diff --git a/dockers/index/job/creation/Dockerfile b/dockers/index/job/creation/Dockerfile index aec6cded896..18954b23e6e 100644 --- a/dockers/index/job/creation/Dockerfile +++ b/dockers/index/job/creation/Dockerfile @@ -25,6 +25,7 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -61,7 +62,7 @@ COPY go.sum . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make go/download + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . @@ -81,7 +82,7 @@ COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} diff --git a/dockers/index/job/readreplica/rotate/Dockerfile b/dockers/index/job/readreplica/rotate/Dockerfile index d22f7a6e95b..79ddda23cc1 100644 --- a/dockers/index/job/readreplica/rotate/Dockerfile +++ b/dockers/index/job/readreplica/rotate/Dockerfile @@ -25,6 +25,7 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -61,7 +62,7 @@ COPY go.sum . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make go/download + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . @@ -81,7 +82,7 @@ COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} diff --git a/dockers/index/job/save/Dockerfile b/dockers/index/job/save/Dockerfile index 9146892bba1..8e328b32008 100644 --- a/dockers/index/job/save/Dockerfile +++ b/dockers/index/job/save/Dockerfile @@ -25,6 +25,7 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -61,7 +62,7 @@ COPY go.sum . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make go/download + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . @@ -81,7 +82,7 @@ COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} diff --git a/dockers/manager/index/Dockerfile b/dockers/manager/index/Dockerfile index 056624f3fff..d1660dd0c03 100644 --- a/dockers/manager/index/Dockerfile +++ b/dockers/manager/index/Dockerfile @@ -25,6 +25,7 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -61,7 +62,7 @@ COPY go.sum . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make go/download + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . @@ -81,7 +82,7 @@ COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} diff --git a/dockers/operator/helm/Dockerfile b/dockers/operator/helm/Dockerfile index a8d0cfd6a00..a8806f51e5a 100644 --- a/dockers/operator/helm/Dockerfile +++ b/dockers/operator/helm/Dockerfile @@ -90,7 +90,7 @@ COPY .git . COPY go.mod . COPY go.sum . -RUN make go/download +RUN make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal/errors COPY internal/errors . @@ -117,7 +117,7 @@ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/hack/helm/schema/gen COPY hack/helm/schema/gen . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} -RUN make helm/schema/vald helm/schema/vald-helm-operator \ +RUN make GOARCH=${TARGETARCH} GOOS=${TARGETOS} helm/schema/vald helm/schema/vald-helm-operator \ && cp -r charts /charts COPY --from=operator /usr/local/bin/${APP_NAME} /usr/bin/${APP_NAME} diff --git a/dockers/tools/benchmark/job/Dockerfile b/dockers/tools/benchmark/job/Dockerfile index acef095c7ed..0e0bf3af9c7 100644 --- a/dockers/tools/benchmark/job/Dockerfile +++ b/dockers/tools/benchmark/job/Dockerfile @@ -31,6 +31,7 @@ ARG UPX_OPTIONS ARG ZLIB_VERSION ARG HDF5_VERSION ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -91,7 +92,7 @@ COPY go.sum . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make go/download + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . @@ -111,7 +112,7 @@ COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} diff --git a/dockers/tools/benchmark/operator/Dockerfile b/dockers/tools/benchmark/operator/Dockerfile index e629f68ca16..8b8c8ba2d24 100644 --- a/dockers/tools/benchmark/operator/Dockerfile +++ b/dockers/tools/benchmark/operator/Dockerfile @@ -26,6 +26,7 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -66,7 +67,7 @@ COPY go.sum . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make go/download + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . @@ -86,7 +87,7 @@ COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} REPO=${ORG} NAME=${REPO} cmd/${PKG}/${APP_NAME} \ && mv "cmd/${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} diff --git a/dockers/tools/cli/loadtest/Dockerfile b/dockers/tools/cli/loadtest/Dockerfile index eeabbc9dda2..0fe4ec019c8 100644 --- a/dockers/tools/cli/loadtest/Dockerfile +++ b/dockers/tools/cli/loadtest/Dockerfile @@ -23,6 +23,7 @@ FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS golang FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder ARG TARGETARCH +ARG TARGETOS ENV GO111MODULE on ENV DEBIAN_FRONTEND noninteractive @@ -61,7 +62,7 @@ COPY go.sum . RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ - make go/download + make GOARCH=${TARGETARCH} GOOS=${TARGETOS} go/download WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/internal COPY internal . diff --git a/internal/core/algorithm/algorithm.go b/internal/core/algorithm/algorithm.go index 3f0fc46af58..b8253e3bbe3 100644 --- a/internal/core/algorithm/algorithm.go +++ b/internal/core/algorithm/algorithm.go @@ -21,7 +21,7 @@ import "math" const ( // MaximumVectorDimensionSize is maximum value of vector dimension. - MaximumVectorDimensionSize = math.MaxUint32 + MaximumVectorDimensionSize = int(math.MaxInt32 / 4) // MinimumVectorDimensionSize is minimum value of vector dimension. MinimumVectorDimensionSize = 2 ) diff --git a/k8s/agent/faiss/configmap.yaml b/k8s/agent/faiss/configmap.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/agent/faiss/configmap.yaml +++ b/k8s/agent/faiss/configmap.yaml @@ -1 +0,0 @@ - diff --git a/k8s/agent/sidecar/configmap.yaml b/k8s/agent/sidecar/configmap.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/agent/sidecar/configmap.yaml +++ b/k8s/agent/sidecar/configmap.yaml @@ -1 +0,0 @@ - diff --git a/k8s/agent/sidecar/svc.yaml b/k8s/agent/sidecar/svc.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/agent/sidecar/svc.yaml +++ b/k8s/agent/sidecar/svc.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/filter/configmap.yaml b/k8s/gateway/gateway/filter/configmap.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/filter/configmap.yaml +++ b/k8s/gateway/gateway/filter/configmap.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/filter/daemonset.yaml b/k8s/gateway/gateway/filter/daemonset.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/filter/daemonset.yaml +++ b/k8s/gateway/gateway/filter/daemonset.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/filter/deployment.yaml b/k8s/gateway/gateway/filter/deployment.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/filter/deployment.yaml +++ b/k8s/gateway/gateway/filter/deployment.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/filter/hpa.yaml b/k8s/gateway/gateway/filter/hpa.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/filter/hpa.yaml +++ b/k8s/gateway/gateway/filter/hpa.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/filter/networkpolicy.yaml b/k8s/gateway/gateway/filter/networkpolicy.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/filter/networkpolicy.yaml +++ b/k8s/gateway/gateway/filter/networkpolicy.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/filter/pdb.yaml b/k8s/gateway/gateway/filter/pdb.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/filter/pdb.yaml +++ b/k8s/gateway/gateway/filter/pdb.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/filter/priorityclass.yaml b/k8s/gateway/gateway/filter/priorityclass.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/filter/priorityclass.yaml +++ b/k8s/gateway/gateway/filter/priorityclass.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/filter/svc.yaml b/k8s/gateway/gateway/filter/svc.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/filter/svc.yaml +++ b/k8s/gateway/gateway/filter/svc.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/lb/daemonset.yaml b/k8s/gateway/gateway/lb/daemonset.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/lb/daemonset.yaml +++ b/k8s/gateway/gateway/lb/daemonset.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/lb/networkpolicy.yaml b/k8s/gateway/gateway/lb/networkpolicy.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/lb/networkpolicy.yaml +++ b/k8s/gateway/gateway/lb/networkpolicy.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/mirror/clusterrole.yaml b/k8s/gateway/gateway/mirror/clusterrole.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/mirror/clusterrole.yaml +++ b/k8s/gateway/gateway/mirror/clusterrole.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/mirror/clusterrolebinding.yaml b/k8s/gateway/gateway/mirror/clusterrolebinding.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/mirror/clusterrolebinding.yaml +++ b/k8s/gateway/gateway/mirror/clusterrolebinding.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/mirror/configmap.yaml b/k8s/gateway/gateway/mirror/configmap.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/mirror/configmap.yaml +++ b/k8s/gateway/gateway/mirror/configmap.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/mirror/daemonset.yaml b/k8s/gateway/gateway/mirror/daemonset.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/mirror/daemonset.yaml +++ b/k8s/gateway/gateway/mirror/daemonset.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/mirror/deployment.yaml b/k8s/gateway/gateway/mirror/deployment.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/mirror/deployment.yaml +++ b/k8s/gateway/gateway/mirror/deployment.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/mirror/hpa.yaml b/k8s/gateway/gateway/mirror/hpa.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/mirror/hpa.yaml +++ b/k8s/gateway/gateway/mirror/hpa.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/mirror/networkpolicy.yaml b/k8s/gateway/gateway/mirror/networkpolicy.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/mirror/networkpolicy.yaml +++ b/k8s/gateway/gateway/mirror/networkpolicy.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/mirror/pdb.yaml b/k8s/gateway/gateway/mirror/pdb.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/mirror/pdb.yaml +++ b/k8s/gateway/gateway/mirror/pdb.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/mirror/priorityclass.yaml b/k8s/gateway/gateway/mirror/priorityclass.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/mirror/priorityclass.yaml +++ b/k8s/gateway/gateway/mirror/priorityclass.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/mirror/serviceaccount.yaml b/k8s/gateway/gateway/mirror/serviceaccount.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/mirror/serviceaccount.yaml +++ b/k8s/gateway/gateway/mirror/serviceaccount.yaml @@ -1 +0,0 @@ - diff --git a/k8s/gateway/gateway/mirror/svc.yaml b/k8s/gateway/gateway/mirror/svc.yaml index 8b137891791..e69de29bb2d 100644 --- a/k8s/gateway/gateway/mirror/svc.yaml +++ b/k8s/gateway/gateway/mirror/svc.yaml @@ -1 +0,0 @@ -