scylladb / scylla-ccm

Cassandra Cluster Manager, modified for Scylla
Apache License 2.0
20 stars 64 forks source link

Add experimental Nix Flake support #472

Closed Lorak-mmk closed 1 year ago

Lorak-mmk commented 1 year ago

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.

avelanarius commented 1 year ago

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).

Lorak-mmk commented 1 year ago

Drafting, @avelanarius found some issues

Lorak-mmk commented 1 year ago

Fixed issues found by @avelanarius . While fixing them, I found out that ccm respects JAVA_HOME - it doesn't call JMX's select-java at all if JAVA_HOME is present. This allowed me to get rid of buildFHSUserEnv, which got rid of previous documented limitations and simplified code a bit.

Lorak-mmk commented 1 year ago

@fruch ping