<commit_before>#!/usr/bin/env bash
set -ex
# setup the environment file. Export the env-vars passed as args to 'vagrant up'
# This script will also: add keys, update and install pre-requisites

echo Args passed: [[ $@ ]]

cat <<EOF >/etc/profile.d/envvar.sh
export http_proxy='${http_proxy}'
export https_proxy='${https_proxy}'
export HTTP_PROXY='${http_proxy}'
export HTTPS_PROXY='${https_proxy}'
EOF

source /etc/profile.d/envvar.sh

if [ "$1" = "install" ];then
    echo "Updating apt lists..."
    sudo -E apt-get update

    echo "Installing dependency packages..."
    sudo -E apt-get install -y apt-transport-https \
                      ca-certificates \
                      curl \
                      software-properties-common \
                      htop

    echo "Adding Kubernetes repo..."
    curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo -E apt-key add -
    sudo -E add-apt-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"

    if [ "${node_os_release}" == "16.04" ] ; then
      echo "Adding Docker repo..."
      curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo -E apt-key add -
      sudo -E add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
    fi

    echo "Updating apt lists..."
    sudo -E apt-get update -q

    echo "Installing Kubernetes Components..."
    sudo -E apt-get install -qy kubelet=${k8s_version}-00 \
                      kubectl=${k8s_version}-00 \
                      kubeadm=${k8s_version}-00 kubernetes-cni=0.6.0-00

    echo "Installing Docker..."
    if [ "${node_os_release}" == "16.04" ] ; then
      sudo -E apt-get install -y docker-ce=${docker_version}~ubuntu
    else
      sudo -E apt-get install -y docker.io=18.06.1-0ubuntu1.2~18.04.1
    fi

    systemctl stop docker
    modprobe overlay

    echo '{"storage-driver": "overlay2"}' > /etc/docker/daemon.json
    rm -rf /var/lib/docker/*
    systemctl start docker
fi
<commit_msg>do not hardcode kubernetes-cni version in vagrant setup<commit_after>#!/usr/bin/env bash
set -ex
# setup the environment file. Export the env-vars passed as args to 'vagrant up'
# This script will also: add keys, update and install pre-requisites

echo Args passed: [[ $@ ]]

cat <<EOF >/etc/profile.d/envvar.sh
export http_proxy='${http_proxy}'
export https_proxy='${https_proxy}'
export HTTP_PROXY='${http_proxy}'
export HTTPS_PROXY='${https_proxy}'
EOF

source /etc/profile.d/envvar.sh

if [ "$1" = "install" ];then
    echo "Updating apt lists..."
    sudo -E apt-get update

    echo "Installing dependency packages..."
    sudo -E apt-get install -y apt-transport-https \
                      ca-certificates \
                      curl \
                      software-properties-common \
                      htop

    echo "Adding Kubernetes repo..."
    curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo -E apt-key add -
    sudo -E add-apt-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"

    if [ "${node_os_release}" == "16.04" ] ; then
      echo "Adding Docker repo..."
      curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo -E apt-key add -
      sudo -E add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
    fi

    echo "Updating apt lists..."
    sudo -E apt-get update -q

    echo "Installing Kubernetes Components..."
    ver=`echo $k8s_version | cut -c 3-4`

    if [[ ${ver} -eq 13 ]];then
        sudo -E apt-get install -qy kubelet=${k8s_version}-00 \
                      kubectl=${k8s_version}-00 \
                      kubeadm=${k8s_version}-00 kubernetes-cni=0.6.0-00
    else
        sudo -E apt-get install -qy kubelet=${k8s_version}-00 \
                      kubectl=${k8s_version}-00 \
                      kubeadm=${k8s_version}-00

    echo "Installing Docker..."
    if [ "${node_os_release}" == "16.04" ] ; then
      sudo -E apt-get install -y docker-ce=${docker_version}~ubuntu
    else
      sudo -E apt-get install -y docker.io=18.06.1-0ubuntu1.2~18.04.1
    fi

    systemctl stop docker
    modprobe overlay

    echo '{"storage-driver": "overlay2"}' > /etc/docker/daemon.json
    rm -rf /var/lib/docker/*
    systemctl start docker
fi

{'fraction_non_alphanumeric': 0.13584288052373159, 'fraction_numerical': 0.021510404489127895, 'mean_word_length': 2.2857142857142856, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6707888', 'n_tokens_mistral': 1517, 'n_tokens_neox': 1369, 'n_words': 368}