diff --git a/lotus-soup/compositions/composition-natural-k8s.toml b/lotus-soup/compositions/composition-natural-k8s.toml new file mode 100644 index 000000000..465811f1a --- /dev/null +++ b/lotus-soup/compositions/composition-natural-k8s.toml @@ -0,0 +1,81 @@ +[metadata] + name = "lotus-soup" + author = "" + +[global] + plan = "lotus-soup" + case = "deals-e2e" + total_instances = 9 + builder = "docker:go" + runner = "cluster:k8s" + +[global.build] + selectors = ["testground"] + +[global.build_config] + push_registry=true + go_proxy_mode="remote" + go_proxy_url="http://localhost:8081" + registry_type="aws" + +[global.run_config] + exposed_ports = ["6060", "1234", "2345"] + +[global.run.test_params] + clients = "3" + miners = "5" + genesis_timestamp_offset = "0" + balance = "2000000000" + random_beacon_type = "mock" + +[[groups]] + id = "bootstrapper" + [groups.resources] + memory = "1024Mi" + cpu = "1000m" + [groups.instances] + count = 1 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "bootstrapper" + +[[groups]] + id = "miners-big" + [groups.resources] + memory = "3096Mi" + cpu = "1000m" + [groups.instances] + count = 2 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "miner" + mining_mode = "natural" + sectors = "8" + +[[groups]] + id = "miners-small" + [groups.resources] + memory = "3096Mi" + cpu = "1000m" + [groups.instances] + count = 3 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "miner" + mining_mode = "natural" + sectors = "6" + +[[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-natural.toml b/lotus-soup/compositions/composition-natural.toml index 36e8908bd..3a7a56e94 100644 --- a/lotus-soup/compositions/composition-natural.toml +++ b/lotus-soup/compositions/composition-natural.toml @@ -5,7 +5,7 @@ [global] plan = "lotus-soup" case = "deals-e2e" - total_instances = 6 + total_instances = 9 builder = "docker:go" runner = "local:docker" @@ -15,9 +15,8 @@ [global.run.test_params] clients = "3" miners = "2" - genesis_timestamp_offset = "100000" + genesis_timestamp_offset = "0" balance = "2000000000" - sectors = "10" random_beacon_type = "mock" [[groups]] @@ -30,7 +29,7 @@ role = "bootstrapper" [[groups]] - id = "miners" + id = "miners-big" [groups.instances] count = 2 percentage = 0.0 @@ -38,6 +37,18 @@ [groups.run.test_params] role = "miner" mining_mode = "natural" + sectors = "8" + +[[groups]] + id = "miners-small" + [groups.instances] + count = 3 + percentage = 0.0 + [groups.run] + [groups.run.test_params] + role = "miner" + mining_mode = "natural" + sectors = "6" [[groups]] id = "clients" diff --git a/lotus-soup/go.mod b/lotus-soup/go.mod index ee5c85140..0703376df 100644 --- a/lotus-soup/go.mod +++ b/lotus-soup/go.mod @@ -6,11 +6,11 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/drand/drand v0.9.2-0.20200616080806-a94e9c1636a4 github.com/filecoin-project/go-address v0.0.2-0.20200504173055-8b6f2fb2b3ef - github.com/filecoin-project/go-fil-markets v0.3.1 + github.com/filecoin-project/go-fil-markets v0.3.2-0.20200702145639-4034a18364e4 github.com/filecoin-project/go-jsonrpc v0.1.1-0.20200602181149-522144ab4e24 github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b - github.com/filecoin-project/lotus v0.4.1-0.20200701153027-70d83784046b - github.com/filecoin-project/specs-actors v0.6.2-0.20200617175406-de392ca14121 + github.com/filecoin-project/lotus v0.4.2-0.20200703175215-fe49bcd9faa7 + github.com/filecoin-project/specs-actors v0.6.2-0.20200702170846-2cd72643a5cf github.com/gorilla/mux v1.7.4 github.com/influxdata/influxdb v1.8.0 // indirect github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d diff --git a/lotus-soup/go.sum b/lotus-soup/go.sum index 5a58be51d..781a5ae7c 100644 --- a/lotus-soup/go.sum +++ b/lotus-soup/go.sum @@ -242,6 +242,8 @@ github.com/filecoin-project/go-fil-commcid v0.0.0-20200208005934-2b8bd03caca5 h1 github.com/filecoin-project/go-fil-commcid v0.0.0-20200208005934-2b8bd03caca5/go.mod h1:JbkIgFF/Z9BDlvrJO1FuKkaWsH673/UdFaiVS6uIHlA= github.com/filecoin-project/go-fil-markets v0.3.1 h1:YLH4ck4hQrKBpQ3fo0VcA2SXqiAosizxBJ/QHYgR9aE= github.com/filecoin-project/go-fil-markets v0.3.1/go.mod h1:UY+/zwNXHN73HcrN6HxNDpv6KKM6ehqfCuE9vK9khF8= +github.com/filecoin-project/go-fil-markets v0.3.2-0.20200702145639-4034a18364e4 h1:VqNmKGy4/ryzo/TqevSa1kancc3hSdws7sl/NCTZzT0= +github.com/filecoin-project/go-fil-markets v0.3.2-0.20200702145639-4034a18364e4/go.mod h1:UY+/zwNXHN73HcrN6HxNDpv6KKM6ehqfCuE9vK9khF8= github.com/filecoin-project/go-jsonrpc v0.1.1-0.20200602181149-522144ab4e24 h1:Jc7vkplmZYVuaEcSXGHDwefvZIdoyyaoGDLqSr8Svms= github.com/filecoin-project/go-jsonrpc v0.1.1-0.20200602181149-522144ab4e24/go.mod h1:j6zV//WXIIY5kky873Q3iIKt/ViOE8rcijovmpxrXzM= github.com/filecoin-project/go-padreader v0.0.0-20200210211231-548257017ca6 h1:92PET+sx1Hb4W/8CgFwGuxaKbttwY+UNspYZTvXY0vs= @@ -259,6 +261,8 @@ github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b/go.mod h1:Q0GQOBtKf1oE10eSXSlhN45kDBdGvEcVOqMiffqX+N8= github.com/filecoin-project/lotus v0.4.1-0.20200701153027-70d83784046b h1:5B4Sabzrk8lH+AD/yTUrL9yJT4AemAEtRJMHrciA7bk= github.com/filecoin-project/lotus v0.4.1-0.20200701153027-70d83784046b/go.mod h1:hqGdmSDzUWfhss1qBHot1Yi35AHFFJ6NVuFVZJLKW1M= +github.com/filecoin-project/lotus v0.4.2-0.20200703175215-fe49bcd9faa7 h1:jWU2NK9yHMYIX9LRbtdsw28P8lNwpsmcuq9m+Ekpm0I= +github.com/filecoin-project/lotus v0.4.2-0.20200703175215-fe49bcd9faa7/go.mod h1:uo3yDPhPlpHwdCKr0k41/a205WwlSclQamx+sQDKRMI= github.com/filecoin-project/sector-storage v0.0.0-20200615154852-728a47ab99d6/go.mod h1:M59QnAeA/oV+Z8oHFLoNpGMv0LZ8Rll+vHVXX7GirPM= github.com/filecoin-project/sector-storage v0.0.0-20200625154333-98ef8e4ef246/go.mod h1:8f0hWDzzIi1hKs4IVKH9RnDsO4LEHVz8BNat0okDOuY= github.com/filecoin-project/sector-storage v0.0.0-20200630180318-4c1968f62a8f h1:EHKqNJNIcYggqfrd5nu7SV1KR93ReZygfdSV0w/jefQ= @@ -269,6 +273,10 @@ github.com/filecoin-project/specs-actors v0.6.0/go.mod h1:dRdy3cURykh2R8O/DKqy8o github.com/filecoin-project/specs-actors v0.6.1/go.mod h1:dRdy3cURykh2R8O/DKqy8olScl70rmIS7GrB4hB1IDY= github.com/filecoin-project/specs-actors v0.6.2-0.20200617175406-de392ca14121 h1:oRA+b4iN4H86xXDXbU3TOyvmBZp7//c5VqTc0oJ6nLg= github.com/filecoin-project/specs-actors v0.6.2-0.20200617175406-de392ca14121/go.mod h1:dRdy3cURykh2R8O/DKqy8olScl70rmIS7GrB4hB1IDY= +github.com/filecoin-project/specs-actors v0.6.2-0.20200702133233-d2058ba8282b h1:EHIfoAK5HR/uHbWTqu6kLmxqNhZ2+ljzcDXQcJ4QLDU= +github.com/filecoin-project/specs-actors v0.6.2-0.20200702133233-d2058ba8282b/go.mod h1:dRdy3cURykh2R8O/DKqy8olScl70rmIS7GrB4hB1IDY= +github.com/filecoin-project/specs-actors v0.6.2-0.20200702170846-2cd72643a5cf h1:2ERozAZteHYef3tVLVJRepzYieLtJdxvfXNUel19CeU= +github.com/filecoin-project/specs-actors v0.6.2-0.20200702170846-2cd72643a5cf/go.mod h1:dRdy3cURykh2R8O/DKqy8olScl70rmIS7GrB4hB1IDY= github.com/filecoin-project/specs-storage v0.1.0/go.mod h1:Pr5ntAaxsh+sLG/LYiL4tKzvA83Vk5vLODYhfNwOg7k= github.com/filecoin-project/specs-storage v0.1.1-0.20200622113353-88a9704877ea h1:iixjULRQFPn7Q9KlIqfwLJnlAXO10bbkI+xy5GKGdLY= github.com/filecoin-project/specs-storage v0.1.1-0.20200622113353-88a9704877ea/go.mod h1:Pr5ntAaxsh+sLG/LYiL4tKzvA83Vk5vLODYhfNwOg7k= diff --git a/lotus-soup/main.go b/lotus-soup/main.go index 9efd0f95d..d69285a1d 100644 --- a/lotus-soup/main.go +++ b/lotus-soup/main.go @@ -15,7 +15,7 @@ import ( ) var cases = map[string]interface{}{ - "deals-e2e": testkit.WrapTestEnvironment(dealsE2E), + "deals-e2e": testkit.WrapTestEnvironment(dealsE2E), "drand-halting": testkit.WrapTestEnvironment(dealsE2E), } @@ -59,7 +59,7 @@ func dealsE2E(t *testkit.TestEnvironment) error { client := cl.FullApi // select a random miner - minerAddr := cl.MinerAddrs[rand.Intn(len(cl.MinerAddrs))] + minerAddr := cl.MinerAddrs[t.InitContext.GroupSeq-1] if err := client.NetConnect(ctx, minerAddr.PeerAddr); err != nil { return err } diff --git a/lotus-soup/manifest.toml b/lotus-soup/manifest.toml index d43c42627..14531c6b5 100644 --- a/lotus-soup/manifest.toml +++ b/lotus-soup/manifest.toml @@ -8,7 +8,7 @@ runner = "local:docker" [builders."docker:go"] enabled = true build_base_image = "iptestground/oni-buildbase:v3" -runtime_image = "iptestground/oni-runtime:v2" +runtime_image = "iptestground/oni-runtime:v2-debug" [runners."local:docker"] enabled = true diff --git a/lotus-soup/testkit/node.go b/lotus-soup/testkit/node.go index 83427a1a3..de57e0444 100644 --- a/lotus-soup/testkit/node.go +++ b/lotus-soup/testkit/node.go @@ -25,6 +25,8 @@ import ( logging "github.com/ipfs/go-log/v2" influxdb "github.com/kpacha/opencensus-influxdb" + stats "github.com/filecoin-project/lotus/tools/stats" + "github.com/libp2p/go-libp2p-core/peer" manet "github.com/multiformats/go-multiaddr-net" "go.opencensus.io/stats" @@ -38,6 +40,8 @@ func init() { build.InsecurePoStValidation = true build.DisableBuiltinAssets = true + build.BlockDelaySecs = 1 + build.PropagationDelaySecs = 2 power.ConsensusMinerMinPower = big.NewInt(2048) saminer.SupportedProofTypes = map[abi.RegisteredSealProof]struct{}{ @@ -247,3 +251,26 @@ func registerAndExportMetrics(instanceName string) { view.RegisterExporter(e) view.SetReportingPeriod(5 * time.Second) } + +func collectStats(ctx context.Context, api api.FullNode) error { + var database string = "testground" + var headlag int = 3 + + influxAddr := os.Getenv("INFLUXDB_URL") + influxUser := "" + influxPass := "" + + influx, err := stats.InfluxClient(influxAddr, influxUser, influxPass) + if err != nil { + return err + } + + height, err := stats.GetLastRecordedHeight(influx, database) + if err != nil { + return err + } + + go stats.Collect(ctx, api, influx, database, height, headlag) + + return nil +} diff --git a/lotus-soup/testkit/role_client.go b/lotus-soup/testkit/role_client.go index 398edd6e7..fe41e5117 100644 --- a/lotus-soup/testkit/role_client.go +++ b/lotus-soup/testkit/role_client.go @@ -14,8 +14,6 @@ import ( "github.com/filecoin-project/lotus/node/repo" "github.com/filecoin-project/specs-actors/actors/crypto" - - tstats "github.com/filecoin-project/oni/lotus-soup/stats" ) type LotusClient struct { @@ -92,9 +90,6 @@ func PrepareClient(t *TestEnvironment) (*LotusClient, error) { registerAndExportMetrics(fmt.Sprintf("client_%d", t.GroupSeq)) - // collect stats based on Travis' scripts - go tstats.Collect(n.FullApi) - t.RecordMessage("publish our address to the clients addr topic") addrinfo, err := n.FullApi.NetAddrsListen(ctx) if err != nil { diff --git a/lotus-soup/testkit/role_miner.go b/lotus-soup/testkit/role_miner.go index 8f3abca44..066e159f4 100644 --- a/lotus-soup/testkit/role_miner.go +++ b/lotus-soup/testkit/role_miner.go @@ -6,6 +6,7 @@ import ( "fmt" "io/ioutil" "net/http" + "time" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-jsonrpc" @@ -33,8 +34,6 @@ import ( libp2pcrypto "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/peer" "github.com/testground/sdk-go/sync" - - tstats "github.com/filecoin-project/oni/lotus-soup/stats" ) type LotusMiner struct { @@ -230,7 +229,9 @@ func PrepareMiner(t *TestEnvironment) (*LotusMiner, error) { registerAndExportMetrics(minerAddr.String()) // collect stats based on Travis' scripts - go tstats.Collect(n.FullApi) + if t.InitContext.GroupSeq == 1 { + go collectStats(n.FullApi) + } // Bootstrap with full node remoteAddrs, err := n.FullApi.NetAddrsListen(ctx) @@ -379,6 +380,8 @@ func (m *LotusMiner) RunDefault() error { return err } + time.Sleep(3600 * time.Second) + mine = false <-done