#!/bin/bash
. /pi/bin/inc/wait_funcs.sh
. /pi/bin/inc/matchers.sh
. /pi/bin/inc/docker_utils.sh

function start_inventory(){
	# mysqld: ready for connections.
	start_docker inventory "$msg_mysql"
}

export PYTHONPATH=..:$PYTHONPATH
python="$HOME/miniconda3/envs/bigdata/bin/python"
jupyter="$HOME/miniconda3/envs/bigdata/bin/jupyter"
streamlit="$HOME/miniconda3/envs/bigdata/bin/streamlit"

# startup 
if [ $# -lt 1 ]; then	
	echo "available opts: all, zk, storm, repl, ..."
else
	CMD=$1
	case "$CMD" in
	"redis")
		start_docker redis "$msg_redis"
		;;
	"inventory")
		start_inventory
		;;
	"note")		
		$jupyter notebook
		;;
	"sl")
		$python -m sagas.tool.creators normal ${@:2}
		$streamlit run ${@:2}
		;;
	*)
		# default proc
		handle_cmd ${@:1}
		;;
	esac
fi

