add support to start the Go version of the open olt adapter and put voltha up config options in README.md
diff --git a/README.md b/README.md
index 9d9caba..16ab5cc 100644
--- a/README.md
+++ b/README.md
@@ -51,6 +51,29 @@
![Demo @ Speed](./resources/kind-voltha.gif "Demo @ Speed")
_NOTE: Shown significantly sped up (20x), actual install was about 8 minutes._
+### `voltha up` Configuration Options
+This options should be set using environment variables, thus to start VOLTHA
+with the BBSIM POD you could use the following command:
+```
+WITH_BBSIM=yes voltha up
+```
+
+| OPTION | DEFAULT | DESCRIPTION |
+| ----------------------------- | ---------------------------- | ----------------------------------------------------------------------------------- |
+| `TYPE` | minimal | `minimal` or `full` and determines number of cluster nodes and etcd cluster members |
+| `WITH_BBSIM` | no | Should the BBSIM POD be deployed? |
+| `JUST_K8S` | no | Should just the KinD Kubernetes cluster be depoyed? (i.e. no VOLTHA) |
+| `DEPLOY_K8S` | yes | Should the KinD Kubernetes cluster be deployed? |
+| `SKIP_RESTART_API` | no | Should the VOLTHA API service be restarted after install to avoid known bug? |
+| `INSTALL_KUBECTL` | yes | Should a copy of `kubectl` be installed locally? |
+| `INSTALL_HELM` | yes | Should a copy of `helm` be installed locallly? |
+| `USE_GO` | yes | Should the Go[lang] version of the OpenOLT adapter be used? |
+| `VOLTHA_LOG_LEVEL` | WARN | Log level to set for VOLTHA core processes |
+| `VOLTHA_CHART` | onf/voltha | Helm chart to used to install voltha |
+| `VOLTHA_ADAPTER_SIM_CHART` | onf/voltha-adapter-simulated | Helm chart to use to install simulated device adapter |
+| `VOLTHA_ADAPTER_OPEN_OLT_CHART` | onf/voltha-adapter-openolt | Helm chart to use to install OpenOlt adapter |
+| `VOLTHA_ADAPTER_OPEN_ONU_CHART` | onf/voltha-adapter-openonu | Helm chart to use to install OpenOnu adapter |
+
## Create Kubernetes Cluster
Kind provides a command line control tool to easily create Kubernetes clusters
using just a basic Docker envionrment. The following commands will create
diff --git a/voltha b/voltha
index 9b95959..1a0d608 100755
--- a/voltha
+++ b/voltha
@@ -52,6 +52,7 @@
VOLTHA_ADAPTER_OPEN_OLT_CHART=${VOLTHA_ADAPTER_OPEN_OLT_CHART:-onf/voltha-adapter-openolt}
VOLTHA_ADAPTER_OPEN_ONU_CHART=${VOLTHA_ADAPTER_OPEN_ONU_CHART:-onf/voltha-adapter-openonu}
VOLTHA_LOG_LEVEL=${VOLTHA_LOG_LEVEL:-WARN}
+USE_GO=${USE_GO:-yes}
HAVE_GO=$(which go >/dev/null 2>&1 && echo "yes" || echo "no")
HOSTOS=$(uname -s | tr "[:upper:]" "[:lower:"])
@@ -122,6 +123,17 @@
SKIP_RESTART_API=no
fi
+# Verify USE_GO settting and convert uniform value of yes or no
+if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$USE_GO:") -eq 0 ]; then
+ >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$USE_GO value of '$USE_GO'. Should be 'yes' or 'no'${NORMAL}"
+ exit 1
+fi
+if [ $(echo ":y:yes:true:1:" | grep -ic ":$USE_GO:") -eq 1 ]; then
+ USE_GO=true
+else
+ USE_GO=false
+fi
+
# Verify INSTALL_HELM settting and convert uniform value of yes or no
if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$INSTALL_HELM:") -eq 0 ]; then
>&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$INSTALL_HELM value of '$INSTALL_HELM'. Should be 'yes' or 'no'${NORMAL}"
@@ -180,6 +192,22 @@
LOG="install-$TYPE.log"
date > $LOG
+# Output install options to log
+echo "OPTIONS" >> $LOG
+echo " TYPE = $TYPE" >> $LOG
+echo " WITH_BBSIM = $WITH_BBSIM" >> $LOG
+echo " JUST_K8S = $JUST_K8S" >> $LOG
+echo " DEPLOY_K8S = $DEPLOY_K8S" >> $LOG
+echo " SKIP_RESTART_API = $SKIP_RESTART_API" >> $LOG
+echo " INSTALL_KUBECTL = $INSTALL_KUBECTL" >> $LOG
+echo " INSTALL_HELM = $INSTALL_HELM" >> $LOG
+echo " VOLTHA_CHART = $VOLTHA_CHART" >> $LOG
+echo " VOLTHA_ADAPTER_SIM_CHART = $VOLTHA_ADAPTER_SIM_CHART" >> $LOG
+echo " VOLTHA_ADAPTER_OPEN_OLT_CHART = $VOLTHA_ADAPTER_OPEN_OLT_CHART" >> $LOG
+echo " VOLTHA_ADAPTER_OPEN_ONU_CHART = $VOLTHA_ADAPTER_OPEN_ONU_CHART" >> $LOG
+echo " VOLTHA_LOG_LEVEL = $VOLTHA_LOG_LEVEL" >> $LOG
+echo " USE_GO = $(echo $USE_GO | test $(grep -c true) -eq 1 && echo yes || echo no)" >> $LOG
+
spin() {
PARTS="\
\xe2\xa2\x8e\xe2\xa1\xb0 \
@@ -335,7 +363,7 @@
COUNT=$(expr 300 / 15)
bspin $INDENT $MESSAGE
- (set -x; helm install -f $TYPE-values.yaml --set defaults.log_level=$VOLTHA_LOG_LEVEL --namespace $NAMESPACE --name $NAME $CHART >>$LOG 2>&1) >>$LOG 2>&1
+ (set -x; helm install -f $TYPE-values.yaml --set use_go=$USE_GO --set defaults.log_level=$VOLTHA_LOG_LEVEL --namespace $NAMESPACE --name $NAME $CHART >>$LOG 2>&1) >>$LOG 2>&1
SUCCESS=$?
while [ $SUCCESS -ne 0 ]; do
sspin $INDENT