#!/bin/bash

source /var/onap/functions

RANCHER_PORT=8880
oom_delay=30
export RANCHER_URL=http://localhost:$RANCHER_PORT
export RANCHER_ACCESS_KEY='access_key'
export RANCHER_SECRET_KEY='secret_key'

# _install_docker() - Function that installs Docker version for Rancher
function _install_docker {
    if ! $(docker version &>/dev/null); then
        curl https://releases.rancher.com/install-docker/1.12.sh | sh
        _configure_docker_settings 15
    fi
}

# _pull_rancher_images() - Function that retrieves Rancher images required for k8s
function _pull_rancher_images {
    for image in "net:v0.13.5" "k8s:v1.8.5-rancher3" \
"lb-service-rancher:v0.7.17" "network-manager:v0.7.18" "metadata:v0.9.5" \
"kubectld:v0.8.5" "kubernetes-agent:v0.6.6" "dns:v0.15.3" \
"kubernetes-auth:v0.0.8" "healthcheck:v0.3.3" "etcd:v2.3.7-13" \
"etc-host-updater:v0.0.3" "net:holder"; do
        pull_docker_image rancher/$image &
    done
}

# _pull_k8s_images() - Function that retrieves Google k8s images
function _pull_k8s_images {
    for image in "kubernetes-dashboard-amd64:v1.7.1" \
"k8s-dns-sidecar-amd64:1.14.5" "k8s-dns-kube-dns-amd64:1.14.5" \
"k8s-dns-dnsmasq-nanny-amd64:1.14.5" "heapster-influxdb-amd64:v1.3.3" \
"heapster-grafana-amd64:v4.4.3" "heapster-amd64:v1.4.0" "pause-amd64:3.0"; do
        pull_docker_image gcr.io/google_containers/$image  &
    done
}

# _install_rancher() - Function that installs Rancher CLI and container
function _install_rancher {
    local rancher_version=v0.6.5
    local rancher_server_version=v1.6.10
    local rancher_server=rancher/server:$rancher_server_version

    if [ ! -d /opt/rancher/current ]; then
        mkdir -p /opt/rancher/current
        wget https://github.com/rancher/cli/releases/download/$rancher_version/rancher-linux-amd64-$rancher_version.tar.gz
        tar -xzf rancher-linux-amd64-$rancher_version.tar.gz -C /tmp
        mv /tmp/rancher-$rancher_version/rancher /opt/rancher/current/
    fi

    _install_docker
    pull_docker_image $rancher_server
    run_docker_image -d --restart=unless-stopped -p $RANCHER_PORT:8080 $rancher_server
    while true; do
        if curl --fail -X GET $RANCHER_URL; then
            break
        fi
        echo "waiting for racher"
        sleep $oom_delay
    done
}

# _install_kubernetes() - Function that deploys kubernetes via RancherOS host registration
function _install_kubernetes {
    local rancher_agent_version=v1.2.7
    local rancher_agent=rancher/agent:$rancher_agent_version

    _install_rancher

    _pull_rancher_images
    _pull_k8s_images
    pull_docker_image $rancher_agent
    _wait_docker_pull

    pushd /opt/rancher/current/
    export RANCHER_ENVIRONMENT=`./rancher env create -t kubernetes onap_on_kubernetes`
    popd

    install_python_package rancher-agent-registration
    export no_proxy=$no_proxy,$IP_ADDRESS
    rancher-agent-registration --host-ip $IP_ADDRESS --url http://$IP_ADDRESS:$RANCHER_PORT --environment $RANCHER_ENVIRONMENT --key $RANCHER_ACCESS_KEY --secret $RANCHER_SECRET_KEY
}

# _install_kubectl() - Function that installs kubectl as client for kubernetes
function _install_kubectl {
    if ! $(kubectl version &>/dev/null); then
        rm -rf ~/.kube
        curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
        chmod +x ./kubectl
        mv ./kubectl /usr/local/bin/kubectl
        mkdir ~/.kube
        pushd ~/.kube
        python /var/onap/files/kubectl_config_generator.py
        popd
    fi
}

