#!/bin/bash
# -----------------------------------------------------------------------------
# Downloads and sets-up Apache Karaf as a basis for running ONOS locally
# as a single-instance.
#
# Note that this in no way impacts the method for running ONOS remotely.
# For that, one should use onos-package and onos-install tools.
# -----------------------------------------------------------------------------

[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults

# TODO: consider putting this under ~/Applications/onos/apache-karaf-...
export KARAF_ROOT=${KARAF_ROOT:-~/Applications/apache-karaf-$KARAF_VERSION}
export STAGE=$(dirname $KARAF_ROOT)

# Validates the specified IP regular expression against existing adapters.
# Excludes local-loopback.
function validateIp {
    ifconfig | awk '{ print $2}' | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | grep $1
}

# Clean the previous Karaf directory if requested and if it exists.
if [ "$1" = "clean" ]; then
    shift
    [ -d $KARAF_ROOT ] && rm -fr $KARAF_ROOT $STAGE/apps $STAGE/config
fi

ONOS_IP=${ONOS_IP:-127.0.0.1}
IP="${1:-$ONOS_IP}"

# If IP was not given, nor configured attempt to use ONOS_NIC env. variable
if [ -z "$IP" -a -n "$ONOS_NIC" ]; then
    IP=$(validateIp $ONOS_NIC)
    [ -z "$IP" ] && echo "No adapter with IP matching $ONOS_NIC found!"
else
    # Otherwise, verify that the IP address given exists among the adapters.
    saveIp=$IP
    IP=$(validateIp $IP)
    [ -z "$IP" ] && echo "No adapter with IP $saveIp found!"
fi

# If IP is still not surmised or if usage was requested, show usage and IPs.
if [ -z "$IP" -o "$1" = "-?" -o "$1" = "-h" -o "$1" = "--help" ]; then
    echo "usage: $(basename $0) [clean] <ip-address>"
    echo "Available IP addresses are:"
    validateIp .
    exit 1
fi

SUBNET="$(echo $IP | cut -d. -f1-3)"

# Bail on any errors
set -e

# Check if Apache Karaf is already installed.
if [ ! -d $KARAF_ROOT ]; then
    # Check if Apache Karaf bits are available and if not, fetch them.
    if [ ! -f $KARAF_TAR ]; then
        echo "Downloading $KARAF_TAR..."
        curl -sL http://downloads.onosproject.org/third-party/apache-karaf-$KARAF_VERSION.tar.gz > $KARAF_TAR
    fi
    [ ! -f $KARAF_ZIP -a ! -f $KARAF_TAR ] && \
        echo "Apache Karaf bits $KARAF_ZIP or $KARAF_TAR not found" && exit 1

    echo "Unpacking $KARAF_TAR to $STAGE..."
    mkdir -p $STAGE
    cd $STAGE
    tar zxf $KARAF_TAR
    rm -rf $KARAF_ROOT/demos
fi

if ! grep -q "/onos-features/" $KARAF_ROOT/etc/org.apache.karaf.features.cfg; then
    # Patch the Apache Karaf distribution file to add ONOS features repository
    echo "Adding ONOS feature repository..."
    perl -pi.old -e "s|^(featuresRepositories=.*)|\1,mvn:org.onosproject/onos-features/$ONOS_POM_VERSION/xml/features|" \
        $KARAF_ROOT/etc/org.apache.karaf.features.cfg
fi

if ! grep -q ",onos-api," $KARAF_ROOT/etc/org.apache.karaf.features.cfg; then
    # Patch the Apache Karaf distribution file to load default ONOS boot features
    export BOOT_FEATURES="webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-gui"
    echo "Adding ONOS boot features $BOOT_FEATURES..."
    perl -pi.old -e "s|^(featuresBoot=.*)|\1,$BOOT_FEATURES|" \
        $KARAF_ROOT/etc/org.apache.karaf.features.cfg
fi

if [ ! -f $KARAF_ROOT/lib/onos-branding-$ONOS_POM_VERSION.jar ]; then
    # Patch the Apache Karaf distribution with ONOS branding bundle
    echo "Branding as ONOS..."
    rm -f $KARAF_ROOT/lib/onos-branding-*.jar
    cp $M2_REPO/org/onosproject/onos-branding/$ONOS_POM_VERSION/onos-branding-$ONOS_POM_VERSION.jar \
        $KARAF_ROOT/lib
fi

echo "Creating local cluster configs for IP $IP..."
[ -d $STAGE/config ] || mkdir -p $STAGE/config
cat > $STAGE/config/cluster.json <<EOF
    { "ipPrefix": "$SUBNET.*",
      "nodes":[ { "id": "$IP", "ip": "$IP", "tcpPort": 9876 }]}
EOF

cat > $STAGE/config/tablets.json <<EOF
    { "nodes": [ { "ip": "$IP", "id": "$IP", "tcpPort": 9876 }],
      "partitions": { "p1": [ { "ip": "$IP", "id": "$IP", "tcpPort": 9876 }]}}
EOF

echo "Staging builtin apps..."
rm -fr $STAGE/apps
onos-stage-apps $STAGE/apps $KARAF_ROOT/system

ACTIVE_APPS=${ONOS_APPS:-drivers,openflow}
echo "Customizing apps to be auto-activated: $ACTIVE_APPS..."
for app in ${ACTIVE_APPS//,/ }; do
    touch $STAGE/apps/org.onosproject.$app/active
done
