use of es.bsc.compss.gat.master.utils.GATScriptExecutor in project compss by bsc-wdc.
the class GATWorkerNode method initWorkingDir.
private void initWorkingDir() throws InitNodeException {
LinkedList<URI> traceScripts = new LinkedList<>();
LinkedList<String> traceParams = new LinkedList<>();
String host = getHost();
String installDir = getInstallDir();
String workingDir = getWorkingDir();
String user = getUser();
if (user == null || user.isEmpty()) {
user = "";
} else {
user += "@";
}
try {
String initScriptPath = Protocol.ANY_URI.getSchema() + user + host + File.separator + installDir + GAT_SCRIPT_PATH + INIT_SCRIPT_NAME;
traceScripts.add(new URI(initScriptPath));
} catch (URISyntaxException e) {
new InitNodeException("Error addind initScript");
}
String pars = workingDir;
traceParams.add(pars);
// Use cleaner to run the trace script and generate the package
LOGGER.debug("Initializing working dir " + workingDir + " in host " + getName());
boolean result = new GATScriptExecutor(this).executeScript(traceScripts, traceParams, "init_" + host);
if (!result) {
throw new InitNodeException("Error executing init script for initializing working dir " + workingDir + " in host " + getName());
}
}
use of es.bsc.compss.gat.master.utils.GATScriptExecutor in project compss by bsc-wdc.
the class GATWorkerNode method deleteTemporary.
@Override
public void deleteTemporary() {
LinkedList<URI> traceScripts = new LinkedList<URI>();
LinkedList<String> traceParams = new LinkedList<String>();
String host = getHost();
String installDir = getInstallDir();
String workingDir = getWorkingDir();
String user = getUser();
if (user == null) {
user = "";
} else {
user += "@";
}
try {
traceScripts.add(new URI(Protocol.ANY_URI.getSchema() + user + host + File.separator + installDir + GAT_SCRIPT_PATH + CLEANER_SCRIPT_NAME));
} catch (URISyntaxException e) {
LOGGER.error("Error deleting working dir " + workingDir + " in host " + getName(), e);
return;
}
String pars = workingDir;
traceParams.add(pars);
// Use cleaner to run the trace script and generate the package
LOGGER.debug("Deleting working dir " + workingDir + " in host " + getName());
boolean result = new GATScriptExecutor(this).executeScript(traceScripts, traceParams, "clean_" + host);
if (!result) {
LOGGER.error("Error executing clean script for deleting working dir " + workingDir + " in host " + getName());
}
}
use of es.bsc.compss.gat.master.utils.GATScriptExecutor in project compss by bsc-wdc.
the class GATTracer method generatePackage.
public static boolean generatePackage(GATWorkerNode node) {
LinkedList<URI> traceScripts = new LinkedList<>();
LinkedList<String> traceParams = new LinkedList<>();
String host = node.getHost();
String installDir = node.getInstallDir();
String workingDir = node.getWorkingDir();
String user = node.getUser();
if (user == null || user.isEmpty()) {
user = "";
} else {
user += "@";
}
try {
traceScripts.add(new URI(Protocol.ANY_URI.getSchema() + user + host + File.separator + installDir + TRACE_SCRIPT_PATH));
} catch (URISyntaxException e) {
LOGGER.error("Error deleting tracing host", e);
return false;
}
String pars = "package " + workingDir + " " + host;
traceParams.add(pars);
// Use cleaner to run the trace script and generate the package
return new GATScriptExecutor(node).executeScript(traceScripts, traceParams, "trace_packaging_" + host);
}
Aggregations