<commit_before>#!/bin/bash

set -e

weaveexec() {
    docker run --rm --privileged \
    -e VERSION \
    -e WEAVE_DEBUG \
    -e WEAVE_DOCKER_ARGS \
    -e WEAVE_DNS_DOCKER_ARGS \
    -e WEAVE_PASSWORD \
    -e WEAVE_PORT \
    -e WEAVE_CONTAINER_NAME \
    -e DOCKER_BRIDGE \
    -v /var/run/docker.sock:/var/run/docker.sock \
    --entrypoint=./weave weaveworks/plugin $@
}

echo Run weave
weaveexec launch -iprange 10.20.0.0/16 $WEAVE_ARGS

echo Run weaveDNS
weaveexec launch-dns 10.254.254.1/24 --watch=false $WEAVE_DNS_ARGS

echo Make weaved containers routable from weaveDNS
WEAVEDNS_PID=$(docker inspect --format='{{ .State.Pid }}' weavedns)
[ ! -d /var/run/netns ] && sudo mkdir -p /var/run/netns
sudo ln -s /proc/$WEAVEDNS_PID/ns/net /var/run/netns/$WEAVEDNS_PID
sudo ip netns exec $WEAVEDNS_PID sudo ip route add 10.20.0.0/16 dev ethwe
sudo rm -f /var/run/netns/$WEAVEDNS_PID

echo Run weave plugin
sudo rm -f /usr/share/docker/plugins/weave.sock
docker rm -f weaveplugin || true

`dirname $0`/start-plugin.sh --nameserver=10.254.254.1 "$@"<commit_msg>Simplify startup scripts<commit_after>#!/bin/bash

set -e

weaveexec() {
    docker run --rm --privileged \
    -e VERSION \
    -e WEAVE_NO_FASTDP \
    -e WEAVE_DEBUG \
    -e WEAVE_DOCKER_ARGS \
    -e WEAVE_DNS_DOCKER_ARGS \
    -e WEAVE_PASSWORD \
    -e WEAVE_PORT \
    -e WEAVE_CONTAINER_NAME \
    -e DOCKER_BRIDGE \
    -v /var/run/docker.sock:/var/run/docker.sock \
    --entrypoint=./weave weaveworks/plugin $@
}

echo Run weave
weaveexec launch-router --ipalloc-range 10.20.0.0/16 $WEAVE_ARGS

echo Run weave plugin
docker rm -f weaveplugin 2>&1 || true
`dirname $0`/start-plugin.sh "$@"
{'fraction_non_alphanumeric': 0.13289236319903788, 'fraction_numerical': 0.028863499699338546, 'mean_word_length': 2.7904328018223237, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 5, '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': '7096774', 'n_tokens_mistral': 757, 'n_tokens_neox': 680, 'n_words': 151}