blob: 80d5ca266fbcedb672439469753ee619849573dc [file] [log] [blame]
#!/usr/bin/env python
# Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import run_on_as_app
import shutil
import subprocess
import sys
import utils
def main():
working_dir = run_on_as_app.WORKING_DIR
print 'Removing directories that do not match checked out revision'
if not os.path.exists(working_dir):
for repo in run_on_as_app.APP_REPOSITORIES:
repo_dir = os.path.join(working_dir,
if os.path.exists(repo_dir) \
and utils.get_HEAD_sha1_for_checkout(repo_dir) != repo.revision:
print 'Removing %s' % repo_dir
print 'Downloading all missing apps'
# Package all files as cloud dependency
print 'Creating archive for opensource_apps (this may take some time)'
if os.path.exists(utils.OPENSOURCE_APPS_FOLDER):
for repo in run_on_as_app.APP_REPOSITORIES:
repo_dir = os.path.join(working_dir,
dst = os.path.join(utils.OPENSOURCE_APPS_FOLDER,
shutil.copytree(repo_dir, dst)
with utils.ChangedWorkingDirectory(utils.THIRD_PARTY):
subprocess.check_call(['', '-a', '--bucket',
'r8-deps', 'opensource_apps'])
print 'To have apps benchmarked on Golem, the updated apps have to be ' \
'downloaded to the runners by ssh\'ing into each runner and do:\n' \
'cd ../golem\n' \
if __name__ == '__main__':