Skip to content

Conversation

@wprzytula
Copy link

NodeConfig-related functionalities were not yet used anywhere, and we are in hurry during the hackathon. Let's give others the ccm framework without NodeConfig and add NodeConfig later if it appears to be useful.

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

Lorak-mmk and others added 7 commits February 11, 2025 14:21
CCM is cli tool that manages Scylla / Cassandra clusters.
Using it in integration suit will help to expand test coverage.

Co-authored-by: Dmitry Kropachev <[email protected]>
Co-authored-by: Mikołaj Uzarski <[email protected]>
Co-authored-by: Dmitry Kropachev <[email protected]>
For now it will run on each PR. If at some point it becomes too slow
we can switch it to running manually and before release.
Few things happen in this commit
1. Move NetPrefix from cluster.rs to ip_allocator.rs

2. Introduce IpAllocator (with LocalSubnetIdentifier)
LocalSubnetIdentifier is a utility wrapper over two ip octets, by which
we identify a local subnet (127.x.y.0/24). It can be converted to Ipv4Addr
and vice-versa. For now, we only support ipv4 (even though NetPrefix)
supports ipv6 as well. This may change in the future.

IpAllocator does exactly what we would expect - it keeps track of the
ip address pool and allows to allocate/free addresses (subnet ids) from this pool.
Upon construction, it scans the /proc/net/tcp file to find out which subnets
are used before the tests start. This way, the pool is initialized.

We introduce a global IpAllocator for test purposes. It's fine, because
IpAllocator is thread-safe. The only assumption we make, is that the ip pool
is exclusive to the tests when they run. This is true for CI, and for most
local use cases. There are some niche cases which break this assumption,
but we do not care about it now. This solution works just fine for hackathon purposes.

I introduced two new unit tests for Ipv4Addr and LocalSubnetIdentifier conversions.

3. Adjust cluster.rs to the allocator.
The `alloc_ip_prefix` is called where NetPrefix::sniff_ip_prefix was originally called.

The `free_ip_prefix` is called in `Cluster` destructor.
NodeConfig-related functionalities were not yet used anywhere, and we
are in hurry during the hackathon. Let's give others the ccm framework
without NodeConfig and add NodeConfig later if it appears to be useful.
@Lorak-mmk Lorak-mmk force-pushed the ccm-integration-v3 branch 2 times, most recently from f4a7533 to 729a898 Compare February 11, 2025 14:14
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.

3 participants