def submit(self, job):
# TODO: inherit docstring
self._check_job(job)
# Wraps the main command to copy inputs into working dir and copy outputs out
cmdstring = ['export CCC_WORKDIR=`pwd`']
if job.inputs:
cmdstring = ['cp -rf /inputs/* .'] + cmdstring
if isinstance(job.command, basestring):
cmdstring.append(job.command)
else:
cmdstring.append(' '.join(job.command))
cmdstring.append('cd $CCC_WORKDIR && cp -r * /outputs 2>/dev/null')
returnval = self.proxy.submitjob(image=job.image,
command=['sh', '-c', ' && '.join(cmdstring)],
inputs=job.inputs,
cpus=job.numcpus, # how is this the "minimum"?
maxDuration=1000*job.runtime,
workingDir='/workingdir')
job.jobid = returnval['jobId']
job._result_json = None
评论列表
文章目录