From 48764d0147f80329459fc9f6a3ea81216103e750 Mon Sep 17 00:00:00 2001 From: vankichi Date: Tue, 20 Feb 2024 11:31:27 +0900 Subject: [PATCH] :recycle: remove dimension from con-bench Signed-off-by: vankichi --- .../crds/valdbenchmarkjob.yaml | 3 --- .../vald-benchmark-operator/schemas/job-values.yaml | 3 --- .../schemas/scenario-values.yaml | 1 - .../values/benchmark-job.yaml | 1 - .../values/benchmark-scenario.yaml | 8 -------- docs/performance/continuos-benchmatk.md | 1 - internal/config/benchmark.go | 1 - internal/k8s/vald/benchmark/api/v1/job_types.go | 1 - .../benchmark/operator/crds/valdbenchmarkjob.yaml | 3 --- pkg/tools/benchmark/job/service/job.go | 1 - pkg/tools/benchmark/job/service/option.go | 12 ------------ pkg/tools/benchmark/job/service/search.go | 8 -------- pkg/tools/benchmark/job/usecase/benchmarkd.go | 1 - 13 files changed, 44 deletions(-) diff --git a/charts/vald-benchmark-operator/crds/valdbenchmarkjob.yaml b/charts/vald-benchmark-operator/crds/valdbenchmarkjob.yaml index 53367d67c86..b0aad134ae3 100644 --- a/charts/vald-benchmark-operator/crds/valdbenchmarkjob.yaml +++ b/charts/vald-benchmark-operator/crds/valdbenchmarkjob.yaml @@ -277,9 +277,6 @@ spec: - indexes - group - range - dimension: - type: integer - minimum: 1 global_config: type: object properties: diff --git a/charts/vald-benchmark-operator/schemas/job-values.yaml b/charts/vald-benchmark-operator/schemas/job-values.yaml index 8b7de934cdd..a619e55d4d6 100644 --- a/charts/vald-benchmark-operator/schemas/job-values.yaml +++ b/charts/vald-benchmark-operator/schemas/job-values.yaml @@ -47,9 +47,6 @@ dataset: # @schema {"name": "dataset.url", "type": "string"} # dataset.url -- the dataset url which is used for executing benchmark job with user defined hdf5 file url: "" -# @schema {"name": "dimension", "type": "integer", "minimum": 1} -# dimension -- vector dimension -dimension: 784 # @schema {"name": "replica", "type": "integer", "minimum": 1} # replica -- the number of running concurrency job replica: 1 diff --git a/charts/vald-benchmark-operator/schemas/scenario-values.yaml b/charts/vald-benchmark-operator/schemas/scenario-values.yaml index 2600b42a155..28a1d5786ce 100644 --- a/charts/vald-benchmark-operator/schemas/scenario-values.yaml +++ b/charts/vald-benchmark-operator/schemas/scenario-values.yaml @@ -59,7 +59,6 @@ jobs: range: start: 1 end: 1000 - dimension: 784 replica: 1 repetition: 1 job_type: "search" diff --git a/charts/vald-benchmark-operator/values/benchmark-job.yaml b/charts/vald-benchmark-operator/values/benchmark-job.yaml index b11d8dfafaf..3a24f856ef7 100644 --- a/charts/vald-benchmark-operator/values/benchmark-job.yaml +++ b/charts/vald-benchmark-operator/values/benchmark-job.yaml @@ -27,7 +27,6 @@ spec: start: 1 end: 1000 job_type: "search" - dimension: 784 repetition: 1 replica: 1 rules: [] diff --git a/charts/vald-benchmark-operator/values/benchmark-scenario.yaml b/charts/vald-benchmark-operator/values/benchmark-scenario.yaml index ac9df3aa566..ef018a3ea69 100644 --- a/charts/vald-benchmark-operator/values/benchmark-scenario.yaml +++ b/charts/vald-benchmark-operator/values/benchmark-scenario.yaml @@ -45,7 +45,6 @@ spec: jobs: # @schema {"name": "jobs.items.dataset", "type": "object"} - job_type: "insert" - dimension: 784 repetition: 1 replica: 1 rules: [] @@ -62,7 +61,6 @@ spec: health_check_duration: "10s" rps: 500 - job_type: "update" - dimension: 784 repetition: 1 replica: 1 rules: [] @@ -79,7 +77,6 @@ spec: health_check_duration: "10s" rps: 500 - job_type: "search" - dimension: 784 repetition: 1 replica: 1 rules: [] @@ -94,7 +91,6 @@ spec: health_check_duration: "10s" rps: 2000 - job_type: "upsert" - dimension: 784 repetition: 1 replica: 1 rules: [] @@ -111,7 +107,6 @@ spec: health_check_duration: "10s" rps: 1000 - job_type: "search" - dimension: 784 repetition: 2 replica: 1 rules: [] @@ -133,7 +128,6 @@ spec: health_check_duration: "10s" rps: 4000 - job_type: "exists" - dimension: 784 repetition: 1 replica: 1 rules: [] @@ -148,7 +142,6 @@ spec: health_check_duration: "10s" rps: 1000 - job_type: "getobject" - dimension: 784 repetition: 1 replica: 1 rules: [] @@ -163,7 +156,6 @@ spec: health_check_duration: "10s" rps: 1000 - job_type: "remove" - dimension: 784 repetition: 1 replica: 1 rules: [] diff --git a/docs/performance/continuos-benchmatk.md b/docs/performance/continuos-benchmatk.md index 34a483cc93f..41bdab43ee5 100644 --- a/docs/performance/continuos-benchmatk.md +++ b/docs/performance/continuos-benchmatk.md @@ -49,7 +49,6 @@ And, Benchmark Operator also applies it to the Kubernetes cluster based on `Vald | :------------------------- | :-------- | :-------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- | | target | \* | target Vald cluster | object | ref: [target](#target-prop) | | dataset | \* | dataset information | object | ref: [dataset](#dataset-prop) | -| dimension | \* | dimension of vector | integer | 784 | | job_type | \* | execute job type | string enum: [insert, update, upsert, remove, search, getobject, exists] | search | | repetition | | the number of job repetitions
default: `1` | integer | 1 | | replica | | the number of job concurrent job executions
default: `1` | integer | 2 | diff --git a/internal/config/benchmark.go b/internal/config/benchmark.go index e7e9acb4e4e..68272a58bc1 100644 --- a/internal/config/benchmark.go +++ b/internal/config/benchmark.go @@ -21,7 +21,6 @@ package config type BenchmarkJob struct { Target *BenchmarkTarget `json:"target,omitempty" yaml:"target"` Dataset *BenchmarkDataset `json:"dataset,omitempty" yaml:"dataset"` - Dimension int `json:"dimension,omitempty" yaml:"dimension"` Replica int `json:"replica,omitempty" yaml:"replica"` Repetition int `json:"repetition,omitempty" yaml:"repetition"` JobType string `json:"job_type,omitempty" yaml:"job_type"` diff --git a/internal/k8s/vald/benchmark/api/v1/job_types.go b/internal/k8s/vald/benchmark/api/v1/job_types.go index 8c82d48e378..cc1fedb0181 100644 --- a/internal/k8s/vald/benchmark/api/v1/job_types.go +++ b/internal/k8s/vald/benchmark/api/v1/job_types.go @@ -28,7 +28,6 @@ type BenchmarkJobSpec struct { ServerConfig *config.Servers `json:"server_config,omitempty" yaml:"server_config"` Target *BenchmarkTarget `json:"target,omitempty" yaml:"target"` Dataset *BenchmarkDataset `json:"dataset,omitempty" yaml:"dataset"` - Dimension int `json:"dimension,omitempty" yaml:"dimension"` Replica int `json:"replica,omitempty" yaml:"replica"` Repetition int `json:"repetition,omitempty" yaml:"repetition"` JobType string `json:"job_type,omitempty" yaml:"job_type"` diff --git a/k8s/tools/benchmark/operator/crds/valdbenchmarkjob.yaml b/k8s/tools/benchmark/operator/crds/valdbenchmarkjob.yaml index 53367d67c86..b0aad134ae3 100644 --- a/k8s/tools/benchmark/operator/crds/valdbenchmarkjob.yaml +++ b/k8s/tools/benchmark/operator/crds/valdbenchmarkjob.yaml @@ -277,9 +277,6 @@ spec: - indexes - group - range - dimension: - type: integer - minimum: 1 global_config: type: object properties: diff --git a/pkg/tools/benchmark/job/service/job.go b/pkg/tools/benchmark/job/service/job.go index 455d6f17941..905501534c0 100644 --- a/pkg/tools/benchmark/job/service/job.go +++ b/pkg/tools/benchmark/job/service/job.go @@ -82,7 +82,6 @@ func (jt jobType) String() string { type job struct { eg errgroup.Group - dimension int dataset *config.BenchmarkDataset jobType jobType jobFunc func(context.Context, chan error) error diff --git a/pkg/tools/benchmark/job/service/option.go b/pkg/tools/benchmark/job/service/option.go index 10b04dbebc6..4b0fb7e4592 100644 --- a/pkg/tools/benchmark/job/service/option.go +++ b/pkg/tools/benchmark/job/service/option.go @@ -32,23 +32,11 @@ import ( type Option func(j *job) error var defaultOpts = []Option{ - // TODO: set default config for client - WithDimension(784), WithBeforeJobDuration("30s"), WithRPS(1000), WithConcurencyLimit(200), } -// WithDimension sets the vector's dimension for running benchmark job with dataset. -func WithDimension(dim int) Option { - return func(j *job) error { - if dim > 0 { - j.dimension = dim - } - return nil - } -} - // WithInsertConfig sets the insert API config for running insert request job. func WithInsertConfig(c *config.InsertConfig) Option { return func(j *job) error { diff --git a/pkg/tools/benchmark/job/service/search.go b/pkg/tools/benchmark/job/service/search.go index 4128584344b..79beaadaf91 100644 --- a/pkg/tools/benchmark/job/service/search.go +++ b/pkg/tools/benchmark/job/service/search.go @@ -66,10 +66,6 @@ func (j *job) search(ctx context.Context, ech chan error) error { } // idx is the modulo, which takes between <0, len(vecs)-1>. idx := (iter - 1) % len(vecs) - if len(vecs[idx]) != j.dimension { - log.Warn("len(vecs) ", len(vecs[iter]), "is not matched with ", j.dimension) - return nil - } res, err := j.client.Search(egctx, &payload.Search_Request{ Vector: vecs[idx], Config: cfg, @@ -121,10 +117,6 @@ func (j *job) search(ctx context.Context, ech chan error) error { log.Debugf("[benchmark job] Start linear search: iter = %d", iter) // idx is the modulo, which takes between <0, len(vecs)-1>. idx := (iter - 1) % len(vecs) - if len(vecs[idx]) != j.dimension { - log.Warn("len(vecs) ", len(vecs[idx]), "is not matched with ", j.dimension) - return nil - } res, err := j.client.LinearSearch(egctx, &payload.Search_Request{ Vector: vecs[idx], Config: cfg, diff --git a/pkg/tools/benchmark/job/usecase/benchmarkd.go b/pkg/tools/benchmark/job/usecase/benchmarkd.go index 173edf6d8b3..1036125b2e7 100644 --- a/pkg/tools/benchmark/job/usecase/benchmarkd.go +++ b/pkg/tools/benchmark/job/usecase/benchmarkd.go @@ -91,7 +91,6 @@ func New(cfg *config.Config) (r runner.Runner, err error) { service.WithValdClient(vcli), service.WithDataset(cfg.Job.Dataset), service.WithJobTypeByString(cfg.Job.JobType), - service.WithDimension(cfg.Job.Dimension), service.WithInsertConfig(cfg.Job.InsertConfig), service.WithUpdateConfig(cfg.Job.UpdateConfig), service.WithUpsertConfig(cfg.Job.UpsertConfig),