#!/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
}

# 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
}
