From 2f7bb14d1d4b1e11129109d3ec2386d004ffb8af Mon Sep 17 00:00:00 2001 From: Mission Liao Date: Wed, 22 Aug 2018 14:00:04 +0800 Subject: simulation: allow to run simulation with scheduler on k8s (#72) To run a simulation with scheduler on k8s: ./run_scheduler.sh 61 5 Where *61* means the simulation contains 61 validators, and *5* means the simulation utilizes 5 vCPUs and corresponding concurrent workers to run. --- simulation/config/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'simulation/config') diff --git a/simulation/config/config.go b/simulation/config/config.go index cb67411..fe91881 100644 --- a/simulation/config/config.go +++ b/simulation/config/config.go @@ -59,11 +59,17 @@ type Networking struct { LossRateValue float64 } +// Scheduler Settings. +type Scheduler struct { + WorkerNum int +} + // Config represents the configuration for simulation. type Config struct { Title string Validator Validator Networking Networking + Scheduler Scheduler } // GenerateDefault generates a default configuration file. @@ -93,6 +99,9 @@ func GenerateDefault(path string) error { Sigma: 10, LossRateValue: 0, }, + Scheduler: Scheduler{ + WorkerNum: 2, + }, } if err := toml.NewEncoder(f).Encode(&config); err != nil { -- cgit v1.2.3