Skip to content

Commit

Permalink
feat: tpcc support dameng (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengluodb authored Jul 23, 2024
1 parent f0dff72 commit 73abc87
Show file tree
Hide file tree
Showing 19 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha1/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type ResourceList struct {
type Target struct {
// the driver represents the database type
// +optional
// +kubebuilder:validation:Enum={mysql,postgresql,mongodb,redis,oceanbase-oracle}
// +kubebuilder:validation:Enum={mysql,postgresql,mongodb,redis,oceanbase-oracle,dameng}
Driver string `json:"driver,omitempty"`

// The database server's host name
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/benchmark.apecloud.io_pgbenches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/benchmark.apecloud.io_redisbenches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/benchmark.apecloud.io_sysbenches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/benchmark.apecloud.io_tpccs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/benchmark.apecloud.io_tpcds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/benchmark.apecloud.io_tpches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/benchmark.apecloud.io_ycsbs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
1 change: 1 addition & 0 deletions deploy/helm/crds/benchmark.apecloud.io_pgbenches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
1 change: 1 addition & 0 deletions deploy/helm/crds/benchmark.apecloud.io_redisbenches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
1 change: 1 addition & 0 deletions deploy/helm/crds/benchmark.apecloud.io_sysbenches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
1 change: 1 addition & 0 deletions deploy/helm/crds/benchmark.apecloud.io_tpccs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
1 change: 1 addition & 0 deletions deploy/helm/crds/benchmark.apecloud.io_tpcds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
1 change: 1 addition & 0 deletions deploy/helm/crds/benchmark.apecloud.io_tpches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
1 change: 1 addition & 0 deletions deploy/helm/crds/benchmark.apecloud.io_ycsbs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ spec:
- mongodb
- redis
- oceanbase-oracle
- dameng
type: string
host:
type: string
Expand Down
4 changes: 2 additions & 2 deletions deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ kubebenchImages:
ycsb: "registry.cn-hangzhou.aliyuncs.com/apecloud/go-ycsb:latest"
fio: "registry.cn-hangzhou.aliyuncs.com/apecloud/fio:latest"
redisbench: "registry.cn-hangzhou.aliyuncs.com/apecloud/redis:7.0.5"
exporter: "registry.cn-hangzhou.aliyuncs.com/apecloud/kubebench:0.0.9"
tools: "registry.cn-hangzhou.aliyuncs.com/apecloud/kubebench:0.0.9"
exporter: "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubebench:0.0.10"
tools: "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubebench:0.0.10"
8 changes: 8 additions & 0 deletions internal/controller/tpcc_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ func NewTpccWorkLoadParams(cr *v1alpha1.Tpcc) string {
return NewTpccPostgresParams(cr)
case constants.OceanBaseOracleTenantDriver:
return NewOceanBaseOracleTenantParams(cr)
case constants.DamengDriver:
return NewDamengParams(cr)
default:
return ""
}
Expand All @@ -175,6 +177,12 @@ func NewOceanBaseOracleTenantParams(cr *v1alpha1.Tpcc) string {
return result
}

func NewDamengParams(cr *v1alpha1.Tpcc) string {
result := fmt.Sprintf("--driver %s", "dm.jdbc.driver.DmDriver")
result = fmt.Sprintf("%s --conn jdbc:dm://%s:%d", result, cr.Spec.Target.Host, cr.Spec.Target.Port)
return result
}

// TpccInitContainers returns the init containers for tpcc
// tpcc will fail if database not exists, so we need to create database first
func TpccInitContainers(cr *v1alpha1.Tpcc) *corev1.Container {
Expand Down
1 change: 1 addition & 0 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
MongoDbDriver = "mongodb"
RedisDriver = "redis"
OceanBaseOracleTenantDriver = "oceanbase-oracle"
DamengDriver = "dameng"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions pkg/constants/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ const (
func init() {
viper.SetDefault(KubebenchEnvPgbench, "registry.cn-hangzhou.aliyuncs.com/apecloud/spilo:14.8.0")
viper.SetDefault(KubebenchEnvSysbench, "registry.cn-hangzhou.aliyuncs.com/apecloud/customsuites:latest")
viper.SetDefault(KubebenchEnvTpcc, "registry.cn-hangzhou.aliyuncs.com/apecloud/benchmarksql:latest")
viper.SetDefault(KubebenchEnvTpcc, "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/benchmarksql:latest")
viper.SetDefault(KubebenchEnvTpcds, "infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/tpcds:latest")
viper.SetDefault(KubebenchEnvTpch, "registry.cn-hangzhou.aliyuncs.com/apecloud/customsuites:latest")
viper.SetDefault(KubebenchEnvYcsb, "registry.cn-hangzhou.aliyuncs.com/apecloud/go-ycsb:latest")
viper.SetDefault(KubebenchEnvFio, "registry.cn-hangzhou.aliyuncs.com/apecloud/fio:latest")
viper.SetDefault(KubebenchEnvRedisBench, "registry.cn-hangzhou.aliyuncs.com/apecloud/redis:7.0.5")
viper.SetDefault(KubebenchExporter, "registry.cn-hangzhou.aliyuncs.com/apecloud/kubebench:0.0.9")
viper.SetDefault(KubebenchTools, "registry.cn-hangzhou.aliyuncs.com/apecloud/kubebench:0.0.9")
viper.SetDefault(KubebenchExporter, "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubebench:0.0.10")
viper.SetDefault(KubebenchTools, "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubebench:0.0.10")
}

// GetBenchmarkImage get benchmark image
Expand Down

0 comments on commit 73abc87

Please sign in to comment.