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

testutil/compose: add lock command #570

Merged
merged 1 commit into from
May 21, 2022
Merged

Conversation

corverroos
Copy link
Contributor

Adds the first version of the lock command that creates a docker-compose file to run charon create cluster to generate keys and cluster lock file.

category: feature
ticket: #568

@codecov
Copy link

codecov bot commented May 20, 2022

Codecov Report

Merging #570 (43ae0fa) into main (0bfa40b) will decrease coverage by 0.22%.
The diff coverage is 56.52%.

@@            Coverage Diff             @@
##             main     #570      +/-   ##
==========================================
- Coverage   54.39%   54.16%   -0.23%     
==========================================
  Files          92       94       +2     
  Lines        8496     8716     +220     
==========================================
+ Hits         4621     4721     +100     
- Misses       3243     3320      +77     
- Partials      632      675      +43     
Impacted Files Coverage Δ
testutil/compose/template.go 43.75% <43.75%> (ø)
testutil/compose/lock.go 51.92% <51.92%> (ø)
testutil/compose/define.go 59.01% <73.91%> (+3.91%) ⬆️
testutil/compose/config.go 100.00% <100.00%> (ø)
core/qbft/qbft.go 71.45% <0.00%> (-10.68%) ⬇️
dkg/exchanger.go 80.95% <0.00%> (ø)
dkg/disk.go 44.26% <0.00%> (+3.72%) ⬆️
dkg/dkg.go 53.58% <0.00%> (+12.20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0bfa40b...43ae0fa. Read the comment docs.

return nil
}

func newDefaultConfig(seed int) (config, []*ecdsa.PrivateKey) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

extracted function

Comment on lines +1 to +22
version: "3.8"

x-node-base: &node-base
image: ghcr.io/obolnetwork/charon:latest
entrypoint: /usr/local/bin/charon
command: [create,cluster]
networks: [compose]
volumes: [testdir:/compose]


services:

node0:
<<: *node-base
environment:
CHARON_THRESHOLD: 3
CHARON_NODES: 4
CHARON_CLUSTER_DIR: /compose


networks:
compose:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the resulting docker-compose to run charon create cluster

Copy link
Contributor

@dB2510 dB2510 left a comment

Choose a reason for hiding this comment

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

LGTM

x-node-base: &node-base
image: ghcr.io/obolnetwork/charon:latest
entrypoint: /usr/local/bin/charon
command: [create,cluster]
Copy link
Contributor

Choose a reason for hiding this comment

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

is this means space separated command names?
like charon create dkg would be [create, dkg]?

Copy link
Contributor Author

@corverroos corverroos May 21, 2022

Choose a reason for hiding this comment

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

yeah, otherwise it is a single argument: charon create cluster vs charon 'create cluster'

}
}
// nodeFile returns the path to a file in a node folder.
func nodeFile(dir string, i int, file string) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

why a separate function for just one line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

easier to read, and used in many places

@corverroos corverroos added the merge when ready Indicates bulldozer bot may merge when all checks pass label May 21, 2022
@obol-bulldozer obol-bulldozer bot merged commit ac67cd8 into main May 21, 2022
@obol-bulldozer obol-bulldozer bot deleted the corver/composelock branch May 21, 2022 09:41
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.

None yet

2 participants