-
Notifications
You must be signed in to change notification settings - Fork 7
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-db-sync module #59
Conversation
eh, attic input fails to build with these nixpkgs. but still id say go ahead and review |
our nixos tests run forever in CI. Locally it's maybe 25 secs for me. But previously the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot run the test locally using
nix run .#apps.x86_64-linux.vmTests-cardano-db-sync
I get the following error:
nix run .#apps.x86_64-linux.vmTests-cardano-db-sync
Check also #69
Anyway the test seems good! 💪 You said it works locally, right? Any idea why it doesn't work on CI? You increased the timeout and decreased the target percentage, both reasonable actions.
modules/cardano-db-sync.nix
Outdated
} | ||
{ | ||
assertion = (! cfg.postgres.enable) || (cfg.database.name == cfg.database.user); | ||
message = "When postgres is enabled, we use the ensureDBOwnership option which expects the user name to match db name."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ensureUsers = [
{
name = "${cfg.database.name}";
ensureDBOwnership = true;
}
];
this means that cfg.database.name
has access to cfg.database.name
database, so if database.name
is different, then the user needs to overwrite these permissions himself.
But I should make it a warning I now think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added assertion
@brainrake i think it's fine now, would you check once more? Irrelevant note on the side:Before I was under the impression that you're supposed to abstract away the underlying module (here |
Thanks @zmrocze , that makes sense. I think you solved one part by mentoning Let me explain. There were upstream modules for cardano-node and cardano-db-sync. Wrapping everything leads to a large amount of extra code with no apparent advantage except having all the options in the same namespace. So we went the opposite way, not wrapping anything, just adding the minimum options to support default use cases (sometimes just |
solves issue #58.
Cardano-db-sync
module. Withcardano-db-sync.postgres.enable
also runs postgres.Single test that awaits sync progress to start.