diff --git a/README.md b/README.md index ff46a03..c714382 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ To deploy both command line interface (CLI) module and the Open On Demand (OOD) bin/deploy cli ood ``` -or only the other if only one needs updating. +or only the other if only one needs updating. To test the OOD app, you can install using `ood-dev` to install the OOD sandbox app. Check the contents of the script for details. diff --git a/bin/deploy b/bin/deploy index 80893bb..19d60b5 100755 --- a/bin/deploy +++ b/bin/deploy @@ -14,9 +14,11 @@ Usage: $ deploy ood - Deploy both the CLI and OOD app: + Deploy the Open Ondemand (OOD) sandbox app: - $ deploy cli ood + $ deploy ood-dev + + These options could be used together. EOF } @@ -47,6 +49,7 @@ SPEECH2TEXT_CPUS_PER_TASK="6" CLI=false OOD=false +OODDEV=false if [ "$#" -gt 0 ]; then for arg in "$@"; do @@ -56,6 +59,9 @@ if [ "$#" -gt 0 ]; then if [[ "$arg" == "ood" ]]; then OOD=true fi + if [[ "$arg" == "ood-dev" ]]; then + OODDEV=true + fi done else echo "Provide at least one argument: cli or ood" @@ -147,3 +153,35 @@ then echo ".. OOD files pushed to: $REPO_URL. (Do not forget to run the ansible scripts!)" fi + + +# -------------------------------------------------- +# Deploy as an Open OnDemand app sandbox app + +if [ "$OODDEV" = true ] +then + + echo "Deploy the Open OnDemand (OOD) sandbox" + + SCRIPT="$SCRIPT_DIR"/deploy-data/ood/template/script.sh + + sed -i "s||$VERSION|g" $SCRIPT + sed -i "s||$SPEECH2TEXT|g" $SCRIPT + sed -i "s||$CONDA_ENV|g" $SCRIPT + sed -i "s||$HF_HOME|g" $SCRIPT + sed -i "s||$PYANNOTE_CACHE|g" $SCRIPT + sed -i "s||$TORCH_HOME|g" $SCRIPT + sed -i "s||$PYANNOTE_CONFIG|g" $SCRIPT + sed -i "s||$NUMBA_CACHE_DIR|g" $SCRIPT + sed -i "s||$MPLCONFIGDIR|g" $SCRIPT + sed -i "s||$SPEECH2TEXT_MEM|g" $SCRIPT + sed -i "s||$SPEECH2TEXT_CPUS_PER_TASK|g" $SCRIPT + + + USERNAME=$(whoami) + mkdir -p /scratch/work/$USERNAME/.ondemand/dev/speech2text-dev + cp -r bin/deploy-data/ood/* /scratch/work/$USERNAME/.ondemand/dev/speech2text-dev + + echo ".. OOD sandbox app is installed!" + +fi diff --git a/bin/deploy-data/ood/template/script.sh b/bin/deploy-data/ood/template/script.sh index 1c99975..d18d75d 100755 --- a/bin/deploy-data/ood/template/script.sh +++ b/bin/deploy-data/ood/template/script.sh @@ -13,5 +13,5 @@ export SPEECH2TEXT_CPUS_PER_TASK="" export HF_HUB_OFFLINE="1" -module load speech2text +module load speech2text/ speech2text "$audio_path"