From f91364fb3e319c05c1a2bda1f05fbb1f07709c7d Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Fri, 26 Jun 2020 15:24:01 +0200 Subject: [PATCH] extract common vars --- lotus-soup/baseline.go | 2 + .../compositions/composition-k8s-3-1.toml | 59 +++++++++++++++++++ .../compositions/composition-k8s-3-2.toml | 59 +++++++++++++++++++ lotus-soup/compositions/composition-k8s.toml | 19 +++--- lotus-soup/manifest.toml | 2 + lotus-soup/node.go | 4 +- 6 files changed, 131 insertions(+), 14 deletions(-) create mode 100644 lotus-soup/compositions/composition-k8s-3-1.toml create mode 100644 lotus-soup/compositions/composition-k8s-3-2.toml diff --git a/lotus-soup/baseline.go b/lotus-soup/baseline.go index 6349c79e5..3893a7f88 100644 --- a/lotus-soup/baseline.go +++ b/lotus-soup/baseline.go @@ -117,6 +117,8 @@ func runBaselineClient(t *TestEnvironment) error { t.SyncClient.MustSignalEntry(ctx, stateStopMining) + time.Sleep(10 * time.Second) // wait for metrics to be emitted + // TODO broadcast published content CIDs to other clients // TODO select a random piece of content published by some other client and retrieve it diff --git a/lotus-soup/compositions/composition-k8s-3-1.toml b/lotus-soup/compositions/composition-k8s-3-1.toml new file mode 100644 index 000000000..a4fb82ce2 --- /dev/null +++ b/lotus-soup/compositions/composition-k8s-3-1.toml @@ -0,0 +1,59 @@ +[metadata] + name = "lotus-soup" + author = "" + +[global] + plan = "lotus-soup" + case = "lotus-baseline" + total_instances = 5 + builder = "docker:go" + runner = "cluster:k8s" + +[global.build_config] + push_registry=true + go_proxy_mode="remote" + go_proxy_url="http://localhost:8081" + registry_type="aws" + +[global.run.test_params] + clients = "3" + miners = "1" + genesis_timestamp_offset = "100000" + balance = "2000" + sectors = "10" + +[[groups]] + id = "bootstrapper" + [groups.resources] + memory = "512Mi" + cpu = "1000m" + [groups.instances] + count = 1 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "bootstrapper" + +[[groups]] + id = "miners" + [groups.resources] + memory = "4096Mi" + cpu = "1000m" + [groups.instances] + count = 1 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "miner" + +[[groups]] + id = "clients" + [groups.resources] + memory = "1024Mi" + cpu = "1000m" + [groups.instances] + count = 3 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "client" diff --git a/lotus-soup/compositions/composition-k8s-3-2.toml b/lotus-soup/compositions/composition-k8s-3-2.toml new file mode 100644 index 000000000..b0c7f3c74 --- /dev/null +++ b/lotus-soup/compositions/composition-k8s-3-2.toml @@ -0,0 +1,59 @@ +[metadata] + name = "lotus-soup" + author = "" + +[global] + plan = "lotus-soup" + case = "lotus-baseline" + total_instances = 6 + builder = "docker:go" + runner = "cluster:k8s" + +[global.build_config] + push_registry=true + go_proxy_mode="remote" + go_proxy_url="http://localhost:8081" + registry_type="aws" + +[global.run.test_params] + clients = "3" + miners = "2" + genesis_timestamp_offset = "100000" + balance = "2000" + sectors = "10" + +[[groups]] + id = "bootstrapper" + [groups.resources] + memory = "512Mi" + cpu = "1000m" + [groups.instances] + count = 1 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "bootstrapper" + +[[groups]] + id = "miners" + [groups.resources] + memory = "4096Mi" + cpu = "1000m" + [groups.instances] + count = 2 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "miner" + +[[groups]] + id = "clients" + [groups.resources] + memory = "1024Mi" + cpu = "1000m" + [groups.instances] + count = 3 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "client" diff --git a/lotus-soup/compositions/composition-k8s.toml b/lotus-soup/compositions/composition-k8s.toml index a9ff7d0f5..b4e2d563e 100644 --- a/lotus-soup/compositions/composition-k8s.toml +++ b/lotus-soup/compositions/composition-k8s.toml @@ -15,6 +15,13 @@ go_proxy_url="http://localhost:8081" registry_type="aws" +[global.run.test_params] + clients = "1" + miners = "1" + genesis_timestamp_offset = "100000" + balance = "2000" + sectors = "10" + [[groups]] id = "bootstrapper" [groups.resources] @@ -26,10 +33,6 @@ [groups.run] [groups.run.test_params] role = "bootstrapper" - clients = "1" - miners = "1" - balance = "2000" - sectors = "10" [[groups]] id = "miners" @@ -42,10 +45,6 @@ [groups.run] [groups.run.test_params] role = "miner" - clients = "1" - miners = "1" - balance = "2000" - sectors = "10" [[groups]] id = "clients" @@ -58,7 +57,3 @@ [groups.run] [groups.run.test_params] role = "client" - clients = "1" - miners = "1" - balance = "2000" - sectors = "10" diff --git a/lotus-soup/manifest.toml b/lotus-soup/manifest.toml index f33fdd645..2ee118523 100644 --- a/lotus-soup/manifest.toml +++ b/lotus-soup/manifest.toml @@ -27,6 +27,8 @@ instances = { min = 1, max = 100, default = 5 } sectors = { type = "int", default = 1 } role = { type = "string" } + genesis_timestamp_offset = { type = "int", default = 0 } + random_beacon_type = { type = "enum", default = "mock", options = ["mock", "local-drand", "external-drand"] } # Params relevant to drand nodes. drand nodes should have role="drand", and must all be diff --git a/lotus-soup/node.go b/lotus-soup/node.go index 6bdd30ebc..0375d545b 100644 --- a/lotus-soup/node.go +++ b/lotus-soup/node.go @@ -51,7 +51,7 @@ import ( ) func init() { - logging.SetLogLevel("*", "WARN") + logging.SetLogLevel("*", "ERROR") os.Setenv("BELLMAN_NO_GPU", "1") @@ -176,7 +176,7 @@ func prepareBootstrapper(t *TestEnvironment) (*Node, error) { genesisTemplate := genesis.Template{ Accounts: genesisActors, Miners: genesisMiners, - Timestamp: uint64(time.Now().Unix() - 100000), // this needs to be in the past + Timestamp: uint64(time.Now().Unix()) - uint64(t.IntParam("genesis_timestamp_offset")), // this needs to be in the past } // dump the genesis block