Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
.strip()
)
for i in range(360):
missing = False
for arch in platform_map.keys():
if (i % 5) == 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
if not missing:
break
time.sleep(10)
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))