Skip to content

Commit

Permalink
fix(testing): fix testing env tablets setup
Browse files Browse the repository at this point in the history
Tablets went from experimental feature to regular enable_tablets feature. This commit updates test env setup according to this change. It also gets rid of no longer needed things like:
- separate scylla.yaml and .properties for other cluster
- no need to control raft topology, as it is always enabled in 6.0, and we don't care for it in previous versions
  • Loading branch information
Michal-Leszczynski authored and karol-kokoszka committed Aug 9, 2024
1 parent 821330a commit c85cfbf
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 696 deletions.
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ GIT_ROOT = $(shell git rev-parse --show-toplevel)
GOBIN ?= $(shell pwd)/bin
GOFILES = go list -f '{{range .GoFiles}}{{ $$.Dir }}/{{ . }} {{end}}{{range .TestGoFiles}}{{ $$.Dir }}/{{ . }} {{end}}' $(PKG)

SCYLLA_VERSION?=scylla:5.4.1
SCYLLA_VERSION?=scylla:6.0.1
IP_FAMILY?=IPV4
RAFT_SCHEMA?=true
RAFT_TOPOLOGY?=false
TABLETS?=false
SKIP_GOSSIP?=false
RAFT_SCHEMA?=none
TABLETS?=enabled

MANAGER_CONFIG := testing/scylla-manager/scylla-manager.yaml
PUBLIC_NET := 192.168.200.
Expand Down Expand Up @@ -173,7 +171,7 @@ start-dev-env: .testing-up deploy-agent build-cli

.PHONY: .testing-up
.testing-up:
@IPV6=$(IPV6) SCYLLA_VERSION=$(SCYLLA_VERSION) RAFT_SCHEMA=$(RAFT_SCHEMA) RAFT_TOPOLOGY=$(RAFT_TOPOLOGY) TABLETS=$(TABLETS) make -C testing build down up
@IPV6=$(IPV6) SCYLLA_VERSION=$(SCYLLA_VERSION) RAFT_SCHEMA=$(RAFT_SCHEMA) TABLETS=$(TABLETS) make -C testing build down up

.PHONY: dev-env-status
dev-env-status: ## Checks status of docker containers and cluster nodes
Expand Down
40 changes: 15 additions & 25 deletions testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ YQ := ../bin/yq
CURRENT_UID := $(shell id -u)
CURRENT_GID := $(shell id -g)

SCYLLA_VERSION?=scylla:5.4.1
SCYLLA_VERSION?=scylla:6.0.1
IP_FAMILY?=IPV4
RAFT_SCHEMA?=true
RAFT_TOPOLOGY?=false
TABLETS?=false
SKIP_GOSSIP?=false
RAFT_SCHEMA?=none
TABLETS?=enabled

