<commit_before>#!/bin/bash

#Example script
#Launch a ZK container that registers and configures an ensemble
# using consul and consul template

DOCKER_IMAGE=${DOCKER_IMAGE:-"asteris/zookeeper:latest"}

#Run a single zk container 
PORTS=" -p 2181:2181 -p 2888:2888 -p 3888:3888 "

#Option #2: Map contaier to host ports
#PORTS=" -p 2181 -p 2888 -p 3888 "

# Zookeeper needs an ID for each node in an ensemble
ZK_ID=${ZK_ID:-${RANDOM}}

#Values for service discovery in consul
SERVICE_TAGS=${SERVICE_TAGS:-"zookeeper"}
ZK_ENV=${ZK_ENV:-"dev"}
ZK_CLUSTER_ID=${ZK_CLUSTER_ID:-"cluster1"}

# what we register in consul
# query at http://consul:8500/v1/catalog/service/${CONSUL_SERVICE}
CONSUL_SERVICE=${CONSUL_SERVICE:-"zookeeper"}

#Used for service discovery in consul template
# for example {{ range "cluster1.zookeeper" }}
CONSUL_QUERY=${CONSUL_QUERY:-"${ZK_CLUSTER_ID}.${CONSUL_SERVICE}"}

CONTAINER_NAME="${SERVICE_NAME}-${ZK_ENV}-${ZK_CLUSTER_ID}-${ZK_ID}"

docker run -d --name ${CONTAINER_NAME} \
             --link consul:consul \
             ${PORTS}  \
             -e ZK_ID="${ZK_ID}" \
             -e CONSUL_QUERY="${CONSUL_QUERY}" \
             -e SERVICE_2181_NAME="${CONSUL_SERVICE}" \
             -e SERVICE_2181_ID="$(hostname -s):${CONTAINER_NAME}:2181:zkid-${ZK_ID}" \
             -e SERVICE_2888_NAME="${CONSUL_SERVICE}-2888" \
             -e SERVICE_2888_ID="$(hostname -s):${CONTAINER_NAME}:2888:zkid-${ZK_ID}" \
             -e SERVICE_3888_NAME="${CONSUL_SERVICE}-3888" \
             -e SERVICE_3888_ID="$(hostname -s):${CONTAINER_NAME}:3888:zkid-${ZK_ID}" \
             -e SERVICE_TAGS="${SERVICE_TAGS},${ZK_ENV},${ZK_CLUSTER_ID},zkid-${ZK_ID}" \
                ${DOCKER_IMAGE}
<commit_msg>Fix container name<commit_after>#!/bin/bash

#Example script
#Launch a ZK container that registers and configures an ensemble
# using consul and consul template

DOCKER_IMAGE=${DOCKER_IMAGE:-"asteris/zookeeper:latest"}

#Run a single zk container 
PORTS=" -p 2181:2181 -p 2888:2888 -p 3888:3888 "

#Option #2: Map contaier to host ports
#PORTS=" -p 2181 -p 2888 -p 3888 "

# Zookeeper needs an ID for each node in an ensemble
ZK_ID=${ZK_ID:-${RANDOM}}

#Values for service discovery in consul
SERVICE_TAGS=${SERVICE_TAGS:-"zookeeper"}
ZK_ENV=${ZK_ENV:-"dev"}
ZK_CLUSTER_ID=${ZK_CLUSTER_ID:-"cluster1"}

# what we register in consul
# query at http://consul:8500/v1/catalog/service/${CONSUL_SERVICE}
CONSUL_SERVICE=${CONSUL_SERVICE:-"zookeeper"}

#Used for service discovery in consul template
# for example {{ range "cluster1.zookeeper" }}
CONSUL_QUERY=${CONSUL_QUERY:-"${ZK_CLUSTER_ID}.${CONSUL_SERVICE}"}

CONTAINER_NAME="${CONSUL_SERVICE}-${ZK_ENV}-${ZK_CLUSTER_ID}-${ZK_ID}"

docker run -d --name ${CONTAINER_NAME} \
             --link consul:consul \
             ${PORTS}  \
             -e ZK_ID="${ZK_ID}" \
             -e CONSUL_QUERY="${CONSUL_QUERY}" \
             -e SERVICE_2181_NAME="${CONSUL_SERVICE}" \
             -e SERVICE_2181_ID="$(hostname -s):${CONTAINER_NAME}:2181:zkid-${ZK_ID}" \
             -e SERVICE_2888_NAME="${CONSUL_SERVICE}-2888" \
             -e SERVICE_2888_ID="$(hostname -s):${CONTAINER_NAME}:2888:zkid-${ZK_ID}" \
             -e SERVICE_3888_NAME="${CONSUL_SERVICE}-3888" \
             -e SERVICE_3888_ID="$(hostname -s):${CONTAINER_NAME}:3888:zkid-${ZK_ID}" \
             -e SERVICE_TAGS="${SERVICE_TAGS},${ZK_ENV},${ZK_CLUSTER_ID},zkid-${ZK_ID}" \
                ${DOCKER_IMAGE}

{'fraction_non_alphanumeric': 0.15986099044309296, 'fraction_numerical': 0.0509701708659137, 'mean_word_length': 3.636241610738255, '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': '7227459', 'n_tokens_mistral': 1451, 'n_tokens_neox': 1360, 'n_words': 236}