-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add experimental Nix Flake support #472
Conversation
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.
LGTM
as long as driver team is taking ownership on it (and it works)
Yes, we are taking ownership on it. We'll experiment with it as a base of more approachable dev environments of all drivers (as each driver is written in a different language and requires different toolchain). |
Drafting, @avelanarius found some issues |
This commit adds Nix flake which can be used to add ccm as a dependency in other Nix projects or to quickly enter development environment with all dependencies required to run and test ccm.
Direnv has good support for flakes - it's easy to activate it, it retains your current shell, and it works properly (unloads dev env when leaving the folder). This commit enables direnv flake support for this project.
As the whole Nix flake in this repo is experimental, this workflow has `continue-on-error` set to true in order to avoid potential problems with Nix stalling CCM development. We can make it required, or even completely switch to it, after some time, to be sure Nix really works here.
Fixed issues found by @avelanarius . While fixing them, I found out that ccm respects |
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.
LGTM. Tested it on my computer, starting Scylla 5.1.0 and 2022.1.7 (different relocatable versions) and it all now works correctly.
@fruch I think you can merge it now.
This will make it easier to use CCM without having to worry about having correct Java/Python/etc. on the system: nix shell github:scylladb/scylla-ccm
and everything will work after that single command. The source itself is very small (57 lines of flake.nix
) so maintaining it won't be a huge burden for me and @Lorak-mmk.
@fruch ping |
Nix is, citing their GH repo, 'a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible.'
See here for a more detailed description: https://serokell.io/blog/what-is-nix
We want to use Nix in drivers (starting with Java driver) to create reproducible, easy to use development environments, and later to extend this to CI and release process.
In order to do that, we need to create Nix package for CCM, as it's used by many drivers in integration tests. This PR accomplishes experimental version of it.
PR introduces Nix flake that can be used to add CCM as a dependency somewhere or to quickly enter a development environment where you can run and test CCM (with caveats due to Scylla using absolute paths when searching for Java - see commit messages / README / flake.nix).
There is also a CI pipeline running tests in Nix environment - marked with
continue-on-error
in order to not affect CCM's development process if something breaks in Nix. When we are sure everything is correct and stable, this parameter can be removed.