#!/bin/bash

source /var/onap/functions

hbase_version=1.2.3
aai_src_folder=$git_src_folder/aai
aai_repos=("aai/aai-common" "aai/aai-config" "aai/aai-data" "aai/aai-service" \
"aai/babel" "aai/champ" "aai/data-router" "aai/esr-gui" "aai/esr-server" \
"aai/gizmo" "aai/logging-service" "aai/model-loader" "aai/resources" \
"aai/rest-client" "aai/router-core" "aai/search-data-service" \
"aai/test-config" "aai/traversal" "aai/sparky-fe" "aai/sparky-be")

# install_hadoop() - Function that installs Hadoop
function install_hadoop {
    local release=titan
    local version=1.0.0
    local filename=$release-$version-hadoop1
    local dest_folder=/opt/hadoop/current

    if [ ! -d $dest_folder ]; then
        curl http://s3.thinkaurelius.com/downloads/$release/$filename.zip -o /tmp/${filename}.zip
        install_package unzip
        mkdir -p $dest_folder
        unzip /tmp/${filename}.zip -d $dest_folder
        pushd $dest_folder/${filename}
        # Change commitlog_directory and data_file_directories values (https://stackoverflow.com/a/26856246/1707651)
        sed -i "s|db/cassandra/data|/tmp/data|g" conf/cassandra/cassandra.yaml
        sed -i "s|db/cassandra/commitlog|/tmp/commitlog|g" conf/cassandra/cassandra.yaml

        install_java
        ./bin/titan.sh start
        popd
    fi
}

# install_haproxy() - Function that install HAProxy
function install_haproxy {
    if is_package_installed haproxy; then
        return
    fi
    install_package software-properties-common
    add-apt-repository -y ppa:vbernat/haproxy-1.7
    install_package haproxy
    cp /var/onap/files/haproxy.cfg /etc/haproxy/
    cp /var/onap/files/aai.pem /etc/ssl/private/
    chmod 640 /etc/ssl/private/aai.pem
    chown root:ssl-cert /etc/ssl/private/aai.pem
    mkdir /usr/local/etc/haproxy
    #echo "127.0.0.1 localhost aai-traversal.api.simpledemo.openecomp.org aai-resources.api.simpledemo.openecomp.org" >> /etc/hosts

    service haproxy restart
}

