-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impl benchmark jobs #1977
Merged
vankichi
merged 3 commits into
feature/continuous-benchmark
from
feature/pkg-internal/impl-benchmark-jobs
Apr 26, 2023
Merged
Impl benchmark jobs #1977
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# | ||
# Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
# Copyright (C) 2019-2023 vdaas.org vald team <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
// Copyright (C) 2019-2023 vdaas.org vald team <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
// Copyright (C) 2019-2023 vdaas.org vald team <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
// Copyright (C) 2019-2023 vdaas.org vald team <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# | ||
# Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
# Copyright (C) 2019-2023 vdaas.org vald team <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
// Copyright (C) 2019-2023 vdaas.org vald team <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
// Copyright (C) 2019-2023 vdaas.org vald team <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
@@ -17,33 +17,32 @@ | |
// Package config providers configuration type and load configuration logic | ||
package config | ||
|
||
import "github.com/vdaas/vald/internal/k8s/client" | ||
|
||
// BenchmarkJob represents the configuration for the internal benchmark search job. | ||
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"` | ||
InsertConfig *InsertConfig `json:"insert_config,omitempty" yaml:"insert_config"` | ||
UpdateConfig *UpdateConfig `json:"update_config,omitempty" yaml:"update_config"` | ||
UpsertConfig *UpsertConfig `json:"upsert_config,omitempty" yaml:"upsert_config"` | ||
SearchConfig *SearchConfig `json:"search_config,omitempty" yaml:"search_config"` | ||
RemoveConfig *RemoveConfig `json:"remove_config,omitempty" yaml:"remove_config"` | ||
ClientConfig *GRPCClient `json:"client_config,omitempty" yaml:"client_config"` | ||
Rules []*BenchmarkJobRule `json:"rules,omitempty" yaml:"rules"` | ||
BeforeJobName string `json:"before_job_name,omitempty" yaml:"before_job_name"` | ||
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"` | ||
InsertConfig *InsertConfig `json:"insert_config,omitempty" yaml:"insert_config"` | ||
UpdateConfig *UpdateConfig `json:"update_config,omitempty" yaml:"update_config"` | ||
UpsertConfig *UpsertConfig `json:"upsert_config,omitempty" yaml:"upsert_config"` | ||
SearchConfig *SearchConfig `json:"search_config,omitempty" yaml:"search_config"` | ||
RemoveConfig *RemoveConfig `json:"remove_config,omitempty" yaml:"remove_config"` | ||
ObjectConfig *ObjectConfig `json:"object_config,omitempty" yaml:"object_config"` | ||
ClientConfig *GRPCClient `json:"client_config,omitempty" yaml:"client_config"` | ||
Rules []*BenchmarkJobRule `json:"rules,omitempty" yaml:"rules"` | ||
BeforeJobName string `json:"before_job_name,omitempty" yaml:"before_job_name"` | ||
BeforeJobNamespace string `json:"before_job_namespace,omitempty" yaml:"before_job_namespace"` | ||
Client client.Client `json:"client,omitempty" yaml:"client"` | ||
RPS int `json:"rps,omitempty" yaml:"rps"` | ||
} | ||
|
||
// BenchmarkScenario represents the configuration for the internal benchmark scenario. | ||
type BenchmarkScenario struct { | ||
Target *BenchmarkTarget `json:"target" yaml:"target"` | ||
Dataset *BenchmarkDataset `jon:"dataset" yaml:"dataset"` | ||
Jobs []*BenchmarkJob `job:"jobs" yaml:jobs` | ||
Target *BenchmarkTarget `json:"target,omitempty" yaml:"target"` | ||
Dataset *BenchmarkDataset `json:"dataset,omitempty" yaml:"dataset"` | ||
Jobs []*BenchmarkJob `json:"jobs,omitempty" yaml:"jobs"` | ||
} | ||
|
||
// BenchmarkTarget defines the desired state of BenchmarkTarget | ||
|
@@ -52,6 +51,11 @@ type BenchmarkTarget struct { | |
Port int `json:"port,omitempty"` | ||
} | ||
|
||
func (t *BenchmarkTarget) Bind() *BenchmarkTarget { | ||
t.Host = GetActualValue(t.Host) | ||
return t | ||
} | ||
|
||
// BenchmarkDataset defines the desired state of BenchmarkDateset | ||
type BenchmarkDataset struct { | ||
Name string `json:"name,omitempty"` | ||
|
@@ -60,6 +64,11 @@ type BenchmarkDataset struct { | |
Range *BenchmarkDatasetRange `json:"range,omitempty"` | ||
} | ||
|
||
func (d *BenchmarkDataset) Bind() *BenchmarkDataset { | ||
d.Name = GetActualValue(d.Name) | ||
return d | ||
} | ||
|
||
// BenchmarkDatasetRange defines the desired state of BenchmarkDatesetRange | ||
type BenchmarkDatasetRange struct { | ||
Start int `json:"start,omitempty"` | ||
|
@@ -72,22 +81,45 @@ type BenchmarkJobRule struct { | |
Type string `json:"type,omitempty"` | ||
} | ||
|
||
func (r *BenchmarkJobRule) Bind() *BenchmarkJobRule { | ||
r.Name = GetActualValue(r.Name) | ||
r.Type = GetActualValue(r.Type) | ||
return r | ||
} | ||
|
||
// InsertConfig defines the desired state of insert config | ||
type InsertConfig struct { | ||
SkipStrictExistCheck bool `json:"skip_strict_exist_check,omitempty"` | ||
Timestamp string `json:"timestamp,omitempty"` | ||
} | ||
|
||
func (cfg *InsertConfig) Bind() *InsertConfig { | ||
cfg.Timestamp = GetActualValue(cfg.Timestamp) | ||
return cfg | ||
} | ||
|
||
// UpdateConfig defines the desired state of update config | ||
type UpdateConfig struct { | ||
SkipStrictExistCheck bool `json:"skip_strict_exist_check,omitempty"` | ||
Timestamp string `json:"timestamp,omitempty"` | ||
SkipStrictExistCheck bool `json:"skip_strict_exist_check,omitempty"` | ||
Timestamp string `json:"timestamp,omitempty"` | ||
DisableBalancedUpdate bool `json:"disable_balanced_update,omitempty"` | ||
} | ||
|
||
func (cfg *UpdateConfig) Bind() *UpdateConfig { | ||
cfg.Timestamp = GetActualValue(cfg.Timestamp) | ||
return cfg | ||
} | ||
|
||
// UpsertConfig defines the desired state of upsert config | ||
type UpsertConfig struct { | ||
SkipStrictExistCheck bool `json:"skip_strict_exist_check,omitempty"` | ||
Timestamp string `json:"timestamp,omitempty"` | ||
SkipStrictExistCheck bool `json:"skip_strict_exist_check,omitempty"` | ||
Timestamp string `json:"timestamp,omitempty"` | ||
DisableBalancedUpdate bool `json:"disable_balanced_update,omitempty"` | ||
} | ||
|
||
func (cfg *UpsertConfig) Bind() *UpsertConfig { | ||
cfg.Timestamp = GetActualValue(cfg.Timestamp) | ||
return cfg | ||
} | ||
|
||
// SearchConfig defines the desired state of search config | ||
|
@@ -99,19 +131,93 @@ type SearchConfig struct { | |
Timeout string `json:"timeout,omitempty"` | ||
} | ||
|
||
func (cfg *SearchConfig) Bind() *SearchConfig { | ||
cfg.Timeout = GetActualValue(cfg.Timeout) | ||
return cfg | ||
} | ||
|
||
// RemoveConfig defines the desired state of remove config | ||
type RemoveConfig struct { | ||
SkipStrictExistCheck bool `json:"skip_strict_exist_check,omitempty"` | ||
Timestamp string `json:"timestamp,omitempty"` | ||
} | ||
|
||
func (cfg *RemoveConfig) Bind() *RemoveConfig { | ||
cfg.Timestamp = GetActualValue(cfg.Timestamp) | ||
return cfg | ||
} | ||
|
||
// ObjectConfig defines the desired state of object config | ||
type ObjectConfig struct { | ||
FilterConfig FilterConfig `json:"filter_config,omitempty" yaml:"filter_config"` | ||
} | ||
|
||
func (cfg *ObjectConfig) Bind() *ObjectConfig { | ||
cfg.FilterConfig = *cfg.FilterConfig.Bind() | ||
return cfg | ||
} | ||
|
||
// FilterTarget defines the desired state of filter target | ||
type FilterTarget struct { | ||
Host string `json:"host,omitempty" yaml:"host"` | ||
Port int32 `json:"port,omitempty" yaml:"port"` | ||
} | ||
|
||
func (cfg *FilterTarget) Bind() *FilterTarget { | ||
cfg.Host = GetActualValue(cfg.Host) | ||
return cfg | ||
} | ||
|
||
// FilterConfig defines the desired state of filter config | ||
type FilterConfig struct { | ||
Targets []*FilterTarget `json:"target,omitempty" yaml:"target"` | ||
} | ||
|
||
func (cfg *FilterConfig) Bind() *FilterConfig { | ||
for i := 0; i < len(cfg.Targets); i++ { | ||
cfg.Targets[i] = cfg.Targets[i].Bind() | ||
} | ||
return cfg | ||
} | ||
|
||
// Bind binds the actual data from the Job receiver fields. | ||
func (b *BenchmarkJob) Bind() *BenchmarkJob { | ||
b.JobType = GetActualValue(b.JobType) | ||
b.BeforeJobName = GetActualValue(b.BeforeJobName) | ||
b.BeforeJobNamespace = GetActualValue(b.BeforeJobNamespace) | ||
|
||
if b.Target != nil { | ||
b.Target = b.Target.Bind() | ||
} | ||
if b.Dataset != nil { | ||
b.Dataset = b.Dataset.Bind() | ||
} | ||
if b.InsertConfig != nil { | ||
b.InsertConfig = b.InsertConfig.Bind() | ||
} | ||
if b.UpdateConfig != nil { | ||
b.UpdateConfig = b.UpdateConfig.Bind() | ||
} | ||
if b.UpsertConfig != nil { | ||
b.UpsertConfig = b.UpsertConfig.Bind() | ||
} | ||
if b.SearchConfig != nil { | ||
b.SearchConfig = b.SearchConfig.Bind() | ||
} | ||
if b.RemoveConfig != nil { | ||
b.RemoveConfig = b.RemoveConfig.Bind() | ||
} | ||
if b.ObjectConfig != nil { | ||
b.ObjectConfig = b.ObjectConfig.Bind() | ||
} | ||
if b.ClientConfig != nil { | ||
b.ClientConfig = b.ClientConfig.Bind() | ||
} | ||
if len(b.Rules) > 0 { | ||
for i := 0; i < len(b.Rules); i++ { | ||
b.Rules[i] = b.Rules[i].Bind() | ||
} | ||
} | ||
return b | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
// Copyright (C) 2019-2023 vdaas.org vald team <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
// Copyright (C) 2019-2023 vdaas.org vald team <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# | ||
# Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
# Copyright (C) 2019-2023 vdaas.org vald team <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
|
@@ -129,6 +129,8 @@ spec: | |
- type | ||
type: object | ||
type: array | ||
rps: | ||
type: integer | ||
insert_config: | ||
description: InsertConfig defines the desired state of insert config | ||
properties: | ||
|
@@ -168,6 +170,8 @@ spec: | |
type: boolean | ||
timestamp: | ||
type: string | ||
disable_balanced_update: | ||
type: boolean | ||
type: object | ||
upsert_config: | ||
description: UpsertConfig defines the desired state of upsert config | ||
|
@@ -176,6 +180,8 @@ spec: | |
type: boolean | ||
timestamp: | ||
type: string | ||
disable_balanced_update: | ||
type: boolean | ||
type: object | ||
client_config: | ||
description: ClientConfig represents the configurations for gRPC client. | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gochecknoglobals: ErrMismatchBenchmarkAtomics is a global variable
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
@sonatype-lift ignore
@sonatype-lift ignoreall
@sonatype-lift exclude <file|issue|path|tool>
file|issue|path|tool
from Lift findings by updating your config.toml fileNote: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Help us improve LIFT! (Sonatype LiftBot external survey)
Was this a good recommendation for you? Answering this survey will not impact your Lift settings.
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]