diff --git a/scripts/configure_cryosparc_for_slurm.sh b/scripts/configure_cryosparc_for_slurm.sh deleted file mode 100755 index bb584ee..0000000 --- a/scripts/configure_cryosparc_for_slurm.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# Check that CRYOSPARC_HOME is set and directory exists -if [ -z "$CRYOSPARC_HOME" ]; then - echo "Error: CRYOSPARC_HOME is not set." - return 1 -fi - -if [ ! -d "$CRYOSPARC_HOME" ]; then - echo "Error: CRYOSPARC_HOME directory '$CRYOSPARC_HOME' does not exist." - return 1 -fi - -cd "$CRYOSPARC_HOME" || { echo "Failed to change directory to $CRYOSPARC_HOME"; return 1; } - -echo "Cloning merlin7 branch of merlin-cryosparc into 'config' directory..." -if git clone -b merlin7 git@gitea.psi.ch:CLS-IT/merlin-cryosparc.git config; then - echo "Clone successful." -else - echo "Git clone failed." - return 1 -fi - -# Define remote host -remote_host="merlin7-cryosparc01.psi.ch" - -echo "Running install_filter on remote host..." -if ssh "$USER@$remote_host" install_filter; then - echo "install_filter command completed successfully." -else - echo "install_filter command failed." - return 1 -fi - -echo "Running connect_all on remote host..." -if ssh "$USER@$remote_host" connect_all; then - echo "connect_all command completed successfully." -else - echo "connect_all command failed." - return 1 -fi diff --git a/scripts/install_cryosparc_lanes.sh b/scripts/install_cryosparc_lanes.sh new file mode 100755 index 0000000..c926bee --- /dev/null +++ b/scripts/install_cryosparc_lanes.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +# Set CryoSPARC installation directory +CRYOSPARC_HOME="/data/user/$USER/cryosparc" + +# Check that CRYOSPARC_HOME is set and directory exists +if [ -z "$CRYOSPARC_HOME" ]; then + echo "Error: CRYOSPARC_HOME is not set." + return 1 +fi + +if [ ! -d "$CRYOSPARC_HOME" ]; then + echo "Error: CRYOSPARC_HOME directory '$CRYOSPARC_HOME' does not exist." + return 1 +fi + +cd "$CRYOSPARC_HOME" || { echo "Failed to change directory to $CRYOSPARC_HOME"; return 1; } + +# Check if 'config' directory already exists +if [ -d "config/.git" ]; then + echo "'config' directory already exists. Attempting to pull latest changes..." + cd config || { echo "Failed to change directory to config"; return 1; } + + # Check if we're on the correct branch + current_branch=$(git rev-parse --abbrev-ref HEAD) + if [ "$current_branch" != "merlin7" ]; then + echo "Switching to 'merlin7' branch..." + git fetch origin merlin7 && git checkout merlin7 || { echo "Failed to switch to merlin7 branch"; return 1; } + fi + + git pull || { echo "Git pull failed."; return 1; } + echo "Repository updated successfully." +else + echo "Cloning merlin7 branch of merlin-cryosparc into 'config' directory..." + if git clone -b merlin7 git@gitea.psi.ch:CLS-IT/merlin-cryosparc.git config; then + echo "Clone successful." + else + echo "Git clone failed." + return 1 + fi +fi + +# Define remote host +remote_host="merlin7-cryosparc01.psi.ch" + +echo "Running install_filter on remote host..." +if ssh "$USER@$remote_host" install_filter; then + echo "install_filter command completed successfully." +else + echo "install_filter command failed." + return 1 +fi + +echo "Running connect_all on remote host..." +if ssh "$USER@$remote_host" connect_all; then + echo "connect_all command completed successfully." +else + echo "connect_all command failed." + return 1 +fi diff --git a/scripts/install_cryosparc_worker.sh b/scripts/install_cryosparc_worker.sh index 29d3b80..1f26c00 100755 --- a/scripts/install_cryosparc_worker.sh +++ b/scripts/install_cryosparc_worker.sh @@ -1,5 +1,8 @@ #!/bin/bash +# Set CryoSPARC installation directory +CRYOSPARC_HOME="/data/user/$USER/cryosparc" + # Check CRYOSPARC_HOME if [ -z "$CRYOSPARC_HOME" ]; then echo "Error: CRYOSPARC_HOME is not set."