skia2/tools/buildbot_globals.py

81 lines
2.1 KiB
Python
Raw Normal View History

Remove base-* directories from gm expected/actual paths; just use platform names BUG=skia:1512 The buildbot master continues to set gm_image_subdir, but the slaves no longer use that component when building GM paths (they just use builder_name instead). But gm_image_subdir is still used for SKP storage paths under gs://chromium-skia-gm/playback/gm-actual , for now... Immediately before committing this CL, I will copy the actual-results.json files from their old locations to their new locations (within the skia-autogen repo) so that both old and new versions of rebaseline.py will be able to retrieve actual results, like so: svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Debug/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Debug svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Release/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Release svn cp base-android-nexus-10/Test-Android-Nexus10-MaliT604-Arm7-Debug/base-android-nexus-10 Test-Android-Nexus10-MaliT604-Arm7-Debug ... svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Debug/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Debug svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Release/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Release Once we see this CL land successfully, I will delete the actual-results.json files from their OLD location within skia-autogen, like so: svn rm base-android-galaxy-nexus svn rm base-android-nexus-10 ... svn rm base-shuttle-win7-intel-directwrite svn rm base-shuttle-win7-intel-float R=borenet@google.com, rmistry@google.com Review URL: https://codereview.chromium.org/23120002 git-svn-id: http://skia.googlecode.com/svn/trunk@10821 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-20 16:21:55 +00:00
#!/usr/bin/python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Provides read access to buildbot's global_variables.json .
"""
from contextlib import closing
import HTMLParser
import base64
Remove base-* directories from gm expected/actual paths; just use platform names BUG=skia:1512 The buildbot master continues to set gm_image_subdir, but the slaves no longer use that component when building GM paths (they just use builder_name instead). But gm_image_subdir is still used for SKP storage paths under gs://chromium-skia-gm/playback/gm-actual , for now... Immediately before committing this CL, I will copy the actual-results.json files from their old locations to their new locations (within the skia-autogen repo) so that both old and new versions of rebaseline.py will be able to retrieve actual results, like so: svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Debug/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Debug svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Release/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Release svn cp base-android-nexus-10/Test-Android-Nexus10-MaliT604-Arm7-Debug/base-android-nexus-10 Test-Android-Nexus10-MaliT604-Arm7-Debug ... svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Debug/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Debug svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Release/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Release Once we see this CL land successfully, I will delete the actual-results.json files from their OLD location within skia-autogen, like so: svn rm base-android-galaxy-nexus svn rm base-android-nexus-10 ... svn rm base-shuttle-win7-intel-directwrite svn rm base-shuttle-win7-intel-float R=borenet@google.com, rmistry@google.com Review URL: https://codereview.chromium.org/23120002 git-svn-id: http://skia.googlecode.com/svn/trunk@10821 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-20 16:21:55 +00:00
import json
import re
Remove base-* directories from gm expected/actual paths; just use platform names BUG=skia:1512 The buildbot master continues to set gm_image_subdir, but the slaves no longer use that component when building GM paths (they just use builder_name instead). But gm_image_subdir is still used for SKP storage paths under gs://chromium-skia-gm/playback/gm-actual , for now... Immediately before committing this CL, I will copy the actual-results.json files from their old locations to their new locations (within the skia-autogen repo) so that both old and new versions of rebaseline.py will be able to retrieve actual results, like so: svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Debug/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Debug svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Release/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Release svn cp base-android-nexus-10/Test-Android-Nexus10-MaliT604-Arm7-Debug/base-android-nexus-10 Test-Android-Nexus10-MaliT604-Arm7-Debug ... svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Debug/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Debug svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Release/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Release Once we see this CL land successfully, I will delete the actual-results.json files from their OLD location within skia-autogen, like so: svn rm base-android-galaxy-nexus svn rm base-android-nexus-10 ... svn rm base-shuttle-win7-intel-directwrite svn rm base-shuttle-win7-intel-float R=borenet@google.com, rmistry@google.com Review URL: https://codereview.chromium.org/23120002 git-svn-id: http://skia.googlecode.com/svn/trunk@10821 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-20 16:21:55 +00:00
import svn
import sys
import urllib2
Remove base-* directories from gm expected/actual paths; just use platform names BUG=skia:1512 The buildbot master continues to set gm_image_subdir, but the slaves no longer use that component when building GM paths (they just use builder_name instead). But gm_image_subdir is still used for SKP storage paths under gs://chromium-skia-gm/playback/gm-actual , for now... Immediately before committing this CL, I will copy the actual-results.json files from their old locations to their new locations (within the skia-autogen repo) so that both old and new versions of rebaseline.py will be able to retrieve actual results, like so: svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Debug/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Debug svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Release/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Release svn cp base-android-nexus-10/Test-Android-Nexus10-MaliT604-Arm7-Debug/base-android-nexus-10 Test-Android-Nexus10-MaliT604-Arm7-Debug ... svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Debug/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Debug svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Release/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Release Once we see this CL land successfully, I will delete the actual-results.json files from their OLD location within skia-autogen, like so: svn rm base-android-galaxy-nexus svn rm base-android-nexus-10 ... svn rm base-shuttle-win7-intel-directwrite svn rm base-shuttle-win7-intel-float R=borenet@google.com, rmistry@google.com Review URL: https://codereview.chromium.org/23120002 git-svn-id: http://skia.googlecode.com/svn/trunk@10821 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-20 16:21:55 +00:00
_global_vars = None
_GLOBAL_VARS_JSON_BASE64_URL = (
'https://skia.googlesource.com/buildbot/+/master/'
'site_config/global_variables.json?format=TEXT')
class GlobalVarsRetrievalError(Exception):
"""Exception which is raised when the global_variables.json file cannot be
retrieved from the Skia buildbot repository."""
pass
class JsonDecodeError(Exception):
"""Exception which is raised when the global_variables.json file cannot be
interpreted as JSON. This may be due to the file itself being incorrectly
formatted or due to an incomplete or corrupted downloaded version of the file.
"""
pass
Remove base-* directories from gm expected/actual paths; just use platform names BUG=skia:1512 The buildbot master continues to set gm_image_subdir, but the slaves no longer use that component when building GM paths (they just use builder_name instead). But gm_image_subdir is still used for SKP storage paths under gs://chromium-skia-gm/playback/gm-actual , for now... Immediately before committing this CL, I will copy the actual-results.json files from their old locations to their new locations (within the skia-autogen repo) so that both old and new versions of rebaseline.py will be able to retrieve actual results, like so: svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Debug/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Debug svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Release/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Release svn cp base-android-nexus-10/Test-Android-Nexus10-MaliT604-Arm7-Debug/base-android-nexus-10 Test-Android-Nexus10-MaliT604-Arm7-Debug ... svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Debug/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Debug svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Release/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Release Once we see this CL land successfully, I will delete the actual-results.json files from their OLD location within skia-autogen, like so: svn rm base-android-galaxy-nexus svn rm base-android-nexus-10 ... svn rm base-shuttle-win7-intel-directwrite svn rm base-shuttle-win7-intel-float R=borenet@google.com, rmistry@google.com Review URL: https://codereview.chromium.org/23120002 git-svn-id: http://skia.googlecode.com/svn/trunk@10821 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-20 16:21:55 +00:00
class NoSuchGlobalVariable(KeyError):
"""Exception which is raised when a given variable is not found in the
global_variables.json file."""
Remove base-* directories from gm expected/actual paths; just use platform names BUG=skia:1512 The buildbot master continues to set gm_image_subdir, but the slaves no longer use that component when building GM paths (they just use builder_name instead). But gm_image_subdir is still used for SKP storage paths under gs://chromium-skia-gm/playback/gm-actual , for now... Immediately before committing this CL, I will copy the actual-results.json files from their old locations to their new locations (within the skia-autogen repo) so that both old and new versions of rebaseline.py will be able to retrieve actual results, like so: svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Debug/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Debug svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Release/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Release svn cp base-android-nexus-10/Test-Android-Nexus10-MaliT604-Arm7-Debug/base-android-nexus-10 Test-Android-Nexus10-MaliT604-Arm7-Debug ... svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Debug/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Debug svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Release/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Release Once we see this CL land successfully, I will delete the actual-results.json files from their OLD location within skia-autogen, like so: svn rm base-android-galaxy-nexus svn rm base-android-nexus-10 ... svn rm base-shuttle-win7-intel-directwrite svn rm base-shuttle-win7-intel-float R=borenet@google.com, rmistry@google.com Review URL: https://codereview.chromium.org/23120002 git-svn-id: http://skia.googlecode.com/svn/trunk@10821 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-20 16:21:55 +00:00
pass
Remove base-* directories from gm expected/actual paths; just use platform names BUG=skia:1512 The buildbot master continues to set gm_image_subdir, but the slaves no longer use that component when building GM paths (they just use builder_name instead). But gm_image_subdir is still used for SKP storage paths under gs://chromium-skia-gm/playback/gm-actual , for now... Immediately before committing this CL, I will copy the actual-results.json files from their old locations to their new locations (within the skia-autogen repo) so that both old and new versions of rebaseline.py will be able to retrieve actual results, like so: svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Debug/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Debug svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Release/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Release svn cp base-android-nexus-10/Test-Android-Nexus10-MaliT604-Arm7-Debug/base-android-nexus-10 Test-Android-Nexus10-MaliT604-Arm7-Debug ... svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Debug/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Debug svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Release/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Release Once we see this CL land successfully, I will delete the actual-results.json files from their OLD location within skia-autogen, like so: svn rm base-android-galaxy-nexus svn rm base-android-nexus-10 ... svn rm base-shuttle-win7-intel-directwrite svn rm base-shuttle-win7-intel-float R=borenet@google.com, rmistry@google.com Review URL: https://codereview.chromium.org/23120002 git-svn-id: http://skia.googlecode.com/svn/trunk@10821 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-20 16:21:55 +00:00
def Get(var_name):
"""Return the value associated with this name in global_variables.json.
Args:
var_name: string; the variable to look up.
Returns:
The value of the variable.
Raises:
NoSuchGlobalVariable if there is no variable with that name.
"""
Remove base-* directories from gm expected/actual paths; just use platform names BUG=skia:1512 The buildbot master continues to set gm_image_subdir, but the slaves no longer use that component when building GM paths (they just use builder_name instead). But gm_image_subdir is still used for SKP storage paths under gs://chromium-skia-gm/playback/gm-actual , for now... Immediately before committing this CL, I will copy the actual-results.json files from their old locations to their new locations (within the skia-autogen repo) so that both old and new versions of rebaseline.py will be able to retrieve actual results, like so: svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Debug/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Debug svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Release/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Release svn cp base-android-nexus-10/Test-Android-Nexus10-MaliT604-Arm7-Debug/base-android-nexus-10 Test-Android-Nexus10-MaliT604-Arm7-Debug ... svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Debug/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Debug svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Release/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Release Once we see this CL land successfully, I will delete the actual-results.json files from their OLD location within skia-autogen, like so: svn rm base-android-galaxy-nexus svn rm base-android-nexus-10 ... svn rm base-shuttle-win7-intel-directwrite svn rm base-shuttle-win7-intel-float R=borenet@google.com, rmistry@google.com Review URL: https://codereview.chromium.org/23120002 git-svn-id: http://skia.googlecode.com/svn/trunk@10821 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-20 16:21:55 +00:00
global _global_vars
if not _global_vars:
try:
with closing(urllib2.urlopen(_GLOBAL_VARS_JSON_BASE64_URL)) as f:
global_vars_text = base64.b64decode(f.read())
except Exception as e:
raise GlobalVarsRetrievalError('Failed to retrieve %s:\n%s' %
(_GLOBAL_VARS_JSON_BASE64_URL, str(e)))
try:
_global_vars = json.loads(global_vars_text)
except ValueError as e:
raise JsonDecodeError(e.message + '\n' + global_vars_text)
Remove base-* directories from gm expected/actual paths; just use platform names BUG=skia:1512 The buildbot master continues to set gm_image_subdir, but the slaves no longer use that component when building GM paths (they just use builder_name instead). But gm_image_subdir is still used for SKP storage paths under gs://chromium-skia-gm/playback/gm-actual , for now... Immediately before committing this CL, I will copy the actual-results.json files from their old locations to their new locations (within the skia-autogen repo) so that both old and new versions of rebaseline.py will be able to retrieve actual results, like so: svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Debug/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Debug svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Release/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Release svn cp base-android-nexus-10/Test-Android-Nexus10-MaliT604-Arm7-Debug/base-android-nexus-10 Test-Android-Nexus10-MaliT604-Arm7-Debug ... svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Debug/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Debug svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Release/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Release Once we see this CL land successfully, I will delete the actual-results.json files from their OLD location within skia-autogen, like so: svn rm base-android-galaxy-nexus svn rm base-android-nexus-10 ... svn rm base-shuttle-win7-intel-directwrite svn rm base-shuttle-win7-intel-float R=borenet@google.com, rmistry@google.com Review URL: https://codereview.chromium.org/23120002 git-svn-id: http://skia.googlecode.com/svn/trunk@10821 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-20 16:21:55 +00:00
try:
return _global_vars[var_name]['value']
except KeyError:
raise NoSuchGlobalVariable(var_name)
if __name__ == '__main__':
print Get(sys.argv[1])