<commit_before>#!/bin/bash

# Based on https://github.com/jplock/docker-zookeeper/blob/master/Dockerfile
# and https://github.com/lukeolbrish/examples/tree/master/zookeeper/five-server-docker
# Please respect the licenses on those repos

until grep -q '169.254.169.250' /etc/resolv.conf; do sleep 1; done

METADATA="http://1172.16.31.10/latest"
MYID=$(curl --header 'Accept: application/json' "$METADATA/self/container/service_index"|jq -r .)
IPS=$(curl --header 'Accept: application/json' "$METADATA/self/service/containers"|jq  -r '.[] | .ports[0]'|cut -f1 -d':')

mkdir -p /{var,tmp}/zookeeper
echo $MYID | tee /var/zookeeper/myid > /tmp/zookeeper/myid

curl --header 'Accept: application/json' \
    "$METADATA/self/service/containers" | \
    jq  -r '.[] | [ .service_index , .ports[0] ]' -c | \
    sed -r -e 's#\["([^"]+)","([^:]+).*#zk.\1=\2:2888:3888#g' >> \
    /opt/zookeeper/conf/zoo.cfg

exec /opt/zookeeper/bin/zkServer.sh start-foreground
<commit_msg>Added an extra wait for all CTs to be live at launch<commit_after>#!/bin/bash

# Based on https://github.com/jplock/docker-zookeeper/blob/master/Dockerfile
# and https://github.com/lukeolbrish/examples/tree/master/zookeeper/five-server-docker
# Please respect the licenses on those repos

sleep 10
until grep -q '169.254.169.250' /etc/resolv.conf; do sleep 1; done

METADATA="http://169.254.169.250/latest"
MYID=$(curl --header 'Accept: application/json' "$METADATA/self/container/service_index"|jq -r .)
IPS=$(curl --header 'Accept: application/json' "$METADATA/self/service/containers"|jq  -r '.[] | .ports[0]'|cut -f1 -d':')

mkdir -p /{var,tmp}/zookeeper
echo $MYID | tee /var/zookeeper/myid > /tmp/zookeeper/myid

curl --header 'Accept: application/json' \
    "$METADATA/self/service/containers" | \
    jq  -r '.[] | [ .service_index , .ports[0] ]' -c | \
    sed -r -e 's#\["([^"]+)","([^:]+).*#zk.\1=\2:2888:3888#g' >> \
    /opt/zookeeper/conf/zoo.cfg

exec /opt/zookeeper/bin/zkServer.sh start-foreground

{'fraction_non_alphanumeric': 0.20282542885973764, 'fraction_numerical': 0.03834510595358224, 'mean_word_length': 3.699052132701422, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '5373151', 'n_tokens_mistral': 854, 'n_tokens_neox': 772, 'n_words': 141}