Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Cassie 4.0 #246

Merged
merged 91 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
1bbf977
cassie4 - Use datastax/cass-config-builder to generate configuration
cscetbon Aug 24, 2020
f494cf2
cassie4 - Use PreserveUnknownFields kubebuilder marker
cscetbon Aug 25, 2020
db53b00
cassie4 - No longer manage seeds in run.sh and use jvm11 for Cassie4
cscetbon Aug 26, 2020
02fa19b
cassie4 - Remove unneeded code in bootstrap and update e2e configuration
cscetbon Aug 27, 2020
f954719
cassie4 - Fix jvm option in e2e
cscetbon Aug 27, 2020
893c34a
cassie4 - Remove duplicate option
cscetbon Aug 27, 2020
afd8b55
cassie4 - Add comments for Cassie 4 tests
cscetbon Aug 27, 2020
f785602
cassie4 - Add serverVersion to deployment files
cscetbon Aug 27, 2020
0904304
cassie4 - Fix server version in test
cscetbon Aug 27, 2020
d6f176d
cassie4 - Remove configuration now it's handled by cass-config-builder
cscetbon Oct 7, 2020
a4df70b
cassie4 - Remove config from openAPI CRD definition
cscetbon Oct 8, 2020
0774b5d
cassie4 - ServerType now uses a default value in the CRD
cscetbon Oct 9, 2020
7ed01b5
cassie4 - Add service monitor for CassKop
cscetbon Oct 9, 2020
b94a9b2
Add code back to run.sh
cscetbon Apr 2, 2021
de6c0a4
Refactoring
cscetbon Apr 2, 2021
345a7de
Fix test
cscetbon Apr 2, 2021
42b48a0
Put CASSANDRA_SEEDS back
cscetbon Apr 4, 2021
4535196
Add handling of CASSANDRA_SEEDS back to bootstrap
cscetbon Apr 4, 2021
54201f5
Fix tests
cscetbon Apr 5, 2021
9ef7f38
Refactoring
cscetbon Apr 5, 2021
9bf03c2
Fix unit test
cscetbon Apr 7, 2021
fc4a982
Do not use deprecated type
cscetbon Apr 20, 2021
052c17e
Add new version of CRDs
cscetbon Apr 20, 2021
28a50f4
ServerType is not required
cscetbon Apr 21, 2021
df94d9f
Update CRD generation
cscetbon Apr 22, 2021
37bd876
Add Config to DC and Rack
cscetbon Apr 22, 2021
28489b1
Copy only run files from configmap
cscetbon Apr 22, 2021
25e7c1e
IF ServerType and ServerVersion are not set infer them from Cassandra…
cscetbon Apr 22, 2021
628d5c4
Add GetRackFromDCRackName
cscetbon Apr 23, 2021
39b73b5
Add support of config at all levels and fix tests
cscetbon Apr 23, 2021
ebac399
Fix typo in doc
cscetbon Apr 23, 2021
8f25e5f
NumTokens is managed in the new config parameter
cscetbon Apr 23, 2021
f0e6859
Update CRD
cscetbon Apr 23, 2021
3edf537
Replace numTokensteverywhere by config and get rid of GCStdout
cscetbon Apr 23, 2021
b42fef3
Generate zz_generated.deepcopy
cscetbon Apr 23, 2021
a81e361
Fix TestComputeLastAppliedConfiguration
cscetbon Apr 23, 2021
d5ae39e
Fix unit tests
cscetbon Apr 23, 2021
2ecc5df
Do not use latest anymore
cscetbon Apr 23, 2021
cc60923
Remove unneeded configuration
cscetbon Apr 24, 2021
926a6b4
gc logs are stored in /var/log/cassandra
cscetbon Apr 25, 2021
f0a0378
Use temporary new bootstrap image
cscetbon Apr 25, 2021
ae912c2
Add shortname
cscetbon Apr 25, 2021
996f056
Rename short names
cscetbon Apr 25, 2021
a9cf951
Fix tests and rename short names
cscetbon Apr 25, 2021
1848ee1
Remove CASSANDRA_MAX_HEAP env var
cscetbon Apr 25, 2021
dc3479f
Rename init-config to config-builder
cscetbon Apr 25, 2021
6ae5bd9
Use config-builder along with bootstrap and some refactoring
cscetbon Apr 25, 2021
1462673
Add print_flss_statistics to config that dgoss checks
cscetbon Apr 25, 2021
1cb44eb
Copy only pre_run.sh and post_run.sh from ConfigMap
cscetbon Apr 25, 2021
ceb9449
Remove useless dgoss test and add check in another
cscetbon Apr 25, 2021
3a5e812
Add support of CASSANDRA_ENABLE_JOLOKIA back for dgoss
cscetbon Apr 25, 2021
6e63532
Update parameters for dgoss tests
cscetbon Apr 25, 2021
c18fa44
Add some logs and tests
cscetbon Apr 25, 2021
a3965e2
Update debug logs and configuration for tests
cscetbon Apr 25, 2021
c48f94f
Add more logs
cscetbon Apr 25, 2021
ae645d2
Fix condition in test
cscetbon Apr 25, 2021
997d891
No need to copy run files are they are executed right after
cscetbon Apr 26, 2021
d20fdb0
Fix configuration files
cscetbon Apr 26, 2021
c4444d2
Fix dgoss tests
cscetbon Apr 26, 2021
a30ff24
Remove unused file
cscetbon Apr 26, 2021
3501715
Add configuration file back
cscetbon Apr 26, 2021
e7dfc56
Add base-config-builder until cass-config-builder fully supports c* 4
cscetbon Apr 29, 2021
b6634ca
Reorder containers
cscetbon Apr 30, 2021
bfbc70f
Minor changes
cscetbon Apr 30, 2021
f1efe8a
Push bootstrap image to regular repo
cscetbon Apr 30, 2021
d550fd5
Remove unused env vars
cscetbon May 2, 2021
c261e7f
Fix tests, doc and some refactoring
cscetbon May 2, 2021
3ae8a9d
Merge branch 'master' into cassie4
cscetbon May 14, 2021
39c057a
Upgrade k3d to 1.20.6
cscetbon May 14, 2021
e26be56
Remove comment
cscetbon May 16, 2021
0c3b4f1
Don't prepend with version
cscetbon May 16, 2021
07d9afe
Handle RunAsUser and FSGroup in multi-casskop as well
cscetbon May 16, 2021
de99ff8
Fix test of parameters
cscetbon May 16, 2021
504563c
Check ServerType as well
cscetbon May 16, 2021
3c4d6b9
When backRestSidecar is set but without image, add the default
cscetbon May 18, 2021
4e37ce9
Update Cassandra version and delete old files
cscetbon May 18, 2021
0350cd7
Update doc and clean files
cscetbon May 18, 2021
4ecca05
Add more tests
cscetbon May 18, 2021
b699ff7
Rename internal function and update doc
cscetbon May 18, 2021
0f67ba4
Decommission in v4 requires an argument
cscetbon May 18, 2021
821d9d0
Update documentation
cscetbon May 19, 2021
08559a2
Create symlink to testdata before starting e2e tests
cscetbon May 20, 2021
22d288c
Update website/docs/3_configuration_deployment/5_cassandra_configurat…
cscetbon May 27, 2021
9a09988
Merge branch 'master' into cassie4
cscetbon May 28, 2021
bb4f930
No secret
cscetbon May 28, 2021
6ec4f32
Clean config
cscetbon May 30, 2021
b536976
Use jm-server-options not only in default settings
cscetbon May 30, 2021
23a1708
Add debug
cscetbon May 30, 2021
dd6a18e
Add more debug
cscetbon May 30, 2021
1a0aee0
Revert debug statements
cscetbon May 30, 2021
450d362
Increase max_heap_size for Cassie 4
cscetbon May 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ orbs:
executor: vm
working_directory: /home/circleci/<< parameters.operatorDir >>
environment:
K3S_IMAGE: rancher/k3s:v1.18.4-k3s1
K8S_VERSION: v1.18.4
K3S_IMAGE: rancher/k3s:v1.20.6-k3s1
K8S_VERSION: v1.20.6
GOPATH: /go
GO111MODULE: on
DOCKER_LATEST: 1
Expand Down Expand Up @@ -95,6 +95,7 @@ orbs:
name: Operator acceptance test
no_output_timeout: 1200
command: |
ln -s test/e2e/testdata
if [ << parameters.test_type >> = "e2e" ]
then
kubectl create namespace cassandra-e2e
Expand Down Expand Up @@ -350,8 +351,6 @@ jobs:
- run:
name: deploy
command: |
echo $(pwd)
ls -la
git config --global user.name "${GH_NAME}"
git config --global user.email "${GH_EMAIL}"
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ DOCKER_REPO_BASE_TEST ?= orangeopensource
IMAGE_NAME := $(SERVICE_NAME)
BUILD_IMAGE ?= orangeopensource/casskop-build

BOOTSTRAP_IMAGE ?= orangeopensource/cassandra-bootstrap:0.1.7
BOOTSTRAP_IMAGE ?= orangeopensource/cassandra-bootstrap:0.1.9
TELEPRESENCE_REGISTRY ?= datawire
KUBESQUASH_REGISTRY:=

Expand Down Expand Up @@ -182,13 +182,19 @@ docker-generate-k8s:
--env https_proxy=$(https_proxy) --env http_proxy=$(http_proxy) \
$(BUILD_IMAGE):$(OPERATOR_SDK_VERSION) /bin/bash -c 'operator-sdk generate k8s'

SPEC_PROPS = .spec.versions[0].schema.openAPIV3Schema.properties.spec.properties

docker-generate-crds:
echo "Generate crds"
docker run --rm -v $(PWD):$(WORKDIR) -v $(GOPATH)/pkg/mod:/go/pkg/mod:delegated \
-v $(shell go env GOCACHE):/root/.cache/go-build:delegated --env GO111MODULE=on \
--env https_proxy=$(https_proxy) --env http_proxy=$(http_proxy) \
$(BUILD_IMAGE):$(OPERATOR_SDK_VERSION) /bin/bash -c 'operator-sdk generate crds'
@sed -i '/\- protocol/d' deploy/crds/db.orange.com_cassandraclusters_crd.yaml
echo Update CRD - Remove protocol and set config type to object CRD
@sed -i -e '/\- protocol/d' deploy/crds/db.orange.com_cassandraclusters_crd.yaml
@yq -i e '$(SPEC_PROPS).config.type = "object"' deploy/crds/db.orange.com_cassandraclusters_crd.yaml
@yq -i e '$(SPEC_PROPS).topology.properties.dc.items.properties.config.type = "object"' deploy/crds/db.orange.com_cassandraclusters_crd.yaml
@yq -i e '$(SPEC_PROPS).topology.properties.dc.items.properties.rack.items.properties.config.type = "object"' deploy/crds/db.orange.com_cassandraclusters_crd.yaml
PERES-Richard marked this conversation as resolved.
Show resolved Hide resolved
cp -v deploy/crds/* helm/*/crds/
cp -v deploy/crds/* */helm/*/crds/

Expand Down
2,776 changes: 1,150 additions & 1,626 deletions deploy/crds/db.orange.com_cassandraclusters_crd.yaml

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions docker/bootstrap/Changelog.md

This file was deleted.

2 changes: 1 addition & 1 deletion docker/bootstrap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else
PROJECT:=$(CI_REGISTRY_IMAGE)
endif

VERSION:=0.1.8
VERSION:=0.1.9
TAG?=${VERSION}
ifeq ($(CIRCLE_BRANCH),master)
BRANCH:=latest
Expand Down
13 changes: 3 additions & 10 deletions docker/bootstrap/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
#!/usr/bin/env bash
set -e

# Copies any default config files from CassKop bootstrapper image to the /etc/cassandra volume which will replace the one used in cassandra image
# Copies any default config files from CassKop bootstrapper image to /etc/cassandra volume which will replace the one used in cassandra image
cp -rLv /${BOOTSTRAP_CONF}/* /etc/cassandra/

# If User has submited a configMap, we uses them to deplace default ones
# (overwriting the above)
if [[ -d ${CONFIGMAP} && ! -z `ls -A ${CONFIGMAP}` ]] ; then
echo "We have a ConfigMap, we surcharge default configuration files"
cp -rLv ${CONFIGMAP}/* /etc/cassandra/
fi

# Copies any extra libraries from this bootstrapper image to the extra-lib empty-dir
if [[ -d /${BOOTSTRAP_LIBS} && ! -z `ls -A /${BOOTSTRAP_LIBS}` ]] ; then
echo "We have additional libraries, we copy them over"
cp -v ${BOOTSTRAP_LIBS}/* $CASSANDRA_LIBS/
fi
fi

cp -v /${BOOTSTRAP_TOOLS}/* $CASSANDRA_TOOLS/

Expand All @@ -33,4 +26,4 @@ if [ -f ${CONFIGMAP}/post_run.sh ]; then
${CONFIGMAP}/post_run.sh
fi

echo '== bootstrap ended :-)'
echo '**** bootstrap ended ****'
5 changes: 0 additions & 5 deletions docker/bootstrap/dgoss/checks/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,13 @@ file:
/etc/cassandra/cassandra-env.sh:
exists: true
contains:
- "LOCAL_JMX=no"
- "/extra-lib/jolokia-agent.jar"
- "-javaagent:/extra-lib/cassandra-exporter-agent.jar=@/etc/cassandra/exporter.conf"

/etc/cassandra/exporter.conf:
exists: true
contains: ["--listen=:9500"]

# pre_run.sh is created through configmap which is not used in this test
/etc/cassandra/pre_run.sh:
exists: false

/etc/cassandra/liveness-probe.sh:
exists: true

Expand Down
4 changes: 0 additions & 4 deletions docker/bootstrap/dgoss/test-with-configmap/goss.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions docker/bootstrap/dgoss/test-with-configmap/run.sh

This file was deleted.

4 changes: 0 additions & 4 deletions docker/bootstrap/dgoss/test-without-volumes/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ file:
- "!jolokia-agent.jar"
- "!javaagent:/extra-lib/cassandra-exporter-agent.jar=@/etc/cassandra/exporter.conf"

# pre_run.sh is created through configmap which is not used in this test
/etc/cassandra/pre_run.sh:
exists: false

/etc/cassandra/liveness-probe.sh:
exists: true

Expand Down
80 changes: 51 additions & 29 deletions docker/bootstrap/dgoss/util.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,38 @@
#!/bin/bash

CASSANDRA_IMAGE=cassandra:latest

CASSANDRA_IMAGE=cassandra:3.11.6
CASSANDRA_SEEDS=cassandra-demo-dc1-rack1-0.cassandra-demo.ns,cassandra-demo-dc1-rack2-0.cassandra-demo.ns,cassandra-demo-dc1-rack3-0.cassandra-demo.ns
CASSANDRA_UID=1000
CASSANDRA_DC=dc1
CASSANDRA_RACK=rack1

CONFIG_FILE_DATA=$(cat <<-EOF
{
"cassandra-yaml": {
"max_hints_delivery_threads": 8,
"authenticator": "PasswordAuthenticator",
"authorizer": "CassandraAuthorizer"
},
"cluster-info": {
"name": "cassandra-e2e",
"seeds": "$CASSANDRA_SEEDS"
},
"datacenter-info": {
"name": "$CASSANDRA_DC"
},
"jvm-options": {
"cassandra_ring_delay_ms": 30000,
"initial_heap_size": "64M",
"jmx-connection-type": "remote-no-auth",
"max_heap_size": "256M",
"print_flss_statistics": true
},
"logback-xml": {
"debuglog-enabled": false
}
}
EOF
)

BOOTSTRAP_VOLUME=dgoss-bootstrap-vol
EXTRA_LIB_VOLUME=dgoss-extralib-vol
Expand All @@ -24,12 +54,21 @@ function deleteDgossVolumes {

function createInitConfigContainer {
echo "== createInitConfigContainer"
docker run --rm -u 0 \
-v ${BOOTSTRAP_VOLUME}:/bootstrap \
-e PRODUCT_NAME=$(echo $CASSANDRA_IMAGE|cut -d: -f1) \
-e PRODUCT_VERSION=$(echo $CASSANDRA_IMAGE|cut -d: -f2) \
-e CONFIG_FILE_DATA="$CONFIG_FILE_DATA" \
-e CONFIG_OUTPUT_DIRECTORY=/bootstrap \
-e RACK_NAME=$CASSANDRA_RACK \
datastax/cass-config-builder:1.0.3

docker run --rm \
-v ${BOOTSTRAP_VOLUME}:/bootstrap \
-v ${EXTRA_LIB_VOLUME}:/extra-lib \
--entrypoint=bash \
${CASSANDRA_IMAGE} \
-c "cp -vr /etc/cassandra/* /bootstrap && chown -R cassandra: /bootstrap /extra-lib"
-c "chown -R cassandra: /bootstrap /extra-lib"
}

function checkDgossVolumes {
Expand All @@ -47,17 +86,11 @@ function createCassandraBootstrapContainer {
docker run \
-u 999 \
--rm -ti \
-e CASSANDRA_MAX_HEAP=1024M \
-e CASSANDRA_SEEDS=cassandra-demo-dc1-rack1-0.cassandra-demo.ns,cassandra-demo-dc1-rack2-0.cassandra-demo.ns,cassandra-demo-dc1-rack3-0.cassandra-demo.ns \
-e CASSANDRA_CLUSTER_NAME=cassandra-demo \
-e CASSANDRA_AUTO_BOOTSTRAP=true \
-e CASSANDRA_SEEDS=$CASSANDRA_SEEDS \
-e HOSTNAME=cassandra-seb-dc1-rack1-0 \
-e POD_NAME=cassandra-demo-dc1-rack1-0 \
-e POD_NAMESPACE=ns \
-e CASSANDRA_GC_STDOUT=true \
-e CASSANDRA_NUM_TOKENS=32 \
-e CASSANDRA_DC=dc1 \
-e CASSANDRA_RACK=rack1 \
-e CASSANDRA_DC=$CASSANDRA_DC \
-e CASSANDRA_RACK=$CASSANDRA_RACK \
-v ${BOOTSTRAP_VOLUME}:/etc/cassandra/ \
-v ${CONFIGMAP_VOLUME}:/configmap \
-v ${EXTRA_LIB_VOLUME}:/extra-lib/ \
Expand All @@ -71,19 +104,13 @@ function createCassandraBootstrapContainerNoExtraLib {
docker run \
-u 999 \
--rm -ti \
-e CASSANDRA_MAX_HEAP=1024M \
-e CASSANDRA_SEEDS=cassandra-demo-dc1-rack1-0.cassandra-demo.ns,cassandra-demo-dc1-rack2-0.cassandra-demo.ns,cassandra-demo-dc1-rack3-0.cassandra-demo.ns \
-e CASSANDRA_CLUSTER_NAME=cassandra-demo \
-e CASSANDRA_AUTO_BOOTSTRAP=true \
-e CASSANDRA_SEEDS=$CASSANDRA_SEEDS \
-e HOSTNAME=cassandra-seb-dc1-rack1-0 \
-e POD_NAME=cassandra-demo-dc1-rack1-0 \
-e POD_NAMESPACE=ns \
-e CASSANDRA_GC_STDOUT=true \
-e CASSANDRA_ENABLE_JOLOKIA=false \
-e CASSANDRA_EXPORTER_AGENT=false \
-e CASSANDRA_NUM_TOKENS=32 \
-e CASSANDRA_DC=dc1 \
-e CASSANDRA_RACK=rack1 \
-e CASSANDRA_DC=$CASSANDRA_DC \
-e CASSANDRA_RACK=$CASSANDRA_RACK \
-v ${BOOTSTRAP_VOLUME}:/etc/cassandra/ \
${IMAGE_TO_TEST}
}
Expand All @@ -93,17 +120,12 @@ function createCassandraBootstrapContainerWithConfigMap {
docker run \
-u 999 \
--rm -ti \
-e CASSANDRA_MAX_HEAP=1024M \
-e CASSANDRA_SEEDS=cassandra-demo-dc1-rack1-0.cassandra-demo.ns,cassandra-demo-dc1-rack2-0.cassandra-demo.ns,cassandra-demo-dc1-rack3-0.cassandra-demo.ns \
-e CASSANDRA_SEEDS=$CASSANDRA_SEEDS \
-e CASSANDRA_CLUSTER_NAME=cassandra-demo \
-e CASSANDRA_AUTO_BOOTSTRAP=true \
-e HOSTNAME=cassandra-seb-dc1-rack1-0 \
-e POD_NAME=cassandra-demo-dc1-rack1-0 \
-e POD_NAMESPACE=ns \
-e CASSANDRA_GC_STDOUT=true \
-e CASSANDRA_NUM_TOKENS=32 \
-e CASSANDRA_DC=dc1 \
-e CASSANDRA_RACK=rack1 \
-e CASSANDRA_DC=$CASSANDRA_DC \
-e CASSANDRA_RACK=$CASSANDRA_RACK \
-v ${BOOTSTRAP_VOLUME}:/etc/cassandra/ \
-v ${CONFIGMAP_VOLUME}:/configmap \
-v ${EXTRA_LIB_VOLUME}:/extra-lib/ \
Expand Down
Loading