use of org.gridlab.gat.io.File in project compss by bsc-wdc.
the class AdvertJob method main.
public static void main(String[] args) throws Exception {
try {
GATContext c = new GATContext();
Preferences prefs = new Preferences();
prefs.put("File.adaptor.name", "local,commandlinessh");
prefs.put("job.stop.on.exit", "false");
c.addPreferences(prefs);
SoftwareDescription sd = new SoftwareDescription();
sd.setExecutable("/bin/sleep");
sd.setArguments("100");
// stdout & stderr
File stdout = GAT.createFile(c, "std.out");
File stderr = GAT.createFile(c, "std.err");
sd.setStderr(stderr);
sd.setStdout(stdout);
ResourceDescription rd = new HardwareResourceDescription();
JobDescription jd = new JobDescription(sd, rd);
ResourceBroker broker = GAT.createResourceBroker(c, new URI("sshsge://fs0.das3.cs.vu.nl"));
Job job = broker.submitJob(jd);
AdvertService a = GAT.createAdvertService(c);
MetaData m = new MetaData();
m.put("name", "testJob");
a.add(job, m, "/rob/testJob");
a.exportDataBase(new URI("file:///mydb"));
GAT.end();
System.exit(0);
} catch (Throwable e) {
e.printStackTrace();
}
}
use of org.gridlab.gat.io.File in project compss by bsc-wdc.
the class SubmitLocalJob method main.
public static void main(String[] args) throws Exception {
SoftwareDescription sd = new SoftwareDescription();
sd.setExecutable("/bin/hostname");
File stdout = GAT.createFile("hostname.txt");
sd.setStdout(stdout);
JobDescription jd = new JobDescription(sd);
ResourceBroker broker = GAT.createResourceBroker(new URI("any://localhost"));
Job job = broker.submitJob(jd);
while ((job.getState() != JobState.STOPPED) && (job.getState() != JobState.SUBMISSION_ERROR)) Thread.sleep(1000);
GAT.end();
}
use of org.gridlab.gat.io.File in project compss by bsc-wdc.
the class LfnFileCopy method main.
/**
* @param args
*/
public static void main(String[] args) throws Exception {
String lfnroot = "lfn:/grid/pvier/ceriel/";
// Create a new CertificateSecurityContext containing the globus certificates
// and the user password.
CertificateSecurityContext securityContext = new CertificateSecurityContext(new URI(System.getProperty("user.home") + "/.globus/userkey.pem"), new URI(System.getProperty("user.home") + "/.globus/usercert.pem"), getPassphrase());
// Store this SecurityContext in a GATContext
GATContext context = new GATContext();
context.addSecurityContext(securityContext);
context.addPreference("VirtualOrganisation", "pvier");
context.addPreference("vomsServerUrl", "voms.grid.sara.nl");
context.addPreference("vomsServerPort", "30000");
context.addPreference("vomsHostDN", "/O=dutchgrid/O=hosts/OU=sara.nl/CN=voms.grid.sara.nl");
context.addPreference("LfcServer", "lfc.grid.sara.nl");
context.addPreference("bdiiURI", "ldap://bdii.grid.sara.nl:2170");
// context.addPreference("ftp.connection.passive", "false");
// context.addPreference("ftp.server.noauthentication", "true");
// context.addPreference("gridftp.authenticate.retry", "5");
// context.addPreference("preferredSEID", "srm.grid.sara.nl");
GAT.setDefaultGATContext(context);
File exampleFile = GAT.createFile(lfnroot + "text.txt");
exampleFile.copy(new URI("localtext.txt"));
File exampleFile2 = GAT.createFile("localtext.txt");
exampleFile2.copy(new URI(lfnroot + "data"));
GAT.end();
}
use of org.gridlab.gat.io.File in project compss by bsc-wdc.
the class SubmitRemoteJob method main.
public static void main(String[] args) throws Exception {
SoftwareDescription sd = new SoftwareDescription();
sd.setExecutable("/bin/hostname");
File stdout = GAT.createFile("hostname.txt");
sd.setStdout(stdout);
JobDescription jd = new JobDescription(sd);
Preferences prefs = new Preferences();
/*
prefs.put("VirtualOrganisation", "pvier");
prefs.put("vomsServerURL", "voms.grid.sara.nl");
prefs.put("vomsServerPort", "30000");
prefs.put("vomsHostDN", "/O=dutchgrid/O=hosts/OU=sara.nl/CN=voms.grid.sara.nl");
*/
CertificateSecurityContext ctxt = new CertificateSecurityContext(new URI(System.getProperty("user.home") + "/.globus/userkey.pem"), new URI(System.getProperty("user.home") + "/.globus/usercert.pem"), getPassphrase());
GATContext context = new GATContext();
context.addPreferences(prefs);
context.addSecurityContext(ctxt);
ResourceBroker broker = GAT.createResourceBroker(context, new URI(args[0]));
Job job = broker.submitJob(jd);
while ((job.getState() != JobState.STOPPED) && (job.getState() != JobState.SUBMISSION_ERROR)) {
System.out.println("State: " + job.getState());
Thread.sleep(1000);
}
}
Aggregations