From a5d30d97b27951b27a8fe0b67bc5f5b2e51b5145 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Mon, 9 Dec 2024 12:48:21 -0500 Subject: [PATCH 1/5] Launch subshell from `hpc_init.sh` with env --- batch/hpc_init.sh | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 batch/hpc_init.sh diff --git a/batch/hpc_init.sh b/batch/hpc_init.sh old mode 100644 new mode 100755 index 2a73268f5..c66f450a0 --- a/batch/hpc_init.sh +++ b/batch/hpc_init.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # Generic setup set -e @@ -140,3 +142,6 @@ Otherwise make sure this diagnostic info looks correct before continuing: EOM set +e + +# Launch subshell with modified environment +eval "$SHELL -i" From 30c1d15c898eaef6ba24b88686bd8a3ac80d84a2 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:02:13 -0500 Subject: [PATCH 2/5] Add output to directly address GH-417 --- build/hpc_install_or_update.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build/hpc_install_or_update.sh b/build/hpc_install_or_update.sh index 745aaf2bf..a3b424027 100755 --- a/build/hpc_install_or_update.sh +++ b/build/hpc_install_or_update.sh @@ -103,4 +103,5 @@ R -e "library(inference); inference::install_cli()" # Done echo "> Done installing/updating flepiMoP." +echo "> To activate the environment, run '$FLEPI_PATH/batch/hpc_init.sh $1'." set +e From 7151d33b16263cac7276b451cf1febadc9f9d85a Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:06:04 -0500 Subject: [PATCH 3/5] Remove `.sh` extension Removed the `.sh` extension from `hpc_init.sh` and `hpc_install_or_update.sh` to clarify that these are executables that should be ran directly by the user. --- batch/{hpc_init.sh => hpc_init} | 0 ...pc_install_or_update.sh => hpc_install_or_update} | 2 +- .../running-on-a-hpc-with-slurm.md | 12 ++++++------ 3 files changed, 7 insertions(+), 7 deletions(-) rename batch/{hpc_init.sh => hpc_init} (100%) rename build/{hpc_install_or_update.sh => hpc_install_or_update} (99%) diff --git a/batch/hpc_init.sh b/batch/hpc_init similarity index 100% rename from batch/hpc_init.sh rename to batch/hpc_init diff --git a/build/hpc_install_or_update.sh b/build/hpc_install_or_update similarity index 99% rename from build/hpc_install_or_update.sh rename to build/hpc_install_or_update index a3b424027..61dd657fe 100755 --- a/build/hpc_install_or_update.sh +++ b/build/hpc_install_or_update @@ -103,5 +103,5 @@ R -e "library(inference); inference::install_cli()" # Done echo "> Done installing/updating flepiMoP." -echo "> To activate the environment, run '$FLEPI_PATH/batch/hpc_init.sh $1'." +echo "> To activate the environment, run '$FLEPI_PATH/batch/hpc_init $1'." set +e diff --git a/documentation/gitbook/how-to-run/advanced-run-guides/running-on-a-hpc-with-slurm.md b/documentation/gitbook/how-to-run/advanced-run-guides/running-on-a-hpc-with-slurm.md index 8c9fa7967..65968fb0b 100644 --- a/documentation/gitbook/how-to-run/advanced-run-guides/running-on-a-hpc-with-slurm.md +++ b/documentation/gitbook/how-to-run/advanced-run-guides/running-on-a-hpc-with-slurm.md @@ -32,10 +32,10 @@ Resolving deltas: 100% (59/59), done. Updating files: 100% (411/411), done. ``` -Run the `hpc_install_or_update.sh` script, substituting `` with either `rockfish` or `longleaf`. This script will prompt the user asking for the location to place the `flepiMoP` clone and the name of the conda environment that it will create. If this is your first time using this script accepting the defaults is the quickest way to get started. Also, expect this script to take a while the first time that you run it. +Run the `hpc_install_or_update` script, substituting `` with either `rockfish` or `longleaf`. This script will prompt the user asking for the location to place the `flepiMoP` clone and the name of the conda environment that it will create. If this is your first time using this script accepting the defaults is the quickest way to get started. Also, expect this script to take a while the first time that you run it. ``` -$ ./flepiMoP/build/hpc_install_or_update.sh +$ ./flepiMoP/build/hpc_install_or_update ``` Remove the temporary clone of the `flepiMoP` repository created before. This step is not required, but does help alleviate confusion later. @@ -46,20 +46,20 @@ $ rm -rf flepiMoP/ ## Updating `flepiMoP` -Updating `flepiMoP` is designed to work just the same as installing `flepiMoP`. Make sure that your clone of the `flepiMoP` repository is set to the branch your working with (if doing development or operations work) and then run the `hpc_install_or_update.sh` script, substituting `` with either `rockfish` or `longleaf`. +Updating `flepiMoP` is designed to work just the same as installing `flepiMoP`. Make sure that your clone of the `flepiMoP` repository is set to the branch your working with (if doing development or operations work) and then run the `hpc_install_or_update` script, substituting `` with either `rockfish` or `longleaf`. ``` -$ ./flepiMoP/build/hpc_install_or_update.sh +$ ./flepiMoP/build/hpc_install_or_update ``` ## Initialize The Created `flepiMoP` Environment These steps to initialize the environment need to run on a per run or as needed basis. -Change directory to where a full clone of the `flepiMoP` repository was placed (it will state the location in the output of the script above). And then run the `hpc_init.sh` script, substituting `` with either `rockfish` or `longleaf`. This script will assume the same defaults as the script before for where the `flepiMoP` clone is and the name of the conda environment. This script will also ask about a project directory and config, if this is your first time initializing `flepiMoP` it might be helpful to clone [the `flepimop_sample` GitHub repository](https://github.com/HopkinsIDD/flepimop\_sample) to the same directory to use as a test. +Change directory to where a full clone of the `flepiMoP` repository was placed (it will state the location in the output of the script above). And then run the `hpc_init` script, substituting `` with either `rockfish` or `longleaf`. This script will assume the same defaults as the script before for where the `flepiMoP` clone is and the name of the conda environment. This script will also ask about a project directory and config, if this is your first time initializing `flepiMoP` it might be helpful to clone [the `flepimop_sample` GitHub repository](https://github.com/HopkinsIDD/flepimop\_sample) to the same directory to use as a test. ``` -$ source batch/hpc_init.sh +$ ./flepiMoP/batch/hpc_init ``` Upon completing this script it will output a sample set of commands to run to quickly test if the installation/initialization has gone okay. From ad936917742da2db7fe633b17e5bf125e113c35d Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:09:04 -0500 Subject: [PATCH 4/5] Add clarity to docs on `hpc_init` --- .../advanced-run-guides/running-on-a-hpc-with-slurm.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/gitbook/how-to-run/advanced-run-guides/running-on-a-hpc-with-slurm.md b/documentation/gitbook/how-to-run/advanced-run-guides/running-on-a-hpc-with-slurm.md index 65968fb0b..2f3d9d24c 100644 --- a/documentation/gitbook/how-to-run/advanced-run-guides/running-on-a-hpc-with-slurm.md +++ b/documentation/gitbook/how-to-run/advanced-run-guides/running-on-a-hpc-with-slurm.md @@ -56,13 +56,13 @@ $ ./flepiMoP/build/hpc_install_or_update These steps to initialize the environment need to run on a per run or as needed basis. -Change directory to where a full clone of the `flepiMoP` repository was placed (it will state the location in the output of the script above). And then run the `hpc_init` script, substituting `` with either `rockfish` or `longleaf`. This script will assume the same defaults as the script before for where the `flepiMoP` clone is and the name of the conda environment. This script will also ask about a project directory and config, if this is your first time initializing `flepiMoP` it might be helpful to clone [the `flepimop_sample` GitHub repository](https://github.com/HopkinsIDD/flepimop\_sample) to the same directory to use as a test. +Change directory to where a full clone of the `flepiMoP` repository was placed (it will state the location in the output of the script above). And then run the `hpc_init` script, substituting `` with either `rockfish` or `longleaf`. This script will assume the same defaults as the script before for where the `flepiMoP` clone is and the name of the conda environment. This script will also ask about a project directory and config, if this is your first time initializing `flepiMoP` it might be helpful to clone [the `flepimop_sample` GitHub repository](https://github.com/HopkinsIDD/flepimop\_sample) to the same directory to use as a test. This script will finish by outputting a summary of the environment changes and launching a subshell with this modified environment. ``` -$ ./flepiMoP/batch/hpc_init +$ ./batch/hpc_init ``` -Upon completing this script it will output a sample set of commands to run to quickly test if the installation/initialization has gone okay. +Upon completing this script it will output a sample set of commands to run to quickly test if the installation/initialization has gone okay. ## Submitting A Batch Inference Job To Slurm From 0dd0aae801b5586e0690f9b2b408774e3cd89098 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:15:33 -0500 Subject: [PATCH 5/5] Change interactive flag to login flag --- batch/hpc_init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/batch/hpc_init b/batch/hpc_init index c66f450a0..bb2fdfdd4 100755 --- a/batch/hpc_init +++ b/batch/hpc_init @@ -144,4 +144,4 @@ EOM set +e # Launch subshell with modified environment -eval "$SHELL -i" +eval "$SHELL -l"