Handle cryosparc2_ vs cryosparc_ in paths

Breaking change: Remove '2' from default worker paths.

Pulling this change into old installations that still us
`cryosparc2_worker` in the path will temporarily break the worker. To
fix, run `dev/update_version.sh` followed by `./connect_all.sh`.

- new dev/update_versions.sh script to fix your config
- use cryosparcm wrapper, which handles alternate CRYOSPARC_HOME
  correctly
This commit is contained in:
2023-04-21 16:41:34 +02:00
parent 93d47f36b1
commit f529f11f58
7 changed files with 32 additions and 6 deletions

View File

@ -1,7 +1,10 @@
#!/bin/bash
# Connect all lanes to cryosparc
: "${CRYOSPARCM:=/data/user/$USER/cryosparc/cryosparc2_master/bin/cryosparcm}"
# Path to cryosparcm binary
# Defaults to the wrapper script, which validates the host and supports $CRYOSPARC_HOME
: "${CRYOSPARCM:=/data/project/bio/software/cryoSPARC/v2/scripts/cryosparcm.sh}"
if [[ ! -x "$CRYOSPARCM" ]]; then
echo "ERROR: Unable to find cryosparcm at $CRYOSPARCM" >&2

View File

@ -1,6 +1,6 @@
{
"name" : "cpu-daily",
"worker_bin_path" : "/data/user/USERNAME/cryosparc/cryosparc2_worker/bin/cryosparcw",
"worker_bin_path" : "/data/user/USERNAME/cryosparc/cryosparc_worker/bin/cryosparcw",
"cache_path" : "/scratch/",
"send_cmd_tpl" : "{{ command }}",
"qsub_cmd_tpl" : "bash -c 'sbatch --parsable --cluster=merlin6 \"{{ script_path_abs }}\" | cut -d \";\" -f 1'",

23
dev/update_versions.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
# Updates the cluster scripts based on the currently loaded cuda, gcc, and CRYOSPARC_HOME settings
shopt -s failglob
set -euo pipefail
CRYOSPARC_HOME="${CRYOSPARC_HOME:-/data/user/$USER/cryosparc}"
if [[ ! -d "$CRYOSPARC_HOME" ]]; then
echo "$CRYOSPARC_HOME not found. Set the CRYOSPARC_HOME variable."
exit 1
fi
# support both cryosparc2_master and cryosparc_master directories
CRYOSPARC_WORKER=$(ls "$CRYOSPARC_HOME"/cryosparc*_worker/bin/cryosparcw | head -1)
echo "Cuda version: ${CUDA_VERSION?Please load the correct cuda module}"
echo "GCC version: ${GCC_VERSION?Please load the correct gcc version}"
echo "Worker path: ${CRYOSPARC_WORKER}"
sed -ri 's#cuda/[0-9.]+#cuda/'$CUDA_VERSION'#' */cluster_script.sh
sed -ri 's#gcc/[0-9.]+#gcc/'$GCC_VERSION'#' */cluster_script.sh
sed -ri 's#worker_bin_path.*#worker_bin_path" : "'$CRYOSPARC_WORKER'",#' */cluster_info.json

View File

@ -1,6 +1,6 @@
{
"name" : "gpu-big",
"worker_bin_path" : "/data/user/USERNAME/cryosparc/cryosparc2_worker/bin/cryosparcw",
"worker_bin_path" : "/data/user/USERNAME/cryosparc/cryosparc_worker/bin/cryosparcw",
"cache_path" : "/scratch/",
"send_cmd_tpl" : "{{ command }}",
"qsub_cmd_tpl" : "bash -c 'sbatch --parsable --cluster=gmerlin6 \"{{ script_path_abs }}\" | cut -d \";\" -f 1'",

View File

@ -1,6 +1,6 @@
{
"name" : "gpu-rtx2080ti",
"worker_bin_path" : "/data/user/USERNAME/cryosparc/cryosparc2_worker/bin/cryosparcw",
"worker_bin_path" : "/data/user/USERNAME/cryosparc/cryosparc_worker/bin/cryosparcw",
"cache_path" : "/scratch/",
"send_cmd_tpl" : "{{ command }}",
"qsub_cmd_tpl" : "bash -c 'sbatch --parsable --cluster=gmerlin6 \"{{ script_path_abs }}\" | cut -d \";\" -f 1'",

View File

@ -1,6 +1,6 @@
{
"name" : "gpu-short",
"worker_bin_path" : "/data/user/USERNAME/cryosparc/cryosparc2_worker/bin/cryosparcw",
"worker_bin_path" : "/data/user/USERNAME/cryosparc/cryosparc_worker/bin/cryosparcw",
"cache_path" : "/scratch/",
"send_cmd_tpl" : "{{ command }}",
"qsub_cmd_tpl" : "bash -c 'sbatch --parsable --cluster=gmerlin6 \"{{ script_path_abs }}\" | cut -d \";\" -f 1'",

View File

@ -1,6 +1,6 @@
{
"name" : "gpu",
"worker_bin_path" : "/data/user/USERNAME/cryosparc/cryosparc2_worker/bin/cryosparcw",
"worker_bin_path" : "/data/user/USERNAME/cryosparc/cryosparc_worker/bin/cryosparcw",
"cache_path" : "/scratch/",
"send_cmd_tpl" : "{{ command }}",
"qsub_cmd_tpl" : "bash -c 'sbatch --parsable --cluster=gmerlin6 \"{{ script_path_abs }}\" | cut -d \";\" -f 1'",