Skip to content

Conversation

@AlanRostem
Copy link
Collaborator

Previously, the --hosts cli flag was omitted when integrating Cue. Now I have introduced --client-hosts and --replica-hosts to the cli so that things can work like before and be compatible with Cue if the user chooses to.

Upon implementing this fix, I see that the choice between Cue and Viper cli configuration can be improved so I opened issue #168

Copy link
Member

@meling meling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done a quick pass on this one. It looks like this is incompatible with #170. I suggest we close this one after migrating any important updates to #170. Otherwise, it will be painful to merge either this one or #170.

return nil, err
}
opt.SetTreeOptions(e.hostCfg.BranchFactor, e.hostCfg.TreePositions, e.hostCfg.TreeDelta)
// opt.SetTreeOptions(e.hostCfg.BranchFactor, e.hostCfg.TreePositions, e.hostCfg.TreeDelta)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was deleted in #170. We should just delete it here as well since it will be compatible with #170.

numReplicas := viper.GetInt("replicas")
numClients := viper.GetInt("clients")

// Kauri values
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Tree-related values


cfgPath := viper.GetString("cue")

treeDelta := viper.GetDuration("tree-delta")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These belong together with tree values above (bf)


var cfg *config.HostConfig
if cfgPath != "" {
cfg, err = config.Load(cfgPath)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe Load was renamed in the other PR.

replicaHosts := viper.GetStringSlice("replica-hosts")
clientHosts := viper.GetStringSlice("client-hosts")

var cfg *config.HostConfig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now ExperimentConfig

}
if viper.GetBool("random-tree") {
rnd := rand.New(rand.NewSource(rand.Uint64()))
rnd.Shuffle(len(treePos), reflect.Swapper(treePos))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have tree.Shuffle() for this.

@AlanRostem AlanRostem merged commit 3bde00b into master Jan 24, 2025
4 checks passed
@meling meling deleted the cue-cli-compat-fixes branch January 24, 2025 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants