-
Notifications
You must be signed in to change notification settings - Fork 312
/
Copy pathcassandra-reaper.yaml
189 lines (173 loc) · 8.62 KB
/
cassandra-reaper.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
package:
name: cassandra-reaper
version: "3.8.0"
epoch: 2
description: Automated Repair Awesomeness for Apache Cassandra
copyright:
- license: Apache-2.0
target-architecture:
- x86_64
dependencies:
runtime:
- bash
- busybox
- openjdk-11-default-jvm
- py3-requests
environment:
contents:
packages:
- build-base
- maven
- nvm
- openjdk-11-default-jdk
- openssl-dev
- py3-setuptools
- python3
- wolfi-base
environment:
JAVA_HOME: /usr/lib/jvm/default-jvm
pipeline:
- uses: git-checkout
with:
repository: https://github.com/thelastpickle/cassandra-reaper
tag: ${{package.version}}
expected-commit: 6547a9872bb10030c03382df03fa37f97262a5ca
- uses: maven/pombump
working-directory: src/server
- uses: maven/pombump
working-directory: src/server
with:
properties-file: pombump-properties.yaml
# Install native binary JAR to $HOME/.m2 so it can be used later
- runs: |
builddir=$(pwd)
source /usr/share/nvm/nvm.sh
nvm install v12
nvm use v12
MAVEN_OPTS="-Xmx384m" mvn -B install -DskipTests -Drat.excludesFile=rat-exclusions.txt
mkdir -p "${{targets.destdir}}"//usr/local/bin
mkdir -p "${{targets.destdir}}"//usr/local/lib
mkdir -p "${{targets.destdir}}"/etc/cassandra-reaper/config
echo "listing files:"
ls -latr $builddir/src/server/target/
SHADED_JAR="src/server/target/cassandra-reaper-${{package.version}}.jar"
echo "Shaded jar: $SHADED_JAR"
cp -r $builddir/src/server/src/main/docker/cassandra-reaper.yml "${{targets.destdir}}"/etc/cassandra-reaper/cassandra-reaper.yml
cp -r $builddir/src/server/src/main/docker/shiro.ini "${{targets.destdir}}"/etc/cassandra-reaper/shiro.ini
cp -r $builddir/src/server/src/main/docker/entrypoint.sh "${{targets.destdir}}"/usr/local/bin/entrypoint.sh
cp -r $builddir/src/server/src/main/docker/configure-persistence.sh "${{targets.destdir}}"/usr/local/bin/configure-persistence.sh
cp -r $builddir/src/server/src/main/docker/configure-metrics.sh "${{targets.destdir}}"/usr/local/bin/configure-metrics.sh
cp -r $builddir/src/server/src/main/docker/configure-webui-authentication.sh "${{targets.destdir}}"/usr/local/bin/configure-webui-authentication.sh
cp -r $builddir/src/server/src/main/docker/configure-jmx-credentials.sh "${{targets.destdir}}"/usr/local/bin/configure-jmx-credentials.sh
cp -r $builddir/$SHADED_JAR "${{targets.destdir}}"/usr/local/lib/cassandra-reaper.jar
cp -r $builddir/src/packaging/bin/spreaper "${{targets.destdir}}"/usr/local/bin/spreaper
touch "${{targets.destdir}}"/etc/cassandra-reaper/cassandra-reaper.yml
touch "${{targets.destdir}}"/etc/cassandra-reaper/shiro.ini
chmod +x \
"${{targets.destdir}}"/usr/local/bin/entrypoint.sh \
"${{targets.destdir}}"/usr/local/bin/configure-persistence.sh \
"${{targets.destdir}}"/usr/local/bin/configure-webui-authentication.sh \
"${{targets.destdir}}"/usr/local/bin/configure-metrics.sh \
"${{targets.destdir}}"/usr/local/bin/configure-jmx-credentials.sh \
"${{targets.destdir}}"/usr/local/bin/spreaper
# https://github.com/thelastpickle/cassandra-reaper/pull/1499/files#diff-a51813561d5bd959f98eb6965691410fb1aa3b3b659f6b437b418cfa30d366a9R87
mkdir -p "${{targets.destdir}}"/var/lib/cassandra-reaper/storage
mkdir -p "${{targets.destdir}}"/var/tmp/cassandra-reaper
update:
enabled: true
github:
identifier: thelastpickle/cassandra-reaper
test:
environment:
contents:
packages:
- python3
- py3-requests
environment:
JAVA_HOME: /usr/lib/jvm/default-jvm
LANG: en_US.UTF-8
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
# cassandra reaper env vars
REAPER_SEGMENT_COUNT_PER_NODE: 0
REAPER_REPAIR_PARALELLISM: DATACENTER_AWARE
REAPER_REPAIR_INTENSITY: 1
REAPER_MAX_PENDING_COMPACTIONS: 1
REAPER_SCHEDULE_DAYS_BETWEEN: 1
REAPER_REPAIR_RUN_THREADS: 1
REAPER_HANGING_REPAIR_TIMEOUT_MINS: 10 # Increased for testing
REAPER_STORAGE_TYPE: "memory"
REAPER_ENABLE_CROSS_ORIGIN: False
REAPER_INCREMENTAL_REPAIR: False # Set to True for incremental repairs
REAPER_SUBRANGE_INCREMENTAL: False # Set to False for full repairs
REAPER_BLACKLIST_TWCS: ""
REAPER_ENABLE_DYNAMIC_SEED_LIST: True # Enable for dynamic seed list
REAPER_REPAIR_MANAGER_SCHEDULING_INTERVAL_SECONDS: 60 # 1 minute
REAPER_JMX_CONNECTION_TIMEOUT_IN_SECONDS: 30 # 30 seconds timeout
REAPER_USE_ADDRESS_TRANSLATOR: False # Set to False unless needed
REAPER_MAX_PARALLEL_REPAIRS: 1 # Limit to 1 for testing
REAPER_AUTO_SCHEDULING_ENABLED: True
REAPER_AUTO_SCHEDULING_INITIAL_DELAY_PERIOD: "PT15S"
REAPER_AUTO_SCHEDULING_PERIOD_BETWEEN_POLLS: "PT10M"
REAPER_AUTO_SCHEDULING_TIME_BEFORE_FIRST_SCHEDULE: "PT5M"
REAPER_AUTO_SCHEDULING_SCHEDULE_SPREAD_PERIOD: "PT6H"
REAPER_AUTO_SCHEDULING_ADAPTIVE: True # Enable adaptive scheduling
REAPER_AUTO_SCHEDULING_INCREMENTAL: True # Enable incremental scheduling
REAPER_AUTO_SCHEDULING_PERCENT_UNREPAIRED_THRESHOLD: "0.1" # 10% threshold
REAPER_AUTO_SCHEDULING_EXCLUDED_KEYSPACES: ""
REAPER_AUTO_SCHEDULING_EXCLUDED_CLUSTERS: ""
REAPER_JMX_PORTS: "{}"
REAPER_JMXMP_ENABLED: False # Enable JMXMP
REAPER_JMXMP_SSL: False # Disable SSL for JMXMP
REAPER_LOGGING_ROOT_LEVEL: "INFO" # Set logging level
REAPER_LOGGING_LOGGERS: "{ 'io.dropwizard': 'WARN' }"
REAPER_LOGGING_APPENDERS_CONSOLE_LOG_FORMAT: "" # Default console log format
REAPER_LOGGING_APPENDERS_CONSOLE_THRESHOLD: "INFO" # Console log threshold
REAPER_SERVER_APP_PORT: 8080 # Default application port
REAPER_SERVER_APP_BIND_HOST: "0.0.0.0" # Bind to all interfaces
REAPER_SERVER_ADMIN_PORT: 8081 # Default admin port
REAPER_SERVER_ADMIN_BIND_HOST: "0.0.0.0" # Bind to all interfaces
REAPER_HTTP_MANAGEMENT_ENABLE: True # Enable HTTP management
REAPER_MGMT_API_METRICS_PORT: 8082 # Metrics port
REAPER_HTTP_MANAGEMENT_KEYSTORE_PATH: "" # Path to keystore (if using SSL)
REAPER_HTTP_MANAGEMENT_TRUSTSTORE_PATH: "" # Path to truststore (if using SSL)
REAPER_HTTP_MANAGEMENT_TRUSTSTORES_DIR: "" # Directory for truststores
REAPER_DATACENTER_AVAILABILITY: "LOCAL"
pipeline:
- name: "Cassandra-Reaper version test"
runs: |
echo "127.0.0.1 $(hostname)" >> /etc/hosts
java -jar /usr/local/lib/cassandra-reaper.jar --version
- name: "Cassandra-Reaper verify configuration file"
runs: |
java -jar /usr/local/lib/cassandra-reaper.jar check /etc/cassandra-reaper/cassandra-reaper.yml
- name: "Cassandra-Reaper local memory server"
runs: |
echo "127.0.0.1 $(hostname)" >> /etc/hosts
#export REAPER_JMX_AUTH_USERNAME="reaperUser"
#export REAPER_JMX_AUTH_PASSWORD="reaperPass"
export REAPER_SERVER_APP_PORT=8080
export REAPER_SERVER_ADMIN_PORT=8081
export REAPER_STORAGE_TYPE="memory"
export REAPER_REPAIR_INTENSITY="1.0"
# need to add persistenceStoragePath to the cassandra-reaper.yml file when using memory as the storage type
sed -i '/maxParallelRepairs: ${REAPER_MAX_PARALLEL_REPAIRS}/a persistenceStoragePath: /tmp' /etc/cassandra-reaper/cassandra-reaper.yml
# trust store and managers will fail since they are not being set.
java -jar /usr/local/lib/cassandra-reaper.jar server /etc/cassandra-reaper/cassandra-reaper.yml & REAPER_PID=$!; sleep 2; kill $REAPER_PID
- name: "Configuration helper bash scripts test"
runs: |
# Mimic behavior of entrypoint script https://github.com/thelastpickle/cassandra-reaper/blob/3.7.1/src/server/src/main/docker/entrypoint.sh#L40-L42
cp /etc/cassandra-reaper/cassandra-reaper.yml /etc/cassandra-reaper/config/cassandra-reaper.yml
cp /etc/cassandra-reaper/shiro.ini /etc/cassandra-reaper/config/shiro.ini
# none of these scripts have --help or --version
# bash -x will print each command before its executed so we can at a minimum
# verify that the scripts are running
echo "127.0.0.1 $(hostname)" >> /etc/hosts
bash -x configure-jmx-credentials.sh
bash -x configure-jmx-credentials.sh
bash -x configure-metrics.sh
bash -x configure-metrics.sh
bash -x configure-persistence.sh
bash -x configure-persistence.sh
bash -x configure-webui-authentication.sh
bash -x configure-webui-authentication.sh