ccc.py 文件源码

python
阅读 405 收藏 0 点赞 0 评论 0

项目:py-cloud-compute-cannon 作者: Autodesk 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号