<commit_before>#!/bin/bash


# Configure a zookeeper ensemble using consul-template
# to populate server lists

set -e 
set -x 

#This is the Zookeeper ID for the node.
# Supply if more than one node in the cluster
export ZK_ID=${ZK_ID:-1}

export ZK_HOME=${ZK_HOME:-/opt/zookeeper}

#ZK super user
ZK_SUPER_USER=${ZK_SUPER_USER:-super}
ZK_SUPER_PW=${ZK_SUPER_PW:-}


#Consul server
CONSUL_CONNECT=${CONSUL_CONNECT:-"consul:8500"}
CONSUL_SERVICE=${CONSUL_SERVICE:-zookeeper}

#If we have consul-template update immediately, we 
#get into a start/stop cycle with all the zk procs
CONSUL_MINWAIT=${CONSUL_MINWAIT:-4s}
CONSUL_MAXWAIT=${CONSUL_MAXWAIT:-20s}

args=()
#Optional: Set up auth to consul server
[[ -n "${CONSUL_TOKEN}" ]]        && args+=" -token ${CONSUL_TOKEN}"
[[ -n "${CONSUL_SSL}" ]]          && args+=" -ssl ${CONSUL_SSL}"
[[ -n "${CONSUL_SSL_VERIFY}" ]]   && args+=" -ssl-verify ${CONSUL_SSL_VERIFY}"

CONSUL_TEMPLATE=/usr/local/bin/consul-template
TEMPLATE_DIR=templates

RESTART_COMMAND=zk_launch.sh

# We can search for "servicename" or "tag.servicename"?
if [ -z ${CONSUL_TAG+x} ]; then 
  CONSUL_QUERY=${CONSUL_SERVICE}
else 
  CONSUL_QUERY="${CONSUL_TAG}.${CONSUL_SERVICE}" 
fi

${CONSUL_TEMPLATE} -consul ${CONSUL_CONNECT} \
                   -wait ${CONSUL_MINWAIT}:${CONSUL_MAXWAIT} \
                   -template ${TEMPLATE_DIR}/zoo.env.tmpl:${ZK_HOME}/conf/zoo.env:${RESTART_COMMAND} $args $@ <commit_msg>Move $args before template option. $args were being added to the zk_launch.sh command<commit_after>#!/bin/bash


# Configure a zookeeper ensemble using consul-template
# to populate server lists

set -e 
set -x 

#This is the Zookeeper ID for the node.
# Supply if more than one node in the cluster
export ZK_ID=${ZK_ID:-1}

export ZK_HOME=${ZK_HOME:-/opt/zookeeper}

#ZK super user
ZK_SUPER_USER=${ZK_SUPER_USER:-super}
ZK_SUPER_PW=${ZK_SUPER_PW:-}


#Consul server
CONSUL_CONNECT=${CONSUL_CONNECT:-"consul:8500"}
CONSUL_SERVICE=${CONSUL_SERVICE:-zookeeper}

#If we have consul-template update immediately, we 
#get into a start/stop cycle with all the zk procs
CONSUL_MINWAIT=${CONSUL_MINWAIT:-4s}
CONSUL_MAXWAIT=${CONSUL_MAXWAIT:-20s}

args=()
#Optional: Set up auth to consul server
[[ -n "${CONSUL_TOKEN}" ]]        && args+=" -token ${CONSUL_TOKEN}"
[[ -n "${CONSUL_SSL}" ]]          && args+=" -ssl ${CONSUL_SSL}"
[[ -n "${CONSUL_SSL_VERIFY}" ]]   && args+=" -ssl-verify ${CONSUL_SSL_VERIFY}"

CONSUL_TEMPLATE=/usr/local/bin/consul-template
TEMPLATE_DIR=templates

RESTART_COMMAND=zk_launch.sh

# We can search for "servicename" or "tag.servicename"?
if [ -z ${CONSUL_TAG+x} ]; then 
  CONSUL_QUERY=${CONSUL_SERVICE}
else 
  CONSUL_QUERY="${CONSUL_TAG}.${CONSUL_SERVICE}" 
fi

${CONSUL_TEMPLATE} -consul ${CONSUL_CONNECT} \
                   -wait ${CONSUL_MINWAIT}:${CONSUL_MAXWAIT} \
                   $args -template ${TEMPLATE_DIR}/zoo.env.tmpl:${ZK_HOME}/conf/zoo.env:${RESTART_COMMAND} $@ 
{'fraction_non_alphanumeric': 0.14918256130790192, 'fraction_numerical': 0.005449591280653951, 'mean_word_length': 4.573055028462998, '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': '487968', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1171, 'n_words': 238}