Skip to content
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

feat: installing grafana from picodata.io #151

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ venv/

benchmark
terraform*.zip
config

vendor
bin
Expand Down
20 changes: 20 additions & 0 deletions README_ydb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# YDB-specific configuration for stroppy tests

To support the authentication methods specific to YDB Managed Service, stroppy uses the additional environment variables when running in *client* mode only:
* `YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS` - the path to the service account key file. When configured, the key file is used to authenticate the connection.
* `YDB_METADATA_CREDENTIALS` - when set to `1`, the service account key associated with the Cloud compute instance is used to authenticate the connection.
* `YDB_ACCESS_TOKEN_CREDENTIALS` - YDB access token. When configured, the access token is passed as is to authenticate the connection.
* `YDB_TLS_CERTIFICATES_FILE` - PEM-encoded file with custom TLS certificate(s) to be used for GRPCS connections.

In addition, there are the following YDB-specific environment variables:
* `YDB_STROPPY_PARTITIONS_COUNT` - [`AUTO_PARTITIONING_MIN_PARTITIONS_COUNT`](https://ydb.tech/en/docs/concepts/datamodel/table#auto_partitioning_partition_size_mb) setting value for `account` and `transfer` tables. This setting only affects the `pop` operation mode.
* `YDB_STROPPY_PARTITIONS_SIZE` - [`AUTO_PARTITIONING_PARTITION_SIZE_MB`](https://ydb.tech/en/docs/concepts/datamodel/table#auto_partitioning_min_partitions_count) setting value for `account` and `transfer` tables. This setting only affects the `pop` operation mode.
* `YDB_STROPPY_HASH_TRANSFER_ID` - when set to `1`, the actual value of `transfer_id` field in the `transfer` table is replaced with its SHA-1 hash code (Base-64 encoded). This setting only affects the `pay` operation mode.

Typical "client" operation modes command examples:

```bash
export YDB_DB='grpc://stroppy:passw0rd@ycydb-d1:2136?database=/Root/testdb'
./stroppy pop --dbtype ydb --url "$YDB_DB" -n 1000000 -w 8000 --run-type client
./stroppy pay --dbtype ydb --url "$YDB_DB" -n 10000000 -w 8000 --run-type client
```
3 changes: 2 additions & 1 deletion cmd/stroppy/commands/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ func newDeployCommand(settings *config.Settings) *cobra.Command {

deployCmd.PersistentFlags().BoolVarP(
&settings.DatabaseSettings.Sharded,
"sharded", "",
"sharded",
"",
false,
"Use to populate accounts in sharded MongoDB cluster. "+
"Default false - populate accounts in MongoDB replicasets cluster",
Expand Down
23 changes: 9 additions & 14 deletions cmd/stroppy/commands/pay.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,15 @@ func newPayCommand(settings *config.Settings) *cobra.Command {
},

Run: func(cmd *cobra.Command, args []string) {
statistics.StatsSetTotal(settings.DatabaseSettings.Count)
statistics.StatsSetTotal(int(settings.DatabaseSettings.Count))

if settings.EnableProfile {
go func() {
llog.Infoln(http.ListenAndServe("localhost:6060", nil))
}()
}
if settings.TestSettings.UseCloudStroppy && settings.TestSettings.RunAsPod {
llog.Fatalf("use-cloud-stroppy and run-as-pod flags specified at the same time")
}

if settings.Local && settings.TestSettings.RunAsPod {
llog.Fatalf("--local and --run-as-pod flags specified at the same time")
}

if settings.TestSettings.UseCloudStroppy {
if settings.TestSettings.IsController() { //nolint
sh, err := deployment.LoadState(settings)
if err != nil {
llog.Fatalf("deployment load state failed: %v", err)
Expand Down Expand Up @@ -96,7 +89,7 @@ func newPayCommand(settings *config.Settings) *cobra.Command {
},
}

payCmd.PersistentFlags().IntVarP(&settings.DatabaseSettings.Count,
payCmd.PersistentFlags().Uint64VarP(&settings.DatabaseSettings.Count,
"count", "n", settings.DatabaseSettings.Count,
"Number of transfers to make")

Expand All @@ -121,10 +114,12 @@ func newPayCommand(settings *config.Settings) *cobra.Command {
settings.TestSettings.KubernetesMasterAddress,
"kubernetes master address")

payCmd.PersistentFlags().BoolVarP(&settings.TestSettings.RunAsPod,
"run-as-pod", "",
false,
"run stroppy as in pod statement")
payCmd.PersistentFlags().StringVarP(
&settings.TestSettings.RunType,
"run-type", "",
"controller",
"set troppy run type [controller, client, or local]",
)

return payCmd
}
28 changes: 11 additions & 17 deletions cmd/stroppy/commands/pop.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,15 @@ func newPopCommand(settings *config.Settings) *cobra.Command {
},

Run: func(cmd *cobra.Command, args []string) {
statistics.StatsSetTotal(settings.DatabaseSettings.Count)
statistics.StatsSetTotal(int(settings.DatabaseSettings.Count))

if settings.EnableProfile {
go func() {
llog.Infoln(http.ListenAndServe("localhost:6060", nil))
}()
}

if settings.TestSettings.UseCloudStroppy && settings.TestSettings.RunAsPod {
llog.Fatalf("--use-cloud-stroppy and --run-as-pod flags specified at the same time")
}

if settings.Local && settings.TestSettings.RunAsPod {
llog.Fatalf("--local and --run-as-pod flags specified at the same time")
}

if settings.TestSettings.UseCloudStroppy {
if settings.TestSettings.IsController() { //nolint
sh, err := deployment.LoadState(settings)
if err != nil {
llog.Fatalf("deployment load state failed: %v", err)
Expand All @@ -62,7 +54,7 @@ func newPopCommand(settings *config.Settings) *cobra.Command {
}

if err = dbPayload.Connect(); err != nil {
llog.Fatalf("failed to connec to to cluster: %v", err)
llog.Fatalf("failed to connect to cluster: %v", err)
}

err = dbPayload.StartStatisticsCollect(settings.DatabaseSettings.StatInterval)
Expand All @@ -86,16 +78,11 @@ func newPopCommand(settings *config.Settings) *cobra.Command {
},
}

popCmd.PersistentFlags().IntVarP(&settings.DatabaseSettings.Count,
popCmd.PersistentFlags().Uint64VarP(&settings.DatabaseSettings.Count,
"count", "n",
settings.DatabaseSettings.Count,
"Number of accounts to create")

popCmd.PersistentFlags().BoolVarP(&settings.TestSettings.RunAsPod,
"run-as-pod", "",
false,
"run stroppy as in pod statement")

popCmd.PersistentFlags().StringVarP(&settings.TestSettings.KubernetesMasterAddress,
"kube-master-addr", "k",
settings.TestSettings.KubernetesMasterAddress,
Expand All @@ -106,5 +93,12 @@ func newPopCommand(settings *config.Settings) *cobra.Command {
false,
"Use to populate accounts in sharded MongoDB cluster. Default false - populate accounts in MongoDB replicasets cluster")

popCmd.PersistentFlags().StringVarP(
&settings.TestSettings.RunType,
"run-type", "",
"controller",
"set troppy run type [controller, client, or local]",
)

return popCmd
}
22 changes: 8 additions & 14 deletions cmd/stroppy/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
func Execute() {
settings := config.DefaultSettings()
dbSettings := settings.DatabaseSettings
statistics.StatsSetTotal(dbSettings.Count)
statistics.StatsSetTotal(int(dbSettings.Count))

rootCmd := &cobra.Command{
Use: "stroppy [pop|pay|deploy|shell]",
Expand Down Expand Up @@ -45,10 +45,6 @@ bandwidth along the way.`,
settings.UseChaos,
"install and run chaos-mesh on target cluster")

rootCmd.PersistentFlags().BoolVar(&settings.Local, "local",
settings.Local,
"operate with local cluster")

rootCmd.PersistentFlags().StringVarP(&settings.ChaosParameter,
"chaos-parameter", "c",
settings.ChaosParameter, "specify chaos parameter of an free form")
Expand Down Expand Up @@ -96,24 +92,22 @@ than we saved during DB population process (that is achieved if brm > 1).
The recommended range of brm is from 1.01 to 1.1.
The default value of banRangeMultipluer is 1.1.`)

rootCmd.PersistentFlags().IntVarP(&settings.DatabaseSettings.Workers,
"workers", "w",
rootCmd.PersistentFlags().Uint64VarP(&settings.DatabaseSettings.Workers,
"workers",
"w",
settings.DatabaseSettings.Workers,
"Number of workers, 4 * NumCPU if not set.")

rootCmd.PersistentFlags().DurationVarP(&settings.DatabaseSettings.StatInterval,
"stat-interval", "s",
settings.DatabaseSettings.StatInterval,
"interval by seconds for gettings db stats. Only fdb yet.")
rootCmd.PersistentFlags().IntVar(&settings.DatabaseSettings.ConnectPoolSize,
rootCmd.PersistentFlags().Uint64Var(
&settings.DatabaseSettings.ConnectPoolSize,
"pool-size",
settings.DatabaseSettings.ConnectPoolSize,
"count of connection in db pool. Equal workers count by default.")

rootCmd.PersistentFlags().BoolVarP(&settings.TestSettings.UseCloudStroppy,
"enable-profilier", "",
false,
"specify to use pprof for diagnostic")
"count of connection in db pool. Equal workers count by default.",
)

rootCmd.AddCommand(newPopCommand(settings),
newPayCommand(settings),
Expand Down
Loading