From bfa5b455787b9168f363cf58a9e4d94ea93ec5a4 Mon Sep 17 00:00:00 2001 From: borenet Date: Wed, 19 Oct 2016 10:13:32 -0700 Subject: Add key params for buildbotless bots in DM/nanobench BUG=skia:5626 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2424793005 Review-Url: https://chromiumcodereview.appspot.com/2424793005 --- infra/bots/recipe_modules/vars/__init__.py | 1 + infra/bots/recipe_modules/vars/api.py | 38 +- .../recipes/swarm_perf.expected/nobuildbot.json | 250 ++++++++++ infra/bots/recipes/swarm_perf.py | 32 ++ .../recipes/swarm_test.expected/nobuildbot.json | 507 +++++++++++++++++++++ infra/bots/recipes/swarm_test.py | 22 + 6 files changed, 846 insertions(+), 4 deletions(-) create mode 100644 infra/bots/recipes/swarm_perf.expected/nobuildbot.json create mode 100644 infra/bots/recipes/swarm_test.expected/nobuildbot.json diff --git a/infra/bots/recipe_modules/vars/__init__.py b/infra/bots/recipe_modules/vars/__init__.py index aaf8fafa66..e74431efac 100644 --- a/infra/bots/recipe_modules/vars/__init__.py +++ b/infra/bots/recipe_modules/vars/__init__.py @@ -8,5 +8,6 @@ DEPS = [ 'recipe_engine/path', 'recipe_engine/properties', 'recipe_engine/python', + 'recipe_engine/raw_io', 'recipe_engine/step', ] diff --git a/infra/bots/recipe_modules/vars/api.py b/infra/bots/recipe_modules/vars/api.py index 945cf913fa..d36ab13a9d 100644 --- a/infra/bots/recipe_modules/vars/api.py +++ b/infra/bots/recipe_modules/vars/api.py @@ -35,6 +35,7 @@ class SkiaVarsApi(recipe_api.RecipeApi): self.gclient_env = {} self.is_compile_bot = self.builder_name.startswith('Build-') self.no_buildbot = self.m.properties.get('nobuildbot', '') == 'True' + self.skia_task_id = self.m.properties.get('skia_task_id', None) self.default_env['CHROME_HEADLESS'] = '1' # The 'depot_tools' directory comes from recipe DEPS and isn't provided by @@ -113,12 +114,16 @@ class SkiaVarsApi(recipe_api.RecipeApi): self.issue = None self.patchset = None if self.no_buildbot: - self.is_trybot = ( - self.m.properties.get('issue', '') and - self.m.properties.get('patchset', '')) - if self.is_trybot: + if (self.m.properties.get('issue', '') and + self.m.properties.get('patchset', '')): + self.is_trybot = True self.issue = self.m.properties['issue'] self.patchset = self.m.properties['patchset'] + elif (self.m.properties.get('event.change.number', '') and + self.m.properties.get('event.patchSet.ref', '')): + self.is_trybot = True + self.issue = self.m.properties['event.change.number'] + self.patchset = self.m.properties['event.patchSet.ref'].split('/')[-1] else: self.is_trybot = self.builder_cfg['is_trybot'] if self.is_trybot: @@ -133,6 +138,8 @@ class SkiaVarsApi(recipe_api.RecipeApi): self.swarming_out_dir, 'dm') self.perf_data_dir = self.m.path.join(self.swarming_out_dir, 'perfdata', self.builder_name, 'data') + self._swarming_bot_id = None + self._swarming_task_id = None @property def upload_dm_results(self): @@ -171,3 +178,26 @@ class SkiaVarsApi(recipe_api.RecipeApi): upload_perf_results = False break return upload_perf_results + + @property + def swarming_bot_id(self): + if not self._swarming_bot_id: + self._swarming_bot_id = self.m.python.inline( + name='get swarming bot id', + program='''import os +print os.environ.get('SWARMING_BOT_ID', '') +''', + stdout=self.m.raw_io.output()).stdout.rstrip() + return self._swarming_bot_id + + @property + def swarming_task_id(self): + if not self._swarming_task_id: + self._swarming_task_id = self.m.python.inline( + name='get swarming task id', + program='''import os +print os.environ.get('SWARMING_TASK_ID', '') +''', + stdout=self.m.raw_io.output()).stdout.rstrip() + return self._swarming_task_id + diff --git a/infra/bots/recipes/swarm_perf.expected/nobuildbot.json b/infra/bots/recipes/swarm_perf.expected/nobuildbot.json new file mode 100644 index 0000000000..26c22ab24a --- /dev/null +++ b/infra/bots/recipes/swarm_perf.expected/nobuildbot.json @@ -0,0 +1,250 @@ +[ + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", + "[SLAVE_BUILD]\\skia\\infra\\bots\\assets\\skp\\VERSION", + "/path/to/tmp/" + ], + "name": "Get downloaded SKP VERSION" + }, + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", + "42", + "[SLAVE_BUILD]\\tmp\\SKP_VERSION" + ], + "name": "write SKP_VERSION" + }, + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", + "[SLAVE_BUILD]\\skia\\infra\\bots\\assets\\skimage\\VERSION", + "/path/to/tmp/" + ], + "name": "Get downloaded skimage VERSION" + }, + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", + "42", + "[SLAVE_BUILD]\\tmp\\SK_IMAGE_VERSION" + ], + "name": "write SK_IMAGE_VERSION" + }, + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", + "[SLAVE_BUILD]\\skia\\infra\\bots\\assets\\svg\\VERSION", + "/path/to/tmp/" + ], + "name": "Get downloaded SVG VERSION" + }, + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", + "42", + "[SLAVE_BUILD]\\tmp\\SVG_VERSION" + ], + "name": "write SVG_VERSION" + }, + { + "cmd": [ + "python", + "-u", + "\nimport os, sys\nfrom common import chromium_utils # Error? See https://crbug.com/584783.\n\n\nif os.path.exists(sys.argv[1]):\n chromium_utils.RemoveDirectory(sys.argv[1])\n", + "[CUSTOM_[SWARM_OUT_DIR]]\\perfdata\\Perf-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Release-Trybot\\data" + ], + "env": { + "PYTHONPATH": "[SLAVE_BUILD]\\skia\\infra\\bots\\.recipe_deps\\build\\scripts" + }, + "name": "rmtree data", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@import os, sys@@@", + "@@@STEP_LOG_LINE@python.inline@from common import chromium_utils # Error? See https://crbug.com/584783.@@@", + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@if os.path.exists(sys.argv[1]):@@@", + "@@@STEP_LOG_LINE@python.inline@ chromium_utils.RemoveDirectory(sys.argv[1])@@@", + "@@@STEP_LOG_END@python.inline@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "\nimport sys, os\npath = sys.argv[1]\nmode = int(sys.argv[2])\nif not os.path.isdir(path):\n if os.path.exists(path):\n print \"%s exists but is not a dir\" % path\n sys.exit(1)\n os.makedirs(path, mode)\n", + "[CUSTOM_[SWARM_OUT_DIR]]\\perfdata\\Perf-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Release-Trybot\\data", + "511" + ], + "name": "makedirs data", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@import sys, os@@@", + "@@@STEP_LOG_LINE@python.inline@path = sys.argv[1]@@@", + "@@@STEP_LOG_LINE@python.inline@mode = int(sys.argv[2])@@@", + "@@@STEP_LOG_LINE@python.inline@if not os.path.isdir(path):@@@", + "@@@STEP_LOG_LINE@python.inline@ if os.path.exists(path):@@@", + "@@@STEP_LOG_LINE@python.inline@ print \"%s exists but is not a dir\" % path@@@", + "@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@", + "@@@STEP_LOG_LINE@python.inline@ os.makedirs(path, mode)@@@", + "@@@STEP_LOG_END@python.inline@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "import os\nprint os.environ.get('SWARMING_BOT_ID', '')\n" + ], + "name": "get swarming bot id", + "stdout": "/path/to/tmp/", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@python.inline@import os@@@", + "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_BOT_ID', '')@@@", + "@@@STEP_LOG_END@python.inline@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "import os\nprint os.environ.get('SWARMING_TASK_ID', '')\n" + ], + "name": "get swarming task id", + "stdout": "/path/to/tmp/", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@python.inline@import os@@@", + "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_TASK_ID', '')@@@", + "@@@STEP_LOG_END@python.inline@@@" + ] + }, + { + "cmd": [ + "[SLAVE_BUILD]\\out\\Release_x64\\nanobench", + "--undefok", + "-i", + "[SLAVE_BUILD]\\skia\\resources", + "--skps", + "[SLAVE_BUILD]\\skp", + "--images", + "[SLAVE_BUILD]\\skimage\\nanobench", + "--svgs", + "[SLAVE_BUILD]\\svg", + "--nocpu", + "--pre_log", + "--images", + "--gpuStatsDump", + "true", + "--scales", + "1.0", + "1.1", + "--config", + "8888", + "gpu", + "nonrendering", + "hwui", + "f16", + "srgb", + "msaa16", + "nvpr16", + "nvprdit16", + "--match", + "~interlaced1.png", + "~interlaced2.png", + "~interlaced3.png", + "~inc0.gif", + "~inc1.gif", + "~incInterlaced.gif", + "~inc0.jpg", + "~incGray.jpg", + "~inc0.wbmp", + "~inc1.wbmp", + "~inc0.webp", + "~inc1.webp", + "~inc0.ico", + "~inc1.ico", + "~inc0.png", + "~inc1.png", + "~inc2.png", + "~inc12.png", + "~inc13.png", + "~inc14.png", + "~inc0.webp", + "~inc1.webp", + "--outResultsFile", + "[CUSTOM_[SWARM_OUT_DIR]]\\perfdata\\Perf-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Release-Trybot\\data\\nanobench_abc123_1337000001.json", + "--properties", + "gitHash", + "abc123", + "build_number", + "5", + "issue", + "2100", + "patchset", + "2", + "patch_storage", + "gerrit", + "no_buildbot", + "True", + "swarming_bot_id", + "skia-bot-123", + "swarming_task_id", + "123456", + "--key", + "arch", + "x86_64", + "compiler", + "MSVC", + "cpu_or_gpu", + "GPU", + "cpu_or_gpu_value", + "HD4600", + "model", + "ShuttleB", + "os", + "Win8" + ], + "cwd": "[SLAVE_BUILD]\\skia", + "name": "nanobench" + }, + { + "cmd": [ + "python", + "-u", + "\nimport sys, os\npath = sys.argv[1]\nmode = int(sys.argv[2])\nif not os.path.isdir(path):\n if os.path.exists(path):\n print \"%s exists but is not a dir\" % path\n sys.exit(1)\n os.makedirs(path, mode)\n", + "[CUSTOM_[SWARM_OUT_DIR]]\\perfdata\\Perf-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Release-Trybot\\data", + "511" + ], + "name": "makedirs perf_dir", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@import sys, os@@@", + "@@@STEP_LOG_LINE@python.inline@path = sys.argv[1]@@@", + "@@@STEP_LOG_LINE@python.inline@mode = int(sys.argv[2])@@@", + "@@@STEP_LOG_LINE@python.inline@if not os.path.isdir(path):@@@", + "@@@STEP_LOG_LINE@python.inline@ if os.path.exists(path):@@@", + "@@@STEP_LOG_LINE@python.inline@ print \"%s exists but is not a dir\" % path@@@", + "@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@", + "@@@STEP_LOG_LINE@python.inline@ os.makedirs(path, mode)@@@", + "@@@STEP_LOG_END@python.inline@@@" + ] + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +] \ No newline at end of file diff --git a/infra/bots/recipes/swarm_perf.py b/infra/bots/recipes/swarm_perf.py index 31d6dbefe8..95948aae49 100644 --- a/infra/bots/recipes/swarm_perf.py +++ b/infra/bots/recipes/swarm_perf.py @@ -188,6 +188,10 @@ def perf_steps(api): 'patchset', api.vars.patchset, 'patch_storage', api.vars.patch_storage, ]) + if api.vars.no_buildbot: + properties.extend(['no_buildbot', 'True']) + properties.extend(['swarming_bot_id', api.vars.swarming_bot_id]) + properties.extend(['swarming_task_id', api.vars.swarming_task_id]) target = 'nanobench' args = [ @@ -335,3 +339,31 @@ def GenTests(api): revision='abc123', **gerrit_kwargs) ) + + yield ( + api.test('nobuildbot') + + api.properties(buildername=builder, + mastername='client.skia', + slavename='skiabot-linux-swarm-000', + buildnumber=5, + revision='abc123', + path_config='kitchen', + nobuildbot='True', + swarm_out_dir='[SWARM_OUT_DIR]', + **gerrit_kwargs) + + api.path.exists( + api.path['slave_build'].join('skia'), + api.path['slave_build'].join('skia', 'infra', 'bots', 'assets', + 'skimage', 'VERSION'), + api.path['slave_build'].join('skia', 'infra', 'bots', 'assets', + 'skp', 'VERSION'), + api.path['slave_build'].join('skia', 'infra', 'bots', 'assets', + 'svg', 'VERSION'), + api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt') + ) + + api.platform('win', 64) + + api.step_data('get swarming bot id', + stdout=api.raw_io.output('skia-bot-123')) + + api.step_data('get swarming task id', stdout=api.raw_io.output('123456')) + ) + diff --git a/infra/bots/recipes/swarm_test.expected/nobuildbot.json b/infra/bots/recipes/swarm_test.expected/nobuildbot.json new file mode 100644 index 0000000000..85bc056434 --- /dev/null +++ b/infra/bots/recipes/swarm_test.expected/nobuildbot.json @@ -0,0 +1,507 @@ +[ + { + "cmd": [ + "python", + "-u", + "\nimport sys, os\npath = sys.argv[1]\nmode = int(sys.argv[2])\nif not os.path.isdir(path):\n if os.path.exists(path):\n print \"%s exists but is not a dir\" % path\n sys.exit(1)\n os.makedirs(path, mode)\n", + "[SLAVE_BUILD]/tmp", + "511" + ], + "name": "makedirs tmp_dir", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@import sys, os@@@", + "@@@STEP_LOG_LINE@python.inline@path = sys.argv[1]@@@", + "@@@STEP_LOG_LINE@python.inline@mode = int(sys.argv[2])@@@", + "@@@STEP_LOG_LINE@python.inline@if not os.path.isdir(path):@@@", + "@@@STEP_LOG_LINE@python.inline@ if os.path.exists(path):@@@", + "@@@STEP_LOG_LINE@python.inline@ print \"%s exists but is not a dir\" % path@@@", + "@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@", + "@@@STEP_LOG_LINE@python.inline@ os.makedirs(path, mode)@@@", + "@@@STEP_LOG_END@python.inline@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", + "[SLAVE_BUILD]/skia/infra/bots/assets/skp/VERSION", + "/path/to/tmp/" + ], + "name": "Get downloaded SKP VERSION" + }, + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", + "42", + "[SLAVE_BUILD]/tmp/SKP_VERSION" + ], + "name": "write SKP_VERSION" + }, + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", + "[SLAVE_BUILD]/skia/infra/bots/assets/skimage/VERSION", + "/path/to/tmp/" + ], + "name": "Get downloaded skimage VERSION" + }, + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", + "42", + "[SLAVE_BUILD]/tmp/SK_IMAGE_VERSION" + ], + "name": "write SK_IMAGE_VERSION" + }, + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", + "[SLAVE_BUILD]/skia/infra/bots/assets/svg/VERSION", + "/path/to/tmp/" + ], + "name": "Get downloaded SVG VERSION" + }, + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", + "42", + "[SLAVE_BUILD]/tmp/SVG_VERSION" + ], + "name": "write SVG_VERSION" + }, + { + "cmd": [ + "python", + "-u", + "\nimport os, sys\nfrom common import chromium_utils # Error? See https://crbug.com/584783.\n\n\nif os.path.exists(sys.argv[1]):\n chromium_utils.RemoveDirectory(sys.argv[1])\n", + "[CUSTOM_[SWARM_OUT_DIR]]/dm" + ], + "env": { + "PYTHONPATH": "[SLAVE_BUILD]/skia/infra/bots/.recipe_deps/build/scripts" + }, + "name": "rmtree dm", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@import os, sys@@@", + "@@@STEP_LOG_LINE@python.inline@from common import chromium_utils # Error? See https://crbug.com/584783.@@@", + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@if os.path.exists(sys.argv[1]):@@@", + "@@@STEP_LOG_LINE@python.inline@ chromium_utils.RemoveDirectory(sys.argv[1])@@@", + "@@@STEP_LOG_END@python.inline@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "\nimport sys, os\npath = sys.argv[1]\nmode = int(sys.argv[2])\nif not os.path.isdir(path):\n if os.path.exists(path):\n print \"%s exists but is not a dir\" % path\n sys.exit(1)\n os.makedirs(path, mode)\n", + "[CUSTOM_[SWARM_OUT_DIR]]/dm", + "511" + ], + "name": "makedirs dm", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@import sys, os@@@", + "@@@STEP_LOG_LINE@python.inline@path = sys.argv[1]@@@", + "@@@STEP_LOG_LINE@python.inline@mode = int(sys.argv[2])@@@", + "@@@STEP_LOG_LINE@python.inline@if not os.path.isdir(path):@@@", + "@@@STEP_LOG_LINE@python.inline@ if os.path.exists(path):@@@", + "@@@STEP_LOG_LINE@python.inline@ print \"%s exists but is not a dir\" % path@@@", + "@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@", + "@@@STEP_LOG_LINE@python.inline@ os.makedirs(path, mode)@@@", + "@@@STEP_LOG_END@python.inline@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "\nimport contextlib\nimport math\nimport socket\nimport sys\nimport time\nimport urllib2\n\nHASHES_URL = 'https://gold.skia.org/_/hashes'\nRETRIES = 5\nTIMEOUT = 60\nWAIT_BASE = 15\n\nsocket.setdefaulttimeout(TIMEOUT)\nfor retry in range(RETRIES):\n try:\n with contextlib.closing(\n urllib2.urlopen(HASHES_URL, timeout=TIMEOUT)) as w:\n hashes = w.read()\n with open(sys.argv[1], 'w') as f:\n f.write(hashes)\n break\n except Exception as e:\n print 'Failed to get uninteresting hashes from %s:' % HASHES_URL\n print e\n if retry == RETRIES:\n raise\n waittime = WAIT_BASE * math.pow(2, retry)\n print 'Retry in %d seconds.' % waittime\n time.sleep(waittime)\n", + "[SLAVE_BUILD]/tmp/uninteresting_hashes.txt" + ], + "cwd": "[SLAVE_BUILD]/skia", + "env": { + "BUILDTYPE": "Debug", + "CHROME_HEADLESS": "1", + "SKIA_OUT": "[SLAVE_BUILD]/out" + }, + "name": "get uninteresting hashes", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@import contextlib@@@", + "@@@STEP_LOG_LINE@python.inline@import math@@@", + "@@@STEP_LOG_LINE@python.inline@import socket@@@", + "@@@STEP_LOG_LINE@python.inline@import sys@@@", + "@@@STEP_LOG_LINE@python.inline@import time@@@", + "@@@STEP_LOG_LINE@python.inline@import urllib2@@@", + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@HASHES_URL = 'https://gold.skia.org/_/hashes'@@@", + "@@@STEP_LOG_LINE@python.inline@RETRIES = 5@@@", + "@@@STEP_LOG_LINE@python.inline@TIMEOUT = 60@@@", + "@@@STEP_LOG_LINE@python.inline@WAIT_BASE = 15@@@", + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@socket.setdefaulttimeout(TIMEOUT)@@@", + "@@@STEP_LOG_LINE@python.inline@for retry in range(RETRIES):@@@", + "@@@STEP_LOG_LINE@python.inline@ try:@@@", + "@@@STEP_LOG_LINE@python.inline@ with contextlib.closing(@@@", + "@@@STEP_LOG_LINE@python.inline@ urllib2.urlopen(HASHES_URL, timeout=TIMEOUT)) as w:@@@", + "@@@STEP_LOG_LINE@python.inline@ hashes = w.read()@@@", + "@@@STEP_LOG_LINE@python.inline@ with open(sys.argv[1], 'w') as f:@@@", + "@@@STEP_LOG_LINE@python.inline@ f.write(hashes)@@@", + "@@@STEP_LOG_LINE@python.inline@ break@@@", + "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@", + "@@@STEP_LOG_LINE@python.inline@ print 'Failed to get uninteresting hashes from %s:' % HASHES_URL@@@", + "@@@STEP_LOG_LINE@python.inline@ print e@@@", + "@@@STEP_LOG_LINE@python.inline@ if retry == RETRIES:@@@", + "@@@STEP_LOG_LINE@python.inline@ raise@@@", + "@@@STEP_LOG_LINE@python.inline@ waittime = WAIT_BASE * math.pow(2, retry)@@@", + "@@@STEP_LOG_LINE@python.inline@ print 'Retry in %d seconds.' % waittime@@@", + "@@@STEP_LOG_LINE@python.inline@ time.sleep(waittime)@@@", + "@@@STEP_LOG_END@python.inline@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "import os\nprint os.environ.get('SWARMING_BOT_ID', '')\n" + ], + "name": "get swarming bot id", + "stdout": "/path/to/tmp/", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@python.inline@import os@@@", + "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_BOT_ID', '')@@@", + "@@@STEP_LOG_END@python.inline@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "import os\nprint os.environ.get('SWARMING_TASK_ID', '')\n" + ], + "name": "get swarming task id", + "stdout": "/path/to/tmp/", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@python.inline@import os@@@", + "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_TASK_ID', '')@@@", + "@@@STEP_LOG_END@python.inline@@@" + ] + }, + { + "cmd": [ + "[SLAVE_BUILD]/out/Debug/dm", + "--undefok", + "--resourcePath", + "[SLAVE_BUILD]/skia/resources", + "--skps", + "[SLAVE_BUILD]/skp", + "--images", + "[SLAVE_BUILD]/skimage/dm", + "--colorImages", + "[SLAVE_BUILD]/skimage/colorspace", + "--nameByHash", + "--properties", + "gitHash", + "abc123", + "master", + "client.skia", + "builder", + "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug-Trybot", + "build_number", + "5", + "issue", + "2100", + "patchset", + "2", + "patch_storage", + "gerrit", + "no_buildbot", + "True", + "swarming_bot_id", + "skia-bot-123", + "swarming_task_id", + "123456", + "--svgs", + "[SLAVE_BUILD]/svg", + "--key", + "arch", + "x86", + "compiler", + "GCC", + "configuration", + "Debug", + "cpu_or_gpu", + "CPU", + "cpu_or_gpu_value", + "AVX2", + "model", + "GCE", + "os", + "Ubuntu", + "--writePath", + "[CUSTOM_[SWARM_OUT_DIR]]/dm", + "--nogpu", + "--threads", + "4", + "--config", + "8888", + "gpu", + "gpusrgb", + "pdf", + "msaa16", + "565", + "f16", + "srgb", + "sp-8888", + "2ndpic-8888", + "lite-8888", + "serialize-8888", + "tiles_rt-8888", + "pic-8888", + "--src", + "tests", + "gm", + "image", + "colorImage", + "svg", + "--blacklist", + "f16", + "_", + "_", + "dstreadshuffle", + "f16", + "image", + "_", + "_", + "srgb", + "image", + "_", + "_", + "gpusrgb", + "image", + "_", + "_", + "serialize-8888", + "gm", + "_", + "bleed_image", + "serialize-8888", + "gm", + "_", + "c_gms", + "serialize-8888", + "gm", + "_", + "colortype", + "serialize-8888", + "gm", + "_", + "colortype_xfermodes", + "serialize-8888", + "gm", + "_", + "drawfilter", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_0.75_0", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_1_-0.25", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds", + "serialize-8888", + "gm", + "_", + "fontmgr_match", + "serialize-8888", + "gm", + "_", + "fontmgr_iter", + "serialize-8888", + "gm", + "_", + "imagemasksubset", + "serialize-8888", + "gm", + "_", + "bitmapfilters", + "serialize-8888", + "gm", + "_", + "bitmapshaders", + "serialize-8888", + "gm", + "_", + "bleed", + "serialize-8888", + "gm", + "_", + "bleed_alpha_bmp", + "serialize-8888", + "gm", + "_", + "bleed_alpha_bmp_shader", + "serialize-8888", + "gm", + "_", + "convex_poly_clip", + "serialize-8888", + "gm", + "_", + "extractalpha", + "serialize-8888", + "gm", + "_", + "filterbitmap_checkerboard_32_32_g8", + "serialize-8888", + "gm", + "_", + "filterbitmap_image_mandrill_64", + "serialize-8888", + "gm", + "_", + "shadows", + "serialize-8888", + "gm", + "_", + "simpleaaclip_aaclip", + "serialize-8888", + "gm", + "_", + "composeshader_bitmap", + "serialize-8888", + "gm", + "_", + "scaled_tilemodes_npot", + "serialize-8888", + "gm", + "_", + "scaled_tilemodes", + "serialize-8888", + "gm", + "_", + "typefacerendering_pfaMac", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image_shader", + "sp-8888", + "gm", + "_", + "drawfilter", + "pic-8888", + "gm", + "_", + "drawfilter", + "2ndpic-8888", + "gm", + "_", + "drawfilter", + "lite-8888", + "gm", + "_", + "drawfilter", + "sp-8888", + "gm", + "_", + "image-cacherator-from-picture", + "pic-8888", + "gm", + "_", + "image-cacherator-from-picture", + "2ndpic-8888", + "gm", + "_", + "image-cacherator-from-picture", + "serialize-8888", + "gm", + "_", + "image-cacherator-from-picture", + "sp-8888", + "gm", + "_", + "image-cacherator-from-raster", + "pic-8888", + "gm", + "_", + "image-cacherator-from-raster", + "2ndpic-8888", + "gm", + "_", + "image-cacherator-from-raster", + "serialize-8888", + "gm", + "_", + "image-cacherator-from-raster", + "sp-8888", + "gm", + "_", + "image-cacherator-from-ctable", + "pic-8888", + "gm", + "_", + "image-cacherator-from-ctable", + "2ndpic-8888", + "gm", + "_", + "image-cacherator-from-ctable", + "serialize-8888", + "gm", + "_", + "image-cacherator-from-ctable", + "sp-8888", + "gm", + "_", + "gamut", + "pic-8888", + "gm", + "_", + "gamut", + "lite-8888", + "gm", + "_", + "gamut", + "2ndpic-8888", + "gm", + "_", + "gamut", + "serialize-8888", + "gm", + "_", + "gamut" + ], + "env": { + "BUILDTYPE": "Debug", + "CHROME_HEADLESS": "1", + "SKIA_OUT": "[SLAVE_BUILD]/out" + }, + "name": "dm" + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +] \ No newline at end of file diff --git a/infra/bots/recipes/swarm_test.py b/infra/bots/recipes/swarm_test.py index 19de982bda..d35373353c 100644 --- a/infra/bots/recipes/swarm_test.py +++ b/infra/bots/recipes/swarm_test.py @@ -475,6 +475,10 @@ def test_steps(api): 'patchset', api.vars.patchset, 'patch_storage', api.vars.patch_storage, ]) + if api.vars.no_buildbot: + properties.extend(['no_buildbot', 'True']) + properties.extend(['swarming_bot_id', api.vars.swarming_bot_id]) + properties.extend(['swarming_task_id', api.vars.swarming_task_id]) args = [ 'dm', @@ -688,3 +692,21 @@ def GenTests(api): revision='abc123', **gerrit_kwargs) ) + + yield ( + api.test('nobuildbot') + + api.properties( + buildername=builder, + mastername='client.skia', + slavename='skiabot-linux-swarm-000', + buildnumber=5, + path_config='kitchen', + swarm_out_dir='[SWARM_OUT_DIR]', + revision='abc123', + nobuildbot='True', + **gerrit_kwargs) + + api.step_data('get swarming bot id', + stdout=api.raw_io.output('skia-bot-123')) + + api.step_data('get swarming task id', stdout=api.raw_io.output('123456')) + ) + -- cgit v1.2.3