Skip to content

Commit

Permalink
add support for ood-dev sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
hsnfirooz committed Nov 1, 2024
1 parent 920c2dd commit 7489174
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
42 changes: 40 additions & 2 deletions bin/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -47,6 +49,7 @@ SPEECH2TEXT_CPUS_PER_TASK="6"

CLI=false
OOD=false
OODDEV=false

if [ "$#" -gt 0 ]; then
for arg in "$@"; do
Expand All @@ -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"
Expand Down Expand Up @@ -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>|$VERSION|g" $SCRIPT
sed -i "s|<SPEECH2TEXT>|$SPEECH2TEXT|g" $SCRIPT
sed -i "s|<CONDA_ENV>|$CONDA_ENV|g" $SCRIPT
sed -i "s|<HF_HOME>|$HF_HOME|g" $SCRIPT
sed -i "s|<PYANNOTE_CACHE>|$PYANNOTE_CACHE|g" $SCRIPT
sed -i "s|<TORCH_HOME>|$TORCH_HOME|g" $SCRIPT
sed -i "s|<PYANNOTE_CONFIG>|$PYANNOTE_CONFIG|g" $SCRIPT
sed -i "s|<NUMBA_CACHE_DIR>|$NUMBA_CACHE_DIR|g" $SCRIPT
sed -i "s|<MPLCONFIGDIR>|$MPLCONFIGDIR|g" $SCRIPT
sed -i "s|<SPEECH2TEXT_MEM>|$SPEECH2TEXT_MEM|g" $SCRIPT
sed -i "s|<SPEECH2TEXT_CPUS_PER_TASK>|$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
2 changes: 1 addition & 1 deletion bin/deploy-data/ood/template/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export SPEECH2TEXT_CPUS_PER_TASK="<SPEECH2TEXT_CPUS_PER_TASK>"

export HF_HUB_OFFLINE="1"

module load speech2text
module load speech2text/<VERSION>
speech2text "$audio_path"

0 comments on commit 7489174

Please sign in to comment.