#!/bin/bash
# This is a starter script needed to initialize basic Rubin software environment inside the container and execute
# the actual command line after decoding from hexed strings
cd /tmp;
export HOME=/tmp;
export S3_ENDPOINT_URL=https://storage.googleapis.com
export AWS_ACCESS_KEY_ID=$(</cloudcreds/SINGULARITYENV_AWS_ACCESS_KEY_ID)
export AWS_SECRET_ACCESS_KEY=$(</cloudcreds/SINGULARITYENV_AWS_SECRET_ACCESS_KEY)
export PGPASSWORD=$(</cloudcreds/SINGULARITYENV_PGPASSWORD)
. /opt/lsst/software/stack/loadLSST.bash;
setup lsst_distrib;
echo "$(/usr/bin/python $3/cmd_line_decoder.py $1 $2)"
eval "$(/usr/bin/python $3/cmd_line_decoder.py $1 $2) >&2"
