Skip to content

Commit

Permalink
add batch job script to update metadata cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ehneilsen committed Oct 10, 2024
1 parent 0816259 commit 3fa1ad5
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions batch/compile_prenight_metadata_cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash
#SBATCH --account=rubin:developers # Account name
#SBATCH --job-name=auxtel_prenight_daily # Job name
#SBATCH --output=/sdf/data/rubin/user/neilsen/batch/auxtel_prenight_daily/daily.out # Output file (stdout)
#SBATCH --error=/sdf/data/rubin/user/neilsen/batch/auxtel_prenight_daily/daily.err # Error file (stderr)
#SBATCH --partition=milano # Partition (queue) names
#SBATCH --nodes=1 # Number of nodes
#SBATCH --ntasks=1 # Number of tasks run in parallel
#SBATCH --cpus-per-task=1 # Number of CPUs per task
#SBATCH --mem=16G # Requested memory
#SBATCH --time=1:00:00 # Wall time (hh:mm:ss)

echo "******** START of run_prenight_sims.sh **********"

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# SLAC S3DF - source all files under ~/.profile.d
if [[ -e ~/.profile.d && -n "$(ls -A ~/.profile.d/)" ]]; then
source <(cat $(find -L ~/.profile.d -name '*.conf'))
fi

__conda_setup="$('/sdf/group/rubin/user/neilsen/mambaforge/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/sdf/group/rubin/user/neilsen/mambaforge/etc/profile.d/conda.sh" ]; then
. "/sdf/group/rubin/user/neilsen/mambaforge/etc/profile.d/conda.sh"
else
export PATH="/sdf/group/rubin/user/neilsen/mambaforge/bin:$PATH"
fi
fi
unset __conda_setup

if [ -f "/sdf/group/rubin/user/neilsen/mambaforge/etc/profile.d/mamba.sh" ]; then
. "/sdf/group/rubin/user/neilsen/mambaforge/etc/profile.d/mamba.sh"
fi

mamba activate prenight
export AWS_PROFILE=prenight
WORK_DIR=$(date '+/sdf/data/rubin/user/neilsen/batch/compile_prenight_metadata/%Y-%m-%dT%H%M%S' --utc)
echo "Working in $WORK_DIR"
mkdir ${WORK_DIR}
printenv > env.out
cd ${WORK_DIR}
compile_sim_archive_metadata_resource --append
echo "******* END of compile_prenight_metadata_cache.sh *********"

0 comments on commit 3fa1ad5

Please sign in to comment.