<commit_before>#!/bin/bash

version=${1:-latest}

echo "Creating docker bridge network \"influxdb\""
docker network create --driver bridge influxdb

echo
echo "Starting leader node \"ix0\""
docker run --detach \
    --name ix0 \
    --hostname ix0 \
    --net influxdb \
    --publish 8086 \
    --publish 8083 \
    --env INFLUX___META___BIND_ADDRESS='"ix0:8088"' \
    --env INFLUX___META___HTTP_BIND_ADDRESS='"ix0:8091"' \
    amancevice/influxdb-cluster:$version

echo
echo "Starting follower node \"ix1\""
sleep 1
docker run --detach \
    --name ix1 \
    --hostname ix1 \
    --net influxdb \
    --env INFLUX___META___BIND_ADDRESS='"ix1:8088"' \
    --env INFLUX___META___HTTP_BIND_ADDRESS='"ix1:8091"' \
    amancevice/influxdb-cluster:$version -join ix0:8091

echo
echo "Starting follower node \"ix2\""
sleep 1
docker run --detach \
    --name ix2 \
    --hostname ix2 \
    --net influxdb \
    --env INFLUX___META___BIND_ADDRESS='"ix2:8088"' \
    --env INFLUX___META___HTTP_BIND_ADDRESS='"ix2:8091"' \
    amancevice/influxdb-cluster:$version -join ix0:8091

echo
echo "SHOW SERVERS:"
sleep 1
docker run --rm -it --net influxdb --entrypoint /usr/bin/influx \
    amancevice/influxdb-cluster:$version -host ix0 -execute "SHOW SERVERS"<commit_msg>Added cleanup to cluster.sh<commit_after>#!/bin/bash

version=${1:-latest}

echo "Creating docker bridge network \"influxdb\""
docker network create --driver bridge influxdb

echo
echo "Starting leader node \"ix0\""
docker run --detach \
    --name ix0 \
    --hostname ix0 \
    --net influxdb \
    --publish 8086 \
    --publish 8083 \
    --env INFLUX___META___BIND_ADDRESS='"ix0:8088"' \
    --env INFLUX___META___HTTP_BIND_ADDRESS='"ix0:8091"' \
    amancevice/influxdb-cluster:$version

echo
echo "Starting follower node \"ix1\""
sleep 1
docker run --detach \
    --name ix1 \
    --hostname ix1 \
    --net influxdb \
    --env INFLUX___META___BIND_ADDRESS='"ix1:8088"' \
    --env INFLUX___META___HTTP_BIND_ADDRESS='"ix1:8091"' \
    amancevice/influxdb-cluster:$version -join ix0:8091

echo
echo "Starting follower node \"ix2\""
sleep 1
docker run --detach \
    --name ix2 \
    --hostname ix2 \
    --net influxdb \
    --env INFLUX___META___BIND_ADDRESS='"ix2:8088"' \
    --env INFLUX___META___HTTP_BIND_ADDRESS='"ix2:8091"' \
    amancevice/influxdb-cluster:$version -join ix0:8091

echo
echo "SHOW SERVERS:"
sleep 1
docker run --rm -it --net influxdb --entrypoint /usr/bin/influx \
    amancevice/influxdb-cluster:$version -host ix0 -execute "SHOW SERVERS"

# Cleanup
echo "Removed leader node \"$(docker rm -f ix0)\""
echo "Removed follower node \"$(docker rm -f ix1)\""
echo "Removed follower node \"$(docker rm -f ix2)\""
docker network rm influxdb
echo "Removed network \"influxdb\""
{'fraction_non_alphanumeric': 0.13908004346251357, 'fraction_numerical': 0.0459978268743209, 'mean_word_length': 3.091851851851852, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '872470', 'n_tokens_mistral': 1142, 'n_tokens_neox': 1001, 'n_words': 247}