# clone_all_aai_repos() - Function that clones AAI source repo.
function clone_all_aai_repos {
    for repo in ${aai_repos[@]}; do
        clone_repo $repo $aai_src_folder${repo#*aai}
    done
}

# compile_aai_repos() - Function that compiles AAI source repo.
function compile_aai_repos {
    local repos=("aai/aai-common" "aai/resources" "aai/logging-service" "aai/traversal")
    if [[ "$compile_repo" == "True" ]]; then
        repos=("${aai_repos[@]}")
    fi

    for repo in ${repos[@]}; do
        compile_src $aai_src_folder${repo#*aai}
    done
}

# setup_titan() - Function that configures AAI services to connect to Hadoop Titan
function setup_titan {
    local subdirectory="bundleconfig-local/etc/appprops"
    install_python_package crudini

    for dirc in resources/aai-resources traversal/aai-traversal; do
        for file in titan-cached.properties titan-realtime.properties; do
            crudini --set "$aai_src_folder/$dirc/$subdirectory/$file" "" "storage.backend" "cassandra"
            crudini --set "$aai_src_folder/$dirc/$subdirectory/$file" "" "storage.hostname" "localhost"
        done
    done

    # Add the schema to the local isntance
    compile_src $aai_src_folder/resources/aai-resources/
    uninstall_packages default-jre openjdk-7-jdk openjdk-7-jre openjdk-7-jre-headless
    pushd $aai_src_folder
    java -DAJSC_HOME=$aai_src_folder/resources/aai-resources -DBUNDLECONFIG_DIR="bundleconfig-local" -cp aai-common/aai-core/target/aai-core-1.1.0-SNAPSHOT.jar:resources/aai-resources/target/aai-resources.jar:resources/aai-resources/target/userjars/* org.openecomp.aai.dbgen.GenTester
    popd
}

# start_aai_microservices() - Function that starts AAI microservices
function start_aai_microservices {
    install_maven
    export MAVEN_OPTS="-Xms1024m -Xmx5120m -XX:PermSize=2024m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=9446,server=y,suspend=n"
    for svc in resources traversal; do
        pushd $aai_src_folder/resources
        mvn -P runAjsc
        popd
    done
}

# _pull_hbase_image() - Pull HBase container image from a Docker Registry Hub
function _pull_hbase_image {
    docker_openecomp_login
    docker pull $nexus_docker_repo/aaidocker/aai-hbase-${hbase_version}
}

# install_hbase() - Install HBase Service
function install_hbase {
    docker rm -f hbase
    _pull_hbase_image
    docker run -d --net=host --name="hbase" $nexus_docker_repo/aaidocker/aai-hbase-${hbase_version}
}

# install_ajsc() - Install ASJC Java service container
function install_ajsc_aai {
    cat <<EOL > /etc/ajsc-aai.conf
AAI_REPO_PATH=r/aai
AAI_CHEF_ENV=simpledemo
AAI_CHEF_LOC=/var/chef/aai-data/environments
docker_gitbranch=master
EOL
    docker rm -f aai-service
    if [[ "$build_image" == "True" ]]; then
        build_docker_image $aai_src_folder/aai-service/ajsc-aai
    else
        pull_openecomp_image ajsc-aai
    fi

    docker run --env-file /etc/ajsc-aai.conf --name=aai-service --net=host -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt -it -d $nexus_docker_repo/openecomp/ajsc-aai:$docker_version
}

# install_model_loader() Install Model Loader 
function install_model_loader {
    cat <<EOL > /etc/model-loader.conf
DISTR_CLIENT_ASDC_ADDRESS=${SDC_ADDRESS:-c2.vm1.sdc.simpledemo.openecomp.org:8443}
DISTR_CLIENT_CONSUMER_GROUP=${UEB_CONSUMER_GROUP:-SDCGroup}
DISTR_CLIENT_CONSUMER_ID=${UEB_CONSUMER_GROUP_ID:-UEB}
DISTR_CLIENT_ENVIRONMENT_NAME=${dmaap_topic}
DISTR_CLIENT_PASSWORD=${SDC_PASSWORD:-OBF:1ks51l8d1o3i1pcc1r2r1e211r391kls1pyj1z7u1njf1lx51go21hnj1y0k1mli1sop1k8o1j651vu91mxw1vun1mze1vv11j8x1k5i1sp11mjc1y161hlr1gm41m111nkj1z781pw31kku1r4p1e391r571pbm1o741l4x1ksp}
DISTR_CLIENT_USER=${SDC_USER:-aai}
                     
APP_SERVER_BASE_URL=${APP_SERVER_URL:-https://c1.vm1.aai.simpledemo.openecomp.org:8443}
APP_SERVER_AUTH_USER=${APP_USER:-ModelLoader}
APP_SERVER_KEYSTORE_PASSWORD=OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o
APP_SERVER_AUTH_PASSWORD=${APP_PASSWORD:-OBF:1qvu1v2h1sov1sar1wfw1j7j1wg21saj1sov1v1x1qxw}
EOL

    ARGS=""

    docker rm -f model-loader-service
    if [[ "$build_image" == "True" ]]; then
        build_docker_image $aai_src_folder/model-loader/
        ARGS+="--env-file /etc/model-loader.conf model-loader"
    else
        pull_openecomp_image model-loader
        ARGS+="--name=model-loader-service -it -d --env-file /etc/model-loader.conf $nexus_docker_repo/openecomp/model-loader:$docker_version"
    fi
    docker run ${ARGS}
}

# _wait_for_sdc() - Function that determines if SDC is up and running
function _wait_for_sdc {
    if [[ -s "/opt/config/sdc_ip_addr.txt" ]]; then
        SDC_IP_ADDR=$(cat /opt/config/sdc_ip_addr.txt)
    else
        SDC_IP_ADDR="10.0.3.1"
    fi

     # Run Health Check against SDC and verify that all five components are up
    RES=$(curl http://$SDC_IP_ADDR:8181/sdc1/rest/healthCheck | grep -c "OK")
    while [[ $RES -lt 5 ]]; do
        RES=$(curl http://$SDC_IP_ADDR:8181/sdc1/rest/healthCheck | grep -c "OK")
    done
}

# init_aai() - Function that initialize AAI services
function init_aai {
    install_hadoop
    install_haproxy

    if [[ "$clone_repo" == "True" ]]; then
        clone_all_aai_repos
        if [[ "$compile_repo" == "True" ]]; then
            compile_aai_repos
        fi
    fi

    setup_titan
    #start_aai_microservices

    mkdir -p /opt/openecomp/aai/logs
    mkdir -p /opt/openecomp/aai/data

    install_hbase

    # Wait 3 minutes before instantiating the A&AI container
    sleep 180

    install_ajsc_aai
    _wait_for_sdc
    if [[ "$skip_install" == "False" ]]; then
        install_model_loader
    fi
}
