From 1bbcf049527c186c691c7188878fb7577c9b0ec5 Mon Sep 17 00:00:00 2001 From: Aditi Gaur Date: Tue, 4 Mar 2025 13:30:30 -0800 Subject: [PATCH] Fix do-install flag. If packages are installed, slurm configuration still needs to be done. --- slurm/install/install.py | 4 +++- .../files/install-non-scheduler.sh | 15 ++++++++++----- .../cluster-init/scripts/00-install.sh | 19 ++++++++++++------- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/slurm/install/install.py b/slurm/install/install.py index 76a53ad6..071a43e3 100644 --- a/slurm/install/install.py +++ b/slurm/install/install.py @@ -644,6 +644,7 @@ def main() -> None: "--mode", default="scheduler", choices=["scheduler", "execute", "login"] ) parser.add_argument("--bootstrap-config", default="jetpack") + parser.add_argument("--do-install", default=True) args = parser.parse_args() @@ -663,7 +664,8 @@ def main() -> None: munge_key(settings) # runs either rhel.sh or ubuntu.sh to install the packages - run_installer(settings, os.path.abspath(f"{args.platform}.sh"), args.mode) + if args.do_install: + run_installer(settings, os.path.abspath(f"{args.platform}.sh"), args.mode) # various permissions fixes fix_permissions(settings) diff --git a/specs/default/cluster-init/files/install-non-scheduler.sh b/specs/default/cluster-init/files/install-non-scheduler.sh index eeea99de..9a6e7eec 100644 --- a/specs/default/cluster-init/files/install-non-scheduler.sh +++ b/specs/default/cluster-init/files/install-non-scheduler.sh @@ -11,12 +11,17 @@ platform=$(jetpack config platform_family rhel) cd $CYCLECLOUD_HOME/system/bootstrap -if [ $do_install == "True" ]; then - jetpack download --project $slurm_project_name $install_pkg - tar xzf $install_pkg - cd azure-slurm-install - python3 install.py --platform $platform --mode $mode --bootstrap-config /opt/cycle/jetpack/config/node.json +if [ "$do_install" == "false" ]; then + do_install=False +elif [ "$do_install" == "true" ]; then + do_install=True fi +rm -rf azure-slurm-install +jetpack download --project $slurm_project_name $install_pkg +tar xzf $install_pkg +cd azure-slurm-install +python3 install.py --platform $platform --mode $mode --bootstrap-config /opt/cycle/jetpack/config/node.json --do-install=$do_install + echo "installation complete. Run start-services scheduler|execute|login to start the slurm services." diff --git a/specs/scheduler/cluster-init/scripts/00-install.sh b/specs/scheduler/cluster-init/scripts/00-install.sh index 1c83c9fb..a2b73b85 100644 --- a/specs/scheduler/cluster-init/scripts/00-install.sh +++ b/specs/scheduler/cluster-init/scripts/00-install.sh @@ -8,14 +8,19 @@ slurm_project_name=$(jetpack config slurm.project_name slurm) platform=$(jetpack config platform_family rhel) cd $CYCLECLOUD_HOME/system/bootstrap -if [ $do_install == "True" ]; then - rm -rf azure-slurm-install - jetpack download --project $slurm_project_name $install_pkg - tar xzf $install_pkg - cd azure-slurm-install - python3 install.py --platform $platform --mode scheduler --bootstrap-config $CYCLECLOUD_HOME/config/node.json - cd .. + +if [ "$do_install" == "false" ]; then + do_install=False +elif [ "$do_install" == "true" ]; then + do_install=True fi +rm -rf azure-slurm-install +jetpack download --project $slurm_project_name $install_pkg +tar xzf $install_pkg +cd azure-slurm-install +python3 install.py --platform $platform --mode scheduler --bootstrap-config $CYCLECLOUD_HOME/config/node.json --do-install=$do_install +cd .. + rm -rf azure-slurm jetpack download --project $slurm_project_name $autoscale_pkg