Cherry-pick Skia infra fixes to m53 so that Windows and Android bots can run tests.
authorbenjaminwagner <benjaminwagner@google.com>
Tue, 19 Jul 2016 15:54:47 +0000 (08:54 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 19 Jul 2016 15:54:47 +0000 (08:54 -0700)
-----

Convert SK Images to new assets format

Depends on https://codereview.chromium.org/2162563002/

BUG=skia:5427
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2155163002

Review-Url: https://codereview.chromium.org/2155163002

-----

Add Android SDK asset

This will allow us to use CIPD to install the Android SDK on bots.

BUG=skia:5427
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2086003002

Review-Url: https://codereview.chromium.org/2086003002

-----

Convert Win toolchain to CIPD package

BUG=skia:5427
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2111713003

Review-Url: https://codereview.chromium.org/2111713003

-----

NOTREECHECKS=true
NOTRY=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2159213002

30 files changed:
SK_IMAGE_VERSION [deleted file]
infra/bots/android_sdk.isolate [deleted file]
infra/bots/android_sdk_hash [deleted file]
infra/bots/assets/android_sdk/VERSION [new file with mode: 0644]
infra/bots/assets/android_sdk/common.py [new file with mode: 0755]
infra/bots/assets/android_sdk/create.py [new file with mode: 0644]
infra/bots/assets/android_sdk/create_and_upload.py [new file with mode: 0755]
infra/bots/assets/android_sdk/download.py [new file with mode: 0755]
infra/bots/assets/android_sdk/upload.py [new file with mode: 0755]
infra/bots/assets/skimage/VERSION [new file with mode: 0644]
infra/bots/assets/skimage/common.py [new file with mode: 0755]
infra/bots/assets/skimage/create.py [new file with mode: 0755]
infra/bots/assets/skimage/create_and_upload.py [new file with mode: 0755]
infra/bots/assets/skimage/download.py [new file with mode: 0755]
infra/bots/assets/skimage/upload.py [new file with mode: 0755]
infra/bots/assets/win_toolchain/VERSION [new file with mode: 0644]
infra/bots/assets/win_toolchain/common.py [new file with mode: 0755]
infra/bots/assets/win_toolchain/create.py [new file with mode: 0755]
infra/bots/assets/win_toolchain/create_and_upload.py [new file with mode: 0755]
infra/bots/assets/win_toolchain/download.py [new file with mode: 0755]
infra/bots/assets/win_toolchain/upload.py [new file with mode: 0755]
infra/bots/common.py
infra/bots/download_images.py [deleted file]
infra/bots/images.isolate [deleted file]
infra/bots/isolate_android_sdk.py [deleted file]
infra/bots/isolate_win_toolchain.py [deleted file]
infra/bots/perf_skia.isolate
infra/bots/test_skia.isolate
infra/bots/win_toolchain.isolate [deleted file]
infra/bots/win_toolchain_hash.json [deleted file]

diff --git a/SK_IMAGE_VERSION b/SK_IMAGE_VERSION
deleted file mode 100644 (file)
index 7f8f011..0000000
+++ /dev/null
@@ -1 +0,0 @@
-7
diff --git a/infra/bots/android_sdk.isolate b/infra/bots/android_sdk.isolate
deleted file mode 100644 (file)
index bd33464..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  'variables': {
-    'files': [
-      '<(ANDROID_SDK_DIR)/',
-    ],
-  },
-}
diff --git a/infra/bots/android_sdk_hash b/infra/bots/android_sdk_hash
deleted file mode 100644 (file)
index c97d204..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1665a0011fc1ee7bfdf35ad071d979ad8a608695
\ No newline at end of file
diff --git a/infra/bots/assets/android_sdk/VERSION b/infra/bots/assets/android_sdk/VERSION
new file mode 100644 (file)
index 0000000..c227083
--- /dev/null
@@ -0,0 +1 @@
+0
\ No newline at end of file
diff --git a/infra/bots/assets/android_sdk/common.py b/infra/bots/assets/android_sdk/common.py
new file mode 100755 (executable)
index 0000000..4920c9b
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Common vars used by scripts in this directory."""
+
+
+import os
+import sys
+
+FILE_DIR = os.path.dirname(os.path.abspath(__file__))
+INFRA_BOTS_DIR = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir))
+
+sys.path.insert(0, INFRA_BOTS_DIR)
+from assets import assets
+
+ASSET_NAME = os.path.basename(FILE_DIR)
+
+
+def run(cmd):
+  """Run a command, eg. "upload" or "download". """
+  assets.main([cmd, ASSET_NAME] + sys.argv[1:])
diff --git a/infra/bots/assets/android_sdk/create.py b/infra/bots/assets/android_sdk/create.py
new file mode 100644 (file)
index 0000000..256a41d
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Create the asset."""
+
+
+import argparse
+import os
+import shutil
+
+
+def create_asset(target_dir, android_sdk_root):
+  """Create the asset."""
+  if not android_sdk_root:
+    android_sdk_root = (os.environ.get('ANDROID_HOME') or
+                        os.environ.get('ANDROID_SDK_ROOT'))
+  if not android_sdk_root:
+    raise Exception('No --android_sdk_root provided and no ANDROID_HOME or '
+                    'ANDROID_SDK_ROOT environment variables.')
+
+  dst = os.path.join(target_dir, 'android-sdk')
+  shutil.copytree(android_sdk_root, dst)
+
+
+def main():
+  parser = argparse.ArgumentParser()
+  parser.add_argument('--android_sdk_root')
+  parser.add_argument('--target_dir', '-t', required=True)
+  args = parser.parse_args()
+  create_asset(args.target_dir, args.android_sdk_root)
+
+
+if __name__ == '__main__':
+  main()
diff --git a/infra/bots/assets/android_sdk/create_and_upload.py b/infra/bots/assets/android_sdk/create_and_upload.py
new file mode 100755 (executable)
index 0000000..01b1b2c
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Create the asset and upload it."""
+
+
+import argparse
+import common
+import os
+import subprocess
+import sys
+import utils
+
+
+def main():
+  parser = argparse.ArgumentParser()
+  parser.add_argument('--android_sdk_root')
+  parser.add_argument('--gsutil')
+  args = parser.parse_args()
+
+  with utils.tmp_dir():
+    cwd = os.getcwd()
+    create_script = os.path.join(common.FILE_DIR, 'create.py')
+    upload_script = os.path.join(common.FILE_DIR, 'upload.py')
+
+    try:
+      cmd = ['python', create_script, '-t', cwd]
+      if args.android_sdk_root:
+        cmd.extend(['--android_sdk_root', args.android_sdk_root])
+      subprocess.check_call(cmd)
+
+      cmd = ['python', upload_script, '-t', cwd]
+      if args.gsutil:
+        cmd.extend(['--gsutil', args.gsutil])
+      subprocess.check_call(cmd)
+    except subprocess.CalledProcessError:
+      # Trap exceptions to avoid printing two stacktraces.
+      sys.exit(1)
+
+
+if __name__ == '__main__':
+  main()
diff --git a/infra/bots/assets/android_sdk/download.py b/infra/bots/assets/android_sdk/download.py
new file mode 100755 (executable)
index 0000000..96cc87d
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Download the current version of the asset."""
+
+
+import common
+
+
+if __name__ == '__main__':
+  common.run('download')
diff --git a/infra/bots/assets/android_sdk/upload.py b/infra/bots/assets/android_sdk/upload.py
new file mode 100755 (executable)
index 0000000..ba7fc8b
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Upload a new version of the asset."""
+
+
+import common
+
+
+if __name__ == '__main__':
+  common.run('upload')
diff --git a/infra/bots/assets/skimage/VERSION b/infra/bots/assets/skimage/VERSION
new file mode 100644 (file)
index 0000000..c227083
--- /dev/null
@@ -0,0 +1 @@
+0
\ No newline at end of file
diff --git a/infra/bots/assets/skimage/common.py b/infra/bots/assets/skimage/common.py
new file mode 100755 (executable)
index 0000000..4920c9b
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Common vars used by scripts in this directory."""
+
+
+import os
+import sys
+
+FILE_DIR = os.path.dirname(os.path.abspath(__file__))
+INFRA_BOTS_DIR = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir))
+
+sys.path.insert(0, INFRA_BOTS_DIR)
+from assets import assets
+
+ASSET_NAME = os.path.basename(FILE_DIR)
+
+
+def run(cmd):
+  """Run a command, eg. "upload" or "download". """
+  assets.main([cmd, ASSET_NAME] + sys.argv[1:])
diff --git a/infra/bots/assets/skimage/create.py b/infra/bots/assets/skimage/create.py
new file mode 100755 (executable)
index 0000000..bb83fef
--- /dev/null
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Create the asset."""
+
+
+import argparse
+import common
+from assets import asset_utils
+
+
+def create_asset(target_dir):
+  """Create the asset."""
+  # The common case is to add one or more images to the existing set. Therefore,
+  # download the previous version first.
+  asset = asset_utils.Asset(common.ASSET_NAME, asset_utils.MultiStore())
+  asset.download_current_version(target_dir)
+
+  # Allow the user to modify the contents of the target dir.
+  raw_input('Previous SKImage contents have been downloaded. Please make '
+            'your desired changes in the following directory and press enter '
+            'to continue:\n%s' % target_dir)
+
+
+def main():
+  parser = argparse.ArgumentParser()
+  parser.add_argument('--target_dir', '-t', required=True)
+  args = parser.parse_args()
+  create_asset(args.target_dir)
+
+
+if __name__ == '__main__':
+  main()
diff --git a/infra/bots/assets/skimage/create_and_upload.py b/infra/bots/assets/skimage/create_and_upload.py
new file mode 100755 (executable)
index 0000000..1356447
--- /dev/null
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Create the asset and upload it."""
+
+
+import argparse
+import common
+import os
+import subprocess
+import sys
+import utils
+
+
+def main():
+  parser = argparse.ArgumentParser()
+  parser.add_argument('--gsutil')
+  args = parser.parse_args()
+
+  with utils.tmp_dir():
+    cwd = os.getcwd()
+    create_script = os.path.join(common.FILE_DIR, 'create.py')
+    upload_script = os.path.join(common.FILE_DIR, 'upload.py')
+
+    try:
+      subprocess.check_call(['python', create_script, '-t', cwd])
+      cmd = ['python', upload_script, '-t', cwd]
+      if args.gsutil:
+        cmd.extend(['--gsutil', args.gsutil])
+      subprocess.check_call(cmd)
+    except subprocess.CalledProcessError:
+      # Trap exceptions to avoid printing two stacktraces.
+      sys.exit(1)
+
+
+if __name__ == '__main__':
+  main()
diff --git a/infra/bots/assets/skimage/download.py b/infra/bots/assets/skimage/download.py
new file mode 100755 (executable)
index 0000000..96cc87d
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Download the current version of the asset."""
+
+
+import common
+
+
+if __name__ == '__main__':
+  common.run('download')
diff --git a/infra/bots/assets/skimage/upload.py b/infra/bots/assets/skimage/upload.py
new file mode 100755 (executable)
index 0000000..ba7fc8b
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Upload a new version of the asset."""
+
+
+import common
+
+
+if __name__ == '__main__':
+  common.run('upload')
diff --git a/infra/bots/assets/win_toolchain/VERSION b/infra/bots/assets/win_toolchain/VERSION
new file mode 100644 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1
diff --git a/infra/bots/assets/win_toolchain/common.py b/infra/bots/assets/win_toolchain/common.py
new file mode 100755 (executable)
index 0000000..4920c9b
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Common vars used by scripts in this directory."""
+
+
+import os
+import sys
+
+FILE_DIR = os.path.dirname(os.path.abspath(__file__))
+INFRA_BOTS_DIR = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir))
+
+sys.path.insert(0, INFRA_BOTS_DIR)
+from assets import assets
+
+ASSET_NAME = os.path.basename(FILE_DIR)
+
+
+def run(cmd):
+  """Run a command, eg. "upload" or "download". """
+  assets.main([cmd, ASSET_NAME] + sys.argv[1:])
diff --git a/infra/bots/assets/win_toolchain/create.py b/infra/bots/assets/win_toolchain/create.py
new file mode 100755 (executable)
index 0000000..4ec20d4
--- /dev/null
@@ -0,0 +1,128 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Download an updated VS toolchain"""
+
+
+import argparse
+import common
+import json
+import os
+import shlex
+import shutil
+import subprocess
+import sys
+import utils
+
+import win_toolchain_utils
+
+
+# By default the toolchain includes a bunch of unnecessary stuff with long path
+# names. Trim out directories with these names.
+IGNORE_LIST = [
+  'WindowsMobile',
+  'App Certification Kit',
+  'Debuggers',
+  'Extension SDKs',
+  'winrt',
+  'DesignTime',
+  'AccChecker',
+]
+
+REPO_CHROME = 'https://chromium.googlesource.com/chromium/src.git'
+
+
+def filter_toolchain_files(dirname, files):
+  """Callback for shutil.copytree. Return lists of files to skip."""
+  split = dirname.split(os.path.sep)
+  for ign in IGNORE_LIST:
+    if ign in split:
+       print 'Ignoring dir %s' % dirname
+       return files
+  return []
+
+
+def get_toolchain_dir(toolchain_dir_output):
+  """Find the toolchain directory."""
+  prefix = 'vs_path = '
+  for line in toolchain_dir_output.splitlines():
+    if line.startswith(prefix):
+      return line[len(prefix):].strip('"')
+  raise Exception('Unable to find toolchain dir in output:\n%s' % (
+                  toolchain_dir_output))
+
+
+def gen_toolchain(chrome_path, msvs_version, target_dir):
+  """Update the VS toolchain and copy it to the target_dir."""
+  with utils.chdir(os.path.join(chrome_path, 'src')):
+    subprocess.check_call([utils.GCLIENT, 'sync'])
+    depot_tools = subprocess.check_output([
+        'python', os.path.join('build', 'find_depot_tools.py')]).rstrip()
+    with utils.git_branch():
+      vs_toolchain_py = os.path.join('build', 'vs_toolchain.py')
+      env = os.environ.copy()
+      env['GYP_MSVS_VERSION'] = msvs_version
+      subprocess.check_call(['python', vs_toolchain_py, 'update'], env=env)
+      output = subprocess.check_output(['python', vs_toolchain_py,
+                                        'get_toolchain_dir'], env=env).rstrip()
+      src_dir = get_toolchain_dir(output)
+      # Mock out absolute paths in win_toolchain.json.
+      win_toolchain_utils.abstract(os.path.join('build', 'win_toolchain.json'),
+                                   os.path.dirname(depot_tools))
+
+      # Copy the toolchain files to the target_dir.
+      build = os.path.join(os.getcwd(), 'build')
+      dst_build = os.path.join(target_dir, 'src', 'build')
+      os.makedirs(dst_build)
+      for f in ('find_depot_tools.py', 'vs_toolchain.py', 'win_toolchain.json'):
+        shutil.copyfile(os.path.join(build, f), os.path.join(dst_build, f))
+
+      shutil.copytree(os.path.join(os.getcwd(), 'tools', 'gyp', 'pylib'),
+                      os.path.join(target_dir, 'src', 'tools', 'gyp', 'pylib'))
+
+      dst_depot_tools = os.path.join(target_dir, 'depot_tools')
+      os.makedirs(dst_depot_tools)
+      for f in ('gclient.py', 'breakpad.py'):
+        shutil.copyfile(os.path.join(depot_tools, f),
+                        os.path.join(dst_depot_tools, f))
+      toolchain_dst = os.path.join(
+          target_dir, 'depot_tools', os.path.relpath(src_dir, depot_tools))
+      shutil.copytree(src_dir, toolchain_dst, ignore=filter_toolchain_files)
+
+
+def create_asset(target_dir, msvs_version, chrome_path=None):
+  """Create the asset."""
+  if not os.path.isdir(target_dir):
+    os.makedirs(target_dir)
+  with utils.tmp_dir() as tmp_dir:
+    if not chrome_path:
+      print ('Syncing Chrome from scratch. If you already have a checkout, '
+             'specify --chrome_path to save time.')
+      chrome_path = os.path.join(tmp_dir.name, 'src')
+    if not os.path.isdir(chrome_path):
+      subprocess.check_call([utils.GCLIENT, 'config', REPO_CHROME, '--managed'])
+      subprocess.check_call([utils.GCLIENT, 'sync'])
+
+    gen_toolchain(chrome_path, msvs_version, target_dir)
+
+def main():
+  if sys.platform != 'win32':
+    print >> sys.stderr, 'This script only runs on Windows.'
+    sys.exit(1)
+
+  parser = argparse.ArgumentParser()
+  parser.add_argument('--msvs_version', required=True)
+  parser.add_argument('--chrome_path')
+  parser.add_argument('--target_dir', '-t', required=True)
+  args = parser.parse_args()
+  target_dir = os.path.abspath(args.target_dir)
+  create_asset(target_dir, args.msvs_version, args.chrome_path)
+
+
+if __name__ == '__main__':
+  main()
diff --git a/infra/bots/assets/win_toolchain/create_and_upload.py b/infra/bots/assets/win_toolchain/create_and_upload.py
new file mode 100755 (executable)
index 0000000..d428ca4
--- /dev/null
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Create the asset and upload it."""
+
+
+import argparse
+import common
+import os
+import subprocess
+import sys
+import utils
+
+
+def main():
+  parser = argparse.ArgumentParser()
+  parser.add_argument('--gsutil')
+  parser.add_argument('--chrome_path')
+  parser.add_argument('--msvs_version', required=True)
+  args = parser.parse_args()
+
+  with utils.tmp_dir():
+    cwd = os.getcwd()
+    create_script = os.path.join(common.FILE_DIR, 'create.py')
+    upload_script = os.path.join(common.FILE_DIR, 'upload.py')
+
+    try:
+      cmd = ['python', create_script,
+             '-t', cwd,
+             '--msvs_version', args.msvs_version]
+      if args.chrome_path:
+        cmd.extend(['--chrome_path', args.chrome_path])
+      subprocess.check_call(cmd)
+      cmd = ['python', upload_script, '-t', cwd]
+      if args.gsutil:
+        cmd.extend(['--gsutil', args.gsutil])
+      subprocess.check_call(cmd)
+    except subprocess.CalledProcessError:
+      # Trap exceptions to avoid printing two stacktraces.
+      sys.exit(1)
+
+
+if __name__ == '__main__':
+  main()
diff --git a/infra/bots/assets/win_toolchain/download.py b/infra/bots/assets/win_toolchain/download.py
new file mode 100755 (executable)
index 0000000..96cc87d
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Download the current version of the asset."""
+
+
+import common
+
+
+if __name__ == '__main__':
+  common.run('download')
diff --git a/infra/bots/assets/win_toolchain/upload.py b/infra/bots/assets/win_toolchain/upload.py
new file mode 100755 (executable)
index 0000000..ba7fc8b
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Upload a new version of the asset."""
+
+
+import common
+
+
+if __name__ == '__main__':
+  common.run('upload')
index e4314dd78fa100ff2e606b890a41f27f8d32f16b..3c4a85d163a71918a5d9649c24ca0b48be0f943f 100644 (file)
@@ -13,10 +13,8 @@ import subprocess
 
 GS_GM_BUCKET = 'chromium-skia-gm'
 
-GS_SUBDIR_TMPL_SK_IMAGE = 'skimage/v%s'
 GS_SUBDIR_TMPL_SKP = 'playback_%s/skps'
 
-VERSION_FILE_SK_IMAGE = 'SK_IMAGE_VERSION'
 VERSION_FILE_SKP = 'SKP_VERSION'
 
 
diff --git a/infra/bots/download_images.py b/infra/bots/download_images.py
deleted file mode 100644 (file)
index 4342a9f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2016 Google Inc.
-#
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-import common
-import os
-import sys
-
-
-def main():
-  if len(sys.argv) != 1:
-    print >> sys.stderr, 'Usage: download_images.py'
-    sys.exit(1)
-  skia_dir = os.path.abspath(os.path.join(
-      os.path.dirname(os.path.realpath(__file__)),
-      os.pardir, os.pardir))
-  dst_dir = os.path.join(skia_dir, os.pardir, 'images')
-  tmp_dir = os.path.join(skia_dir, os.pardir, 'tmp')
-  common.download_dir(skia_dir, tmp_dir, common.VERSION_FILE_SK_IMAGE,
-                      common.GS_SUBDIR_TMPL_SK_IMAGE, dst_dir)
-
-
-if __name__ == '__main__':
-  main()
diff --git a/infra/bots/images.isolate b/infra/bots/images.isolate
deleted file mode 100644 (file)
index 573342b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-  'variables': {
-    'files': [
-      '../../../images/',
-      '../../../tmp/SK_IMAGE_VERSION',
-    ],
-  },
-}
diff --git a/infra/bots/isolate_android_sdk.py b/infra/bots/isolate_android_sdk.py
deleted file mode 100644 (file)
index 1cb0acc..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2016 Google Inc.
-#
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-"""Isolate a locally-managed Android SDK."""
-
-
-import argparse
-import os
-import shlex
-import shutil
-import subprocess
-import sys
-import utils
-
-
-INFRA_BOTS_DIR = os.path.realpath(os.path.dirname(os.path.abspath(__file__)))
-ISOLATE_FILE_NAME = 'android_sdk.isolate'
-REPO_SKIA = 'https://skia.googlesource.com/skia.git'
-SDK_DIR_NAME = 'android-sdk'
-
-
-def get_isolate_binary():
-  """Find or, if necessary, obtain the isolate binary."""
-  # Try to find isolate locally.
-  platform = 'linux64'
-  if sys.platform == 'win32':
-    platform = 'win64'
-  elif sys.platform == 'darwin':
-    platform = 'mac64'
-  repo_isolate = os.path.join(INFRA_BOTS_DIR,
-                              'tools', 'luci-go', platform)
-  path = os.pathsep.join((repo_isolate, os.environ['PATH']))
-  try:
-    output = subprocess.check_output(
-        ['which', 'isolate'],
-        env={'PATH':path}).rstrip()
-    print 'Found isolate binary: %s' % output
-    return output
-  except subprocess.CalledProcessError:
-    pass
-
-  # Download isolate from GS.
-  print 'Unable to find isolate binary; attempting to download...'
-  try:
-    subprocess.check_call(
-        ['download_from_google_storage',
-         '--bucket', 'chromium-luci',
-         '-d', repo_isolate])
-  except OSError as e:
-    raise Exception('Failed to download isolate binary. '
-                    'Is depot_tools in PATH?  Error: %s' % e)
-  except subprocess.CalledProcessError as e:
-    raise Exception('Failed to download isolate binary. '
-                    'Are you authenticated to Google Storage?  Error: %s' % e)
-
-  output = subprocess.check_output(
-      ['which', 'isolate'],
-      env={'PATH':path}).rstrip()
-  return output
-
-
-def check_isolate_auth(isolate):
-  """Ensure that we're authenticated to the isolate server."""
-  not_logged_in = 'Not logged in'
-  try:
-    output = subprocess.check_output([isolate, 'whoami'])
-    
-  except subprocess.CalledProcessError:
-    output = not_logged_in
-  if output == not_logged_in:
-    raise Exception('Not authenticated to isolate server. You probably need to '
-                    'run:\n$ %s login' % isolate)
-
-
-def isolate_android_sdk(android_sdk_root):
-  """Isolate the Android SDK and return the isolated hash."""
-  repo_isolate_file = os.path.join(INFRA_BOTS_DIR, ISOLATE_FILE_NAME)
-  with utils.tmp_dir():
-    # Copy the SDK dir contents into a directory with a known name.
-    sdk_dir = os.path.join(os.getcwd(), SDK_DIR_NAME)
-    shutil.copytree(android_sdk_root, sdk_dir)
-    isolate_file = os.path.join(os.getcwd(), ISOLATE_FILE_NAME)
-    shutil.copyfile(repo_isolate_file, isolate_file)
-
-    # Isolate the SDK.
-    isolate = get_isolate_binary()
-    check_isolate_auth(isolate)
-    android_sdk_relpath = os.path.relpath(
-        sdk_dir, os.path.dirname(isolate_file))
-    isolate_cmd = [isolate, 'archive', '--quiet',
-        '--isolate-server', 'https://isolateserver.appspot.com',
-        '-i', isolate_file,
-        '-s', 'android_sdk.isolated',
-        '--extra-variable', 'ANDROID_SDK_DIR=%s' % android_sdk_relpath]
-    isolate_out = subprocess.check_output(isolate_cmd).rstrip()
-    return shlex.split(isolate_out)[0]
-
-
-def update_sdk_file(skia_path, isolated_hash):
-  """Edit the android_sdk_hash file, upload a CL."""
-  with utils.chdir(skia_path):
-    with utils.git_branch():
-      hash_file = os.path.join('infra', 'bots', 'android_sdk_hash')
-      with open(hash_file, 'w') as f:
-        f.write(isolated_hash)
-      subprocess.check_call([utils.GIT, 'add', hash_file])
-      subprocess.check_call([utils.GIT, 'commit', '-m', 'Update Android SDK'])
-      subprocess.check_call([utils.GIT, 'cl', 'upload', '--bypass-hooks'])
-
-
-def main():
-  parser = argparse.ArgumentParser()
-  parser.add_argument('--android_sdk_root', required=True)
-  args = parser.parse_args()
-  skia_path = os.path.abspath(os.path.join(INFRA_BOTS_DIR,
-                                           os.pardir, os.pardir))
-
-  with utils.print_timings():
-    isolated_hash = isolate_android_sdk(args.android_sdk_root)
-    update_sdk_file(skia_path, isolated_hash)
-
-
-if __name__ == '__main__':
-  main()
diff --git a/infra/bots/isolate_win_toolchain.py b/infra/bots/isolate_win_toolchain.py
deleted file mode 100644 (file)
index 6960779..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2016 Google Inc.
-#
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-"""Download an updated VS toolchain, isolate it, upload a CL to update Skia."""
-
-
-import argparse
-import json
-import os
-import shlex
-import shutil
-import subprocess
-import sys
-import utils
-
-import win_toolchain_utils
-
-
-REPO_CHROME = 'https://chromium.googlesource.com/chromium/src.git'
-REPO_SKIA = 'https://skia.googlesource.com/skia.git'
-
-
-def get_toolchain_dir(toolchain_dir_output):
-  """Find the toolchain directory."""
-  prefix = 'vs_path = '
-  for line in toolchain_dir_output.splitlines():
-    if line.startswith(prefix):
-      return line[len(prefix):].strip('"')
-  raise Exception('Unable to find toolchain dir in output:\n%s' % (
-                  toolchain_dir_output))
-
-
-def gen_toolchain(chrome_path, msvs_version, isolate_file):
-  """Update the VS toolchain, isolate it, and return the isolated hash."""
-  with utils.chdir(chrome_path):
-    subprocess.check_call([utils.GCLIENT, 'sync'])
-    depot_tools = subprocess.check_output([
-        'python', os.path.join('build', 'find_depot_tools.py')]).rstrip()
-    with utils.git_branch():
-      vs_toolchain_py = os.path.join('build', 'vs_toolchain.py')
-      env = os.environ.copy()
-      env['GYP_MSVS_VERSION'] = msvs_version
-      subprocess.check_call(['python', vs_toolchain_py, 'update'], env=env)
-      output = subprocess.check_output(['python', vs_toolchain_py,
-                                        'get_toolchain_dir'], env=env).rstrip()
-      src_dir = get_toolchain_dir(output)
-      # Mock out absolute paths in win_toolchain.json.
-      win_toolchain_utils.abstract(os.path.join('build', 'win_toolchain.json'),
-                                   os.path.dirname(depot_tools))
-
-    # Isolate the toolchain. Assumes we're running on Windows, since the above
-    # would fail otherwise.
-    isolate_file_dirname = os.path.dirname(isolate_file)
-    toolchain_relpath = os.path.relpath(src_dir, isolate_file_dirname)
-    chrome_relpath = os.path.relpath(os.getcwd(), isolate_file_dirname)
-    depot_tools_relpath = os.path.relpath(depot_tools, isolate_file_dirname)
-    isolate = os.path.join(
-        os.curdir, 'tools', 'luci-go', 'win64', 'isolate.exe')
-    isolate_cmd = [isolate, 'archive', '--quiet',
-        '--isolate-server', 'https://isolateserver.appspot.com',
-        '-i', isolate_file,
-        '-s', 'win_toolchain_%s.isolated' % msvs_version,
-        '--extra-variable', 'WIN_TOOLCHAIN_DIR=%s' % toolchain_relpath,
-        '--extra-variable', 'DEPOT_TOOLS_DIR=%s' % depot_tools_relpath,
-        '--extra-variable', 'CHROME_DIR=%s' % chrome_relpath]
-    isolate_out = subprocess.check_output(isolate_cmd).rstrip()
-    return shlex.split(isolate_out)[0]
-
-
-def update_toolchain_file(skia_path, msvs_version, isolated_hash):
-  """Edit the win_toolchain_hash file, upload a CL."""
-  with utils.chdir(skia_path):
-    with utils.git_branch():
-      hash_file = os.path.join('infra', 'bots', 'win_toolchain_hash.json')
-      with open(hash_file) as f:
-        hashes = json.load(f)
-      hashes[msvs_version] = isolated_hash
-      with open(hash_file, 'w') as f:
-        json.dump(hashes, f, indent=4, sort_keys=True)
-      subprocess.check_call([utils.GIT, 'add', hash_file])
-      subprocess.check_call([utils.GIT, 'commit', '-m', 'Update Win toolchain'])
-      subprocess.check_call([utils.GIT, 'cl', 'upload', '--bypass-hooks'])
-
-
-def main():
-  parser = argparse.ArgumentParser()
-  parser.add_argument('--msvs_version', required=True)
-  parser.add_argument('--chrome_path')
-  parser.add_argument('--skia_path')
-  args = parser.parse_args()
-
-  isolate_file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
-                              'win_toolchain.isolate')
-
-  with utils.print_timings():
-    with utils.tmp_dir() as tmp_dir:
-      chrome_path = args.chrome_path
-      if not chrome_path:
-        print ('Syncing Chrome from scratch. If you already have a checkout, '
-               'specify --chrome_path to save time.')
-        chrome_path = os.path.join(tmp_dir.name, 'src')
-      if not os.path.isdir(chrome_path):
-        utils.git_clone(REPO_CHROME, chrome_path)
-
-      skia_path = args.skia_path
-      if not skia_path:
-        print ('Syncing Skia from scratch. If you already have a checkout, '
-               'specify --chrome_path to save time.')
-        skia_path = os.path.join(tmp_dir.name, 'skia')
-      if not os.path.isdir(skia_path):
-        utils.git_clone(REPO_SKIA, skia_path)
-
-      isolated_hash = gen_toolchain(chrome_path, args.msvs_version,
-                                    isolate_file)
-      update_toolchain_file(skia_path, args.msvs_version, isolated_hash)
-
-
-if __name__ == '__main__':
-  main()
index d98741c07d09bc29c028cefb5076452cc482a1fb..8e38791ebfd9b0221e152f7d6baa33bc7a63340e 100644 (file)
@@ -1,7 +1,6 @@
 {
   'includes': [
     'android_bin.isolate',
-    'images.isolate',
     'infrabots.isolate',
     'ios_bin.isolate',
     'resources.isolate',
index d98741c07d09bc29c028cefb5076452cc482a1fb..8e38791ebfd9b0221e152f7d6baa33bc7a63340e 100644 (file)
@@ -1,7 +1,6 @@
 {
   'includes': [
     'android_bin.isolate',
-    'images.isolate',
     'infrabots.isolate',
     'ios_bin.isolate',
     'resources.isolate',
diff --git a/infra/bots/win_toolchain.isolate b/infra/bots/win_toolchain.isolate
deleted file mode 100644 (file)
index a2c91db..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  'variables': {
-    'files': [
-      '<(CHROME_DIR)/build/find_depot_tools.py',
-      '<(CHROME_DIR)/build/vs_toolchain.py',
-      '<(CHROME_DIR)/build/win_toolchain.json',
-      '<(CHROME_DIR)/tools/gyp/pylib/',
-      '<(DEPOT_TOOLS_DIR)/gclient.py',
-      '<(DEPOT_TOOLS_DIR)/breakpad.py',
-      '<(WIN_TOOLCHAIN_DIR)/',
-    ],
-  },
-}
diff --git a/infra/bots/win_toolchain_hash.json b/infra/bots/win_toolchain_hash.json
deleted file mode 100644 (file)
index 675a2a8..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-    "2013": "705384d88f80da637eb367e5acc6f315c0e1db2f", 
-    "2015": "3c710fd7f4df8ec24fde62681536fad21be2751c"
-}
\ No newline at end of file