def get_project(conf, url): if url.startswith("file://"): path = url[7:] if not os.path.isdir(path): raise ValueError("%s does not point to a directory" % (url,)) return path else: work_dir = aws.get_work_dir(conf) ebs_snap = aws.project_ebs_snapshot(conf) if ebs_snap: proj_dir = os.path.join(work_dir, "brenda-project.mount") dev = utils.blkdev(0, mount_form=True) utils.mount(dev, proj_dir) else: proj_dir = os.path.join(work_dir, "brenda-project.tmp") get_s3_project(conf, url, proj_dir) return utils.top_dir(proj_dir)
def get_project(conf, url): if url.startswith("file://"): path = url[7:] if not os.path.isdir(path): raise ValueError("%s does not point to a directory" % (url, )) return path else: work_dir = aws.get_work_dir(conf) ebs_snap = aws.project_ebs_snapshot(conf) if ebs_snap: proj_dir = os.path.join(work_dir, "brenda-project.mount") dev = utils.blkdev(0, mount_form=True) utils.mount(dev, proj_dir) else: proj_dir = os.path.join(work_dir, "brenda-project.tmp") get_s3_project(conf, url, proj_dir) return utils.top_dir(proj_dir)
cleanup_all() # initialize task_active and task_push states task_names = ('active', 'push') local = State() local.task_active = None local.task_push = None local.task_id_counter = 0 local.task_count = 0 # setup signal handler signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) # get configuration parameters work_dir = aws.get_work_dir(conf) visibility_timeout_reassert = int(conf.get('VISIBILITY_TIMEOUT_REASSERT', '30')) visibility_timeout = int(conf.get('VISIBILITY_TIMEOUT', '120')) # validate RENDER_OUTPUT bucket #aws.get_s3_output_bucket(conf) # file cleanup utils.rm('task_count') utils.rm('task_last') # create Blender temporary directory tmp_dir = os.path.join(work_dir, 'tmp') if not os.path.isdir(tmp_dir): utils.mkdir(tmp_dir) os.environ['TMP'] = tmp_dir
cleanup_all() # initialize task_active and task_push states task_names = ('active', 'push') local = State() local.task_active = None local.task_push = None local.task_id_counter = 0 local.task_count = 0 # setup signal handler signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) # get configuration parameters work_dir = aws.get_work_dir(conf) visibility_timeout_reassert = int( conf.get('VISIBILITY_TIMEOUT_REASSERT', '30')) visibility_timeout = int(conf.get('VISIBILITY_TIMEOUT', '120')) # validate RENDER_OUTPUT bucket aws.get_s3_output_bucket(conf) # file cleanup utils.rm('task_count') utils.rm('task_last') # create Blender temporary directory tmp_dir = os.path.join(work_dir, 'tmp') if not os.path.isdir(tmp_dir): utils.mkdir(tmp_dir)