Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
69c1e64
Following testing convention in TestOrchestration
AlanRostem Jan 16, 2025
72e1489
fix(internal/test): skip the / separator for the first field
meling Jan 16, 2025
ea7f464
Fixed hosts param compatibility issue with cue and cli
AlanRostem Jan 16, 2025
5c50b50
Fix replica and client hosts through cli
AlanRostem Jan 16, 2025
fd7bcfb
Fix lint error.
AlanRostem Jan 16, 2025
07cc233
All config values in HostsConfig
AlanRostem Jan 16, 2025
3bde00b
Merge branch 'cue-cli-compat-fixes' into 168-simplify-cfg-handling
AlanRostem Jan 16, 2025
1de1066
Merge conflict resovled.
AlanRostem Jan 16, 2025
b33c361
Merge fix and viper config works now
AlanRostem Jan 16, 2025
59b924c
Further cleanup on TestOrchestration
AlanRostem Jan 16, 2025
6c465db
Merge branch '159-testorchestration-cleanup' of github.com:relab/hots…
AlanRostem Jan 16, 2025
32a55d4
Merge branch '159-testorchestration-cleanup' into 168-simplify-cfg-ha…
AlanRostem Jan 16, 2025
450652f
Integrated changes with TestOrchestration. One test fails: TestOrches…
AlanRostem Jan 16, 2025
5c5e9bd
Bugfix: byzantine test case had zero replicas
AlanRostem Jan 17, 2025
7af1eb9
Remove redundant makeClientOpts
AlanRostem Jan 17, 2025
049c655
Test fixes and code cleanup
AlanRostem Jan 17, 2025
bcf4297
Doc cleanup and testDeployment potential fix
AlanRostem Jan 17, 2025
0813db4
chore(config): reorganized the placement within config.go
meling Jan 20, 2025
5f6c877
chore(go.mod): upgraded to recent iago fix
meling Jan 20, 2025
8973bf0
chore(cli): removed a useless err def and some blank lines
meling Jan 20, 2025
5368cf3
chore(orchestration): just some compacting
meling Jan 20, 2025
71f708f
chore: remove commented code, decouple tree position rand
AlanRostem Jan 21, 2025
ce39f95
fix(tree): rename tree.Randomize to Shuffle, use math/rand/v2 pkg
meling Jan 21, 2025
0e9e7b7
chore(config): minor reorganization of viper exp config gen
meling Jan 21, 2025
ca15d8c
chore(orchestration): minor tidying
meling Jan 21, 2025
e2bbe50
bugfix(orchestration): UseTLS was set to true by default, but was not…
AlanRostem Jan 23, 2025
1bfdf62
fix(orchestration): replace string byzantine w/map[string][]uint32
meling Jan 23, 2025
3794e32
fix(orchestration): typo: silent -> silence as byz strategy
meling Jan 23, 2025
d92b030
chore(config): add documentation to ExperimentConfig struct fields.
AlanRostem Jan 24, 2025
ec8f575
Merge branch '168-simplify-cfg-handling' of github.com:relab/hotstuff…
AlanRostem Jan 24, 2025
630de15
fix(config): forgot one struct field.
AlanRostem Jan 24, 2025
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ __debug_bin
/hotstuff
/plot


# other
*.in

Expand All @@ -35,3 +34,5 @@ measurements.json
*.pdf

