Skip to content

Commit

Permalink
GH-349: Improve wrk dir format in dds-ssh-plugin
Browse files Browse the repository at this point in the history
dds-ssh-plugin: Modified: Remote destination directories are no longer required and will be created automatically at runtime. (GH-349)
dds-ssh-plugin: Modified: Final remote destination directories are created in DDS session ID subfolder, i.e. direcrtory format is "(root wrk dir from plugin cfg)/(sessionID)/(wn ID from plugin cfg)". (GH-349)
  • Loading branch information
AnarManafov committed Mar 2, 2021
1 parent 2868c23 commit 99ac14e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
5 changes: 5 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ Modified: improved default SID storage and handling. (GH-318)
Fixed: a couple of fixes in Slurm plugin found on a Virgo cluster.
Fixed: fixed path to demonised log file. This log is created if plug-in failed to start.


### dds-ssh-plugin
Modified: Remote destination directories are no longer required and will be created automatically at runtime. (GH-349)
Modified: Final remote destination directories are created in DDS session ID subfolder, i.e. direcrtory format is "(root wrk dir from plugin cfg)/(sessionID)/(wn ID from plugin cfg)". (GH-349)

## v3.4 (2020-07-01)

### DDS common
Expand Down
4 changes: 2 additions & 2 deletions plugins/dds-submit-lsf/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ int main(int argc, char* argv[])
fs::path pathlsfScript(pathPluginDir);
pathlsfScript /= "dds-submit-lsf-worker";
stringstream cmd;
cmd << "$DDS_LOCATION/bin/dds-daemonize " << sSandboxDir << " /bin/bash -c \""
<< pathlsfScript.string() << "\"";
cmd << "$DDS_LOCATION/bin/dds-daemonize " << sSandboxDir << " /bin/bash -c \"" << pathlsfScript.string()
<< "\"";

proto.sendMessage(dds::intercom_api::EMsgSeverity::info, "Preparing job submission...");
string output;
Expand Down
4 changes: 2 additions & 2 deletions plugins/dds-submit-pbs/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ int main(int argc, char* argv[])
fs::path pathPBSScript(pathPluginDir);
pathPBSScript /= "dds-submit-pbs-worker";
stringstream cmd;
cmd << "$DDS_LOCATION/bin/dds-daemonize " << sSandboxDir << " /bin/bash -c \""
<< pathPBSScript.string() << "\"";
cmd << "$DDS_LOCATION/bin/dds-daemonize " << sSandboxDir << " /bin/bash -c \"" << pathPBSScript.string()
<< "\"";

proto.sendMessage(dds::intercom_api::EMsgSeverity::info, "Preparing job submission...");
string output;
Expand Down
2 changes: 1 addition & 1 deletion plugins/dds-submit-ssh/src/dds-submit-ssh-worker
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fi

# send a worker package and worker's script
# use rsync since it can automatically create a remote working dir
rsync -aq -e "ssh $SSH_OPT_INT $SSHOPT" $WRK_S_L $SSH_CON_STR:$RDIR/ 2>&1 | logMsgPipe
rsync -aq --rsync-path="mkdir -p $RDIR && rsync" -e "ssh $SSH_OPT_INT $SSHOPT" $WRK_S_L $SSH_CON_STR:$RDIR/ 2>&1 | logMsgPipe
if (( ${PIPESTATUS[0]} != 0 )); then
logMsg "$TOOL_NAME error: failed to send worker's package"
exit 1
Expand Down
10 changes: 7 additions & 3 deletions plugins/dds-submit-ssh/src/worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ using namespace std;
using namespace dds;
using namespace dds::ssh_cmd;
using namespace MiscCommon;
using namespace dds::user_defaults_api;
namespace fs = boost::filesystem;
//=============================================================================
const std::chrono::seconds g_cmdTimeout = std::chrono::seconds(20);
Expand All @@ -24,10 +25,13 @@ CWorker::CWorker(ncf::configRecord_t _rec, const SWNOptions& _options, const str
, m_path(_path)
{
// constructing a full path of the worker for this id
// pattern: <m_wrkDir>/<m_id>
smart_append(&m_rec->m_wrkDir, '/');
// pattern: <m_wrkDir>/<sessionID>/<m_id>
smart_path(&m_rec->m_wrkDir);
m_rec->m_wrkDir += m_rec->m_id;
fs::path pathWrk(m_rec->m_wrkDir);
pathWrk /= CUserDefaults::instance().getCurrentSID();
pathWrk /= m_rec->m_id;

m_rec->m_wrkDir = pathWrk.string();
}
//=============================================================================
CWorker::~CWorker()
Expand Down

0 comments on commit 99ac14e

Please sign in to comment.