def poll_ci_build(context): from ai2thor.build import platform_map import ai2thor.downloader import time commit_id = subprocess.check_output("git log -n 1 --format=%H", shell=True).decode('ascii').strip() for i in range(60): missing = False for arch in platform_map.keys(): if (i % 300) == 0: print("checking %s for commit id %s" % (arch, commit_id)) if ai2thor.downloader.commit_build_log_exists(arch, commit_id): print("log exists %s" % commit_id) else: missing = True time.sleep(30) if not missing: break for arch in platform_map.keys(): if not ai2thor.downloader.commit_build_exists(arch, commit_id): print("Build log url: %s" % ai2thor.downloader.commit_build_log_url(arch, commit_id)) raise Exception("Failed to build %s for commit: %s " % (arch, commit_id))
def build(context, local=False): from multiprocessing import Process from ai2thor.build import platform_map version = datetime.datetime.now().strftime('%Y%m%d') build_url_base = 'https://deep-rl.herokuapp.com/resources/' builds = dict() for arch in platform_map.keys(): unity_path = 'unity' build_name = "thor-%s-%s" % (version, arch) build_dir = os.path.join('builds', build_name) build_path = build_dir + ".zip" build_info = builds[platform_map[arch]] = {} build_info['url'] = build_url_base + build_name + '.zip' build_info['build_exception'] = '' build_info['log'] = "%s.log" % (build_name, ) #_build(unity_path, arch, build_dir, build_name) archive_push(unity_path, build_path, build_dir, build_info) generate_quality_settings(context) with open("ai2thor/_builds.py", "w") as fi: fi.write("# GENERATED FILE - DO NOT EDIT\n") fi.write("VERSION = '%s'\n" % version) fi.write("BUILDS = " + pprint.pformat(builds)) increment_version(context) build_pip(context)
def build(context, local=False): from multiprocessing import Process from ai2thor.build import platform_map version = datetime.datetime.now().strftime("%Y%m%d%H%M") build_url_base = "http://s3-us-west-2.amazonaws.com/%s/" % S3_BUCKET builds = {"Docker": {"tag": version}} threads = [] dp = Process(target=build_docker, args=(version,)) dp.start() for arch in platform_map.keys(): unity_path = "unity" build_name = "thor-%s-%s" % (version, arch) build_dir = os.path.join("builds", build_name) build_path = build_dir + ".zip" build_info = builds[platform_map[arch]] = {} build_info["url"] = build_url_base + build_path build_info["build_exception"] = "" build_info["log"] = "%s.log" % (build_name,) _build(unity_path, arch, build_dir, build_name) t = threading.Thread( target=archive_push, args=(unity_path, build_path, build_dir, build_info) ) t.start() threads.append(t) dp.join() if dp.exitcode != 0: raise Exception("Exception with docker build") for t in threads: t.join() if not t.success: raise Exception("Error with thread") generate_quality_settings(context) with open("ai2thor/_builds.py", "w") as fi: fi.write("# GENERATED FILE - DO NOT EDIT\n") fi.write("VERSION = '%s'\n" % version) fi.write("BUILDS = " + pprint.pformat(builds)) increment_version(context) build_pip(context)