Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd: create cluster cleanup #2392

Merged
merged 7 commits into from
Jul 5, 2023
Merged

Conversation

gsora
Copy link
Collaborator

@gsora gsora commented Jul 3, 2023

  • removed --clean subcommand in favor of explicit error messages
  • removed default for --nodes
  • removed default for --network
  • the default cluster dir is now the current working directory

Closes #2302.

category: refactor
ticket: #2302

- removed `--clean` subcommand in favor of explicit error messages
- removed default for `--nodes`
- removed default for `--network`
- the default cluster dir is now the current working directory
@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Patch coverage: 67.34% and project coverage change: -0.29 ⚠️

Comparison is base (fef2ac7) 53.65% compared to head (fb4f902) 53.37%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2392      +/-   ##
==========================================
- Coverage   53.65%   53.37%   -0.29%     
==========================================
  Files         192      196       +4     
  Lines       25990    26254     +264     
==========================================
+ Hits        13946    14012      +66     
- Misses      10318    10505     +187     
- Partials     1726     1737      +11     
Impacted Files Coverage Δ
cmd/createcluster.go 60.29% <65.95%> (+0.56%) ⬆️
cmd/createdkg.go 72.58% <100.00%> (ø)

... and 13 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

cmd/createcluster.go Outdated Show resolved Hide resolved
Co-authored-by: Abhishek Kumar <43061995+xenowits@users.noreply.github.com>
} else if _, err = os.Stat(path.Join(nodeDir(conf.ClusterDir, 0), "cluster-lock.json")); err == nil {
return errors.New("existing cluster found. Try again with --clean")

if conf.NumNodes == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

we can also use wrapPreRunE function to do these config validations like we are using in other commands, WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mmmh I can do that, but it requires refactoring the tests quite a bit because right now we're calling the runCreateCluster straight away.

@corverroos do you think it's worth?

Copy link
Contributor

Choose a reason for hiding this comment

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

Important thing is that this is tested.

Don't mind adding this in the command itself, what about extracting a verifyConfig and calling that here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I can extract config checks in verifyConfig.

Important thing is that this is tested.

It is, I added test cases specifically to test configuration verification.

cmd/createcluster.go Outdated Show resolved Hide resolved
} else if _, err = os.Stat(path.Join(nodeDir(conf.ClusterDir, 0), "cluster-lock.json")); err == nil {
return errors.New("existing cluster found. Try again with --clean")

if conf.NumNodes == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Important thing is that this is tested.

Don't mind adding this in the command itself, what about extracting a verifyConfig and calling that here?

@gsora gsora requested review from corverroos and xenowits July 4, 2023 12:07
cmd/createcluster.go Outdated Show resolved Hide resolved
Co-authored-by: Abhishek Kumar <43061995+xenowits@users.noreply.github.com>
cmd/createcluster.go Outdated Show resolved Hide resolved
@gsora gsora added the merge when ready Indicates bulldozer bot may merge when all checks pass label Jul 5, 2023
@obol-bulldozer obol-bulldozer bot merged commit 268107c into main Jul 5, 2023
12 checks passed
@obol-bulldozer obol-bulldozer bot deleted the gsora/cleanup_create_cluster branch July 5, 2023 09:44
gsora added a commit to ObolNetwork/obol-docs that referenced this pull request Jul 12, 2023
gsora added a commit to ObolNetwork/charon-distributed-validator-cluster that referenced this pull request Jul 12, 2023
v0.17.0 will change how `charon create cluster` works, so update the
relevant mentions here to reflect the changes.

See PR ObolNetwork/charon#2392.
gsora added a commit to ObolNetwork/obol-docs that referenced this pull request Jul 27, 2023
OisinKyne added a commit to ObolNetwork/charon-distributed-validator-cluster that referenced this pull request Aug 22, 2023
* update docker-compose.yml and README.md for v0.17.0

v0.17.0 will change how `charon create cluster` works, so update the
relevant mentions here to reflect the changes.

See PR ObolNetwork/charon#2392.

* update charon version

* Make new create cluster output the same as the old structure so people can continue to upgrade until we have a deprecation path for this repo

* Remove most of the readme and add warnings

* Missed an important '.'

* Add back in sample

---------

Co-authored-by: Oisín Kyne <oisin@obol.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the folder output structure from create cluster compatible with charon run defaults
4 participants