From da446c0177b03f5e69b24b0af2e34121986f5d84 Mon Sep 17 00:00:00 2001 From: Yusuke Kato Date: Fri, 4 Oct 2024 14:04:51 +0900 Subject: [PATCH] Refactor use Absolute path for Makefile (#2670) Signed-off-by: kpango --- Makefile | 12 +-- Makefile.d/docker.mk | 4 +- Makefile.d/functions.mk | 3 +- Makefile.d/git.mk | 2 +- Makefile.d/helm.mk | 78 ++++++++-------- Makefile.d/k8s.mk | 90 +++++++++---------- Makefile.d/proto.mk | 6 +- dockers/agent/core/agent/Dockerfile | 8 +- dockers/agent/core/faiss/Dockerfile | 6 +- dockers/agent/core/ngt/Dockerfile | 6 +- dockers/agent/sidecar/Dockerfile | 2 +- dockers/binfmt/Dockerfile | 2 +- dockers/buildbase/Dockerfile | 2 +- dockers/buildkit/Dockerfile | 2 +- dockers/buildkit/syft/scanner/Dockerfile | 2 +- dockers/ci/base/Dockerfile | 15 ++-- dockers/dev/Dockerfile | 15 ++-- dockers/discoverer/k8s/Dockerfile | 2 +- dockers/gateway/filter/Dockerfile | 2 +- dockers/gateway/lb/Dockerfile | 2 +- dockers/gateway/mirror/Dockerfile | 2 +- dockers/index/job/correction/Dockerfile | 2 +- dockers/index/job/creation/Dockerfile | 2 +- .../index/job/readreplica/rotate/Dockerfile | 2 +- dockers/index/job/save/Dockerfile | 2 +- dockers/index/operator/Dockerfile | 2 +- dockers/manager/index/Dockerfile | 2 +- dockers/operator/helm/Dockerfile | 2 +- dockers/tools/benchmark/job/Dockerfile | 6 +- dockers/tools/benchmark/operator/Dockerfile | 2 +- dockers/tools/cli/loadtest/Dockerfile | 6 +- go.mod | 8 +- go.sum | 15 ++-- hack/actions/gen/main.go | 4 +- hack/cspell/main.go | 5 +- hack/docker/gen/main.go | 18 ++-- hack/tools/deadlink/main.go | 2 +- internal/core/algorithm/faiss/faiss.go | 2 +- internal/core/algorithm/faiss/option.go | 3 +- internal/core/algorithm/usearch/option.go | 2 +- internal/core/algorithm/usearch/usearch.go | 2 +- internal/info/info.go | 64 +++++++++---- internal/k8s/job/job.go | 4 +- internal/net/grpc/errdetails/errdetails.go | 7 +- internal/observability/metrics/mem/mem.go | 2 +- pkg/gateway/lb/handler/grpc/handler.go | 2 +- pkg/gateway/mirror/handler/grpc/handler.go | 2 +- pkg/gateway/mirror/service/gateway.go | 2 +- pkg/index/job/correction/service/corrector.go | 2 +- .../job/readreplica/rotate/service/rotator.go | 2 +- rust/Cargo.lock | 4 +- tests/performance/max_vector_dim_test.go | 14 ++- versions/PROMETHEUS_STACK_VERSION | 2 +- versions/TELEPRESENCE_VERSION | 2 +- versions/actions/DOCKER_SETUP_BUILDX_ACTION | 2 +- 55 files changed, 244 insertions(+), 219 deletions(-) diff --git a/Makefile b/Makefile index 1eb5851603..6480b303a3 100644 --- a/Makefile +++ b/Makefile @@ -139,18 +139,18 @@ GIT_COMMIT := $(eval GIT_COMMIT := $(shell git rev-list -1 HEAD))$(GIT_COMMIT) MAKELISTS := Makefile $(shell find Makefile.d -type f -regex ".*\.mk") ROOTDIR = $(eval ROOTDIR := $(or $(shell git rev-parse --show-toplevel), $(PWD)))$(ROOTDIR) -PROTODIRS := $(eval PROTODIRS := $(shell find apis/proto -type d | sed -e "s%apis/proto/%%g" | grep -v "apis/proto"))$(PROTODIRS) +PROTODIRS := $(eval PROTODIRS := $(shell find $(ROOTDIR)/apis/proto -type d | sed -e "s%apis/proto/%%g" | grep -v "apis/proto"))$(PROTODIRS) BENCH_DATASET_BASE_DIR = hack/benchmark/assets BENCH_DATASET_MD5_DIR_NAME = checksum BENCH_DATASET_HDF5_DIR_NAME = dataset BENCH_DATASET_MD5_DIR = $(BENCH_DATASET_BASE_DIR)/$(BENCH_DATASET_MD5_DIR_NAME) BENCH_DATASET_HDF5_DIR = $(BENCH_DATASET_BASE_DIR)/$(BENCH_DATASET_HDF5_DIR_NAME) -PROTOS := $(eval PROTOS := $(shell find apis/proto -type f -regex ".*\.proto"))$(PROTOS) +PROTOS := $(eval PROTOS := $(shell find $(ROOTDIR)/apis/proto -type f -regex ".*\.proto"))$(PROTOS) PROTOS_V1 := $(eval PROTOS_V1 := $(filter apis/proto/v1/%.proto,$(PROTOS)))$(PROTOS_V1) PBGOS = $(PROTOS:apis/proto/%.proto=apis/grpc/%.pb.go) SWAGGERS = $(PROTOS:apis/proto/%.proto=apis/swagger/%.swagger.json) -PBDOCS = apis/docs/v1/docs.md +PBDOCS = $(ROOTDIR)/apis/docs/v1/docs.md LDFLAGS = -static -fPIC -pthread -std=gnu++23 -lstdc++ -lm -z relro -z now -flto=auto -march=native -mtune=native -fno-plt -Ofast -fvisibility=hidden -ffp-contract=fast -fomit-frame-pointer -fmerge-all-constants -funroll-loops -falign-functions=32 -ffunction-sections -fdata-sections @@ -795,13 +795,13 @@ changelog/update: echo "" >> $(TEMP_DIR)/CHANGELOG.md $(MAKE) -s changelog/next/print >> $(TEMP_DIR)/CHANGELOG.md echo "" >> $(TEMP_DIR)/CHANGELOG.md - tail -n +2 CHANGELOG.md >> $(TEMP_DIR)/CHANGELOG.md - mv -f $(TEMP_DIR)/CHANGELOG.md CHANGELOG.md + tail -n +2 $(ROOTDIR)/CHANGELOG.md >> $(TEMP_DIR)/CHANGELOG.md + mv -f $(TEMP_DIR)/CHANGELOG.md $(ROOTDIR)/CHANGELOG.md .PHONY: changelog/next/print ## print next changelog entry changelog/next/print: - @cat hack/CHANGELOG.template.md | \ + @cat $(ROOTDIR)/hack/CHANGELOG.template.md | \ sed -e 's/{{ version }}/$(VERSION)/g' @echo "$$BODY" diff --git a/Makefile.d/docker.mk b/Makefile.d/docker.mk index b653757ffa..d9ef1ac5f4 100644 --- a/Makefile.d/docker.mk +++ b/Makefile.d/docker.mk @@ -101,7 +101,7 @@ ifeq ($(REMOTE),true) -t $(GHCRORG)/$(IMAGE):$(TAG) \ $(EXTRA_ARGS) \ --output type=registry,oci-mediatypes=true,compression=zstd,compression-level=5,force-compression=true,push=true \ - -f $(DOCKERFILE) . + -f $(DOCKERFILE) $(ROOTDIR) else @echo "starting local build for $(IMAGE):$(TAG)" DOCKER_BUILDKIT=1 $(DOCKER) build \ @@ -113,7 +113,7 @@ else $(EXTRA_ARGS) \ -t $(CRORG)/$(IMAGE):$(TAG) \ -t $(GHCRORG)/$(IMAGE):$(TAG) \ - -f $(DOCKERFILE) . + -f $(DOCKERFILE) $(ROOTDIR) endif .PHONY: docker/name/agent-ngt diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index 9710a92f4a..f9c3312112 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -74,7 +74,7 @@ define go-build -X '$(GOPKG)/internal/info.AlgorithmInfo=$5' \ -X '$(GOPKG)/internal/info.BuildCPUInfoFlags=$(CPU_INFO_FLAGS)' \ -X '$(GOPKG)/internal/info.BuildTime=$(DATETIME)' \ - -X '$(GOPKG)/internal/info.CGOEnabled=$(CGO_ENABLED)' \ + -X '$(GOPKG)/internal/info.CGOEnabled=$(if $(filter 1,$(strip $(CGO_ENABLED))),true,false)' \ -X '$(GOPKG)/internal/info.GitCommit=$(GIT_COMMIT)' \ -X '$(GOPKG)/internal/info.GoArch=$(GOARCH)' \ -X '$(GOPKG)/internal/info.GoOS=$(GOOS)' \ @@ -434,4 +434,3 @@ define gen-deadlink-checker $$BIN_PATH -path $3 -ignore-path $4 -format $5 $1; \ rm -rf $$BIN_PATH endef - diff --git a/Makefile.d/git.mk b/Makefile.d/git.mk index ac858a1842..766f0362fe 100644 --- a/Makefile.d/git.mk +++ b/Makefile.d/git.mk @@ -16,7 +16,7 @@ .PHONY: git/config/init ## add git configs required for development git/config/init: - git config commit.template ".commit_template" + git config commit.template "$(ROOTDIR)/.commit_template" git config core.fileMode false .PHONY: git/hooks/init diff --git a/Makefile.d/helm.mk b/Makefile.d/helm.mk index 06d49345c9..c468abe6c7 100644 --- a/Makefile.d/helm.mk +++ b/Makefile.d/helm.mk @@ -37,14 +37,14 @@ $(BINDIR)/helm-docs: .PHONY: helm/package/vald ## packaging Helm chart for Vald helm/package/vald: - helm package charts/vald + helm package $(ROOTDIR)/charts/vald .PHONY: helm/package/vald-helm-operator ## packaging Helm chart for vald-helm-operator helm/package/vald-helm-operator: \ helm/schema/crd/vald \ helm/schema/crd/vald-helm-operator - helm package charts/vald-helm-operator + helm package $(ROOTDIR)/charts/vald-helm-operator .PHONY: helm/package/vald-benchmark-operator ## packaging Helm chart for vald-helm-operator @@ -52,11 +52,11 @@ helm/package/vald-benchmark-operator: \ helm/schema/crd/vald-benchmark-job \ helm/schema/crd/vald-benchmark-scenario \ helm/schema/crd/vald-benchmark-operator - helm package charts/vald-benchmark-operator + helm package $(ROOTDIR)/charts/vald-benchmark-operator .PHONY: helm/package/vald-readreplica helm/package/vald-readreplica: - helm package charts/vald-readreplica + helm package $(ROOTDIR)/charts/vald-readreplica .PHONY: helm/repo/add ## add Helm chart repository @@ -64,42 +64,42 @@ helm/repo/add: helm repo add vald https://vald.vdaas.org/charts .PHONY: helm/docs/vald -helm/docs/vald: charts/vald/README.md +helm/docs/vald: $(ROOTDIR)/charts/vald/README.md # force to rebuild -.PHONY: charts/vald/README.md -charts/vald/README.md: \ - charts/vald/README.md.gotmpl \ - charts/vald/values.yaml +.PHONY: $(ROOTDIR)/charts/vald/README.md +$(ROOTDIR)/charts/vald/README.md: \ + $(ROOTDIR)/charts/vald/README.md.gotmpl \ + $(ROOTDIR)/charts/vald/values.yaml helm-docs .PHONY: helm/docs/vald-helm-operator -helm/docs/vald-helm-operator: charts/vald-helm-operator/README.md +helm/docs/vald-helm-operator: $(ROOTDIR)/charts/vald-helm-operator/README.md # force to rebuild -.PHONY: charts/vald-helm-operator/README.md -charts/vald-helm-operator/README.md: \ - charts/vald-helm-operator/README.md.gotmpl \ - charts/vald-helm-operator/values.yaml +.PHONY: $(ROOTDIR)/charts/vald-helm-operator/README.md +$(ROOTDIR)/charts/vald-helm-operator/README.md: \ + $(ROOTDIR)/charts/vald-helm-operator/README.md.gotmpl \ + $(ROOTDIR)/charts/vald-helm-operator/values.yaml helm-docs .PHONY: helm/docs/vald-readreplica -helm/docs/vald-readreplica: charts/vald-readreplica/README.md +helm/docs/vald-readreplica: $(ROOTDIR)/charts/vald-readreplica/README.md .PHONY: helm/docs/vald-benchmark-operator -helm/docs/vald-benchmark-operator: charts/vald-benchmark-operator/README.md +helm/docs/vald-benchmark-operator: $(ROOTDIR)/charts/vald-benchmark-operator/README.md -.PHONY: charts/vald-benchmark-operator/README.md -charts/vald-benchmark-operator/README.md: \ - charts/vald-benchmark-operator/README.md.gotmpl \ - charts/vald-benchmark-operator/values.yaml +.PHONY: $(ROOTDIR)/charts/vald-benchmark-operator/README.md +$(ROOTDIR)/charts/vald-benchmark-operator/README.md: \ + $(ROOTDIR)/charts/vald-benchmark-operator/README.md.gotmpl \ + $(ROOTDIR)/charts/vald-benchmark-operator/values.yaml helm-docs # force to rebuild -.PHONY: charts/vald-readreplica/README.md -charts/vald-readreplica/README.md: \ - charts/vald-readreplica/README.md.gotmpl \ - charts/vald-readreplica/values.yaml +.PHONY: $(ROOTDIR)/charts/vald-readreplica/README.md +$(ROOTDIR)/charts/vald-readreplica/README.md: \ + $(ROOTDIR)/charts/vald-readreplica/README.md.gotmpl \ + $(ROOTDIR)/charts/vald-readreplica/values.yaml helm-docs .PHONY: helm/schema/all @@ -112,42 +112,42 @@ helm/schema/all: \ .PHONY: helm/schema/vald ## generate json schema for Vald Helm Chart -helm/schema/vald: charts/vald/values.schema.json +helm/schema/vald: $(ROOTDIR)/charts/vald/values.schema.json -charts/vald/values.schema.json: \ - charts/vald/values.yaml +$(ROOTDIR)/charts/vald/values.schema.json: \ + $(ROOTDIR)/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 +helm/schema/vald-helm-operator: $(ROOTDIR)/charts/vald-helm-operator/values.schema.json -charts/vald-helm-operator/values.schema.json: \ - charts/vald-helm-operator/values.yaml +$(ROOTDIR)/charts/vald-helm-operator/values.schema.json: \ + $(ROOTDIR)/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 +helm/schema/vald-benchmark-job: $(ROOTDIR)/charts/vald-benchmark-operator/job-values.schema.json -charts/vald-benchmark-operator/job-values.schema.json: \ - charts/vald-benchmark-operator/schemas/job-values.yaml +$(ROOTDIR)/charts/vald-benchmark-operator/job-values.schema.json: \ + $(ROOTDIR)/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 +helm/schema/vald-benchmark-scenario: $(ROOTDIR)/charts/vald-benchmark-operator/scenario-values.schema.json -charts/vald-benchmark-operator/scenario-values.schema.json: \ - charts/vald-benchmark-operator/schemas/scenario-values.yaml +$(ROOTDIR)/charts/vald-benchmark-operator/scenario-values.schema.json: \ + $(ROOTDIR)/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 +helm/schema/vald-benchmark-operator: $(ROOTDIR)/charts/vald-benchmark-operator/values.schema.json -charts/vald-benchmark-operator/values.schema.json: \ - charts/vald-benchmark-operator/values.yaml +$(ROOTDIR)/charts/vald-benchmark-operator/values.schema.json: \ + $(ROOTDIR)/charts/vald-benchmark-operator/values.yaml $(call gen-vald-helm-schema,vald-benchmark-operator/values) .PHONY: yq/install diff --git a/Makefile.d/k8s.mk b/Makefile.d/k8s.mk index 5da9210129..8693f9d2fe 100644 --- a/Makefile.d/k8s.mk +++ b/Makefile.d/k8s.mk @@ -44,19 +44,19 @@ k8s/manifest/update: \ --set gateway.mirror.enabled=true \ --output-dir $(TEMP_DIR) \ charts/vald - mkdir -p k8s/gateway - mkdir -p k8s/manager - mkdir -p k8s/index/job - mkdir -p k8s/index/job/readreplica - mv $(TEMP_DIR)/vald/templates/agent k8s/agent - mv $(TEMP_DIR)/vald/templates/discoverer k8s/discoverer - mv $(TEMP_DIR)/vald/templates/gateway k8s/gateway - mv $(TEMP_DIR)/vald/templates/manager/index k8s/manager/index - mv $(TEMP_DIR)/vald/templates/index/operator k8s/index/operator - mv $(TEMP_DIR)/vald/templates/index/job/correction k8s/index/job/correction - mv $(TEMP_DIR)/vald/templates/index/job/creation k8s/index/job/creation - mv $(TEMP_DIR)/vald/templates/index/job/save k8s/index/job/save - mv $(TEMP_DIR)/vald/templates/index/job/readreplica/rotate k8s/index/job/readreplica/rotate + mkdir -p $(ROOTDIR)/k8s/gateway + mkdir -p $(ROOTDIR)/k8s/manager + mkdir -p $(ROOTDIR)/k8s/index/job + mkdir -p $(ROOTDIR)/k8s/index/job/readreplica + mv $(TEMP_DIR)/vald/templates/agent $(ROOTDIR)/k8s/agent + mv $(TEMP_DIR)/vald/templates/discoverer $(ROOTDIR)/k8s/discoverer + mv $(TEMP_DIR)/vald/templates/gateway $(ROOTDIR)/k8s/gateway + mv $(TEMP_DIR)/vald/templates/manager/index $(ROOTDIR)/k8s/manager/index + mv $(TEMP_DIR)/vald/templates/index/operator $(ROOTDIR)/k8s/index/operator + mv $(TEMP_DIR)/vald/templates/index/job/correction $(ROOTDIR)/k8s/index/job/correction + mv $(TEMP_DIR)/vald/templates/index/job/creation $(ROOTDIR)/k8s/index/job/creation + mv $(TEMP_DIR)/vald/templates/index/job/save $(ROOTDIR)/k8s/index/job/save + mv $(TEMP_DIR)/vald/templates/index/job/readreplica/rotate $(ROOTDIR)/k8s/index/job/readreplica/rotate rm -rf $(TEMP_DIR) .PHONY: k8s/manifest/helm-operator/clean @@ -72,10 +72,10 @@ k8s/manifest/helm-operator/update: \ helm template \ --output-dir $(TEMP_DIR) \ charts/vald-helm-operator - mkdir -p k8s/operator - mv $(TEMP_DIR)/vald-helm-operator/templates k8s/operator/helm + mkdir -p $(ROOTDIR)/k8s/operator + mv $(TEMP_DIR)/vald-helm-operator/templates $(ROOTDIR)/k8s/operator/helm rm -rf $(TEMP_DIR) - cp -r charts/vald-helm-operator/crds k8s/operator/helm/crds + cp -r $(ROOTDIR)/charts/vald-helm-operator/crds $(ROOTDIR)/k8s/operator/helm/crds .PHONY: k8s/manifest/benchmark-operator/clean ## clean k8s manifests for benchmark-operator @@ -90,10 +90,10 @@ k8s/manifest/benchmark-operator/update: \ helm template \ --output-dir $(TEMP_DIR) \ charts/vald-benchmark-operator - mkdir -p k8s/tools/benchmark - mv $(TEMP_DIR)/vald-benchmark-operator/templates k8s/tools/benchmark/operator + mkdir -p $(ROOTDIR)/k8s/tools/benchmark + mv $(TEMP_DIR)/vald-benchmark-operator/templates $(ROOTDIR)/k8s/tools/benchmark/operator rm -rf $(TEMP_DIR) - cp -r charts/vald-benchmark-operator/crds k8s/tools/benchmark/operator/crds + cp -r $(ROOTDIR)/charts/vald-benchmark-operator/crds $(ROOTDIR)/k8s/tools/benchmark/operator/crds .PHONY: k8s/manifest/readreplica/clean ## clean k8s manifests for readreplica @@ -108,7 +108,7 @@ k8s/manifest/readreplica/update: \ helm template \ --output-dir $(TEMP_DIR) \ charts/vald-readreplica - mv $(TEMP_DIR)/vald-readreplica/templates k8s/readreplica + mv $(TEMP_DIR)/vald-readreplica/templates $(ROOTDIR)/k8s/readreplica rm -rf $(TEMP_DIR) .PHONY: k8s/vald/deploy @@ -190,15 +190,15 @@ k8s/multi/vald/deploy: -@kubectl create ns $(MIRROR01_NAMESPACE) -@kubectl create ns $(MIRROR02_NAMESPACE) -@kubectl create ns $(MIRROR03_NAMESPACE) - helm install vald-cluster-01 charts/vald \ + helm install vald-cluster-01 $(ROOTDIR)/charts/vald \ -f $(ROOTDIR)/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml \ -f $(ROOTDIR)/charts/vald/values/multi-vald/dev-vald-01.yaml \ -n $(MIRROR01_NAMESPACE) - helm install vald-cluster-02 charts/vald \ + helm install vald-cluster-02 $(ROOTDIR)/charts/vald \ -f $(ROOTDIR)/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml \ -f $(ROOTDIR)/charts/vald/values/multi-vald/dev-vald-02.yaml \ -n $(MIRROR02_NAMESPACE) - helm install vald-cluster-03 charts/vald \ + helm install vald-cluster-03 $(ROOTDIR)/charts/vald \ -f $(ROOTDIR)/charts/vald/values/multi-vald/dev-vald-with-mirror.yaml \ -f $(ROOTDIR)/charts/vald/values/multi-vald/dev-vald-03.yaml \ -n $(MIRROR03_NAMESPACE) @@ -346,18 +346,18 @@ k8s/external/cert-manager/delete: .PHONY: k8s/external/minio/deploy ## deploy minio k8s/external/minio/deploy: - kubectl apply -f k8s/external/minio/deployment.yaml - kubectl apply -f k8s/external/minio/svc.yaml + kubectl apply -f $(ROOTDIR)/k8s/external/minio/deployment.yaml + kubectl apply -f $(ROOTDIR)/k8s/external/minio/svc.yaml sleep $(K8S_SLEEP_DURATION_FOR_WAIT_COMMAND) kubectl wait --for=condition=ready pod -l app=minio --timeout=600s - kubectl apply -f k8s/external/minio/mb-job.yaml + kubectl apply -f $(ROOTDIR)/k8s/external/minio/mb-job.yaml sleep $(K8S_SLEEP_DURATION_FOR_WAIT_COMMAND) kubectl wait --for=condition=complete job/minio-make-bucket --timeout=600s .PHONY: k8s/external/minio/delete ## delete minio k8s/external/minio/delete: - kubectl delete -f k8s/external/minio + kubectl delete -f $(ROOTDIR)/k8s/external/minio .PHONY: k8s/metrics/metrics-server/deploy ## deploy metrics-serrver @@ -374,12 +374,12 @@ k8s/metrics/metrics-server/delete: .PHONY: k8s/metrics/prometheus/deploy ## deploy prometheus k8s/metrics/prometheus/deploy: - kubectl apply -f k8s/metrics/prometheus + kubectl apply -f $(ROOTDIR)/k8s/metrics/prometheus .PHONY: k8s/metrics/prometheus/delete ## delete prometheus k8s/metrics/prometheus/delete: - kubectl delete -f k8s/metrics/prometheus + kubectl delete -f $(ROOTDIR)/k8s/metrics/prometheus .PHONY: k8s/metrics/prometheus/operator/deploy ## deploy prometheus operator @@ -395,14 +395,14 @@ k8s/metrics/prometheus/operator/delete: .PHONY: k8s/metrics/grafana/deploy ## deploy grafana k8s/metrics/grafana/deploy: - kubectl apply -f k8s/metrics/grafana/dashboards - kubectl apply -f k8s/metrics/grafana + kubectl apply -f $(ROOTDIR)/k8s/metrics/grafana/dashboards + kubectl apply -f $(ROOTDIR)/k8s/metrics/grafana .PHONY: k8s/metrics/grafana/delete ## delete grafana k8s/metrics/grafana/delete: - kubectl delete -f k8s/metrics/grafana/dashboards - kubectl delete -f k8s/metrics/grafana + kubectl delete -f $(ROOTDIR)/k8s/metrics/grafana/dashboards + kubectl delete -f $(ROOTDIR)/k8s/metrics/grafana .PHONY: k8s/metrics/jaeger/deploy ## deploy jaeger @@ -412,63 +412,63 @@ k8s/metrics/jaeger/deploy: kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=jaeger-operator --timeout=60s kubectl wait --for=condition=available deployment/jaeger-jaeger-operator --timeout=60s sleep $(JAEGER_OPERATOR_WAIT_DURATION) - kubectl apply -f k8s/metrics/jaeger/jaeger.yaml + kubectl apply -f $(ROOTDIR)/k8s/metrics/jaeger/jaeger.yaml .PHONY: k8s/metrics/jaeger/delete ## delete jaeger k8s/metrics/jaeger/delete: - kubectl delete -f k8s/metrics/jaeger + kubectl delete -f $(ROOTDIR)/k8s/metrics/jaeger helm uninstall jaeger .PHONY: k8s/metrics/loki/deploy ## deploy loki and promtail k8s/metrics/loki/deploy: - kubectl apply -f k8s/metrics/loki + kubectl apply -f $(ROOTDIR)/k8s/metrics/loki .PHONY: k8s/metrics/loki/delete ## delete loki and promtail k8s/metrics/loki/delete: - kubectl delete -f k8s/metrics/loki + kubectl delete -f $(ROOTDIR)/k8s/metrics/loki .PHONY: k8s/metrics/tempo/deploy ## deploy tempo and jaeger-agent k8s/metrics/tempo/deploy: - kubectl apply -f k8s/metrics/tempo + kubectl apply -f $(ROOTDIR)/k8s/metrics/tempo .PHONY: k8s/metrics/tempo/delete ## delete tempo and jaeger-agent k8s/metrics/tempo/delete: - kubectl delete -f k8s/metrics/tempo + kubectl delete -f $(ROOTDIR)/k8s/metrics/tempo .PHONY: k8s/metrics/profefe/deploy ## deploy profefe k8s/metrics/profefe/deploy: - kubectl apply -f k8s/metrics/profefe + kubectl apply -f $(ROOTDIR)/k8s/metrics/profefe .PHONY: k8s/metrics/profefe/delete ## delete profefe k8s/metrics/profefe/delete: - kubectl delete -f k8s/metrics/profefe + kubectl delete -f $(ROOTDIR)/k8s/metrics/profefe .PHONY: k8s/metrics/pyroscope/deploy ## deploy pyroscope k8s/metrics/pyroscope/deploy: - kubectl apply -k k8s/metrics/pyroscope/base + kubectl apply -k $(ROOTDIR)/k8s/metrics/pyroscope/base .PHONY: k8s/metrics/pyroscope/delete ## delete pyroscope k8s/metrics/pyroscope/delete: - kubectl delete -k k8s/metrics/pyroscope/base + kubectl delete -k $(ROOTDIR)/k8s/metrics/pyroscope/base .PHONY: k8s/metrics/pyroscope/pv/deploy ## deploy pyroscope on persistent volume k8s/metrics/pyroscope/pv/deploy: - kubectl apply -k k8s/metrics/pyroscope/overlay + kubectl apply -k $(ROOTDIR)/k8s/metrics/pyroscope/overlay .PHONY: k8s/metrics/pyroscope/pv/delete ## delete pyroscope on persistent volume k8s/metrics/pyroscope/pv/delete: - kubectl delete -k k8s/metrics/pyroscope/overlay + kubectl delete -k $(ROOTDIR)/k8s/metrics/pyroscope/overlay .PHONY: k8s/linkerd/deploy ## deploy linkerd to k8s diff --git a/Makefile.d/proto.mk b/Makefile.d/proto.mk index 2eef443f91..1870f8aa72 100644 --- a/Makefile.d/proto.mk +++ b/Makefile.d/proto.mk @@ -22,9 +22,9 @@ proto/all: \ .PHONY: proto/clean ## clean proto artifacts proto/clean: - find apis/grpc -name "*.pb.go" | xargs -P$(CORES) rm -f - find apis/grpc -name "*.pb.json.go" | xargs -P$(CORES) rm -f - rm -rf apis/swagger apis/docs + find $(ROOTDIR)/apis/grpc -name "*.pb.go" | xargs -P$(CORES) rm -f + find $(ROOTDIR)/apis/grpc -name "*.pb.json.go" | xargs -P$(CORES) rm -f + rm -rf $(ROOTDIR)/apis/swagger $(ROOTDIR)/apis/docs .PHONY: proto/paths/print ## print proto paths diff --git a/dockers/agent/core/agent/Dockerfile b/dockers/agent/core/agent/Dockerfile index 9f8e80f25f..1060dbb2ca 100644 --- a/dockers/agent/core/agent/Dockerfile +++ b/dockers/agent/core/agent/Dockerfile @@ -39,8 +39,8 @@ ENV REPO=vald ENV RUST_HOME=/usr/local/lib/rust ENV TZ=Etc/UTC ENV USER=root -ENV RUSTUP_HOME=${RUST_HOME}/rustup ENV CARGO_HOME=${RUST_HOME}/cargo +ENV RUSTUP_HOME=${RUST_HOME}/rustup ENV PATH=${CARGO_HOME}/bin:${RUSTUP_HOME}/bin:/usr/local/bin:${PATH} WORKDIR ${HOME}/rust/src/github.com/${ORG}/${REPO} SHELL ["/bin/bash", "-o", "pipefail", "-c"] @@ -63,10 +63,10 @@ RUN --mount=type=bind,target=.,rw \ locales \ git \ cmake \ - gcc \ g++ \ - unzip \ + gcc \ libssl-dev \ + unzip \ liblapack-dev \ libomp-dev \ libopenblas-dev \ @@ -93,4 +93,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 7566609ed7..bfd27599f6 100644 --- a/dockers/agent/core/faiss/Dockerfile +++ b/dockers/agent/core/faiss/Dockerfile @@ -66,10 +66,10 @@ RUN --mount=type=bind,target=.,rw \ locales \ git \ cmake \ - gcc \ g++ \ - unzip \ + gcc \ libssl-dev \ + unzip \ liblapack-dev \ libomp-dev \ libopenblas-dev \ @@ -95,4 +95,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 d764a800d1..51e564c224 100644 --- a/dockers/agent/core/ngt/Dockerfile +++ b/dockers/agent/core/ngt/Dockerfile @@ -66,10 +66,10 @@ RUN --mount=type=bind,target=.,rw \ locales \ git \ cmake \ - gcc \ g++ \ - unzip \ + gcc \ libssl-dev \ + unzip \ liblapack-dev \ libomp-dev \ libopenblas-dev \ @@ -94,4 +94,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 b4a1d5ed90..5c19e85c8e 100644 --- a/dockers/agent/sidecar/Dockerfile +++ b/dockers/agent/sidecar/Dockerfile @@ -84,4 +84,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 f2d73909bd..47284d17e2 100644 --- a/dockers/binfmt/Dockerfile +++ b/dockers/binfmt/Dockerfile @@ -16,4 +16,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 301a31e010..6457b01457 100644 --- a/dockers/buildbase/Dockerfile +++ b/dockers/buildbase/Dockerfile @@ -16,4 +16,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 99c71c61e2..9dd722ea25 100644 --- a/dockers/buildkit/Dockerfile +++ b/dockers/buildkit/Dockerfile @@ -16,4 +16,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 4a23207c47..df32fe5705 100644 --- a/dockers/buildkit/syft/scanner/Dockerfile +++ b/dockers/buildkit/syft/scanner/Dockerfile @@ -16,4 +16,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 a05d3e2593..e39363d3d1 100644 --- a/dockers/ci/base/Dockerfile +++ b/dockers/ci/base/Dockerfile @@ -72,21 +72,22 @@ RUN --mount=type=bind,target=.,rw \ git \ npm \ cmake \ - gcc \ g++ \ - unzip \ + gcc \ libssl-dev \ + unzip \ liblapack-dev \ libomp-dev \ libopenblas-dev \ gfortran \ pkg-config \ + file \ gawk \ gnupg2 \ graphviz \ jq \ - libhdf5-dev \ libaec-dev \ + libhdf5-dev \ sed \ zip \ && ldconfig \ @@ -114,16 +115,16 @@ RUN --mount=type=bind,target=.,rw \ && make kind/install \ && make kubectl/install \ && make kubelinter/install \ - && make reviewdog/install \ - && make tparse/install \ - && make yq/install \ && make minikube/install \ + && make reviewdog/install \ && make stern/install \ && make telepresence/install \ + && make tparse/install \ + && make yq/install \ && make ngt/install \ && make faiss/install \ && make usearch/install \ && 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 a084f9b51c..3e80596341 100644 --- a/dockers/dev/Dockerfile +++ b/dockers/dev/Dockerfile @@ -77,21 +77,22 @@ RUN --mount=type=bind,target=.,rw \ locales \ git \ cmake \ - gcc \ g++ \ - unzip \ + gcc \ libssl-dev \ + unzip \ liblapack-dev \ libomp-dev \ libopenblas-dev \ gfortran \ pkg-config \ + file \ gawk \ gnupg2 \ graphviz \ jq \ - libhdf5-dev \ libaec-dev \ + libhdf5-dev \ sed \ zip \ && ldconfig \ @@ -134,14 +135,14 @@ RUN --mount=type=bind,target=.,rw \ && make kind/install \ && make kubectl/install \ && make kubelinter/install \ - && make reviewdog/install \ - && make tparse/install \ - && make yq/install \ && make minikube/install \ + && make reviewdog/install \ && make stern/install \ && make telepresence/install \ + && make tparse/install \ + && make yq/install \ && make ngt/install \ && 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 a9bf1e5781..84302fe9f6 100644 --- a/dockers/discoverer/k8s/Dockerfile +++ b/dockers/discoverer/k8s/Dockerfile @@ -85,4 +85,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/gateway/filter/Dockerfile b/dockers/gateway/filter/Dockerfile index 4ddc9858e9..c4b3c751aa 100644 --- a/dockers/gateway/filter/Dockerfile +++ b/dockers/gateway/filter/Dockerfile @@ -85,4 +85,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 c3bd773deb..8d666ebfa4 100644 --- a/dockers/gateway/lb/Dockerfile +++ b/dockers/gateway/lb/Dockerfile @@ -85,4 +85,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 693d891601..eb136bd4ac 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -85,4 +85,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 1dbefb3c48..96152e486e 100644 --- a/dockers/index/job/correction/Dockerfile +++ b/dockers/index/job/correction/Dockerfile @@ -85,4 +85,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 13576d6dc6..3d89245d18 100644 --- a/dockers/index/job/creation/Dockerfile +++ b/dockers/index/job/creation/Dockerfile @@ -85,4 +85,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/readreplica/rotate/Dockerfile b/dockers/index/job/readreplica/rotate/Dockerfile index d443e0fcc0..2c5f7cfba9 100644 --- a/dockers/index/job/readreplica/rotate/Dockerfile +++ b/dockers/index/job/readreplica/rotate/Dockerfile @@ -85,4 +85,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 9ef2ef629c..5c4b9ccc45 100644 --- a/dockers/index/job/save/Dockerfile +++ b/dockers/index/job/save/Dockerfile @@ -85,4 +85,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 d1ff09eec6..fa713abbd1 100644 --- a/dockers/index/operator/Dockerfile +++ b/dockers/index/operator/Dockerfile @@ -85,4 +85,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 2fadc08ebb..5fe2b80e92 100644 --- a/dockers/manager/index/Dockerfile +++ b/dockers/manager/index/Dockerfile @@ -85,4 +85,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 049914cba3..5e06bc5f31 100644 --- a/dockers/operator/helm/Dockerfile +++ b/dockers/operator/helm/Dockerfile @@ -106,4 +106,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 cb2669cb87..92440346c7 100644 --- a/dockers/tools/benchmark/job/Dockerfile +++ b/dockers/tools/benchmark/job/Dockerfile @@ -66,10 +66,10 @@ RUN --mount=type=bind,target=.,rw \ locales \ git \ cmake \ - gcc \ g++ \ - unzip \ + gcc \ libssl-dev \ + unzip \ libhdf5-dev \ libaec-dev \ && ldconfig \ @@ -93,4 +93,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 f99fa41491..580eca69f1 100644 --- a/dockers/tools/benchmark/operator/Dockerfile +++ b/dockers/tools/benchmark/operator/Dockerfile @@ -85,4 +85,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 594c94eb99..282806ad4c 100644 --- a/dockers/tools/cli/loadtest/Dockerfile +++ b/dockers/tools/cli/loadtest/Dockerfile @@ -66,10 +66,10 @@ RUN --mount=type=bind,target=.,rw \ locales \ git \ cmake \ - gcc \ g++ \ - unzip \ + gcc \ libssl-dev \ + unzip \ libhdf5-dev \ libaec-dev \ && ldconfig \ @@ -93,4 +93,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/go.mod b/go.mod index fb5fa8a928..e21ae9375a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.23.2 replace ( cloud.google.com/go => cloud.google.com/go v0.115.1 - cloud.google.com/go/bigquery => cloud.google.com/go/bigquery v1.63.0 + cloud.google.com/go/bigquery => cloud.google.com/go/bigquery v1.63.1 cloud.google.com/go/compute => cloud.google.com/go/compute v1.28.1 cloud.google.com/go/datastore => cloud.google.com/go/datastore v1.19.0 cloud.google.com/go/firestore => cloud.google.com/go/firestore v1.17.0 @@ -50,7 +50,7 @@ replace ( github.com/aws/aws-sdk-go-v2/config => github.com/aws/aws-sdk-go-v2/config v1.27.39 github.com/aws/aws-sdk-go-v2/credentials => github.com/aws/aws-sdk-go-v2/credentials v1.17.37 github.com/aws/aws-sdk-go-v2/feature/ec2/imds => github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 - github.com/aws/aws-sdk-go-v2/feature/s3/manager => github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.25 + github.com/aws/aws-sdk-go-v2/feature/s3/manager => github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.26 github.com/aws/aws-sdk-go-v2/internal/configsources => github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 github.com/aws/aws-sdk-go-v2/internal/ini => github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 @@ -59,7 +59,7 @@ replace ( github.com/aws/aws-sdk-go-v2/service/internal/presigned-url => github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 github.com/aws/aws-sdk-go-v2/service/internal/s3shared => github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.18 github.com/aws/aws-sdk-go-v2/service/kms => github.com/aws/aws-sdk-go-v2/service/kms v1.36.3 - github.com/aws/aws-sdk-go-v2/service/s3 => github.com/aws/aws-sdk-go-v2/service/s3 v1.63.3 + github.com/aws/aws-sdk-go-v2/service/s3 => github.com/aws/aws-sdk-go-v2/service/s3 v1.64.0 github.com/aws/aws-sdk-go-v2/service/secretsmanager => github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.33.3 github.com/aws/aws-sdk-go-v2/service/sns => github.com/aws/aws-sdk-go-v2/service/sns v1.32.3 github.com/aws/aws-sdk-go-v2/service/sqs => github.com/aws/aws-sdk-go-v2/service/sqs v1.35.3 @@ -192,7 +192,7 @@ replace ( github.com/jstemmer/go-junit-report => github.com/jstemmer/go-junit-report v1.0.0 github.com/kisielk/errcheck => github.com/kisielk/errcheck v1.7.0 github.com/kisielk/gotool => github.com/kisielk/gotool v1.0.0 - github.com/klauspost/compress => github.com/klauspost/compress v1.17.11-0.20240927175842-8e14b1b5a913 + github.com/klauspost/compress => github.com/klauspost/compress v1.17.11-0.20241002081118-f2a4f2583ec1 github.com/klauspost/cpuid/v2 => github.com/klauspost/cpuid/v2 v2.2.8 github.com/kpango/fastime => github.com/kpango/fastime v1.1.9 github.com/kpango/fuid => github.com/kpango/fuid v0.0.0-20221203053508-503b5ad89aa1 diff --git a/go.sum b/go.sum index 84ace8d9bf..aef89bc0a1 100644 --- a/go.sum +++ b/go.sum @@ -37,7 +37,7 @@ cloud.google.com/go/automl v1.14.1/go.mod h1:BocG5mhT32cjmf5CXxVsdSM04VXzJW7chVT cloud.google.com/go/baremetalsolution v1.3.1/go.mod h1:D1djGGmBl4M6VlyjOMc1SEzDYlO4EeEG1TCUv5mCPi0= cloud.google.com/go/batch v1.11.0/go.mod h1:dS/ceyT1eUmQUPtRGvSaXsb8Aa4M3nCc8LIn0qUYiL4= cloud.google.com/go/beyondcorp v1.1.1/go.mod h1:L09o0gLkgXMxCZs4qojrgpI2/dhWtasMc71zPPiHMn4= -cloud.google.com/go/bigquery v1.63.0/go.mod h1:TQto6OR4kw27bqjNTGkVk1Vo5PJlTgxvDJn6YEIZL/E= +cloud.google.com/go/bigquery v1.63.1/go.mod h1:ufaITfroCk17WTqBhMpi8CRjsfHjMX07pDrQaRKKX2o= cloud.google.com/go/bigtable v1.18.1/go.mod h1:NAVyfJot9jlo+KmgWLUJ5DJGwNDoChzAcrecLpmuAmY= cloud.google.com/go/bigtable v1.20.0/go.mod h1:upJDn8frsjzpRMfybiWkD1PG6WCCL7CRl26MgVeoXY4= cloud.google.com/go/bigtable v1.33.0/go.mod h1:HtpnH4g25VT1pejHRtInlFPnN5sjTxbQlsYBjh9t5l0= @@ -59,7 +59,6 @@ cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/yb cloud.google.com/go/contactcenterinsights v1.14.1/go.mod h1:OxSWVQxosMh18KCQ3D5UZWYxVrOcK9xrJCV5waxD2dY= cloud.google.com/go/container v1.40.0/go.mod h1:wNI1mOUivm+ZkpHMbouutgbD4sQxyphMwK31X5cThY4= cloud.google.com/go/containeranalysis v0.13.1/go.mod h1:bmd9H880BNR4Hc8JspEg8ge9WccSQfO+/N+CYvU3sEA= -cloud.google.com/go/datacatalog v1.22.0/go.mod h1:4Wff6GphTY6guF5WphrD76jOdfBiflDiRGFAxq7t//I= cloud.google.com/go/datacatalog v1.22.1/go.mod h1:MscnJl9B2lpYlFoxRjicw19kFTwEke8ReKL5Y/6TWg8= cloud.google.com/go/dataflow v0.10.1/go.mod h1:zP4/tNjONFRcS4NcI9R94YDQEkPalimdbPkijVNJt/g= cloud.google.com/go/dataform v0.10.1/go.mod h1:c5y0hIOBCfszmBcLJyxnELF30gC1qC/NeHdmkzA7TNQ= @@ -230,8 +229,8 @@ github.com/aws/aws-sdk-go-v2/credentials v1.17.37 h1:G2aOH01yW8X373JK419THj5QVqu github.com/aws/aws-sdk-go-v2/credentials v1.17.37/go.mod h1:0ecCjlb7htYCptRD45lXJ6aJDQac6D2NlKGpZqyTG6A= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 h1:C/d03NAmh8C4BZXhuRNboF/DqhBkBCeDiJDcaqIT5pA= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14/go.mod h1:7I0Ju7p9mCIdlrfS+JCgqcYD0VXz/N4yozsox+0o078= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.25 h1:HkpHeZMM39sGtMHVYG1buAg93vhj5d7F81y6G0OAbGc= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.25/go.mod h1:j3Vz04ZjaWA6kygOsZRpmWe4CyGqfqq2u3unDTU0QGA= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.26 h1:BTfwWNFVGLxW2bih/V2xhgCsYDQwG1cAWhWoW9Jx7wE= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.26/go.mod h1:LA1/FxoEFFmv7XpkB8KKqLAUz8AePdK9H0Ec7PUKazs= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 h1:kYQ3H1u0ANr9KEKlGs/jTLrBFPo8P8NaH/w7A01NeeM= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18/go.mod h1:r506HmK5JDUh9+Mw4CfGJGSSoqIiLCndAuqXuhbv67Y= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 h1:Z7IdFUONvTcvS7YuhtVxN99v2cCoHRXOS4mTr0B/pUc= @@ -248,8 +247,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 h1:Xbwbmk44 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20/go.mod h1:oAfOFzUB14ltPZj1rWwRc3d/6OgD76R8KlvU3EqM9Fg= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.18 h1:eb+tFOIl9ZsUe2259/BKPeniKuz4/02zZFH/i4Nf8Rg= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.18/go.mod h1:GVCC2IJNJTmdlyEsSmofEy7EfJncP7DNnXDzRjJ5Keg= -github.com/aws/aws-sdk-go-v2/service/s3 v1.63.3 h1:3zt8qqznMuAZWDTDpcwv9Xr11M/lVj2FsRR7oYBt0OA= -github.com/aws/aws-sdk-go-v2/service/s3 v1.63.3/go.mod h1:NLTqRLe3pUNu3nTEHI6XlHLKYmc8fbHUdMxAB6+s41Q= +github.com/aws/aws-sdk-go-v2/service/s3 v1.64.0 h1:I0p8knB/IDYSQ3dbanaCr4UhiYQ96bvKRhGYxvLyiD8= +github.com/aws/aws-sdk-go-v2/service/s3 v1.64.0/go.mod h1:NLTqRLe3pUNu3nTEHI6XlHLKYmc8fbHUdMxAB6+s41Q= github.com/aws/aws-sdk-go-v2/service/sso v1.23.3 h1:rs4JCczF805+FDv2tRhZ1NU0RB2H6ryAvsWPanAr72Y= github.com/aws/aws-sdk-go-v2/service/sso v1.23.3/go.mod h1:XRlMvmad0ZNL+75C5FYdMvbbLkd6qiqz6foR1nA1PXY= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 h1:yiwVzJW2ZxZTurVbYWA7QOrAaCYQR72t0wrSBfoesUE= @@ -492,8 +491,8 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:C github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= -github.com/klauspost/compress v1.17.11-0.20240927175842-8e14b1b5a913 h1:7s7Xd7zVElAw1qh/eh+tXDNfDNXXj38Tpq54eeG6/BM= -github.com/klauspost/compress v1.17.11-0.20240927175842-8e14b1b5a913/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.17.11-0.20241002081118-f2a4f2583ec1 h1:Dvn9WOWnQvt7Z5txFg96+SqBIZ8S/n+SDW/XT1QbmLI= +github.com/klauspost/compress v1.17.11-0.20241002081118-f2a4f2583ec1/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/kpango/fastime v1.1.9 h1:xVQHcqyPt5M69DyFH7g1EPRns1YQNap9d5eLhl/Jy84= diff --git a/hack/actions/gen/main.go b/hack/actions/gen/main.go index 63298521c1..1a63a285a3 100644 --- a/hack/actions/gen/main.go +++ b/hack/actions/gen/main.go @@ -19,19 +19,19 @@ package main import ( "bytes" "context" - "errors" "fmt" "io/fs" "os" "os/signal" - "strings" "syscall" "text/template" "time" + "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/file" "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/safety" + "github.com/vdaas/vald/internal/strings" "github.com/vdaas/vald/internal/sync/errgroup" "gopkg.in/yaml.v2" ) diff --git a/hack/cspell/main.go b/hack/cspell/main.go index 0595983918..075bb26076 100644 --- a/hack/cspell/main.go +++ b/hack/cspell/main.go @@ -22,8 +22,9 @@ import ( "os" "regexp" "slices" - "strings" - "sync" + + "github.com/vdaas/vald/internal/strings" + "github.com/vdaas/vald/internal/sync" ) type CSpellConfig struct { diff --git a/hack/docker/gen/main.go b/hack/docker/gen/main.go index 3cd50d9f81..df6d58ec62 100644 --- a/hack/docker/gen/main.go +++ b/hack/docker/gen/main.go @@ -338,10 +338,10 @@ var ( clangBuildDeps = []string{ "cmake", - "gcc", "g++", - "unzip", + "gcc", "libssl-dev", + "unzip", } ngtBuildDeps = []string{ "liblapack-dev", @@ -355,12 +355,13 @@ var ( "pkg-config", } devContainerDeps = []string{ + "file", "gawk", "gnupg2", "graphviz", "jq", - "libhdf5-dev", "libaec-dev", + "libhdf5-dev", "sed", "zip", } @@ -379,12 +380,12 @@ var ( "make kind/install", "make kubectl/install", "make kubelinter/install", - "make reviewdog/install", - "make tparse/install", - "make yq/install", "make minikube/install", + "make reviewdog/install", "make stern/install", "make telepresence/install", + "make tparse/install", + "make yq/install", } devContainerPreprocess = []string{ @@ -805,10 +806,7 @@ func main() { data.Environments["HOME"] = "/" + rootUser data.Environments["USER"] = rootUser } else { - user := data.BuildUser - if strings.Contains(user, ":") { - user = strings.SplitN(user, ":", 2)[0] - } + user, _, _ := strings.Cut(data.BuildUser, ":") data.Environments["HOME"] = "/home/" + user data.Environments["USER"] = user } diff --git a/hack/tools/deadlink/main.go b/hack/tools/deadlink/main.go index 2579dbe72e..098523acf7 100644 --- a/hack/tools/deadlink/main.go +++ b/hack/tools/deadlink/main.go @@ -23,13 +23,13 @@ import ( "os" "path/filepath" "regexp" - "strings" "sync/atomic" "github.com/vdaas/vald/internal/file" "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/net" "github.com/vdaas/vald/internal/net/http/client" + "github.com/vdaas/vald/internal/strings" "github.com/vdaas/vald/internal/sync" "github.com/vdaas/vald/internal/sync/errgroup" ) diff --git a/internal/core/algorithm/faiss/faiss.go b/internal/core/algorithm/faiss/faiss.go index 1a43dbc83b..5e0d19021d 100644 --- a/internal/core/algorithm/faiss/faiss.go +++ b/internal/core/algorithm/faiss/faiss.go @@ -24,11 +24,11 @@ package faiss import "C" import ( - "sync" "unsafe" "github.com/vdaas/vald/internal/core/algorithm" "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/sync" ) type ( diff --git a/internal/core/algorithm/faiss/option.go b/internal/core/algorithm/faiss/option.go index d426722b27..89ea6ffad2 100644 --- a/internal/core/algorithm/faiss/option.go +++ b/internal/core/algorithm/faiss/option.go @@ -24,10 +24,9 @@ package faiss import "C" import ( - "strings" - "github.com/vdaas/vald/internal/core/algorithm" "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/strings" ) // Option represents the functional option for faiss. diff --git a/internal/core/algorithm/usearch/option.go b/internal/core/algorithm/usearch/option.go index d4bf0061c8..71dd10a0ee 100644 --- a/internal/core/algorithm/usearch/option.go +++ b/internal/core/algorithm/usearch/option.go @@ -19,12 +19,12 @@ package usearch import ( "strconv" - "strings" "github.com/kpango/fastime" core "github.com/unum-cloud/usearch/golang" "github.com/vdaas/vald/internal/core/algorithm" "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/strings" ) // Option represents the functional option for usearch. diff --git a/internal/core/algorithm/usearch/usearch.go b/internal/core/algorithm/usearch/usearch.go index 0d8c647f63..0aa50f8260 100644 --- a/internal/core/algorithm/usearch/usearch.go +++ b/internal/core/algorithm/usearch/usearch.go @@ -19,11 +19,11 @@ package usearch import ( "strconv" - "sync" core "github.com/unum-cloud/usearch/golang" "github.com/vdaas/vald/internal/core/algorithm" "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/sync" ) type ( diff --git a/internal/info/info.go b/internal/info/info.go index 223a507b07..c64fb9a905 100644 --- a/internal/info/info.go +++ b/internal/info/info.go @@ -37,9 +37,10 @@ type Info interface { } type info struct { - baseURL string // e.g https://github.com/vdaas/vald/tree/main - detail Detail - prepOnce sync.Once + baseURL string // e.g https://github.com/vdaas/vald/tree/main + detail Detail + prepOnce sync.Once + valdReplacer *strings.Replacer // runtime functions rtCaller func(skip int) (pc uintptr, file string, line int, ok bool) @@ -115,13 +116,14 @@ var ( ) const ( - goSrc = "go/src/" - goSrcLen = len(goSrc) - goMod = "go/pkg/mod/" - goModLen = len(goMod) - cgoTrue = "true" - cgoFalse = "false" - cgoUnknown = "unknown" + goSrc = "go/src/" + goSrcLen = len(goSrc) + goMod = "go/pkg/mod/" + goModLen = len(goMod) + cgoTrue = "true" + cgoFalse = "false" + cgoUnknown = "unknown" + googleGolang = "google.golang.org" ) // Init initializes Detail object only once. @@ -298,11 +300,35 @@ func (i info) getDetail() Detail { if funcName == "runtime.main" { break } + index := strings.LastIndex(funcName, "/") + if index != -1 { + funcName = funcName[index+1:] + } url := i.baseURL var idx int switch { case strings.HasPrefix(file, i.detail.GoRoot+"/src"): - url = "https://github.com/golang/go/blob/" + i.detail.GoVersion + strings.TrimPrefix(file, i.detail.GoRoot) + "#L" + strconv.Itoa(line) + url = "https://github.com/golang/go/blob/" + i.detail.GoVersion + strings.TrimPrefix(file, i.detail.GoRoot) + case strings.HasPrefix(file, "runtime"): + url = "https://github.com/golang/go/blob/" + i.detail.GoVersion + "/src/" + file + case strings.HasPrefix(file, googleGolang+"/grpc"): + // google.golang.org/grpc@v1.65.0/server.go to https://github.com/grpc/grpc-go/blob/v1.65.0/server.go + url = "https://github.com/grpc/grpc-go/blob/" + _, versionSource, ok := strings.Cut(file, "@") + if ok && versionSource != "" { + url += versionSource + } else { + url = strings.ReplaceAll(file, googleGolang+"/grpc@", url) + } + case strings.HasPrefix(file, googleGolang+"/protobuf"): + // google.golang.org/protobuf@v1.34.0/proto/decode.go to https://github.com/protocolbuffers/protobuf-go/blob/v1.34.0/proto/decode.go + url = "https://github.com/protocolbuffers/protobuf-go/blob/" + _, versionSource, ok := strings.Cut(file, "@") + if ok && versionSource != "" { + url += versionSource + } else { + url = strings.ReplaceAll(file, googleGolang+"/protobuf@", url) + } case func() bool { idx = strings.Index(file, goMod) return idx >= 0 @@ -319,15 +345,16 @@ func (i info) getDetail() Detail { } url += "/" + path } - url += "#L" + strconv.Itoa(line) case func() bool { idx = strings.Index(file, goSrc) return idx >= 0 && strings.Index(file, valdRepo) >= 0 }(): - url = strings.Replace(file[idx+goSrcLen:]+"#L"+strconv.Itoa(line), valdRepo, "https://"+valdRepo+"/blob/"+i.detail.GitCommit, -1) + url = i.valdReplacer.Replace(file[idx+goSrcLen:]) case strings.HasPrefix(file, valdRepo): - url = fmt.Sprintf("%s#L%d", strings.Replace(file, valdRepo, "https://"+valdRepo+"/blob/"+i.detail.GitCommit, -1), line) + url = i.valdReplacer.Replace(file) } + url += "#L" + strconv.Itoa(line) + i.detail.StackTrace = append(i.detail.StackTrace, StackTrace{ FuncName: funcName, File: file, @@ -364,7 +391,7 @@ func (i *info) prepare() { if i.detail.CGOEnabled == "" && CGOEnabled != "" { i.detail.CGOEnabled = CGOEnabled } - switch i.detail.CGOEnabled { + switch CGOEnabled { case "0", cgoFalse: i.detail.CGOEnabled = cgoFalse case "1", cgoTrue: @@ -390,9 +417,16 @@ func (i *info) prepare() { if len(i.detail.GoroutineCount) == 0 { i.detail.GoroutineCount = strconv.Itoa(runtime.NumGoroutine()) } + if i.valdReplacer == nil { + i.valdReplacer = strings.NewReplacer(valdRepo, "https://"+valdRepo+"/blob/"+i.detail.GitCommit) + } }) } func (s StackTrace) String() string { return "URL: " + s.URL + "\tFile: " + s.File + "\tLine: #" + strconv.Itoa(s.Line) + "\tFuncName: " + s.FuncName } + +func (s StackTrace) ShortString() string { + return s.URL + " " + s.FuncName +} diff --git a/internal/k8s/job/job.go b/internal/k8s/job/job.go index db984ef28c..bd29584969 100644 --- a/internal/k8s/job/job.go +++ b/internal/k8s/job/job.go @@ -16,13 +16,13 @@ package job import ( "context" "reflect" - "strings" - "sync" "time" "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/k8s" "github.com/vdaas/vald/internal/log" + "github.com/vdaas/vald/internal/strings" + "github.com/vdaas/vald/internal/sync" batchv1 "k8s.io/api/batch/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" "sigs.k8s.io/controller-runtime/pkg/builder" diff --git a/internal/net/grpc/errdetails/errdetails.go b/internal/net/grpc/errdetails/errdetails.go index a8e016c1d7..b7443978d7 100644 --- a/internal/net/grpc/errdetails/errdetails.go +++ b/internal/net/grpc/errdetails/errdetails.go @@ -411,12 +411,7 @@ func DebugInfoFromInfoDetail(v *info.Detail) (debug *DebugInfo) { if v.StackTrace != nil { debug.StackEntries = make([]string, 0, len(v.StackTrace)) for i, stack := range v.StackTrace { - debug.StackEntries = append(debug.GetStackEntries(), strings.Join([]string{ - "id:", - strconv.Itoa(i), - "stack_trace:", - stack.String(), - }, " ")) + debug.StackEntries = append(debug.GetStackEntries(), "id: "+strconv.Itoa(i)+" stack_trace: "+stack.ShortString()) } v.StackTrace = nil } diff --git a/internal/observability/metrics/mem/mem.go b/internal/observability/metrics/mem/mem.go index ece3236388..75cb3095a1 100644 --- a/internal/observability/metrics/mem/mem.go +++ b/internal/observability/metrics/mem/mem.go @@ -19,11 +19,11 @@ import ( "os" "runtime" "strconv" - "strings" "time" "github.com/vdaas/vald/internal/conv" "github.com/vdaas/vald/internal/observability/metrics" + "github.com/vdaas/vald/internal/strings" api "go.opentelemetry.io/otel/metric" view "go.opentelemetry.io/otel/sdk/metric" ) diff --git a/pkg/gateway/lb/handler/grpc/handler.go b/pkg/gateway/lb/handler/grpc/handler.go index f6ef4fdb42..10021e53e4 100644 --- a/pkg/gateway/lb/handler/grpc/handler.go +++ b/pkg/gateway/lb/handler/grpc/handler.go @@ -20,7 +20,6 @@ package grpc import ( "context" "fmt" - "io" "math" "slices" "strconv" @@ -33,6 +32,7 @@ import ( "github.com/vdaas/vald/internal/core/algorithm" "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/info" + "github.com/vdaas/vald/internal/io" "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/net" "github.com/vdaas/vald/internal/net/grpc" diff --git a/pkg/gateway/mirror/handler/grpc/handler.go b/pkg/gateway/mirror/handler/grpc/handler.go index 7065b1e177..c424ac6a65 100644 --- a/pkg/gateway/mirror/handler/grpc/handler.go +++ b/pkg/gateway/mirror/handler/grpc/handler.go @@ -16,7 +16,6 @@ package grpc import ( "context" "fmt" - "io" "reflect" "sync/atomic" @@ -24,6 +23,7 @@ import ( "github.com/vdaas/vald/apis/grpc/v1/payload" "github.com/vdaas/vald/apis/grpc/v1/vald" "github.com/vdaas/vald/internal/errors" + "github.com/vdaas/vald/internal/io" "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/net/grpc" "github.com/vdaas/vald/internal/net/grpc/codes" diff --git a/pkg/gateway/mirror/service/gateway.go b/pkg/gateway/mirror/service/gateway.go index 51b4a7ad2a..6d708b91ad 100644 --- a/pkg/gateway/mirror/service/gateway.go +++ b/pkg/gateway/mirror/service/gateway.go @@ -16,13 +16,13 @@ package service import ( "context" "reflect" - "strings" "github.com/vdaas/vald/internal/client/v1/client/mirror" "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/net/grpc" "github.com/vdaas/vald/internal/observability/trace" + "github.com/vdaas/vald/internal/strings" "github.com/vdaas/vald/internal/sync/errgroup" ) diff --git a/pkg/index/job/correction/service/corrector.go b/pkg/index/job/correction/service/corrector.go index 5bcf7a6e96..d403551c5e 100644 --- a/pkg/index/job/correction/service/corrector.go +++ b/pkg/index/job/correction/service/corrector.go @@ -17,7 +17,6 @@ import ( "cmp" "context" "fmt" - "io" "os" "reflect" "slices" @@ -31,6 +30,7 @@ import ( "github.com/vdaas/vald/internal/db/kvs/pogreb" "github.com/vdaas/vald/internal/errors" "github.com/vdaas/vald/internal/file" + "github.com/vdaas/vald/internal/io" "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/net/grpc" "github.com/vdaas/vald/internal/net/grpc/codes" diff --git a/pkg/index/job/readreplica/rotate/service/rotator.go b/pkg/index/job/readreplica/rotate/service/rotator.go index ef24e67889..a57c7ecbfa 100644 --- a/pkg/index/job/readreplica/rotate/service/rotator.go +++ b/pkg/index/job/readreplica/rotate/service/rotator.go @@ -17,7 +17,6 @@ import ( "context" "fmt" "reflect" - "strings" "time" "github.com/vdaas/vald/internal/errors" @@ -27,6 +26,7 @@ import ( "github.com/vdaas/vald/internal/log" "github.com/vdaas/vald/internal/observability/trace" "github.com/vdaas/vald/internal/safety" + "github.com/vdaas/vald/internal/strings" "github.com/vdaas/vald/internal/sync/errgroup" "k8s.io/utils/ptr" ) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index d8b61afc05..ea31fe1a60 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -4228,9 +4228,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-bom" diff --git a/tests/performance/max_vector_dim_test.go b/tests/performance/max_vector_dim_test.go index 1eb434ce49..d39db3e5f4 100644 --- a/tests/performance/max_vector_dim_test.go +++ b/tests/performance/max_vector_dim_test.go @@ -68,17 +68,15 @@ func init_ngt_service(dim int) (service.NGT, error) { } func parse(raw string) (key string, value int) { - text := strings.ReplaceAll(raw[:len(raw)-2], " ", "") - keyValue := strings.Split(text, ":") - val := 0 - if keyValue[1] != "" { - val, err := strconv.Atoi(keyValue[1]) + k, v, ok := strings.Cut(strings.ReplaceAll(raw[:len(raw)-2], " ", ""), ":") + if ok { + val, err := strconv.Atoi(v) if err != nil { - panic(err) + return k, 0 } - return keyValue[0], val + return k, val } - return keyValue[0], val + return k, 0 } func TestMain(m *testing.M) { diff --git a/versions/PROMETHEUS_STACK_VERSION b/versions/PROMETHEUS_STACK_VERSION index c3998b266a..4acff0a40e 100644 --- a/versions/PROMETHEUS_STACK_VERSION +++ b/versions/PROMETHEUS_STACK_VERSION @@ -1 +1 @@ -63.1.0 +65.0.0 diff --git a/versions/TELEPRESENCE_VERSION b/versions/TELEPRESENCE_VERSION index b8e248f40b..7329e21c3b 100644 --- a/versions/TELEPRESENCE_VERSION +++ b/versions/TELEPRESENCE_VERSION @@ -1 +1 @@ -2.19.1 +2.20.0 diff --git a/versions/actions/DOCKER_SETUP_BUILDX_ACTION b/versions/actions/DOCKER_SETUP_BUILDX_ACTION index 9575d51bad..7c69a55dbb 100644 --- a/versions/actions/DOCKER_SETUP_BUILDX_ACTION +++ b/versions/actions/DOCKER_SETUP_BUILDX_ACTION @@ -1 +1 @@ -3.6.1 +3.7.0