-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from chrislbs/issue/75
Adding support to build cassandra-reaper docker images
- Loading branch information
Showing
7 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
FROM openjdk:8-jre-alpine | ||
|
||
ARG SHADED_JAR | ||
|
||
ENV REAPER_SEGMENT_COUNT=200 \ | ||
REAPER_REPAIR_PARALELLISM=DATACENTER_AWARE \ | ||
REAPER_REPAIR_INTENSITY=0.9 \ | ||
REAPER_SCHEDULE_DAYS_BETWEEN=7 \ | ||
REAPER_REPAIR_RUN_THREADS=15 \ | ||
REAPER_HANING_REPAIR_TIMEOUT_MINS=30 \ | ||
REAPER_STORAGE_TYPE=memory \ | ||
REAPER_ENABLE_CORS=true \ | ||
REAPER_INCREMENTAL_REPAIR=false \ | ||
REAPER_ALLOW_UNREACHABLE_NODES=false \ | ||
REAPER_ENABLE_DYNAMIC_SEEDS=true \ | ||
REAPER_AUTO_SCHEDULE_ENABLED=false \ | ||
REAPER_AUTO_SCHEDULE_INITIAL_DELAY_PERIOD=PT15S \ | ||
REAPER_AUTO_SCHEDULE_PERIOD_BETWEEN_POLLS=PT10M \ | ||
REAPER_AUTO_SCHEDULE_TIME_BETWEEN_FIRST_SCHEDULE=PT5M \ | ||
REAPER_AUTO_SCHEDULE_TIME_BETWEEN_FIRST_SCHEDULE=PT6H \ | ||
REAPER_AUTO_SCHEDULE_EXCLUDED_KEYSPACES="[]" \ | ||
REAPER_JMX_PORTS="{}" \ | ||
REAPER_LOGGING_ROOT_LEVEL=INFO \ | ||
REAPER_LOGGERS="{}" \ | ||
REAPER_LOGGING_FORMAT='"%-6level [%d] [%t] %logger{5} - %msg %n"' \ | ||
REAPER_APP_PORT=8080 \ | ||
REAPER_APP_BIND_HOST="0.0.0.0" \ | ||
REAPER_ADMIN_PORT=8081 \ | ||
REAPER_ADMIN_BIND_HOST="0.0.0.0" \ | ||
REAPER_CASS_CLUSTER_NAME="clutername" \ | ||
REAPER_CASS_CONTACT_POINTS="[]" \ | ||
REAPER_CASS_KEYSPACE="cassandra-reaper" \ | ||
REAPER_CASS_AUTH_ENABLED="false" \ | ||
REAPER_CASS_AUTH_USERNAME="cassandra" \ | ||
REAPER_CASS_AUTH_PASSWORD="cassandra" \ | ||
REAPER_DB_DRIVER_CLASS="org.h2.Driver" \ | ||
REAPER_DB_URL="jdbc:h2:/var/lib/cassandra-reaper/db;MODE=PostgreSQL" \ | ||
REAPER_DB_USERNAME="" \ | ||
REAPER_DB_PASSWORD="" \ | ||
JAVA_OPTS="" | ||
|
||
ADD cassandra-reaper.yml /etc/cassandra-reaper.yml | ||
ADD entrypoint.sh /usr/local/bin/entrypoint.sh | ||
ADD append-persistence.sh /usr/local/bin/append-persistence.sh | ||
RUN addgroup -S reaper && \ | ||
adduser -S reaper reaper && \ | ||
apk add --no-cache 'su-exec>=0.2' && \ | ||
mkdir -p /var/lib/cassandra-reaper && \ | ||
chown reaper:reaper /etc/cassandra-reaper.yml /var/lib/cassandra-reaper /usr/local/bin/entrypoint.sh /usr/local/bin/append-persistence.sh && \ | ||
chmod u+x /usr/local/bin/entrypoint.sh /usr/local/bin/append-persistence.sh | ||
|
||
VOLUME /var/lib/cassandra-reaper | ||
|
||
ADD ${SHADED_JAR} /usr/local/lib/cassandra-reaper.jar | ||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | ||
CMD ["cassandra-reaper"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
|
||
case ${REAPER_STORAGE_TYPE} in | ||
"cassandra") | ||
cat <<EOT >> /etc/cassandra-reaper.yml | ||
cassandra: | ||
clusterName: ${REAPER_CASS_CLUSTER_NAME} | ||
contactPoints: ${REAPER_CASS_CONTACT_POINTS} | ||
keyspace: ${REAPER_CASS_KEYSPACE} | ||
EOT | ||
|
||
if [ "true" = "${REAPER_CASS_AUTH_ENABLED}" ]; then | ||
cat <<EOT >> /etc/cassandra-reaper.yml | ||
authProvider: | ||
type: plainText | ||
username: ${REAPER_CASS_AUTH_USERNAME} | ||
password: ${REAPER_CASS_AUTH_PASSWORD} | ||
EOT | ||
fi | ||
;; | ||
"database") | ||
cat <<EOT >> /etc/cassandra-reaper.yml | ||
database: | ||
driverClass: ${REAPER_DB_DRIVER_CLASS} | ||
url: ${REAPER_DB_URL} | ||
user: ${REAPER_DB_USERNAME} | ||
password: ${REAPER_DB_PASSWORD} | ||
EOT | ||
|
||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
segmentCount: ${REAPER_SEGMENT_COUNT} | ||
repairParallelism: ${REAPER_REPAIR_PARALELLISM} | ||
repairIntensity: ${REAPER_REPAIR_INTENSITY} | ||
scheduleDaysBetween: ${REAPER_SCHEDULE_DAYS_BETWEEN} | ||
repairRunThreadCount: ${REAPER_REPAIR_RUN_THREADS} | ||
hangingRepairTimeoutMins: ${REAPER_HANING_REPAIR_TIMEOUT_MINS} | ||
storageType: ${REAPER_STORAGE_TYPE} | ||
enableCrossOrigin: ${REAPER_ENABLE_CORS} | ||
incrementalRepair: ${REAPER_INCREMENTAL_REPAIR} | ||
allowUnreachableNodes: ${REAPER_ALLOW_UNREACHABLE_NODES} | ||
enableDynamicSeedList: ${REAPER_ENABLE_DYNAMIC_SEEDS} | ||
|
||
autoScheduling: | ||
enabled: ${REAPER_AUTO_SCHEDULE_ENABLED} | ||
initialDelayPeriod: ${REAPER_AUTO_SCHEDULE_INITIAL_DELAY_PERIOD} | ||
periodBetweenPolls: ${REAPER_AUTO_SCHEDULE_PERIOD_BETWEEN_POLLS} | ||
timeBeforeFirstSchedule: ${REAPER_AUTO_SCHEDULE_TIME_BETWEEN_FIRST_SCHEDULE} | ||
scheduleSpreadPeriod: ${REAPER_AUTO_SCHEDULE_TIME_BETWEEN_FIRST_SCHEDULE} | ||
excludedKeyspaces: ${REAPER_AUTO_SCHEDULE_EXCLUDED_KEYSPACES} | ||
|
||
jmxPorts: ${REAPER_JMX_PORTS} | ||
|
||
logging: | ||
level: ${REAPER_LOGGING_ROOT_LEVEL} | ||
loggers: ${REAPER_LOGGERS} | ||
appenders: | ||
- type: console | ||
logFormat: ${REAPER_LOGGING_FORMAT} | ||
|
||
server: | ||
type: default | ||
applicationConnectors: | ||
- type: http | ||
port: ${REAPER_APP_PORT} | ||
bindHost: ${REAPER_APP_BIND_HOST} | ||
adminConnectors: | ||
- type: http | ||
port: ${REAPER_ADMIN_PORT} | ||
bindHost: ${REAPER_ADMIN_BIND_HOST} | ||
requestLog: | ||
appenders: [] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
if [ "$1" = 'cassandra-reaper' ]; then | ||
su-exec reaper /usr/local/bin/append-persistence.sh | ||
exec su-exec reaper java -jar ${JAVA_OPTS} \ | ||
/usr/local/lib/cassandra-reaper.jar server /etc/cassandra-reaper.yml | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters