Download sync-model-data-ocp.sh from NatLibFi/FintoAI-data-KAUNO: direct link, hf CLI and curl.
- Browser
- Download file 950 Bytes
-
https://huggingface.co/NatLibFi/FintoAI-data-KAUNO/resolve/refs%2Fpr%2F1/sync-model-data-ocp.sh
- Command line
-
hf download hf://NatLibFi/FintoAI-data-KAUNO@refs/pr/1/sync-model-data-ocp.sh
-
curl -L -o sync-model-data-ocp.sh https://huggingface.co/NatLibFi/FintoAI-data-KAUNO/resolve/refs%2Fpr%2F1/sync-model-data-ocp.sh
950 Bytes
| # Runs rsync to transfer model data from the current directory to an OpenShift volume | |
| # that is attached to a pod which is running Annif. The instance | |
| # {api-annif-org,ai-finto-fi, etc.} to transfer to is given as the argument. | |
| # You need to be logged to the cluster with the oc tool. | |
| set -e | |
| if [ $# -ne 1 ] | |
| then | |
| echo "Not enough arguments; argument 1: destination_instance" | |
| exit 1 | |
| fi | |
| pod=$(oc get pods -l app.kubernetes.io/instance=$1,app.kubernetes.io/name=annif -o name) | |
| if [[ $pod = *[[:space:]]* ]] | |
| then | |
| echo "Multiple pod exists; using first" | |
| pod=(${pod//$'\n'/ }) | |
| fi | |
| echo "Target is "$pod | |
| pod=${pod#pod/} | |
| if [ -z "${pod}" ] | |
| then | |
| echo "No target pod found" | |
| exit 1 | |
| fi | |
| rsync --rsh='oc rsh' -avrL --exclude="*train*" --exclude="*zip" --inplace projects.d $pod:/annif-projects | |
| rsync --rsh='oc rsh' -avrL --exclude="*train*" --exclude="*zip" --inplace data/{projects,vocabs} $pod:/annif-projects/data | |