diff --git a/.github/workflows/dockers-agent-faiss-image.yml b/.github/workflows/dockers-agent-faiss-image.yml new file mode 100644 index 0000000000..297aca6ea9 --- /dev/null +++ b/.github/workflows/dockers-agent-faiss-image.yml @@ -0,0 +1,84 @@ +# +# Copyright (C) 2019-2024 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +name: "Build docker image: agent-faiss" +on: + push: + branches: + - "main" + - "release/v*.*" + - "!release/v*.*.*" + tags: + - "*.*.*" + - "v*.*.*" + - "*.*.*-*" + - "v*.*.*-*" + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/_docker-image.yaml" + - ".github/workflows/dockers-agent-faiss-image.yml" + - "go.mod" + - "go.sum" + - "internal/**" + - "!internal/**/*_test.go" + - "!internal/db/**" + - "!internal/k8s/**" + - "apis/grpc/**" + - "pkg/agent/core/faiss/**" + - "cmd/agent/core/faiss/**" + - "dockers/agent/core/faiss/Dockerfile" + - "versions/GO_VERSION" + - "versions/FAISS_VERSION" + pull_request: + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/_docker-image.yaml" + - ".github/workflows/dockers-agent-faiss-image.yml" + - "go.mod" + - "go.sum" + - "internal/**" + - "!internal/**/*_test.go" + - "!internal/db/**" + - "!internal/k8s/**" + - "apis/grpc/**" + - "pkg/agent/core/faiss/**" + - "cmd/agent/core/faiss/**" + - "dockers/agent/core/faiss/Dockerfile" + - "versions/GO_VERSION" + - "versions/FAISS_VERSION" + pull_request_target: + paths: + - ".github/actions/docker-build/actions.yaml" + - ".github/workflows/_docker-image.yaml" + - ".github/workflows/dockers-agent-faiss-image.yml" + - "go.mod" + - "go.sum" + - "internal/**" + - "!internal/**/*_test.go" + - "!internal/db/**" + - "!internal/k8s/**" + - "apis/grpc/**" + - "pkg/agent/core/faiss/**" + - "cmd/agent/core/faiss/**" + - "dockers/agent/core/faiss/Dockerfile" + - "versions/GO_VERSION" + - "versions/FAISS_VERSION" +jobs: + build: + uses: ./.github/workflows/_docker-image.yaml + with: + target: agent-faiss + platforms: linux/amd64 + secrets: inherit diff --git a/.github/workflows/dockers-agent-ngt-image.yml b/.github/workflows/dockers-agent-ngt-image.yml index f786cc5bce..64ab26c470 100644 --- a/.github/workflows/dockers-agent-ngt-image.yml +++ b/.github/workflows/dockers-agent-ngt-image.yml @@ -80,4 +80,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-benchmark-job-image.yml b/.github/workflows/dockers-benchmark-job-image.yml index 52abd5addc..d86c454edc 100644 --- a/.github/workflows/dockers-benchmark-job-image.yml +++ b/.github/workflows/dockers-benchmark-job-image.yml @@ -78,4 +78,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-helm-operator-image.yml b/.github/workflows/dockers-helm-operator-image.yml index 1050a6e56b..1c9aba0616 100644 --- a/.github/workflows/dockers-helm-operator-image.yml +++ b/.github/workflows/dockers-helm-operator-image.yml @@ -68,4 +68,5 @@ jobs: uses: ./.github/workflows/_docker-image.yaml with: target: operator/helm + platforms: linux/amd64,linux/arm64 secrets: inherit diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 32b792adab..27b02e83d1 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -59,7 +59,7 @@ jobs: - name: Run formatter and license.go run: | make format - git checkout go.mod go.sum + git checkout go.mod go.sum ./rust/Cargo.lock - name: Check and Push to main branch continue-on-error: true run: | @@ -90,7 +90,8 @@ jobs: runs-on: ubuntu-latest needs: [detect-ci-container] container: - image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }} + # TODO: revert this change. + image: ghcr.io/vdaas/vald/vald-ci-container:pr-2334 steps: - uses: actions/checkout@v4 with: @@ -105,9 +106,10 @@ jobs: run: | make deps/install make format - git checkout go.mod go.sum + git checkout go.mod go.sum ./rust/Cargo.lock - name: Check format difference run: | + git diff if git diff --quiet --exit-code; then echo "Nothing updated" else diff --git a/Makefile b/Makefile index f58e60a03f..2bd45004c5 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,8 @@ DATETIME = $(eval DATETIME := $(shell date -u +%Y/%m/%d_% TAG ?= latest CRORG ?= $(ORG) GHCRORG = ghcr.io/$(ORG)/$(NAME) -AGENT_IMAGE = $(NAME)-agent-ngt +AGENT_NGT_IMAGE = $(NAME)-agent-ngt +AGENT_FAISS_IMAGE = $(NAME)-agent-faiss AGENT_SIDECAR_IMAGE = $(NAME)-agent-sidecar CI_CONTAINER_IMAGE = $(NAME)-ci-container DEV_CONTAINER_IMAGE = $(NAME)-dev-container @@ -386,11 +387,7 @@ clean-generated: .PHONY: license ## add license to files license: - GOPRIVATE=$(GOPRIVATE) \ - MAINTAINER=$(MAINTAINER) \ - GOARCH=$(GOARCH) \ - GOOS=$(GOOS) \ - go run -mod=readonly hack/license/gen/main.go $(ROOTDIR) + $(call gen-license,$(ROOTDIR),$(MAINTAINER)) .PHONY: init ## initialize development environment @@ -571,7 +568,7 @@ faiss/install: /usr/local/lib/libfaiss.so curl -LO https://github.com/facebookresearch/faiss/archive/v$(FAISS_VERSION).tar.gz tar zxf v$(FAISS_VERSION).tar.gz -C $(TEMP_DIR)/ cd $(TEMP_DIR)/faiss-$(FAISS_VERSION) && \ - cmake -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -B build . && \ + cmake -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -B build . && \ make -C build -j faiss && \ make -C build install rm -rf v$(FAISS_VERSION).tar.gz diff --git a/Makefile.d/actions.mk b/Makefile.d/actions.mk index dbec637624..9c0ad6dc6f 100644 --- a/Makefile.d/actions.mk +++ b/Makefile.d/actions.mk @@ -24,4 +24,4 @@ list/actions: .PHONY: update/actions # update github actions version update/actions: - @$(call update-github-actions, $(ACTIONS_LIST)) + $(call update-github-actions, $(ACTIONS_LIST)) diff --git a/Makefile.d/build.mk b/Makefile.d/build.mk index da3854a568..677324bfde 100644 --- a/Makefile.d/build.mk +++ b/Makefile.d/build.mk @@ -36,7 +36,7 @@ binary/build: \ cmd/agent/core/ngt/ngt: \ ngt/install $(eval CGO_ENABLED = 1) - $(call go-build,agent/core/ngt,-linkmode 'external',-fPIC -pthread -fopenmp -std=gnu++20 -lstdc++ -lm -z relro -z now $(EXTLDFLAGS), cgo,NGT-$(NGT_VERSION),$@) + $(call go-build,agent/core/ngt,-linkmode 'external',-static -fPIC -pthread -fopenmp -std=gnu++20 -lstdc++ -lm -z relro -z now $(EXTLDFLAGS), cgo,NGT-$(NGT_VERSION),$@) cmd/agent/core/faiss/faiss: \ faiss/install @@ -45,50 +45,50 @@ cmd/agent/core/faiss/faiss: \ cmd/agent/sidecar/sidecar: $(eval CGO_ENABLED = 0) - $(call go-build,agent/sidecar,,,,,$@) + $(call go-build,agent/sidecar,,-static,,,$@) cmd/discoverer/k8s/discoverer: $(eval CGO_ENABLED = 0) - $(call go-build,discoverer/k8s,,,,,$@) + $(call go-build,discoverer/k8s,,-static,,,$@) cmd/gateway/lb/lb: $(eval CGO_ENABLED = 0) - $(call go-build,gateway/lb,,,,,$@) + $(call go-build,gateway/lb,,-static,,,$@) cmd/gateway/filter/filter: $(eval CGO_ENABLED = 0) - $(call go-build,gateway/filter,,,,,$@) + $(call go-build,gateway/filter,,-static,,,$@) cmd/gateway/mirror/mirror: $(eval CGO_ENABLED = 0) - $(call go-build,gateway/mirror,,,,,$@) + $(call go-build,gateway/mirror,,-static,,,$@) cmd/manager/index/index: $(eval CGO_ENABLED = 0) - $(call go-build,manager/index,,,,,$@) + $(call go-build,manager/index,,-static,,,$@) cmd/index/job/correction/index-correction: $(eval CGO_ENABLED = 0) - $(call go-build,index/job/correction,,,,,$@) + $(call go-build,index/job/correction,,-static,,,$@) cmd/index/job/creation/index-creation: $(eval CGO_ENABLED = 0) - $(call go-build,index/job/creation,,,,,$@) + $(call go-build,index/job/creation,,-static,,,$@) cmd/index/job/save/index-save: $(eval CGO_ENABLED = 0) - $(call go-build,index/job/save,,,,,$@) + $(call go-build,index/job/save,,-static,,,$@) cmd/index/job/readreplica/rotate/readreplica-rotate: $(eval CGO_ENABLED = 0) - $(call go-build,index/job/readreplica/rotate,,,,,$@) + $(call go-build,index/job/readreplica/rotate,,-static,,,$@) cmd/tools/benchmark/job/job: - $(call go-build,tools/benchmark/job,-linkmode 'external',-fPIC -pthread -fopenmp -std=gnu++20 -lhdf5 -lhdf5_hl -lm -ldl, cgo,$(HDF5_VERSION),$@) + $(call go-build,tools/benchmark/job,-linkmode 'external',-static -fPIC -pthread -fopenmp -std=gnu++20 -lhdf5 -lhdf5_hl -lm -ldl, cgo,$(HDF5_VERSION),$@) cmd/tools/benchmark/operator/operator: $(eval CGO_ENABLED = 0) - $(call go-build,tools/benchmark/operator,,,,,$@) + $(call go-build,tools/benchmark/operator,,-static,,,$@) .PHONY: binary/build/zip ## build all binaries and zip them diff --git a/Makefile.d/docker.mk b/Makefile.d/docker.mk index 3eec017859..059faea074 100644 --- a/Makefile.d/docker.mk +++ b/Makefile.d/docker.mk @@ -77,24 +77,24 @@ endif .PHONY: docker/name/agent-ngt docker/name/agent-ngt: - @echo "$(ORG)/$(AGENT_IMAGE)" + @echo "$(ORG)/$(AGENT_NGT_IMAGE)" .PHONY: docker/build/agent-ngt ## build agent-ngt image docker/build/agent-ngt: @make DOCKERFILE="$(ROOTDIR)/dockers/agent/core/ngt/Dockerfile" \ - IMAGE=$(AGENT_IMAGE) \ + IMAGE=$(AGENT_NGT_IMAGE) \ docker/build/image .PHONY: docker/name/agent-faiss docker/name/agent-faiss: - @echo "$(ORG)/$(AGENT_IMAGE)" + @echo "$(ORG)/$(AGENT_FAISS_IMAGE)" .PHONY: docker/build/agent-faiss ## build agent-faiss image docker/build/agent-faiss: @make DOCKERFILE="$(ROOTDIR)/dockers/agent/core/faiss/Dockerfile" \ - IMAGE=$(AGENT_IMAGE) \ + IMAGE=$(AGENT_FAISS_IMAGE) \ docker/build/image .PHONY: docker/name/agent-sidecar diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index 753349cd97..52158f9a68 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -70,7 +70,7 @@ define go-build GO_VERSION=$(GO_VERSION) \ go build \ --ldflags "-w $2 \ - -extldflags '-static $3' \ + -extldflags '$3' \ -X '$(GOPKG)/internal/info.AlgorithmInfo=$5' \ -X '$(GOPKG)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \ -X '$(GOPKG)/internal/info.BuildTime=$(DATETIME)' \ @@ -278,15 +278,37 @@ define gen-go-option-test-sources done endef +define gen-license + MAINTAINER=$2 \ + GOPRIVATE=$(GOPRIVATE) \ + GOARCH=$(GOARCH) \ + GOOS=$(GOOS) \ + go run -mod=readonly $(ROOTDIR)/hack/license/gen/main.go $1 +endef + +define gen-vald-helm-schema + BIN_PATH="$(TEMP_DIR)/vald-helm-schema-gen" + rm -rf $$BIN_PATH + GOPRIVATE=$(GOPRIVATE) \ + GOARCH=$(GOARCH) \ + GOOS=$(GOOS) \ + go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/helm/schema/gen/main.go + $$BIN_PATH charts/$1.yaml > charts/$1.schema.json + rm -rf $$BIN_PATH +endef + define gen-vald-crd if [[ -f $(ROOTDIR)/charts/$1/crds/$2.yaml ]]; then \ mv $(ROOTDIR)/charts/$1/crds/$2.yaml $(TEMP_DIR)/$2.yaml; \ fi; + BIN_PATH="$(TEMP_DIR)/vald-helm-crd-schema-gen" + rm -rf $$BIN_PATH GOPRIVATE=$(GOPRIVATE) \ GOARCH=$(GOARCH) \ GOOS=$(GOOS) \ - go run -mod=readonly $(ROOTDIR)/hack/helm/schema/crd/main.go \ - $(ROOTDIR)/charts/$3.yaml > $(TEMP_DIR)/$2-spec.yaml + go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/helm/schema/crd/main.go + $$BIN_PATH $(ROOTDIR)/charts/$3.yaml > $(TEMP_DIR)/$2-spec.yaml + rm -rf $$BIN_PATH $(BINDIR)/yq eval-all 'select(fileIndex==0).spec.versions[0].schema.openAPIV3Schema.properties.spec = select(fileIndex==1).spec | select(fileIndex==0)' \ $(TEMP_DIR)/$2.yaml $(TEMP_DIR)/$2-spec.yaml > $(ROOTDIR)/charts/$1/crds/$2.yaml endef diff --git a/Makefile.d/helm.mk b/Makefile.d/helm.mk index 90dccf378e..bbf971ac86 100644 --- a/Makefile.d/helm.mk +++ b/Makefile.d/helm.mk @@ -93,61 +93,40 @@ helm/schema/all: \ helm/schema/vald: charts/vald/values.schema.json charts/vald/values.schema.json: \ - charts/vald/values.yaml \ - hack/helm/schema/gen/main.go - GOPRIVATE=$(GOPRIVATE) \ - GOARCH=$(GOARCH) \ - GOOS=$(GOOS) \ - go run -mod=readonly hack/helm/schema/gen/main.go charts/vald/values.yaml > charts/vald/values.schema.json + charts/vald/values.yaml + $(call gen-vald-helm-schema,vald/values) .PHONY: helm/schema/vald-helm-operator ## generate json schema for Vald Helm Operator Chart helm/schema/vald-helm-operator: charts/vald-helm-operator/values.schema.json charts/vald-helm-operator/values.schema.json: \ - charts/vald-helm-operator/values.yaml \ - hack/helm/schema/gen/main.go - GOPRIVATE=$(GOPRIVATE) \ - GOARCH=$(GOARCH) \ - GOOS=$(GOOS) \ - go run -mod=readonly hack/helm/schema/gen/main.go charts/vald-helm-operator/values.yaml > charts/vald-helm-operator/values.schema.json + charts/vald-helm-operator/values.yaml + $(call gen-vald-helm-schema,vald-helm-operator/values) .PHONY: helm/schema/vald-benchmark-job ## generate json schema for Vald Benchmark Job Chart helm/schema/vald-benchmark-job: charts/vald-benchmark-operator/job-values.schema.json charts/vald-benchmark-operator/job-values.schema.json: \ - charts/vald-benchmark-operator/schemas/job-values.yaml \ - hack/helm/schema/gen/main.go - GOPRIVATE=$(GOPRIVATE) \ - GOARCH=$(GOARCH) \ - GOOS=$(GOOS) \ - go run -mod=readonly hack/helm/schema/gen/main.go charts/vald-benchmark-operator/schemas/job-values.yaml > charts/vald-benchmark-operator/job-values.schema.json + charts/vald-benchmark-operator/schemas/job-values.yaml + $(call gen-vald-helm-schema,vald-benchmark-operator/schemas/job-values) .PHONY: helm/schema/vald-benchmark-scenario ## generate json schema for Vald Benchmark Job Chart helm/schema/vald-benchmark-scenario: charts/vald-benchmark-operator/scenario-values.schema.json charts/vald-benchmark-operator/scenario-values.schema.json: \ - charts/vald-benchmark-operator/schemas/scenario-values.yaml \ - hack/helm/schema/gen/main.go - GOPRIVATE=$(GOPRIVATE) \ - GOARCH=$(GOARCH) \ - GOOS=$(GOOS) \ - go run -mod=readonly hack/helm/schema/gen/main.go charts/vald-benchmark-operator/schemas/scenario-values.yaml > charts/vald-benchmark-operator/scenario-values.schema.json + charts/vald-benchmark-operator/schemas/scenario-values.yaml + $(call gen-vald-helm-schema,vald-benchmark-operator/schemas/scenario-values) .PHONY: helm/schema/vald-benchmark-operator ## generate json schema for Vald Benchmark Operator Chart helm/schema/vald-benchmark-operator: charts/vald-benchmark-operator/values.schema.json charts/vald-benchmark-operator/values.schema.json: \ - charts/vald-benchmark-operator/values.yaml \ - hack/helm/schema/gen/main.go - GOPRIVATE=$(GOPRIVATE) \ - GOARCH=$(GOARCH) \ - GOOS=$(GOOS) \ - go run -mod=readonly hack/helm/schema/gen/main.go charts/vald-benchmark-operator/values.yaml > charts/vald-benchmark-operator/values.schema.json - + charts/vald-benchmark-operator/values.yaml + $(call gen-vald-helm-schema,vald-benchmark-operator/values) .PHONY: yq/install ## install yq @@ -172,34 +151,34 @@ helm/schema/crd/all: \ ## generate OpenAPI v3 schema for ValdRelease helm/schema/crd/vald: \ yq/install - @$(call gen-vald-crd,vald-helm-operator,valdrelease,vald/values) + $(call gen-vald-crd,vald-helm-operator,valdrelease,vald/values) .PHONY: helm/schema/crd/vald-helm-operator ## generate OpenAPI v3 schema for ValdHelmOperatorRelease helm/schema/crd/vald-helm-operator: \ yq/install - @$(call gen-vald-crd,vald-helm-operator,valdhelmoperatorrelease,vald-helm-operator/values) + $(call gen-vald-crd,vald-helm-operator,valdhelmoperatorrelease,vald-helm-operator/values) .PHONY: helm/schema/crd/vald/mirror-target ## generate OpenAPI v3 schema for ValdMirrorTarget helm/schema/crd/vald/mirror-target: \ yq/install - @$(call gen-vald-crd,vald,valdmirrortarget,vald/schemas/mirror-target-values) + $(call gen-vald-crd,vald,valdmirrortarget,vald/schemas/mirror-target-values) .PHONY: helm/schema/crd/vald-benchmark-job ## generate OpenAPI v3 schema for ValdBenchmarkJobRelease helm/schema/crd/vald-benchmark-job: \ yq/install - @$(call gen-vald-crd,vald-benchmark-operator,valdbenchmarkjob,vald-benchmark-operator/schemas/job-values) + $(call gen-vald-crd,vald-benchmark-operator,valdbenchmarkjob,vald-benchmark-operator/schemas/job-values) .PHONY: helm/schema/crd/vald-benchmark-scenario ## generate OpenAPI v3 schema for ValdBenchmarkScenarioRelease helm/schema/crd/vald-benchmark-scenario: \ yq/install - @$(call gen-vald-crd,vald-benchmark-operator,valdbenchmarkscenario,vald-benchmark-operator/schemas/scenario-values) + $(call gen-vald-crd,vald-benchmark-operator,valdbenchmarkscenario,vald-benchmark-operator/schemas/scenario-values) .PHONY: helm/schema/crd/vald-benchmark-operator ## generate OpenAPI v3 schema for ValdBenchmarkOperatorRelease helm/schema/crd/vald-benchmark-operator: \ yq/install - @$(call gen-vald-crd,vald-benchmark-operator,valdbenchmarkoperatorrelease,vald-benchmark-operator/values) + $(call gen-vald-crd,vald-benchmark-operator,valdbenchmarkoperatorrelease,vald-benchmark-operator/values) diff --git a/Makefile.d/k8s.mk b/Makefile.d/k8s.mk index a522123f70..2c4227756b 100644 --- a/Makefile.d/k8s.mk +++ b/Makefile.d/k8s.mk @@ -95,7 +95,7 @@ k8s/vald/deploy: helm template \ --values $(HELM_VALUES) \ --set defaults.image.tag=$(VERSION) \ - --set agent.image.repository=$(CRORG)/$(AGENT_IMAGE) \ + --set agent.image.repository=$(CRORG)/$(AGENT_NGT_IMAGE) \ --set agent.sidecar.image.repository=$(CRORG)/$(AGENT_SIDECAR_IMAGE) \ --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ @@ -131,7 +131,7 @@ k8s/vald/delete: helm template \ --values $(HELM_VALUES) \ --set defaults.image.tag=$(VERSION) \ - --set agent.image.repository=$(CRORG)/$(AGENT_IMAGE) \ + --set agent.image.repository=$(CRORG)/$(AGENT_NGT_IMAGE) \ --set agent.sidecar.image.repository=$(CRORG)/$(AGENT_SIDECAR_IMAGE) \ --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ @@ -224,7 +224,7 @@ k8s/vald-readreplica/deploy: helm template \ --values $(HELM_VALUES) \ --set defaults.image.tag=$(VERSION) \ - --set agent.image.repository=$(CRORG)/$(AGENT_IMAGE) \ + --set agent.image.repository=$(CRORG)/$(AGENT_NGT_IMAGE) \ --set agent.sidecar.image.repository=$(CRORG)/$(AGENT_SIDECAR_IMAGE) \ --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ @@ -245,7 +245,7 @@ k8s/vald-readreplica/delete: helm template \ --values $(HELM_VALUES) \ --set defaults.image.tag=$(VERSION) \ - --set agent.image.repository=$(CRORG)/$(AGENT_IMAGE) \ + --set agent.image.repository=$(CRORG)/$(AGENT_NGT_IMAGE) \ --set agent.sidecar.image.repository=$(CRORG)/$(AGENT_SIDECAR_IMAGE) \ --set discoverer.image.repository=$(CRORG)/$(DISCOVERER_IMAGE) \ --set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \ @@ -516,27 +516,27 @@ $(BINDIR)/telepresence: .PHONY: telepresence/swap/agent-ngt ## swap agent-ngt deployment using telepresence telepresence/swap/agent-ngt: - @$(call telepresence,vald-agent-ngt,vdaas/vald-agent-ngt) + $(call telepresence,vald-agent-ngt,vdaas/vald-agent-ngt) .PHONY: telepresence/swap/agent-faiss ## swap agent-faiss deployment using telepresence telepresence/swap/agent-faiss: - @$(call telepresence,vald-agent-faiss,vdaas/vald-agent-faiss) + $(call telepresence,vald-agent-faiss,vdaas/vald-agent-faiss) .PHONY: telepresence/swap/discoverer ## swap discoverer deployment using telepresence telepresence/swap/discoverer: - @$(call telepresence,vald-discoverer,vdaas/vald-discoverer-k8s) + $(call telepresence,vald-discoverer,vdaas/vald-discoverer-k8s) .PHONY: telepresence/swap/manager-index ## swap manager-index deployment using telepresence telepresence/swap/manager-index: - @$(call telepresence,vald-manager-index,vdaas/vald-manager-index) + $(call telepresence,vald-manager-index,vdaas/vald-manager-index) .PHONY: telepresence/swap/lb-gateway ## swap lb-gateway deployment using telepresence telepresence/swap/lb-gateway: - @$(call telepresence,vald-lb-gateway,vdaas/vald-lb-gateway) + $(call telepresence,vald-lb-gateway,vdaas/vald-lb-gateway) .PHONY: kubelinter/install ## install kubelinter diff --git a/dockers/agent/core/faiss/Dockerfile b/dockers/agent/core/faiss/Dockerfile index f037f4b94f..5d688213a9 100644 --- a/dockers/agent/core/faiss/Dockerfile +++ b/dockers/agent/core/faiss/Dockerfile @@ -19,7 +19,7 @@ # ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG TARGETARCH @@ -50,6 +50,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ intel-mkl \ unzip \ upx \ + && ldconfig \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -105,7 +106,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM --platform=${BUILDPLATFORM} ubuntu:devel +FROM --platform=${TARGETPLATFORM} ubuntu:devel LABEL maintainer="${MAINTAINER}" ENV APP_NAME faiss diff --git a/dockers/agent/core/ngt/Dockerfile b/dockers/agent/core/ngt/Dockerfile index 8bdb671c5e..1c1f25de63 100644 --- a/dockers/agent/core/ngt/Dockerfile +++ b/dockers/agent/core/ngt/Dockerfile @@ -19,7 +19,7 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM ubuntu:devel AS builder ARG TARGETARCH ARG TARGETOS @@ -52,6 +52,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libopenblas-dev \ unzip \ upx \ + && ldconfig \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -106,7 +107,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME ngt diff --git a/dockers/agent/sidecar/Dockerfile b/dockers/agent/sidecar/Dockerfile index c57dffc531..a0cf2b0138 100644 --- a/dockers/agent/sidecar/Dockerfile +++ b/dockers/agent/sidecar/Dockerfile @@ -19,7 +19,7 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG TARGETARCH @@ -94,7 +94,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",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}" -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME sidecar diff --git a/dockers/ci/base/Dockerfile b/dockers/ci/base/Dockerfile index ed5977616d..b0fdccf4df 100644 --- a/dockers/ci/base/Dockerfile +++ b/dockers/ci/base/Dockerfile @@ -17,7 +17,7 @@ ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder LABEL maintainer="${MAINTAINER}" ARG GO_VERSION diff --git a/dockers/dev/Dockerfile b/dockers/dev/Dockerfile index 4b72efdd05..5e463242bb 100644 --- a/dockers/dev/Dockerfile +++ b/dockers/dev/Dockerfile @@ -19,7 +19,7 @@ ARG MAINTAINER="vdaas.org vald team " # skipcq: DOK-DL3026 # we should stick to official devcontainers as a base image because it is well tested to be used with the vscode devcontainer extension. -FROM --platform=${BUILDPLATFORM} mcr.microsoft.com/vscode/devcontainers/base:debian +FROM --platform=${TARGETPLATFORM} mcr.microsoft.com/vscode/devcontainers/base:debian LABEL maintainer="${MAINTAINER}" ARG GO_VERSION diff --git a/dockers/discoverer/k8s/Dockerfile b/dockers/discoverer/k8s/Dockerfile index 0c11f4151f..cd529b24be 100644 --- a/dockers/discoverer/k8s/Dockerfile +++ b/dockers/discoverer/k8s/Dockerfile @@ -19,7 +19,7 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG TARGETARCH @@ -94,7 +94,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME discoverer diff --git a/dockers/gateway/filter/Dockerfile b/dockers/gateway/filter/Dockerfile index cb3dfc2e6c..df1780880b 100644 --- a/dockers/gateway/filter/Dockerfile +++ b/dockers/gateway/filter/Dockerfile @@ -19,7 +19,7 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG TARGETARCH @@ -93,7 +93,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME filter diff --git a/dockers/gateway/lb/Dockerfile b/dockers/gateway/lb/Dockerfile index ddb50c0c5b..69c5a589d7 100644 --- a/dockers/gateway/lb/Dockerfile +++ b/dockers/gateway/lb/Dockerfile @@ -19,7 +19,7 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG TARGETARCH @@ -93,7 +93,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME lb diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile index f10ad34646..52e84b690e 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -18,7 +18,7 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG TARGETARCH @@ -92,7 +92,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",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}" -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer "${MAINTAINER}" ENV APP_NAME mirror diff --git a/dockers/index/job/correction/Dockerfile b/dockers/index/job/correction/Dockerfile index 744cf6cb5c..022444fd52 100644 --- a/dockers/index/job/correction/Dockerfile +++ b/dockers/index/job/correction/Dockerfile @@ -19,7 +19,7 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG TARGETARCH @@ -93,7 +93,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME index-correction diff --git a/dockers/index/job/creation/Dockerfile b/dockers/index/job/creation/Dockerfile index f227528fc3..a653cbb2ca 100644 --- a/dockers/index/job/creation/Dockerfile +++ b/dockers/index/job/creation/Dockerfile @@ -19,7 +19,7 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG TARGETARCH @@ -93,7 +93,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME index-creation diff --git a/dockers/index/job/readreplica/rotate/Dockerfile b/dockers/index/job/readreplica/rotate/Dockerfile index 042a29cafe..6bd6f2bab0 100644 --- a/dockers/index/job/readreplica/rotate/Dockerfile +++ b/dockers/index/job/readreplica/rotate/Dockerfile @@ -19,7 +19,7 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG TARGETARCH @@ -93,7 +93,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME readreplica-rotate diff --git a/dockers/index/job/save/Dockerfile b/dockers/index/job/save/Dockerfile index 3fa5067223..c19bb7c83c 100644 --- a/dockers/index/job/save/Dockerfile +++ b/dockers/index/job/save/Dockerfile @@ -19,7 +19,7 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG TARGETARCH @@ -93,7 +93,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME index-save diff --git a/dockers/manager/index/Dockerfile b/dockers/manager/index/Dockerfile index 237f1a78cb..5d0ddaf822 100644 --- a/dockers/manager/index/Dockerfile +++ b/dockers/manager/index/Dockerfile @@ -19,7 +19,7 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static ARG DISTROLESS_IMAGE_TAG=nonroot ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG TARGETARCH @@ -93,7 +93,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME index diff --git a/dockers/operator/helm/Dockerfile b/dockers/operator/helm/Dockerfile index bc9ac58900..3aa9ef5c25 100644 --- a/dockers/operator/helm/Dockerfile +++ b/dockers/operator/helm/Dockerfile @@ -25,8 +25,8 @@ ARG VALD_HELM_OPERATOR_KIND="ValdHelmOperatorRelease" ARG MAINTAINER="vdaas.org vald team " # skipcq: DOK-DL3026 -FROM --platform=${BUILDPLATFORM} quay.io/operator-framework/helm-operator:${OPERATOR_SDK_VERSION} AS operator -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} quay.io/operator-framework/helm-operator:${OPERATOR_SDK_VERSION} AS operator +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG OPERATOR_SDK_VERSION @@ -62,6 +62,7 @@ RUN apt-get clean \ curl \ upx \ git \ + && ldconfig \ && apt-get clean \ && rm -rf \ /var/lib/apt/lists/* \ @@ -121,18 +122,19 @@ COPY versions . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/charts COPY charts . -WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/hack/helm/schema/gen -COPY hack/helm/schema/gen . +WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/hack +COPY hack . WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} -RUN make GOARCH=${TARGETARCH} GOOS=${TARGETOS} helm/schema/vald helm/schema/vald-helm-operator \ +RUN make GOARCH=${TARGETARCH} GOOS=${TARGETOS} helm/schema/vald \ + && make GOARCH=${TARGETARCH} GOOS=${TARGETOS} helm/schema/vald-helm-operator \ && cp -r charts /charts COPY --from=operator /usr/local/bin/${APP_NAME} /usr/bin/${APP_NAME} RUN upx ${UPX_OPTIONS} "/usr/bin/${APP_NAME}" -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME helm-operator diff --git a/dockers/tools/benchmark/job/Dockerfile b/dockers/tools/benchmark/job/Dockerfile index 4edb54929f..6389b40081 100644 --- a/dockers/tools/benchmark/job/Dockerfile +++ b/dockers/tools/benchmark/job/Dockerfile @@ -22,7 +22,7 @@ ARG DISTROLESS_IMAGE_TAG=nonroot ARG UPX_OPTIONS=-9 ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG UPX_OPTIONS @@ -123,7 +123,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME job diff --git a/dockers/tools/benchmark/operator/Dockerfile b/dockers/tools/benchmark/operator/Dockerfile index e546e61be0..9d7d4702d5 100644 --- a/dockers/tools/benchmark/operator/Dockerfile +++ b/dockers/tools/benchmark/operator/Dockerfile @@ -20,7 +20,7 @@ ARG DISTROLESS_IMAGE_TAG=nonroot ARG UPX_OPTIONS=-9 ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG TARGETARCH @@ -96,7 +96,7 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} RUN cp sample.yaml /tmp/config.yaml -FROM --platform=${BUILDPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} +FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} LABEL maintainer="${MAINTAINER}" ENV APP_NAME operator diff --git a/dockers/tools/cli/loadtest/Dockerfile b/dockers/tools/cli/loadtest/Dockerfile index e16ff06b33..cc3b0e5417 100644 --- a/dockers/tools/cli/loadtest/Dockerfile +++ b/dockers/tools/cli/loadtest/Dockerfile @@ -17,7 +17,7 @@ ARG MAINTAINER="vdaas.org vald team " -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder ARG GO_VERSION ARG TARGETARCH @@ -118,9 +118,9 @@ RUN GO_VERSION="$(< GO_VERSION)" \ && upx -9 -o "/usr/bin/${APP_NAME}" "${APP_NAME}" # Start From Scratch For Running Environment -FROM --platform=${BUILDPLATFORM} ubuntu:devel +FROM --platform=${TARGETPLATFORM} ubuntu:devel # Start From Alpine For Debug Environment -# FROM --platform=${BUILDPLATFORM} alpine:latest +# FROM --platform=${TARGETPLATFORM} alpine:latest LABEL maintainer="${MAINTAINER}" ENV APP_NAME loadtest