diff --git a/activate b/bin/activate.sh similarity index 51% rename from activate rename to bin/activate.sh index f106500479f53df5571ede6e677be24a48cf6c7a..359a3df5c28bd36f00bc9dd2f603a8e513167a52 100644 --- a/activate +++ b/bin/activate.sh @@ -1,4 +1,5 @@ source /etc/profile.d/modules.sh module load anaconda/3 module load texlive -export PATH=/home/${USER}/.local/bin:$PATH +# export path to python environment +export PATH=$HOME/.local/bin:$PATH diff --git a/bin/slurm_calibrate.sh b/bin/slurm_calibrate.sh index 5b7105a5b7682278a556f171c97066d92fc6c0aa..44be0e93e511c491fe6171badb0e0f49c708d1f2 100755 --- a/bin/slurm_calibrate.sh +++ b/bin/slurm_calibrate.sh @@ -6,7 +6,7 @@ python_path=$2 ipython_path=$3 jupyter_path=$4 ipcluster_path="${5}" -krb_activate_path=$6 +activate_path=$6 uuid=$7 notebook=$8 detector=$9 @@ -21,7 +21,7 @@ echo "Python path: $python_path" echo "IPython path: $ipython_path" echo "Jupyter path: $jupyter_path" echo "IP-Cluster path: $ipcluster_path" -echo "Karabo activate: $krb_activate_path" +echo "Environment activate: $activate_path" echo "IP-Cluster profile: $uuid" echo "notebook: $notebook" echo "detector: $detector" @@ -34,15 +34,7 @@ echo "job ID: $SLURM_JOB_ID" export CAL_NOTEBOOK_NAME=$notebook # set-up enviroment -if [ "${krb_activate_path}" != "NO_KRB_ACTIVATE" ] -then - source ${krb_activate_path} -else - source /etc/profile.d/modules.sh - module load anaconda/3 - module load texlive - export PATH=/home/${USER}/.local/bin:$PATH -fi +source ${activate_path} echo "Starting influx feeder" ./cal_influx_feeder.sh $notebook $detector $caltype > /dev/null 2>&1 & diff --git a/xfel_calibrate/calibrate.py b/xfel_calibrate/calibrate.py index d32a857ecbdc0d0a3ee856c274c7d38bebf880cc..cdfc87f34770d8c2efaedbc6a7afd2c3fe46c3f2 100755 --- a/xfel_calibrate/calibrate.py +++ b/xfel_calibrate/calibrate.py @@ -641,8 +641,8 @@ def concurrent_run(temp_path, nb, nbname, args, cparm=None, cval=None, ipython_path, # path to ipython jupyter_path, # path to jupyter ipcluster_path, # path to ipcluster - # karabo activate path - karabo_activate_path if karabo_activate_path else "NO_KRB_ACTIVATE", + # python activate path + activate_path if activate_path!="" else "{}/bin/activate.sh".format(os.path.dirname(__file__)), args.get("cluster_profile", "NO_CLUSTER"), '"{}"'.format(base_name.upper()), '"{}"'.format(args["detector"].upper()), diff --git a/xfel_calibrate/settings.py b/xfel_calibrate/settings.py index 33924ac125467fd35cb93e882c0d68d619894af9..b132b895d9999570b4da37daba02c4d6efdeb3cf 100644 --- a/xfel_calibrate/settings.py +++ b/xfel_calibrate/settings.py @@ -12,8 +12,8 @@ ipython_path = "ipython" # Path to use for calling Jupyter. If the environment is correctly set, simply the command jupyter_path = "jupyter" -# Path to find the Karabo activate script at, set to an empty string if not running in a Karabo environemnt -karabo_activate_path = "" +# Path to find activate script +activate_path = "" # Path to use for calling ipcluster. If the environment is correctly set, simply the command ipcluster_path = "ipcluster"