Skip to content

Commit

Permalink
Use osdf-client from RPMs instead of downloading our own from the osg…
Browse files Browse the repository at this point in the history
…-flock repo
  • Loading branch information
matyasselmeci committed Mar 10, 2023
1 parent 74c4c8d commit c5382ad
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
32 changes: 24 additions & 8 deletions 10-setup-htcondor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -526,16 +526,32 @@ OSG_PROJECT_NAME $OSG_PROJECT_NAME
EOF
touch $condor_vars_file

# test and add the stash plugin
export STASH_PLUGIN_PATH=/usr/libexec/condor/stash_plugin
if timeout 60s "$STASH_PLUGIN_PATH" -d /osgconnect/public/dweitzel/stashcp/test.file /tmp/stashcp-test.file >/dev/null 2>/tmp/stashcp-debug.txt; then
rm -f /tmp/stashcp-test.file
echo "FILETRANSFER_PLUGINS = \$(FILETRANSFER_PLUGINS),$STASH_PLUGIN_PATH" >> "$PILOT_CONFIG_FILE"
else
disable_osdf_plugin () {
echo "$*; stash://, osdf:// URL support disabled" >&2
echo "STASH_PLUGIN =" >> "$PILOT_CONFIG_FILE"
echo "OSDF_PLUGIN =" >> "$PILOT_CONFIG_FILE" # forward compat
}

# Test the Stash/OSDF plugin that's shipped with Condor; disable it if the test fails.
# TODO: This should be moved to additional-htcondor-config.
osdf_plugin=$(condor_config_val OSDF_PLUGIN 2>/dev/null || condor_config_val STASH_PLUGIN 2>/dev/null)
if [[ ! $osdf_plugin || ! -f $osdf_plugin || ! -x $osdf_plugin ]]; then
# Can't run it, can't test it. No need to explicitly disable it though.
echo >&2 "Stash/OSDF file transfer plugin is missing or not runnable; stash://, osdf:// URL support nonfunctional"
elif ! timeout 60s "$osdf_plugin" -d /osgconnect/public/osg/testfile.txt /tmp/stashcp-test.file >/dev/null 2>/tmp/stashcp-debug.txt; then
disable_osdf_plugin "Stash/OSDF file transfer test failed"
cat >&2 /tmp/stashcp-debug.txt
echo >&2 "stash_plugin test failed; 'stash' filetransfer plugin unavailable"
elif [[ ! -s /tmp/stashcp-test.file ]]; then
disable_osdf_plugin "Stash/OSDF file transfer test created an empty file"
cat >&2 /tmp/stashcp-debug.txt
else
# Sanity check
filetransfer_plugins=$(condor_config_val FILETRANSFER_PLUGINS 2>/dev/null)
if [[ $filetransfer_plugins != *${osdf_plugin}* ]]; then
echo >&2 "Stash/OSDF file transfer plugin missing from plugins list; stash://, osdf:// URL support nonfunctional"
fi
fi
rm -f /tmp/stashcp-debug.txt
rm -f /tmp/stashcp-test.file /tmp/stashcp-debug.txt

export IS_CONTAINER_PILOT=1

Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ RUN git clone --branch ${OSG_FLOCK_BRANCH} https://github.com/${OSG_FLOCK_REPO}
&& install ospool-pilot/itb/job/prepare-hook /gwms/client_group_itb/itb-prepare-hook \
&& install ospool-pilot/itb/job/simple-job-wrapper.sh /usr/sbin/itb-simple-job-wrapper \
# common files: \
&& install stashcp/stashcp /gwms/client/stashcp \
&& install stashcp/stash_plugin /usr/libexec/condor/stash_plugin \
&& ln -snf /gwms/client/stashcp /usr/bin/stashcp \
&& install /usr/bin/stashcp /gwms/client/stashcp \
# advertise info \
&& echo "OSG_FLOCK_REPO = \"$OSG_FLOCK_REPO\"" >> /etc/condor/config.d/60-flock-sources.config \
&& echo "OSG_FLOCK_BRANCH = \"$OSG_FLOCK_BRANCH\"" >> /etc/condor/config.d/60-flock-sources.config \
Expand Down

0 comments on commit c5382ad

Please sign in to comment.