twins.json
internal/tree/benchmarkdata/*
eventloop/benchmarkdata/*
1 change: 1 addition & 0 deletions .vscode/dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ anypb
Bano
Baudet
bbchain
benchmarkdata
BFT's
Bitfield
bitmask
Expand Down
5 changes: 3 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"program": "${workspaceRoot}/cmd/hotstuff/main.go",
"cwd": "${workspaceRoot}",
"args": [
"run"
"run",
"--cue=scripts/local_config.cue"
]
},
{
Expand Down Expand Up @@ -55,4 +56,4 @@
"host": "127.0.0.1"
}
]
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/mitchellh/go-homedir v1.1.0
github.com/mroth/weightedrand v1.0.0
github.com/relab/gorums v0.7.1-0.20220818130557-8533cb369cd6
github.com/relab/iago v0.0.0-20240309193349-5be211223dec
github.com/relab/iago v0.0.0-20250112171319-2c4979b99287
github.com/relab/wrfs v0.0.0-20220416082020-a641cd350078
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ github.com/relab/gorums v0.7.1-0.20220818130557-8533cb369cd6 h1:azahqG2RhvhFvHiJ
github.com/relab/gorums v0.7.1-0.20220818130557-8533cb369cd6/go.mod h1:dS1JU8uB1QgQie2bvRPeJWWmIFLPyl5IU50YfWpYVBE=
github.com/relab/iago v0.0.0-20240309193349-5be211223dec h1:pF3HpDgnvSEm1kqShUAeYDH9mo+cWqo7/VKHsEU9ibc=
github.com/relab/iago v0.0.0-20240309193349-5be211223dec/go.mod h1:3gDmi27sJB5VKFObac3BRuojM8bgBFeRwY2vo5jhbbI=
github.com/relab/iago v0.0.0-20250112171319-2c4979b99287 h1:VqmwluYk/pXSqofd//0yeSey0BAdZG9uYwAG1naKuXo=
github.com/relab/iago v0.0.0-20250112171319-2c4979b99287/go.mod h1:5aSZQxvFPFVU9nphdi+Q8hqN9N2XkW3/roQOlYhF/Vs=
github.com/relab/wrfs v0.0.0-20220416082020-a641cd350078 h1:JN5qn8C/HZoyMAycX6z6O0SeX+09CV3w3GcVNW70OZA=
github.com/relab/wrfs v0.0.0-20220416082020-a641cd350078/go.mod h1:8BTalsvE1BexSfZZFmZfmJKqfoXPzsP/ixpVOmg7Udk=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
Expand Down
80 changes: 80 additions & 0 deletions internal/cli/flags.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package cli

import (
"math"
"time"

"github.com/spf13/cobra"
"github.com/spf13/viper"
)

// runCmd represents the run command
var runCmd = &cobra.Command{
Use: "run",
Short: "Run an experiment.",
Long: `The run command runs an experiment locally or on remote workers.
By default, a local experiment is run.
To run experiments on remote machines, you must create a 'ssh_config' file (or use ~/.ssh/config).
This should at the very least specify the identity file to use.
It is also required that the host keys for all remote machines are present in a 'known_hosts' file.
Then, you must use the '--ssh-config' parameter to specify the location of your 'ssh_config' file
(or omit it to use ~/.ssh/config). Then, you must specify the list of remote machines to connect to
using the '--host' parameter. This should be a comma separated list of hostnames or ip addresses.`,
Run: func(_ *cobra.Command, _ []string) {
runController()
},
}

func init() {
rootCmd.AddCommand(runCmd)

runCmd.Flags().Int("replicas", 4, "number of replicas to run")
runCmd.Flags().Int("clients", 1, "number of clients to run")
runCmd.Flags().Int("batch-size", 1, "number of commands to batch together in each block")
runCmd.Flags().Int("payload-size", 0, "size in bytes of the command payload")
runCmd.Flags().Int("max-concurrent", 4, "maximum number of concurrent commands per client")
runCmd.Flags().Duration("client-timeout", 500*time.Millisecond, "Client timeout.")
runCmd.Flags().Duration("duration", 10*time.Second, "duration of the experiment")
runCmd.Flags().Duration("connect-timeout", 5*time.Second, "duration of the initial connection timeout")
// need longer default timeout for the kauri
runCmd.Flags().Duration("view-timeout", 500*time.Millisecond, "duration of the first view")
runCmd.Flags().Duration("max-timeout", 0, "upper limit on view timeouts")
runCmd.Flags().Int("duration-samples", 1000, "number of previous views to consider when predicting view duration")
runCmd.Flags().Float32("timeout-multiplier", 1.2, "number to multiply the view duration by in case of a timeout")
runCmd.Flags().String("consensus", "chainedhotstuff", "name of the consensus implementation")
runCmd.Flags().String("crypto", "ecdsa", "name of the crypto implementation")
runCmd.Flags().String("leader-rotation", "round-robin", "name of the leader rotation algorithm")
runCmd.Flags().Int64("shared-seed", 0, "Shared random number generator seed")
runCmd.Flags().StringSlice("modules", nil, "Name additional modules to be loaded.")

runCmd.Flags().Bool("worker", false, "run a local worker")
runCmd.Flags().StringSlice("replica-hosts", nil, "the remote hosts to run replicas on via ssh")
runCmd.Flags().StringSlice("client-hosts", nil, "the remote hosts to run clients on via ssh")
runCmd.Flags().String("exe", "", "path to the executable to deploy and run on remote workers")
runCmd.Flags().String("ssh-config", "", "path to ssh_config file to resolve host aliases (defaults to ~/.ssh/config)")

runCmd.Flags().String("output", "", "the directory to save data and profiles to (disabled by default)")
runCmd.Flags().Bool("cpu-profile", false, "enable cpu profiling")
runCmd.Flags().Bool("mem-profile", false, "enable memory profiling")
runCmd.Flags().Bool("trace", false, "enable trace")
runCmd.Flags().Bool("fgprof-profile", false, "enable fgprof")

runCmd.Flags().StringSlice("metrics", []string{"client-latency", "throughput"}, "list of metrics to enable")
runCmd.Flags().Duration("measurement-interval", 0, "time interval between measurements")
runCmd.Flags().Float64("rate-limit", math.Inf(1), "rate limit for clients (in commands/second)")
runCmd.Flags().Float64("rate-step", 0, "rate limit step up for clients (in commands/second)")
runCmd.Flags().Duration("rate-step-interval", time.Hour, "how often the client rate limit should be increased")
runCmd.Flags().StringSlice("byzantine", nil, "byzantine strategies to use, as a comma separated list of 'name:count'")
// tree config parameter
runCmd.Flags().Int("bf", 2, "branch factor of the tree")
runCmd.Flags().IntSlice("tree-pos", []int{}, "tree positions of the replicas")
runCmd.Flags().Duration("tree-delta", 30*time.Millisecond, "waiting time for intermediate nodes in the tree")
runCmd.Flags().Bool("random-tree", false, "randomize tree positions, tree-pos is ignored if set")

runCmd.Flags().String("cue", "", "Cue-based host config")

err := viper.BindPFlags(runCmd.Flags())
if err != nil {
panic(err)
}
}
Loading
Loading