MINIO_ENDPOINT := https://192.168.200.99:9000
COMPOSE_FILE := docker-compose-ipv4.yaml
Expand Down Expand Up @@ -56,39 +54,31 @@ build: ## Build custom docker image
.PHONY: up
up: ## Start docker containers
up:
@echo "==> Starting testing env with SCYLLA_VERSION=$(SCYLLA_VERSION) and IP_FAMILY=$(IP_FAMILY) and RAFT_SCHEMA=$(RAFT_SCHEMA) and RAFT_TOPOLOGY=$(RAFT_TOPOLOGY) and TABLETS=$(TABLETS)"
@echo "==> Starting testing env with SCYLLA_VERSION=$(SCYLLA_VERSION) and IP_FAMILY=$(IP_FAMILY) and RAFT_SCHEMA=$(RAFT_SCHEMA) and TABLETS=$(TABLETS)"
# Scylla bootstap proceedure have requirements that leads us to follow certain recipe:
# 1. Spin up first node on the cluster
# 2. Spin up and join other seed node, which is first node from DC2
# 3. Spin up rest of the nodes
@echo "==> Generating encryption files"
@cd scylla/certs && ./generate.sh
@echo "==> Generating Scylla configuration"
ifeq ($(SM_SSL_ENABLED),yes)
@$(YQ) merge -x scylla/config/scylla.yaml scylla/config/scylla-ssl.yaml > scylla/scylla.yaml
@$(YQ) merge -x scylla/config/scylla-second-cluster.yaml scylla/config/scylla-ssl.yaml > scylla/scylla-scylla-second-cluster.yaml
@cp scylla/config/cqlshrc-ssl scylla/cqlshrc
else
@cp scylla/config/scylla.yaml scylla/scylla.yaml
@cp scylla/config/scylla-second-cluster.yaml scylla/scylla-second-cluster.yaml
@cp scylla/config/cqlshrc scylla/cqlshrc
ifeq ($(RAFT_SCHEMA),enabled)
@$(YQ) write -i scylla/scylla.yaml 'consistent_cluster_management' true
endif
ifeq ($(RAFT_SCHEMA),false)
ifeq ($(RAFT_SCHEMA),disabled)
@$(YQ) write -i scylla/scylla.yaml 'consistent_cluster_management' false
@$(YQ) write -i scylla/scylla-second-cluster.yaml 'consistent_cluster_management' false
endif
ifeq ($(RAFT_TOPOLOGY),true)
@$(YQ) write -i scylla/scylla.yaml 'experimental_features[+]' consistent-topology-changes
@$(YQ) write -i scylla/scylla-second-cluster.yaml 'experimental_features[+]' consistent-topology-changes
endif
ifeq ($(TABLETS),true)
@$(YQ) write -i scylla/scylla.yaml 'experimental_features[+]' tablets
@$(YQ) write -i scylla/scylla-second-cluster.yaml 'experimental_features[+]' tablets
ifeq ($(TABLETS),enabled)
@$(YQ) write -i scylla/scylla.yaml 'enable_tablets' true
endif
ifeq ($(SKIP_GOSSIP),true)
@$(YQ) write -i scylla/scylla.yaml 'skip_wait_for_gossip_to_settle' 0
@$(YQ) write -i scylla/scylla-second-cluster.yaml 'skip_wait_for_gossip_to_settle' 0
ifeq ($(TABLETS),disabled)
@$(YQ) write -i scylla/scylla.yaml 'enable_tablets' false
endif
@cp scylla/scylla.yaml scylla/scylla-second-cluster.yaml
@$(YQ) write -i scylla/scylla-second-cluster.yaml 'cluster_name' 'Managed Other Cluster'

@echo "==> Starting containers"
mkdir -p $(MINIO_DATA_DIR)

Expand Down Expand Up @@ -121,7 +111,7 @@ endif
@echo "==> Adding Minio user"
./minio/add_user.sh || true
@echo "==> Initialising cluster"
@$(CQLSH_NODE) $(PUBLIC_NET)11 -u cassandra -p cassandra -e "ALTER KEYSPACE system_auth WITH REPLICATION = {'class': 'NetworkTopologyStrategy', 'dc1': 3, 'dc2': 3}"
@$(CQLSH_NODE) $(PUBLIC_NET)11 -u cassandra -p cassandra -e "ALTER KEYSPACE system_auth WITH REPLICATION = {'class': 'NetworkTopologyStrategy', 'dc1': 3, 'dc2': 3}" || true

.PHONY: down
down: ## Stop docker containers
Expand Down
6 changes: 3 additions & 3 deletions testing/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ services:
privileged: true
volumes:
- type: bind
source: ./scylla/cassandra-second-cluster.properties
source: ./scylla/cassandra-rackdc.1.properties
target: /etc/scylla/cassandra-rackdc.properties
- type: bind
source: ./scylla/scylla-second-cluster.yaml
Expand All @@ -144,7 +144,7 @@ services:
privileged: true
volumes:
- type: bind
source: ./scylla/cassandra-second-cluster.properties
source: ./scylla/cassandra-rackdc.1.properties
target: /etc/scylla/cassandra-rackdc.properties
- type: bind
source: ./scylla/scylla-second-cluster.yaml
Expand All @@ -166,7 +166,7 @@ services:
- "10000:10000"
volumes:
- type: bind
source: ./scylla/cassandra-second-cluster.properties
source: ./scylla/cassandra-rackdc.1.properties
target: /etc/scylla/cassandra-rackdc.properties
- type: bind
source: ./scylla/scylla-sm.yaml
Expand Down
3 changes: 0 additions & 3 deletions testing/scylla/cassandra-second-cluster.properties

This file was deleted.

Loading

0 comments on commit c85cfbf

Please sign in to comment.