Ejemplo n.º 1
0
from grisu.frontend.control.login import LoginManager
from grisu.frontend.model.job import JobObject
from grisu.model import GrisuRegistryManager

si = LoginManager.loginCommandline("LOCAL")

appInfo = GrisuRegistryManager.getDefault(si).getApplicationInformation(
    "ImageJ")

print 'app: ' + appInfo.getApplicationName()

for subloc in appInfo.getAvailableAllSubmissionLocations():
    print subloc

job = JobObject(si)
job.setTimestampJobname("imageJ")
job.setApplication("java")
job.setApplication("ImageJ")
job.setCommandline("echo Hello")

job.setSubmissionLocation("normal:ng2.ivec.org")

job.createJob("/ARCS/StartUp")
job.submitJob()

job.waitForJobToFinish(3)

print "Stdout: " + job.getStdOutContent()
print "Stderr: " + job.getStdErrContent()
Ejemplo n.º 2
0
                print 'Not a file: ' + line
                sys.exit(1)
    return files_to_upload


files_to_upload = read_files(files_file)

if not si:
    LoginManager.initEnvironment()
    si = LoginManager.login('bestgrid', True)

filemanager = GrisuRegistryManager.getDefault(si).getFileManager()

job = JobObject(si)
job.setSubmissionLocation('pan:pan.nesi.org.nz')
job.setTimestampJobname(jobname_template)
job.setCommandline(commandline)

# add input files
for file in files_to_upload:
    job.addInputFileUrl(file)

jobname = job.createJob('/nz/nesi')
print 'Submitting job...'
job.submitJob()
print 'Jobname: ' + jobname

print 'Waiting for job to finish...'
job.waitForJobToFinish(jobstate_check_intervall)

job_directory = job.getJobDirectoryUrl()
Ejemplo n.º 3
0
            else: 
                print 'Not a file: '+line
                sys.exit(1)
    return files_to_upload

files_to_upload = read_files(files_file)

if not si:
    LoginManager.initEnvironment()
    si = LoginManager.login('bestgrid', True)

filemanager = GrisuRegistryManager.getDefault(si).getFileManager()

job = JobObject(si)
job.setSubmissionLocation('pan:pan.nesi.org.nz')
job.setTimestampJobname(jobname_template)
job.setCommandline(commandline)

# add input files
for file in files_to_upload:
    job.addInputFileUrl(file)
    

jobname = job.createJob('/nz/nesi')
print 'Submitting job...'
job.submitJob()
print 'Jobname: '+jobname

print 'Waiting for job to finish...'
job.waitForJobToFinish(jobstate_check_intervall)
Ejemplo n.º 4
0
import sys

si = LoginManager.loginCommandline()

print "Parsing commandline arguments..."
file1url = sys.argv[1]
file1Name = FileManager.getFilename(file1url)
file2url = sys.argv[2]
file2Name = FileManager.getFilename(file2url)


print "Creating job..."
# create the job object
job = JobObject(si)
# set a unique jobname
job.setTimestampJobname("diff_job")
print "Set jobname to: " + job.getJobname()
# setting the application. this means that grisu can figure out the submission location and
# you don't have to do that manually
job.setApplication("UnixCommands")

# set the commandline that needs to be executed
job.setCommandline("diff " + file1Name + " " + file2Name)

job.addInputFileUrl(file1url)
job.addInputFileUrl(file2url)

# create the job on the backend and specify the VO to use
job.createJob("/ARCS/StartUp")
print "Submitting job..."
# submit the job
Ejemplo n.º 5
0
job_header="""#!/bin/sh
%s
"""
if group == '':
    group = DEFAULT_GROUP
if queue == '':
    queue = DEFAULT_QUEUE

for f in sys.argv[8:]:
    input_files.append(f)

try:
    job = JobObject(si) 
    job.setSubmissionLocation(queue)
    job.setTimestampJobname("galaxy_" + galaxy_job_id)

    job.setMemory(DEFAULT_MEMORY)
    job.setWalltimeInSeconds(DEFAULT_WALLTIME)

    # stop annoying stats from being written to stderr
    job.addEnvironmentVariable("SUPPRESS_STATS", "true")

#create the job script#

except:
    print "Cannot setup the job environment"
    sys.exit(-4)

#create nesi job_script
try:
Ejemplo n.º 6
0
from grisu.model import FileManager
import sys

si = LoginManager.loginCommandline()

print 'Parsing commandline arguments...'
file1url = sys.argv[1]
file1Name = FileManager.getFilename(file1url)
file2url = sys.argv[2]
file2Name = FileManager.getFilename(file2url)

print 'Creating job...'
# create the job object
job = JobObject(si)
# set a unique jobname
job.setTimestampJobname("diff_job")
print 'Set jobname to: ' + job.getJobname()
# setting the application. this means that grisu can figure out the submission location and
# you don't have to do that manually
job.setApplication("UnixCommands")

# set the commandline that needs to be executed
job.setCommandline('diff ' + file1Name + ' ' + file2Name)

job.addInputFileUrl(file1url)
job.addInputFileUrl(file2url)

# create the job on the backend and specify the VO to use
job.createJob("/ARCS/StartUp")
print 'Submitting job...'
# submit the job
Ejemplo n.º 7
0
from grisu.frontend.control.login import LoginManager
from grisu.frontend.model.job import JobObject
from grisu.model import GrisuRegistryManager

si = LoginManager.loginCommandline("LOCAL")

appInfo = GrisuRegistryManager.getDefault(si).getApplicationInformation("ImageJ")

print 'app: '+appInfo.getApplicationName()

for subloc in appInfo.getAvailableAllSubmissionLocations():
    print subloc

job = JobObject(si);
job.setTimestampJobname("imageJ");
job.setApplication("java");
job.setApplication("ImageJ");
job.setCommandline("echo Hello");

job.setSubmissionLocation("normal:ng2.ivec.org");

job.createJob("/ARCS/StartUp");
job.submitJob();

job.waitForJobToFinish(3);

print "Stdout: "+job.getStdOutContent()
print "Stderr: "+job.getStdErrContent()