Skip to content

Commit

Permalink
Merge branch 'infra/cassandra-upgrade-26' into 'master'
Browse files Browse the repository at this point in the history
(infra): updating local Cassandra to 4.0.7 minds/infrastructure/infrastructure#26

See merge request minds/minds!210
  • Loading branch information
markharding committed Jan 24, 2023
2 parents f168602 + 03306a1 commit cdee29d
Show file tree
Hide file tree
Showing 7 changed files with 1,464 additions and 1 deletion.
3 changes: 3 additions & 0 deletions containers/cassandra/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM cassandra:4.0.7

COPY cassandra.yaml /etc/cassandra/cassandra.yaml
1,419 changes: 1,419 additions & 0 deletions containers/cassandra/cassandra.yaml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions containers/wait-for-cassandra/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM cassandra:4.0.7

WORKDIR /opt
COPY wait-for-cassandra.sh /opt/

ENTRYPOINT ["sh", "./wait-for-cassandra.sh"]
13 changes: 13 additions & 0 deletions containers/wait-for-cassandra/wait-for-cassandra.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Exit script wit ERRORLEVEL if any command fails
set -e

echo "Waiting for Cassandra to come online..."
until cqlsh cassandra -e "show version"
do
echo "Ping..."
sleep 1
done

echo "Cassandra is up and running"
11 changes: 10 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ services:
## DATABASES

cassandra:
image: cassandra:3.11.1
build:
context: ./containers/cassandra
environment:
- CASSANDRA_START_RPC=true
- MAX_HEAP_SIZE=768M
Expand All @@ -95,6 +96,14 @@ services:
timeout: 5s
interval: 15s

wait-for-cassandra:
build:
context: ./containers/wait-for-cassandra
networks:
- app
depends_on:
- cassandra

elasticsearch:
image: amazon/opendistro-for-elasticsearch:1.13.2
mem_limit: 1G # keep an eye
Expand Down
1 change: 1 addition & 0 deletions local/commands/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module.exports.handler = async argv => {
argv.stack && require('../tasks/cleanup-stack'),
argv.stack && require('../tasks/provision-elasticsearch'),
argv.stack && require('../tasks/provision-mysql'),
argv.stack && require('../tasks/wait-for-cassandra'),
argv.stack && require('../tasks/install-minds'),
require('../tasks/restart'),
].filter(Boolean), {
Expand Down
12 changes: 12 additions & 0 deletions local/tasks/wait-for-cassandra.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const Listr = require('listr');
const doco = require('../lib/doco');

module.exports = {
title: 'Start Cassandra',
task: () => new Listr([
{
title: 'Waiting for Cassandra',
task: () => doco('run', 'wait-for-cassandra')
},
])
};

0 comments on commit cdee29d

Please sign in to comment.