manually setup redfish tools to allow parallel run
[yaml_builds.git] / tools / 2genesis.sh
index b4065ac..3c2888b 100755 (executable)
@@ -44,23 +44,38 @@ fi
 source $(dirname $0)/env_$SITE.sh
 
 cd $YAML_BUILDS
-# Install OS on Genesis
+
+echo "# Setup redfish tools to avoid race condition"
+/opt/akraino/redfish/setup_tools.sh
+
+FILENAME=$(mktemp)
+echo "# Updating BIOS settings on master and worker nodes in background [$FILENAME]"
+python $YAML_BUILDS/scripts/update_bios_settings.py $SITE.yaml >$FILENAME &
+
+echo "# Install OS on Genesis"
 python $YAML_BUILDS/scripts/jcopy.py $SITE.yaml $YAML_BUILDS/tools/j2/serverrc.j2 $YAML_BUILDS/tools/"$GENESIS_NAME"rc
 /opt/akraino/redfish/install_server_os.sh --rc /opt/akraino/yaml_builds/tools/"$GENESIS_NAME"rc --skip-confirm
 
+echo "# Stage Airship files on Genesis"
 scp $YAML_BUILDS/tars/promenade-bundle-$SITE.tar $GENESIS_HOST:/tmp/
 ssh $GENESIS_HOST << EOF
   # TODO avoid following hard coding$
   route add -net 192.168.41.0/24 gw 192.168.2.1 bond0.41
   mkdir -p /root/akraino
-  cp /tmp/promenade-bundle-$SITE.tar /root/akraino/
   cd /root/akraino/
+  cp /tmp/promenade-bundle-$SITE.tar .
   tar -xmf promenade-bundle-$SITE.tar
+  mv configs/promenade-bundle/deploy_site.sh .
 EOF
-# Update BIOS Setting
-python $YAML_BUILDS/scripts/update_bios_settings.py $SITE.yaml
 
-exec 2>&-
-exec 1>&-
-exit 0
+echo "# Waiting for BIOS updates to finish on master and worker nodes"
+wait
+# Show output from BIOS updates on master and worker nodes
+cat $FILENAME
+rm $FILENAME
+
+echo "#######################################"
+echo "# $0 finished"
+echo "#######################################"
+#pkill -9 $$ && exit 0