-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
1,716 additions
and
5,199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
HAS_CVMFS_LIGO_OSGSTORAGE /cvmfs/oasis.opensciencegrid.org/ligo/frames/O2/hoft/H1/H-H1_HOFT_C00-11650/H-H1_HOFT_C00-1165000704-1884.gwf | ||
HAS_CVMFS_LIGO_STORAGE /cvmfs/ligo.storage.igwn.org/igwn/ligo/frames/O4/hoft_C00/H1/H-H1_HOFT_C00-137/H-H1_HOFT_C00-1373810688-4096.gwf | ||
HAS_CVMFS_VIRGO_STORAGE /cvmfs/virgo.storage.igwn.org/igwn/virgo/frames/O4/HoftOnline/V-HoftOnline-13738/V-HoftOnline-1373814000-2000.gwf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
|
||
glidein_config="$1" | ||
|
||
|
||
function info { | ||
echo "INFO " $@ 1>&2 | ||
} | ||
|
@@ -18,12 +17,11 @@ function warn { | |
} | ||
|
||
function advertise { | ||
# atype is the type of the value as defined by GlideinWMS: | ||
# I - integer | ||
# S - quoted string | ||
# C - unquoted string (i.e. Condor keyword or expression) | ||
|
||
|
||
# atype is the type of the value as defined by GlideinWMS: | ||
# I - integer | ||
# S - quoted string | ||
# C - unquoted string (i.e. Condor keyword or expression) | ||
|
||
key="$1" | ||
value="$2" | ||
atype="$3" | ||
|
@@ -40,90 +38,48 @@ function advertise { | |
fi | ||
} | ||
|
||
function get_glidein_config_value { | ||
# extracts a config attribute value from | ||
# $1 is the attribute key | ||
CF=$glidein_config | ||
if [ "$glidein_config" = "NONE" ]; then | ||
CF="$PWD/glidein_config" | ||
fi | ||
KEY="$1" | ||
VALUE=`(cat $CF | grep "^$KEY " | tail -n 1 | sed "s/^$KEY //") 2>/dev/null` | ||
echo "$VALUE" | ||
} | ||
|
||
if [ "x$glidein_config" = "x" ]; then | ||
glidein_config="NONE" | ||
info "No arguments provided - assuming HTCondor startd cron mode" | ||
else | ||
info "Arguments to the script: $@" | ||
fi | ||
|
||
info "This is a setup script for the IGWN frontend." | ||
info "In case of problems, contact Edgar Fajardo ([email protected])" | ||
|
||
if [ "$glidein_config" != "NONE" ]; then | ||
########################################################### | ||
# import advertise and add_condor_vars_line functions | ||
add_config_line_source=`grep '^ADD_CONFIG_LINE_SOURCE ' $glidein_config | awk '{print $2}'` | ||
source $add_config_line_source | ||
|
||
condor_vars_file=`grep -i "^CONDOR_VARS_FILE " $glidein_config | awk '{print $2}'` | ||
fi | ||
|
||
################## | ||
|
||
info "Checking for IGWN container availability" | ||
info "Checking for IGWN FRAMES availability..." | ||
info "Current X509_USER_PROXY=${X509_USER_PROXY}" | ||
|
||
FS_ATTR="HAS_CVMFS_LIGO_CONTAINERS" | ||
RESULT="False" | ||
if [ -s /cvmfs/singularity.opensciencegrid.org/lscsoft/bayeswave:latest ]; then | ||
RESULT="True" | ||
fi | ||
advertise $FS_ATTR "$RESULT" "C" | ||
advertise "HAS_CVMFS_IGWN_CONTAINERS" "$RESULT" "C" | ||
|
||
|
||
info "Checking for IGWN FRAMES availability" | ||
|
||
HAS_SINGULARITY=`get_glidein_config_value HAS_SINGULARITY` | ||
FS=ligo.osgstorage.org | ||
FS_ATTR="HAS_LIGO_FRAMES" | ||
RESULT="False" | ||
TEST_FILE=`shuf -n 1 client/frame_files_small.txt` | ||
OSG_SINGULARITY_PATH=`get_glidein_config_value OSG_SINGULARITY_PATH` | ||
OSG_SINGULARITY_EXTRA_OPTS=`get_glidein_config_value OSG_SINGULARITY_EXTRA_OPTS` | ||
OSG_SINGULARITY_IMAGE_DEFAULT=`get_glidein_config_value OSG_SINGULARITY_IMAGE_DEFAULT` | ||
TEST_CMD="head -c 1k $TEST_FILE" | ||
|
||
if [ "x$HAS_SINGULARITY" = "xTrue" ]; then | ||
info "Testing LIGO frames inside singularity" | ||
info "Making copy of $X509_USER_PROXY" | ||
cp $X509_USER_PROXY $PWD/frames_test_proxy | ||
chmod 600 $PWD/frames_test_proxy | ||
info "export SINGULARITYENV_X509_USER_PROXY=/srv/frames_test_proxy;setsid $OSG_SINGULARITY_PATH exec --bind $PWD:/srv $OSG_SINGULARITY_EXTRA_OPTS $OSG_SINGULARITY_IMAGE_DEFAULT $TEST_CMD | grep Frame" | ||
if ! (export SINGULARITYENV_X509_USER_PROXY=/srv/frames_test_proxy;setsid $OSG_SINGULARITY_PATH exec --bind $PWD:/srv \ | ||
$OSG_SINGULARITY_EXTRA_OPTS \ | ||
"$OSG_SINGULARITY_IMAGE_DEFAULT" \ | ||
$TEST_CMD \ | ||
| grep Frame) 1>&2 \ | ||
; then | ||
FS_ATTR="HAS_IGWN_FRAMES" | ||
TEST_FILE_LIST="client/ligo-cvmfs-data.txt" | ||
|
||
# test all GWF files in the file | ||
OVERALL_RESULT="True" # start with success and assert otherwise | ||
while read CVMFS_ATTR GWF \ | ||
; do | ||
TEST_CMD="head -c4 $GWF" | ||
if ! (setsid $TEST_CMD | grep IGWD) 1>&2; then | ||
RESULT="False" | ||
OVERALL_RESULT="${RESULT}" | ||
warn "Could not read $GWF" | ||
else | ||
RESULT="True" | ||
info "Successfully read $GWF" | ||
fi | ||
advertise "HAS_CVMFS_IGWN_PRIVATE_DATA_SINGULARITY" "$RESULT" "C" | ||
fi | ||
info "Testing LIGO frames outside singularity" | ||
info "setsid $TEST_CMD | grep Frame" | ||
if ! (setsid $TEST_CMD | grep Frame) 1>&2 \ | ||
; then | ||
RESULT="False" | ||
else | ||
RESULT="True" | ||
fi | ||
advertise $FS_ATTR "$RESULT" "C" | ||
advertise "HAS_CVMFS_IGWN_PRIVATE_DATA" "$RESULT" "C" | ||
advertise "HAS_CVMFS_LIGO_STORAGE" "$RESULT" "C" | ||
advertise "HAS_CVMFS_IGWN_STORAGE" "$RESULT" "C" | ||
################## | ||
info "All done - time to do some real work!" | ||
advertise "${CVMFS_ATTR}" "${RESULT}" "C" | ||
done <${TEST_FILE_LIST} | ||
|
||
advertise $FS_ATTR "$OVERALL_RESULT" "C" | ||
advertise "HAS_LIGO_FRAMES" "$OVERALL_RESULT" "C" | ||
advertise "HAS_CVMFS_IGWN_PRIVATE_DATA" "$OVERALL_RESULT" "C" | ||
advertise "HAS_CVMFS_IGWN_STORAGE" "$OVERALL_RESULT" "C" | ||
|
||
info "Done." |
Oops, something went wrong.