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

Cardano cluster, on-fly genesis, Chairman service & NixOS test #177

Merged
merged 7 commits into from
Sep 25, 2019

Conversation

deepfire
Copy link
Contributor

@deepfire deepfire commented Sep 6, 2019

  1. Turn the cardano-node.service into instanced set of cardano-node@NODE-ID.service, systemd-unit-wise
  2. Define a cardano-cluster target.
  3. Generate genesis on fly for the cluster.
  4. Chairman service, with a factored script generator..
  5. Chairman's cluster NixOS test.

@deepfire deepfire added the WIP Work In Progress (cannot be merged yet) label Sep 6, 2019
@deepfire deepfire changed the base branch from master to serge/cli-cleanup-further September 6, 2019 17:26
Copy link
Contributor

@disassembler disassembler left a comment

Choose a reason for hiding this comment

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

I don't see how this can be ran without having systemd. Can you please provide an example of how the scripts attribute would utilize this service?

@@ -109,7 +110,7 @@ in {

stateDir = mkOption {
type = types.str;
default = "/var/lib/cardano-node";
default = "/var/lib/cardano-node-%i";
Copy link
Contributor

Choose a reason for hiding this comment

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

lets not pollute lib. Maybe optionally if multiple instances are running, do /var/lib/cardano-node/%i

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do!

Copy link
Contributor Author

@deepfire deepfire Sep 10, 2019

Choose a reason for hiding this comment

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

Fixed -- we now have an instanced option to the NixOS service, that guides the choice of:

  1. systemd service name (if instanced is false, the service is not instanced)
  2. node id & port

@@ -27,7 +27,7 @@ in {
uid = 10016;
group = "cardano-node";
};
systemd.services.cardano-node = {
systemd.services."cardano-node@" = {
Copy link
Contributor

Choose a reason for hiding this comment

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

we should optionally do this if it's a cluster vs just a single node

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@deepfire
Copy link
Contributor Author

deepfire commented Sep 6, 2019

I don't see how this can be ran without having systemd

Absolutely, it needs systemd.

@deepfire deepfire force-pushed the serge/cardano-cluster-service branch 3 times, most recently from 466b231 to d364119 Compare September 10, 2019 17:24
@deepfire deepfire marked this pull request as ready for review September 10, 2019 17:26
@deepfire deepfire removed the WIP Work In Progress (cannot be merged yet) label Sep 10, 2019
@deepfire deepfire force-pushed the serge/cardano-cluster-service branch 3 times, most recently from 326244e to 7d998a6 Compare September 10, 2019 18:06
@disassembler
Copy link
Contributor

Breaks connect scripts:

nix-build -A scripts.mainnet.node
error: The option `services.cardano-node.port' defined in `<unknown-file>' does not exist.

Copy link
Contributor

@disassembler disassembler left a comment

Choose a reason for hiding this comment

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

Breaks the scripts.

@deepfire deepfire force-pushed the serge/cli-cleanup-further branch 7 times, most recently from 77a0555 to e17765d Compare September 11, 2019 19:43
@deepfire
Copy link
Contributor Author

deepfire commented Sep 11, 2019

Breaks the scripts.

Hmm, @disassembler, are you sure you tested the latest commit?
My apologies, I might have been pushing things yesterday in parallel..

nix-shell:~/cardano-node]$ git diff

[nix-shell:~/cardano-node]$ grev
7d998a6155cf16eecb698d8b6fbaefbe34e66591 Tue Sep 10 21:06:48 2019 +0300 cardano-cluster-service:  a flock of cardano-node@NODE-ID services

[nix-shell:~/cardano-node]$ nix-build -A scripts.mainnet.node
/nix/store/c586rsqmd211gjlxbciacax7x4k317dr-cardano-node-mainnet

[nix-shell:~/cardano-node]$ /nix/store/c586rsqmd211gjlxbciacax7x4k317dr-cardano-node-mainnet
Starting cardano-node with --node-id 0 --port 3001 --topology /nix/store/g8fb0sjaq39dbxnvv35dqcwafgvc26vx-topology.yaml --log-config /nix/store/jw29jyvvzdfdwccdc96qckwjbywva6c5-log-configuration.yaml
[iohk.cardano.node.CoreId 0:Debug:4] [2019-09-11 20:17:43.67 UTC] tracing verbosity = normal
[iohk.cardano.node.CoreId 0:Debug:4] [2019-09-11 20:17:44.14 UTC] System started at SystemStart {getSystemStart = 2017-09-23 21:44:51 UTC}

@deepfire deepfire changed the base branch from serge/cli-cleanup-further to master September 11, 2019 20:51
@deepfire deepfire force-pushed the serge/cardano-cluster-service branch 3 times, most recently from d511894 to 4764ea5 Compare September 12, 2019 16:02
@deepfire deepfire force-pushed the serge/cardano-cluster-service branch 14 times, most recently from d8e322c to b6f7d41 Compare September 23, 2019 13:56
@deepfire
Copy link
Contributor Author

bors r+

iohk-bors bot added a commit that referenced this pull request Sep 24, 2019
177: Cardano cluster, on-fly genesis, Chairman service & NixOS test r=deepfire a=deepfire

1. Turn the `cardano-node.service` into instanced set of `cardano-node@NODE-ID.service`, systemd-unit-wise
2. Define a `cardano-cluster` target.
3. Generate genesis on fly for the cluster.
4. Chairman service, with a factored script generator..
5. Chairman's cluster NixOS test.

Co-authored-by: Kosyrev Serge <serge.kosyrev@iohk.io>
@iohk-bors iohk-bors bot merged commit 29b047e into master Sep 25, 2019
@iohk-bors iohk-bors bot deleted the serge/cardano-cluster-service branch September 25, 2019 08:07
@deepfire deepfire mentioned this pull request Sep 26, 2019
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.

None yet

3 participants