Skip to content
Snippets Groups Projects
boot-condor-and-workflow.sh 967 B
Newer Older
#!/bin/bash

# Set failfast
set -e
set -o pipefail

# Start condor daemons
condor_master

# Make directory for standardized Python location (if it doesn't exist)
PY_BIN_DIR=/home/ssa/bin
mkdir -p $PY_BIN_DIR
chown root:vlapipe $PY_BIN_DIR
chmod 775 $PY_BIN_DIR
# Add symbolic link to standardized Python install location (if it doesn't already exist)
ls $PY_BIN_DIR/python3.8 || ln -s "$(which python3)" $PY_BIN_DIR/python3.8

WORKFLOW_DIR=/lustre/aoc/cluster/pipeline/"$CAPO_PROFILE"/workspaces/sbin
# Make directory where workflow executables will live (if it doesn't exist)
mkdir -p "$WORKFLOW_DIR"
# Make the PEX location accessible with vlapipe and submituser
chown root:vlapipe "$WORKFLOW_DIR"
chmod 777 "$WORKFLOW_DIR"

if [ "$CAPO_PROFILE" = "dsoc-dev" ] || [ "$CAPO_PROFILE" = "dsoc-test" ]
then
  # If on dev or test, boot workflow as vlapipe
  su vlapipe -c "/code/bin/boot-workflow.sh"
else
  # If local, just boot as root
  /code/bin/boot-workflow.sh
fi