# _install_helm() - Function that install Kubernetes Package Manager
function _install_helm {
    local helm_version=v2.3.0

    if ! $(helm version &>/dev/null); then
        wget http://storage.googleapis.com/kubernetes-helm/helm-${helm_version}-linux-amd64.tar.gz
        tar -zxvf helm-${helm_version}-linux-amd64.tar.gz -C /tmp
        mv /tmp/linux-amd64/helm /usr/local/bin/helm
        helm init
    fi
}

# _pull_images_from_yaml() - Function that parses a yaml file and pull their images
function _pull_images_from_yaml_file {
    local values_file=$1
    local prefix=$2
    local s='[[:space:]]*'
    local w='[a-zA-Z0-9_]*'
    fs=`echo @|tr @ '\034'`

    for line in $(sed -ne "s|^\($s\):|\1|" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p"  $values_file |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {
    if (i > indent) {
        delete vname[i]}
    }
    if (length($3) > 0) {
        vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])(".")}
        printf("%s%s%s=%s\n", "'$prefix'",vn, $2, $3);
    }
}' | grep image); do
        echo $line
        if echo $line | grep -q Version ; then
            pull_docker_image "$image_name:$(echo $line | awk -F "=" '{print $2}')" &
        else
            image_name=`echo ${line#*=}`
            if [[ ${image_name#*${nexus_docker_repo:-nexus3.onap.org:10001}} == *:* ]]; then
                pull_docker_image $image_name &
            else
                pull_docker_image $image_name:latest
            fi
        fi
    done
}

# _wait_docker_pull() - Function that waits for all docker pull processes
function _wait_docker_pull {
    local counter=150

    while [ $(ps -ef | grep "docker pull" | wc -l) -gt 1 ]; do
        sleep $oom_delay
        counter=$((counter - 1))
        if [ "$counter" -eq 0 ]; then
            break
        fi
    done
}

# get_oom_images() - Function that retrieves ONAP images from official hub
function get_oom_images {
    if [[ "$build_image" == "True" ]]; then
        # TODO(electrocucaracha): Create a function for calling the build docker function of every ONAP project
        echo "Not Implemented"
    else
        if [[ "$clone_repo" != "True" ]]; then
            clone_repos "oom"
        fi

        docker_openecomp_login
        for values_file in `find ${src_folders[oom]}/kubernetes -name values.yaml -type f`; do
            _pull_images_from_yaml_file $values_file
        done
        docker logout
        _wait_docker_pull
    fi
}

# _install_oom() - Function that clones OOM and deploys ONAP
function install_oom {
    if [[ "$clone_repo" != "True" ]]; then
        clone_repos "oom"
    fi
    pushd ${src_folders[oom]}/kubernetes/oneclick
    source setenv.bash

    pushd ${src_folders[oom]}/kubernetes/config
    cp onap-parameters-sample.yaml onap-parameters.yaml
    ./createConfig.sh -n onap
    popd

    for app in consul msb mso message-router sdnc vid robot portal policy appc aai sdc dcaegen2 log cli multicloud clamp vnfsdk uui aaf vfc kube2msb; do
        ./createAll.bash -n onap -a $app
    done
    popd
}

# init_oom() - Function that deploys ONAP using OOM
function init_oom {
    mount_external_partition sda /var/lib/docker/
    _install_kubernetes
    _install_kubectl
    _install_helm
    if [[ "$clone_repo" == "True" ]]; then
        clone_repos "oom"
    fi

    if [[ "$skip_get_images" == "False" ]]; then
        get_oom_images
        if [[ "$skip_install" == "False" ]]; then
            until kubectl cluster-info; do
                echo "waiting for kubernetes host"
                sleep $oom_delay
            done
            install_oom
        fi
    fi
}
