#!/bin/bash
###############################################################################
#
# Script used to assist in launching Kubernetes jobs/pods. Expects to be used
# as an supplemental script to the scripts that want to launch their containers
# on a Kubernetes cluster.
#
###############################################################################
#
# Requirements:
#  - Docker login credentials defined inside ~/.docker/config.json
#  - Kubectl installed and configured on machine running the script
#  - Access to a Kubernetes Cluster using v1.5.2 or newer
#  - NFS directories for OpenBMC repo cache, BitBake shared state cache, and
#    shared Jenkins home directory that holds workspaces.
#  - All NFS directories should have RWX permissions for user being used to run
#    the build-setup.sh script
#  - Persistent Volume and Claims created and mounted to NFS directories
#  - Image pull secret exists for image pulls in Kubernetes cluster namespace
#
###############################################################################
# Variables used to create Kubernetes Job:
#  namespace    = the namespace to be used within the Kubernetes cluster
#  registry     = the registry to use to pull and push images
#  imgplsec     = the image pull secret used to access registry if needed
#  jobtimeout   = the amount of time in seconds that the build will wait for
#                 the job to be created in the api of the cluster.
#  podtimeout   = the amount of time in seconds that the build will wait for
#                 the pod to start running on the cluster.
#  imgname      = the name the image that will be passed to the kubernetes api
#                 to build the containers. The image with the tag imgname will
#                 be built in the invoker script. This script will then tag it
#                 to include the registry in the name, push it, and update the
#                 imgname to be what was pushed to the registry. Users should
#                 not include the registry in the original imgname.
#  podname      = the name of the pod, will be needed to trace down the logs
#
###############################################################################
# Variables that act as script options:
#  invoker      = name of what this script is being called by or for, used to
#                 determine the template to use for YAML file
#  log          = set to true to make the script tail the container logs of pod
#  purge        = set to true delete the created object once script completes
#  launch       = used to determine the template for YAML file, Usually brought
#                 in by sourcing from another script but can be declared
#  workaround   = Used to enable the logging workaround, when set will launch a
#                 modified template that waits for a command. In most cases it
#                 will be waiting to have a script run via kubectl exec. Needed
#                 when using a version of Kubernetes that has known issues that
#                 impact the retrieval of container logs when using kubectl.
#                 Defaulting to be true whenever logging is enabled until ICP
#                 upgrades their Kubernetes version.
###############################################################################

# Kubernetes Variables
namespace=${namespace:-openbmc}
imgrepo=${imgrepo:-master.cfc:8500/openbmc/}
imgplsec=${imgplsec:-regkey}
jobtimeout=${jobtimeout:-60}
podtimeout=${podtimeout:-600}

# Options which decide script behavior
invoker=${invoker:-${1}}
log=${log:-${2}}
purge=${purge:-${3}}
launch=${launch:-${4}}
workaround=${workaround:-${log}}

# Set the variables for the specific invoker to fill in the YAML template
# Other variables in the template not declared here are declared by invoker
case ${invoker} in
  OpenBMC-build)
    wclaim=${wclaim:-jenkins-slave-space}
    sclaim=${sclaim:-shared-state-cache}
    oclaim=${oclaim:-openbmc-reference-repo}
    newimgname=${newimgname:-${imgrepo}${distro}:${imgtag}-${ARCH}}
    podname=${podname:-openbmc${BUILD_ID}-${target}-builder}
    ;;
  QEMU-build)
    podname=${podname:-qemubuild${BUILD_ID}}
    wclaim=${wclaim:-jenkins-slave-space}
    qclaim=${qclaim:-qemu-repo}
    newimgname="${imgrepo}${imgname}"
    ;;
  QEMU-launch)
    deployname=${deployname:-qemu-launch-deployment}
    podname=${podname:-qemu-instance}
    replicas=${replicas:-5}
    wclaim=${wclaim:-jenkins-slave-space}
    jenkins_subpath=${jenkins_subpath:-Openbmc-Build/openbmc/build}
    newimgname="${imgrepo}qemu-instance"
    ;;
  XCAT-launch)
    ;;
  generic)
    ;;
  *)
    exit 1
    ;;
esac

# Tag the image created by the invoker with a name that includes the imgrepo
docker tag ${imgname} ${newimgname}
imgname=${newimgname}

# Push the image that was built to the image repository
docker push ${imgname}

if [[ "$ARCH" == x86_64 ]]; then
  ARCH=amd64
fi

extras=""
if [[ "${workaround}" == "true" ]]; then
  extras+="-v2"
fi

yamlfile=$(eval "echo \"$(<./kubernetes/Templates/${invoker}-${launch}${extras}.yaml)\"")
kubectl create -f - <<< "${yamlfile}"

# If launch is a job we have to find the podname with identifiers
if [[ "${launch}" == "job" ]]; then
  while [ -z ${replace} ]
  do
    if [ ${jobtimeout} -lt 0 ]; then
      kubectl delete -f - <<< "${yamlfile}"
      echo "Timeout occurred before job was present in the API"
      exit 1
    else
      sleep 1
      let jobtimeout-=1
    fi
    replace=$(kubectl get pods -n ${namespaces} | grep ${podname} | awk 'print $1')
  done
  podname=${replace}
fi


# Once pod is running track logs
if [[ "${log}" == true ]]; then
  # Wait for Pod to be running
  checkstatus="kubectl describe pod ${podname} -n ${namespace}"
  status=$( ${checkstatus} | grep Status: )
  while [ -z "$( echo ${status} | grep Running)" ]
  do
    if [ ${podtimeout} -lt 0 ]; then
      kubectl delete -f - <<< "${yamlfile}"
      echo "Timeout occurred before pod was Running"
      exit 1
    else
      sleep 1
      let podtimeout-=1
    fi
    status=$( ${checkstatus} | grep Status: )
  done
  # Tail the logs of the pod, if workaround enabled start executing build script instead.
  if [[ "${workaround}" == "true" ]]; then
    kubectl exec -it ${podname} -n ${namespace} ${WORKSPACE}/build.sh
  else
    kubectl logs -f ${podname} -n ${namespace}
  fi
fi

# Delete the object if purge is true
if [[ "${purge}" == true ]]; then
  kubectl delete -f - <<< "${yamlfile}"
fi
