Fix install_traininghost and install_leofs argument issue 78/14978/6
authormoksh.baweja <moksh.baweja@samsung.com>
Wed, 24 Sep 2025 14:09:51 +0000 (19:39 +0530)
committerMoksh Baweja <moksh.baweja@samsung.com>
Fri, 3 Oct 2025 17:43:58 +0000 (17:43 +0000)
Install traininghost and leofs require RECIPE file that is fixed.
Introducing argument so any RECIPE file can be introduced.
Added default RECIPE file incase none is provided.

Issue-Id: AIMLFW-260
Change-Id: I87a800f9c76b7c93d3d33118be6fb058aac4e3ab
Signed-off-by: moksh.baweja <moksh.baweja@samsung.com>
bin/install_traininghost.sh
tools/leofs/bin/install_leofs.sh

index a3dc8d8..2fc0c06 100755 (executable)
 #
 # ==================================================================================
 
+if [ -z "$1" ]; then
+  echo "No RECIPE file path provided. Using default: RECIPE_EXAMPLE/example_recipe_latest_stable.yaml"
+  RECIPE_FILE=RECIPE_EXAMPLE/example_recipe_latest_stable.yaml
+else
+  RECIPE_FILE=$1
+fi
+
+if [ ! -f $RECIPE_FILE ]; then
+  echo "Error: RECIPE file not found at $RECIPE_FILE"
+  exit 1
+fi
+
 tools/kubernetes/install_k8s.sh
 kubectl taint nodes --all node-role.kubernetes.io/control-plane-
 tools/nfs/configure_nfs_server.sh localhost
@@ -24,7 +36,7 @@ tools/nfs/install_nfs_subdir_external_provisioner.sh localhost
 
 bin/install_common_templates_to_helm.sh
 bin/build_default_pipeline_image.sh
-tools/leofs/bin/install_leofs.sh
+tools/leofs/bin/install_leofs.sh $RECIPE_FILE
 tools/kubeflow/bin/install_kubeflow.sh
 kubectl create namespace traininghost
 #copy of secrets to traininghost namespace to enable modelmanagement service to access leofs
@@ -32,4 +44,4 @@ kubectl get secret leofs-secret --namespace=kubeflow -o yaml | sed -e 's/kubeflo
 
 kubectl apply -f bin/rolebindings.yaml
 bin/install_databases.sh
-bin/install.sh -f RECIPE_EXAMPLE/example_recipe_latest_stable.yaml
+bin/install.sh -f $RECIPE_FILE
index b4c0460..81edd83 100755 (executable)
 #
 # ==================================================================================
 
+if [ -z "$1" ]; then
+  echo "Error: RECIPE file path not provided."
+  exit 1
+fi
+
+RECIPE_FILE=$1
+
+if [ ! -f "$RECIPE_FILE" ]; then
+  echo "Error: RECIPE file not found at $RECIPE_FILE"
+  exit 1
+fi
+
 kubectl create namespace kubeflow
 sleep 10
 head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 | kubectl create secret generic leofs-secret -n kubeflow --from-file=password=/dev/stdin
@@ -28,7 +40,7 @@ sudo buildctl --addr=nerdctl-container://buildkitd build \
     --output type=oci,name=leofs | sudo nerdctl load --namespace k8s.io
     
 helm dep up helm/leofs
-helm install leofs helm/leofs -f RECIPE_EXAMPLE/example_recipe_latest_stable.yaml
+helm install leofs helm/leofs -f $RECIPE_FILE
 sleep 10
 NAMESPACE=kubeflow
 COMPONENT=leofs