1 [ 2 { 3 "cmd": [ 4 "python", 5 "-u", 6 "\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", 7 "[START_DIR]/tmp", 8 "511" 9 ], 10 "infra_step": true, 11 "name": "makedirs tmp_dir", 12 "~followup_annotations": [ 13 "@@@STEP_LOG_LINE (a] python.inline@@@@", 14 "@@@STEP_LOG_LINE (a] python.inline@import sys, os@@@", 15 "@@@STEP_LOG_LINE (a] python.inline@path = sys.argv[1]@@@", 16 "@@@STEP_LOG_LINE (a] python.inline@mode = int(sys.argv[2])@@@", 17 "@@@STEP_LOG_LINE (a] python.inline@if not os.path.isdir(path):@@@", 18 "@@@STEP_LOG_LINE (a] python.inline@ if os.path.exists(path):@@@", 19 "@@@STEP_LOG_LINE (a] python.inline@ print \"%s exists but is not a dir\" % path@@@", 20 "@@@STEP_LOG_LINE (a] python.inline@ sys.exit(1)@@@", 21 "@@@STEP_LOG_LINE (a] python.inline@ os.makedirs(path, mode)@@@", 22 "@@@STEP_LOG_END (a] python.inline@@@" 23 ] 24 }, 25 { 26 "cmd": [ 27 "adb", 28 "reboot" 29 ], 30 "cwd": "[START_DIR]/skia", 31 "env": { 32 "BUILDTYPE": "Release", 33 "CHROME_HEADLESS": "1", 34 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 35 "SKIA_OUT": "[START_DIR]/out" 36 }, 37 "infra_step": true, 38 "name": "rebooting device" 39 }, 40 { 41 "cmd": [ 42 "python", 43 "-u", 44 "\nimport subprocess\nimport sys\nimport time\n\nkicks = 0\nwhile True:\n\n times = 0\n while times < 30:\n print 'Waiting for the device to be connected and ready.'\n try:\n times += 1\n output = subprocess.check_output(['adb', 'shell',\n 'getprop', 'sys.boot_completed'])\n if '1' in output:\n print 'Connected'\n sys.exit(0)\n except subprocess.CalledProcessError:\n # no device connected/authorized yet\n pass\n time.sleep(5)\n if kicks >= 3:\n break\n print 'Giving the device a \"kick\" by trying to reboot it.'\n kicks += 1\n print subprocess.check_output(['adb', 'reboot'])\n\nprint 'Timed out waiting for device'\nsys.exit(1)\n" 45 ], 46 "env": { 47 "BUILDTYPE": "Release", 48 "CHROME_HEADLESS": "1", 49 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 50 "SKIA_OUT": "[START_DIR]/out" 51 }, 52 "infra_step": true, 53 "name": "wait for device", 54 "~followup_annotations": [ 55 "@@@STEP_LOG_LINE (a] python.inline@@@@", 56 "@@@STEP_LOG_LINE (a] python.inline@import subprocess@@@", 57 "@@@STEP_LOG_LINE (a] python.inline@import sys@@@", 58 "@@@STEP_LOG_LINE (a] python.inline@import time@@@", 59 "@@@STEP_LOG_LINE (a] python.inline@@@@", 60 "@@@STEP_LOG_LINE (a] python.inline@kicks = 0@@@", 61 "@@@STEP_LOG_LINE (a] python.inline@while True:@@@", 62 "@@@STEP_LOG_LINE (a] python.inline@@@@", 63 "@@@STEP_LOG_LINE (a] python.inline@ times = 0@@@", 64 "@@@STEP_LOG_LINE (a] python.inline@ while times < 30:@@@", 65 "@@@STEP_LOG_LINE (a] python.inline@ print 'Waiting for the device to be connected and ready.'@@@", 66 "@@@STEP_LOG_LINE (a] python.inline@ try:@@@", 67 "@@@STEP_LOG_LINE (a] python.inline@ times += 1@@@", 68 "@@@STEP_LOG_LINE (a] python.inline@ output = subprocess.check_output(['adb', 'shell',@@@", 69 "@@@STEP_LOG_LINE (a] python.inline@ 'getprop', 'sys.boot_completed'])@@@", 70 "@@@STEP_LOG_LINE (a] python.inline@ if '1' in output:@@@", 71 "@@@STEP_LOG_LINE (a] python.inline@ print 'Connected'@@@", 72 "@@@STEP_LOG_LINE (a] python.inline@ sys.exit(0)@@@", 73 "@@@STEP_LOG_LINE (a] python.inline@ except subprocess.CalledProcessError:@@@", 74 "@@@STEP_LOG_LINE (a] python.inline@ # no device connected/authorized yet@@@", 75 "@@@STEP_LOG_LINE (a] python.inline@ pass@@@", 76 "@@@STEP_LOG_LINE (a] python.inline@ time.sleep(5)@@@", 77 "@@@STEP_LOG_LINE (a] python.inline@ if kicks >= 3:@@@", 78 "@@@STEP_LOG_LINE (a] python.inline@ break@@@", 79 "@@@STEP_LOG_LINE (a] python.inline@ print 'Giving the device a \"kick\" by trying to reboot it.'@@@", 80 "@@@STEP_LOG_LINE (a] python.inline@ kicks += 1@@@", 81 "@@@STEP_LOG_LINE (a] python.inline@ print subprocess.check_output(['adb', 'reboot'])@@@", 82 "@@@STEP_LOG_LINE (a] python.inline@@@@", 83 "@@@STEP_LOG_LINE (a] python.inline@print 'Timed out waiting for device'@@@", 84 "@@@STEP_LOG_LINE (a] python.inline@sys.exit(1)@@@", 85 "@@@STEP_LOG_END (a] python.inline@@@" 86 ] 87 }, 88 { 89 "cmd": [ 90 "adb", 91 "shell", 92 "mkdir", 93 "-p", 94 "/sdcard/revenge_of_the_skiabot/resources" 95 ], 96 "cwd": "[START_DIR]/skia", 97 "env": { 98 "BUILDTYPE": "Release", 99 "CHROME_HEADLESS": "1", 100 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 101 "SKIA_OUT": "[START_DIR]/out" 102 }, 103 "infra_step": true, 104 "name": "mkdir /sdcard/revenge_of_the_skiabot/resources" 105 }, 106 { 107 "cmd": [ 108 "python", 109 "-u", 110 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", 111 "[START_DIR]/skia/infra/bots/assets/skp/VERSION", 112 "/path/to/tmp/" 113 ], 114 "infra_step": true, 115 "name": "Get downloaded SKP VERSION" 116 }, 117 { 118 "cmd": [ 119 "python", 120 "-u", 121 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", 122 "42", 123 "[START_DIR]/tmp/SKP_VERSION" 124 ], 125 "infra_step": true, 126 "name": "write SKP_VERSION" 127 }, 128 { 129 "cmd": [ 130 "adb", 131 "shell", 132 "cat", 133 "/sdcard/revenge_of_the_skiabot/SKP_VERSION" 134 ], 135 "cwd": "[START_DIR]/skia", 136 "env": { 137 "BUILDTYPE": "Release", 138 "CHROME_HEADLESS": "1", 139 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 140 "SKIA_OUT": "[START_DIR]/out" 141 }, 142 "infra_step": true, 143 "name": "read /sdcard/revenge_of_the_skiabot/SKP_VERSION", 144 "stdout": "/path/to/tmp/" 145 }, 146 { 147 "cmd": [ 148 "adb", 149 "shell", 150 "rm", 151 "-f", 152 "/sdcard/revenge_of_the_skiabot/SKP_VERSION" 153 ], 154 "cwd": "[START_DIR]/skia", 155 "env": { 156 "BUILDTYPE": "Release", 157 "CHROME_HEADLESS": "1", 158 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 159 "SKIA_OUT": "[START_DIR]/out" 160 }, 161 "infra_step": true, 162 "name": "rm /sdcard/revenge_of_the_skiabot/SKP_VERSION" 163 }, 164 { 165 "cmd": [ 166 "adb", 167 "shell", 168 "rm", 169 "-rf", 170 "/sdcard/revenge_of_the_skiabot/skps" 171 ], 172 "cwd": "[START_DIR]/skia", 173 "env": { 174 "BUILDTYPE": "Release", 175 "CHROME_HEADLESS": "1", 176 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 177 "SKIA_OUT": "[START_DIR]/out" 178 }, 179 "infra_step": true, 180 "name": "rm /sdcard/revenge_of_the_skiabot/skps" 181 }, 182 { 183 "cmd": [ 184 "adb", 185 "shell", 186 "mkdir", 187 "-p", 188 "/sdcard/revenge_of_the_skiabot/skps" 189 ], 190 "cwd": "[START_DIR]/skia", 191 "env": { 192 "BUILDTYPE": "Release", 193 "CHROME_HEADLESS": "1", 194 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 195 "SKIA_OUT": "[START_DIR]/out" 196 }, 197 "infra_step": true, 198 "name": "mkdir /sdcard/revenge_of_the_skiabot/skps" 199 }, 200 { 201 "cmd": [ 202 "python", 203 "-u", 204 "\nimport os\nimport subprocess\nimport sys\nhost = sys.argv[1]\ndevice = sys.argv[2]\nfor d, _, fs in os.walk(host):\n p = os.path.relpath(d, host)\n if p != '.' and p.startswith('.'):\n continue\n for f in fs:\n print os.path.join(p,f)\n subprocess.check_call(['adb', 'push',\n os.path.realpath(os.path.join(host, p, f)),\n os.path.join(device, p, f)])\n", 205 "[START_DIR]/skp", 206 "/sdcard/revenge_of_the_skiabot/skps" 207 ], 208 "env": { 209 "BUILDTYPE": "Release", 210 "CHROME_HEADLESS": "1", 211 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 212 "SKIA_OUT": "[START_DIR]/out" 213 }, 214 "infra_step": true, 215 "name": "push [START_DIR]/skp/* /sdcard/revenge_of_the_skiabot/skps", 216 "~followup_annotations": [ 217 "@@@STEP_LOG_LINE (a] python.inline@@@@", 218 "@@@STEP_LOG_LINE (a] python.inline@import os@@@", 219 "@@@STEP_LOG_LINE (a] python.inline@import subprocess@@@", 220 "@@@STEP_LOG_LINE (a] python.inline@import sys@@@", 221 "@@@STEP_LOG_LINE (a] python.inline@host = sys.argv[1]@@@", 222 "@@@STEP_LOG_LINE (a] python.inline@device = sys.argv[2]@@@", 223 "@@@STEP_LOG_LINE (a] python.inline@for d, _, fs in os.walk(host):@@@", 224 "@@@STEP_LOG_LINE (a] python.inline@ p = os.path.relpath(d, host)@@@", 225 "@@@STEP_LOG_LINE (a] python.inline@ if p != '.' and p.startswith('.'):@@@", 226 "@@@STEP_LOG_LINE (a] python.inline@ continue@@@", 227 "@@@STEP_LOG_LINE (a] python.inline@ for f in fs:@@@", 228 "@@@STEP_LOG_LINE (a] python.inline@ print os.path.join(p,f)@@@", 229 "@@@STEP_LOG_LINE (a] python.inline@ subprocess.check_call(['adb', 'push',@@@", 230 "@@@STEP_LOG_LINE (a] python.inline@ os.path.realpath(os.path.join(host, p, f)),@@@", 231 "@@@STEP_LOG_LINE (a] python.inline@ os.path.join(device, p, f)])@@@", 232 "@@@STEP_LOG_END (a] python.inline@@@" 233 ] 234 }, 235 { 236 "cmd": [ 237 "adb", 238 "push", 239 "[START_DIR]/tmp/SKP_VERSION", 240 "/sdcard/revenge_of_the_skiabot/SKP_VERSION" 241 ], 242 "cwd": "[START_DIR]/skia", 243 "env": { 244 "BUILDTYPE": "Release", 245 "CHROME_HEADLESS": "1", 246 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 247 "SKIA_OUT": "[START_DIR]/out" 248 }, 249 "infra_step": true, 250 "name": "push [START_DIR]/tmp/SKP_VERSION /sdcard/revenge_of_the_skiabot/SKP_VERSION" 251 }, 252 { 253 "cmd": [ 254 "adb", 255 "push", 256 "[START_DIR]/out/Release/skpbench", 257 "/data/local/tmp/" 258 ], 259 "cwd": "[START_DIR]/skia", 260 "env": { 261 "BUILDTYPE": "Release", 262 "CHROME_HEADLESS": "1", 263 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 264 "SKIA_OUT": "[START_DIR]/out" 265 }, 266 "infra_step": true, 267 "name": "push skpbench" 268 }, 269 { 270 "cmd": [ 271 "python", 272 "-u", 273 "[START_DIR]/skia/tools/skpbench/skpbench.py", 274 "/data/local/tmp/skpbench", 275 "/sdcard/revenge_of_the_skiabot/skps", 276 "--adb", 277 "--resultsfile", 278 "[CUSTOM_[SWARM_OUT_DIR]]/table", 279 "--config", 280 "gles,glesinst4" 281 ], 282 "env": { 283 "BUILDTYPE": "Release", 284 "CHROME_HEADLESS": "1", 285 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 286 "SKIA_OUT": "[START_DIR]/out" 287 }, 288 "name": "skpbench" 289 }, 290 { 291 "cmd": [ 292 "python", 293 "-u", 294 "import os\nprint os.environ.get('SWARMING_BOT_ID', '')\n" 295 ], 296 "name": "get swarming bot id", 297 "stdout": "/path/to/tmp/", 298 "~followup_annotations": [ 299 "@@@STEP_LOG_LINE (a] python.inline@import os@@@", 300 "@@@STEP_LOG_LINE (a] python.inline@print os.environ.get('SWARMING_BOT_ID', '')@@@", 301 "@@@STEP_LOG_END (a] python.inline@@@" 302 ] 303 }, 304 { 305 "cmd": [ 306 "python", 307 "-u", 308 "import os\nprint os.environ.get('SWARMING_TASK_ID', '')\n" 309 ], 310 "name": "get swarming task id", 311 "stdout": "/path/to/tmp/", 312 "~followup_annotations": [ 313 "@@@STEP_LOG_LINE (a] python.inline@import os@@@", 314 "@@@STEP_LOG_LINE (a] python.inline@print os.environ.get('SWARMING_TASK_ID', '')@@@", 315 "@@@STEP_LOG_END (a] python.inline@@@" 316 ] 317 }, 318 { 319 "cmd": [ 320 "python", 321 "-u", 322 "\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", 323 "[CUSTOM_[SWARM_OUT_DIR]]/perfdata/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-GN_Android_Skpbench/data", 324 "511" 325 ], 326 "name": "makedirs perf_dir", 327 "~followup_annotations": [ 328 "@@@STEP_LOG_LINE (a] python.inline@@@@", 329 "@@@STEP_LOG_LINE (a] python.inline@import sys, os@@@", 330 "@@@STEP_LOG_LINE (a] python.inline@path = sys.argv[1]@@@", 331 "@@@STEP_LOG_LINE (a] python.inline@mode = int(sys.argv[2])@@@", 332 "@@@STEP_LOG_LINE (a] python.inline@if not os.path.isdir(path):@@@", 333 "@@@STEP_LOG_LINE (a] python.inline@ if os.path.exists(path):@@@", 334 "@@@STEP_LOG_LINE (a] python.inline@ print \"%s exists but is not a dir\" % path@@@", 335 "@@@STEP_LOG_LINE (a] python.inline@ sys.exit(1)@@@", 336 "@@@STEP_LOG_LINE (a] python.inline@ os.makedirs(path, mode)@@@", 337 "@@@STEP_LOG_END (a] python.inline@@@" 338 ] 339 }, 340 { 341 "cmd": [ 342 "python", 343 "-u", 344 "[START_DIR]/skia/tools/skpbench/skiaperf.py", 345 "[CUSTOM_[SWARM_OUT_DIR]]/table", 346 "--properties", 347 "gitHash", 348 "abc123", 349 "build_number", 350 "5", 351 "no_buildbot", 352 "True", 353 "swarming_bot_id", 354 "skia-bot-123", 355 "swarming_task_id", 356 "123456", 357 "--outfile", 358 "[CUSTOM_[SWARM_OUT_DIR]]/perfdata/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-GN_Android_Skpbench/data/skpbench_abc123_1337000001.json", 359 "--key", 360 "arch", 361 "arm64", 362 "compiler", 363 "Clang", 364 "cpu_or_gpu", 365 "GPU", 366 "cpu_or_gpu_value", 367 "TegraX1", 368 "extra_config", 369 "GN_Android_Skpbench", 370 "model", 371 "PixelC", 372 "os", 373 "Android" 374 ], 375 "env": { 376 "BUILDTYPE": "Release", 377 "CHROME_HEADLESS": "1", 378 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 379 "SKIA_OUT": "[START_DIR]/out" 380 }, 381 "name": "Parse skpbench output into Perf json" 382 }, 383 { 384 "cmd": [ 385 "python", 386 "-u", 387 "\nimport os\nimport subprocess\nimport sys\nout = sys.argv[1]\nlog = subprocess.check_output(['adb', 'logcat', '-d'])\nfor line in log.split('\\n'):\n tokens = line.split()\n if len(tokens) == 11 and tokens[-7] == 'F' and tokens[-3] == 'pc':\n addr, path = tokens[-2:]\n local = os.path.join(out, os.path.basename(path))\n if os.path.exists(local):\n sym = subprocess.check_output(['addr2line', '-Cfpe', local, addr])\n line = line.replace(addr, addr + ' ' + sym.strip())\n print line\n", 388 "[START_DIR]/out/Release" 389 ], 390 "env": { 391 "BUILDTYPE": "Release", 392 "CHROME_HEADLESS": "1", 393 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 394 "SKIA_OUT": "[START_DIR]/out" 395 }, 396 "infra_step": true, 397 "name": "dump log", 398 "~followup_annotations": [ 399 "@@@STEP_LOG_LINE (a] python.inline@@@@", 400 "@@@STEP_LOG_LINE (a] python.inline@import os@@@", 401 "@@@STEP_LOG_LINE (a] python.inline@import subprocess@@@", 402 "@@@STEP_LOG_LINE (a] python.inline@import sys@@@", 403 "@@@STEP_LOG_LINE (a] python.inline@out = sys.argv[1]@@@", 404 "@@@STEP_LOG_LINE (a] python.inline@log = subprocess.check_output(['adb', 'logcat', '-d'])@@@", 405 "@@@STEP_LOG_LINE (a] python.inline@for line in log.split('\\n'):@@@", 406 "@@@STEP_LOG_LINE (a] python.inline@ tokens = line.split()@@@", 407 "@@@STEP_LOG_LINE (a] python.inline@ if len(tokens) == 11 and tokens[-7] == 'F' and tokens[-3] == 'pc':@@@", 408 "@@@STEP_LOG_LINE (a] python.inline@ addr, path = tokens[-2:]@@@", 409 "@@@STEP_LOG_LINE (a] python.inline@ local = os.path.join(out, os.path.basename(path))@@@", 410 "@@@STEP_LOG_LINE (a] python.inline@ if os.path.exists(local):@@@", 411 "@@@STEP_LOG_LINE (a] python.inline@ sym = subprocess.check_output(['addr2line', '-Cfpe', local, addr])@@@", 412 "@@@STEP_LOG_LINE (a] python.inline@ line = line.replace(addr, addr + ' ' + sym.strip())@@@", 413 "@@@STEP_LOG_LINE (a] python.inline@ print line@@@", 414 "@@@STEP_LOG_END (a] python.inline@@@" 415 ] 416 }, 417 { 418 "cmd": [ 419 "adb", 420 "kill-server" 421 ], 422 "cwd": "[START_DIR]/skia", 423 "env": { 424 "BUILDTYPE": "Release", 425 "CHROME_HEADLESS": "1", 426 "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", 427 "SKIA_OUT": "[START_DIR]/out" 428 }, 429 "infra_step": true, 430 "name": "kill adb server" 431 }, 432 { 433 "name": "$result", 434 "recipe_result": null, 435 "status_code": 0 436 } 437 ]