-
Notifications
You must be signed in to change notification settings - Fork 177
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
1 parent
0984ed1
commit ae455b0
Showing
6 changed files
with
98 additions
and
1 deletion.
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 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
# The location on the sending client (e.g. Hercules) of Sven's dropbox. | ||
export dropbox="{{sven_dropbox}}" |
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,11 @@ | ||
#!/usr/bin/env bash | ||
# This file will be pushed to Niagara and is used to initialize the Doorman server | ||
|
||
# This is the staging area on Niagara. | ||
# This is where tarballs will be received and confirmations are written and sent. | ||
export GENDEL={{general_delivery_dir}} | ||
|
||
# The globus UUID for the sending platform (e.g. Hercules) | ||
export CLIENT_ENDPOINT={{HERC_GLC}} | ||
# The location of the dropbox on the sending platform | ||
export CLIENT_DROPBOX={{sven_dropbox}} |
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,68 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script runs on Niagara to interact with the Doorman service | ||
{% set cycle_YMDH = current_cycle | to_YMDH %} | ||
subdir="{{RUN}}/{{cycle_YMDH}}" | ||
|
||
# Make the working directory | ||
doorman_dir="${HOME}/.doorman/${subdir}" | ||
mkdir -p "${doorman_dir}" | ||
cd "${doorman_dir}" | ||
rm -f dm.conf | ||
rm -f places.inc | ||
rm -f FLIST | ||
|
||
# Tell the doorman where Sven's dropbox is on the sending client (e.g. Hercules) | ||
echo 'export dropbox="{{sven_dropbox}}"' > dm.conf | ||
|
||
# Tell the doorman where the general delivery space is on Niagara (unique for each RUN/cycle) | ||
# This is where tarballs will be received and confirmations are written and sent. | ||
echo 'export GENDEL={{GENERAL_DELIVERY_ROOT}}/{{RUN}}/{{cycle_YMDH}}' > places.inc | ||
# Tell the doorman what the sender's UUID is | ||
echo 'export CLIENT_ENDPOINT={{CLIENT_GLOBUS_UUID}}' >> places.inc | ||
# Tell the doorman where the sending client's dropbox is (why twice??) | ||
echo 'export CLIENT_DROPBOX={{sven_dropbox}}' >> places.inc | ||
|
||
# Point to the doorman executable scripts | ||
export PATH="${PATH}:{{doorman_root}}/bin" | ||
|
||
# Create the general delivery space if it wasn't already | ||
initialize.sh | ||
|
||
# Transfer the data from the sender and execute the 'todo' script | ||
receive.sh --go | ||
|
||
# If receive didn't produce an FLIST file, then something went wrong | ||
if [[ ! -f FLIST ]]; then | ||
echo "receive.sh failed!" | ||
return 2 | ||
fi | ||
|
||
# Parse the FLIST file created by receive.sh to get the transfer IDs | ||
IDs="" | ||
while IFS= read -r line; do | ||
package_name=$(grep -o "package_location_.*\.tgz") | ||
tmp="${package_name#package_location_}" | ||
ID="${tmp%.tgz}" | ||
IDs="${IDs} ${ID}" | ||
done < FLIST | ||
|
||
# Sleep for a minute to allow time for all globus artifacts to resolve | ||
sleep 1m | ||
|
||
# Validate and generate the acknowledgement for each transfer ID | ||
for ID in ${IDs}; do | ||
ack.sh "${ID}" | ||
done | ||
|
||
# Send the acknowledgement back to the sender | ||
send.sh | ||
|
||
stat=$? | ||
|
||
if [[ ${stat} -ne 0 ]]; then | ||
echo "Failed to send status back to client!" | ||
exit 3 | ||
fi | ||
|
||
exit 0 |
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