<commit_before>#!/bin/bash

set -e

IP=`ifconfig eth1 | grep 'inet addr' | sed 's/.*addr:\([0-9.]*\) .*/\1/'`

# make sure all containers can do DNS lookups through consul
echo "DOCKER_OPTS='--dns ${IP} --dns 8.8.8.8 --dns-search service.consul'" > /etc/default/docker
service docker restart

# generated using
# docker run --rm progrium/consul cmd:run ${IP} -d

docker run \
    --name consul \
    --restart=always \
    -h $HOSTNAME \
    -p ${IP}:8300:8300 \
    -p ${IP}:8301:8301 \
    -p ${IP}:8301:8301/udp \
    -p ${IP}:8302:8302 \
    -p ${IP}:8302:8302/udp \
    -p ${IP}:8400:8400 \
    -p ${IP}:8500:8500 \
    -p ${IP}:53:53/udp \
    -d progrium/consul \
    -server \
    -advertise ${IP} \
    -bootstrap

docker run -d \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -h $HOSTNAME \
    --restart=always \
    --name registrator \
    progrium/registrator consul://${IP}:8500

mkdir -p /data/redis
chown -R vagrant:vagrant /data

# for more redis config options, see:
# https://registry.hub.docker.com/_/redis/

docker run -d \
    --name redis \
    --restart=always \
    -h $HOSTNAME \
    -v /data/redis:/data \
    -p 6379:6379 \
    -e "SERVICE_TAGS=persistent" \
    redis
<commit_msg>output IP address of eth1<commit_after>#!/bin/bash

set -e

IP=`ifconfig eth1 | grep 'inet addr' | sed 's/.*addr:\([0-9.]*\) .*/\1/'`

# make sure all containers can do DNS lookups through consul
echo "DOCKER_OPTS='--dns ${IP} --dns 8.8.8.8 --dns-search service.consul'" > /etc/default/docker
service docker restart
# HACK: wait a little while docker starts
sleep 3

# generated using
# docker run --rm progrium/consul cmd:run ${IP} -d

docker run \
    --name consul \
    --restart=always \
    -h $HOSTNAME \
    -p ${IP}:8300:8300 \
    -p ${IP}:8301:8301 \
    -p ${IP}:8301:8301/udp \
    -p ${IP}:8302:8302 \
    -p ${IP}:8302:8302/udp \
    -p ${IP}:8400:8400 \
    -p ${IP}:8500:8500 \
    -p ${IP}:53:53/udp \
    -d progrium/consul \
    -server \
    -advertise ${IP} \
    -bootstrap

docker run -d \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -h $HOSTNAME \
    --restart=always \
    --name registrator \
    progrium/registrator consul://${IP}:8500

mkdir -p /data/redis
chown -R vagrant:vagrant /data

# for more redis config options, see:
# https://registry.hub.docker.com/_/redis/

docker run -d \
    --name redis \
    --restart=always \
    -h $HOSTNAME \
    -v /data/redis:/data \
    -p 6379:6379 \
    -e "SERVICE_TAGS=persistent" \
    redis

echo "private network (eth1) IP address id $IP"

{'fraction_non_alphanumeric': 0.18007061592781484, 'fraction_numerical': 0.0639466457434288, 'mean_word_length': 2.211586901763224, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6493166', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1029, 'n_words': 243}