2016-07-26 18:52:17 +00:00
|
|
|
#!/usr/bin/env python
|
2016-11-14 17:18:34 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
# Copyright 2017 The LUCI Authors. All rights reserved.
|
2016-07-26 18:52:17 +00:00
|
|
|
# Use of this source code is governed under the Apache License, Version 2.0
|
|
|
|
# that can be found in the LICENSE file.
|
2016-11-14 17:18:34 +00:00
|
|
|
|
2016-07-26 18:52:17 +00:00
|
|
|
"""Bootstrap script to clone and forward to the recipe engine tool.
|
2016-11-14 17:18:34 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
*******************
|
|
|
|
** DO NOT MODIFY **
|
|
|
|
*******************
|
2016-11-14 17:18:34 +00:00
|
|
|
|
2018-12-08 01:42:12 +00:00
|
|
|
This is a copy of https://chromium.googlesource.com/infra/luci/recipes-py/+/master/recipes.py.
|
2017-09-27 17:03:35 +00:00
|
|
|
To fix bugs, fix in the googlesource repo then run the autoroller.
|
2016-07-26 18:52:17 +00:00
|
|
|
"""
|
2016-11-14 17:18:34 +00:00
|
|
|
|
2017-03-15 08:24:56 +00:00
|
|
|
import argparse
|
2017-03-16 01:04:05 +00:00
|
|
|
import json
|
2016-07-26 18:52:17 +00:00
|
|
|
import logging
|
2017-05-11 11:27:01 +00:00
|
|
|
import os
|
2016-07-26 18:52:17 +00:00
|
|
|
import random
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
import time
|
2017-03-25 00:45:40 +00:00
|
|
|
import urlparse
|
2016-11-14 17:18:34 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
from collections import namedtuple
|
|
|
|
|
2017-03-16 01:04:05 +00:00
|
|
|
from cStringIO import StringIO
|
2016-11-14 17:18:34 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
# The dependency entry for the recipe_engine in the client repo's recipes.cfg
|
|
|
|
#
|
|
|
|
# url (str) - the url to the engine repo we want to use.
|
|
|
|
# revision (str) - the git revision for the engine to get.
|
|
|
|
# branch (str) - the branch to fetch for the engine as an absolute ref (e.g.
|
|
|
|
# refs/heads/master)
|
|
|
|
EngineDep = namedtuple('EngineDep',
|
2019-01-16 23:11:31 +00:00
|
|
|
'url revision branch')
|
2017-05-09 18:06:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
class MalformedRecipesCfg(Exception):
|
|
|
|
def __init__(self, msg, path):
|
|
|
|
super(MalformedRecipesCfg, self).__init__('malformed recipes.cfg: %s: %r'
|
|
|
|
% (msg, path))
|
|
|
|
|
2017-03-16 01:04:05 +00:00
|
|
|
|
|
|
|
def parse(repo_root, recipes_cfg_path):
|
2017-05-09 18:06:48 +00:00
|
|
|
"""Parse is a lightweight a recipes.cfg file parser.
|
2017-03-16 01:04:05 +00:00
|
|
|
|
|
|
|
Args:
|
|
|
|
repo_root (str) - native path to the root of the repo we're trying to run
|
|
|
|
recipes for.
|
|
|
|
recipes_cfg_path (str) - native path to the recipes.cfg file to process.
|
|
|
|
|
|
|
|
Returns (as tuple):
|
2017-09-27 17:03:35 +00:00
|
|
|
engine_dep (EngineDep|None): The recipe_engine dependency, or None, if the
|
|
|
|
current repo IS the recipe_engine.
|
2017-03-16 01:04:05 +00:00
|
|
|
recipes_path (str) - native path to where the recipes live inside of the
|
|
|
|
current repo (i.e. the folder containing `recipes/` and/or
|
|
|
|
`recipe_modules`)
|
|
|
|
"""
|
|
|
|
with open(recipes_cfg_path, 'rU') as fh:
|
2017-03-28 03:52:15 +00:00
|
|
|
pb = json.load(fh)
|
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
try:
|
|
|
|
if pb['api_version'] != 2:
|
|
|
|
raise MalformedRecipesCfg('unknown version %d' % pb['api_version'],
|
|
|
|
recipes_cfg_path)
|
|
|
|
|
2018-12-08 01:42:12 +00:00
|
|
|
# If we're running ./recipes.py from the recipe_engine repo itself, then
|
2017-09-27 17:03:35 +00:00
|
|
|
# return None to signal that there's no EngineDep.
|
2019-02-16 22:10:41 +00:00
|
|
|
repo_name = pb.get('repo_name')
|
|
|
|
if not repo_name:
|
|
|
|
repo_name = pb['project_id']
|
|
|
|
if repo_name == 'recipe_engine':
|
2017-09-27 17:03:35 +00:00
|
|
|
return None, pb.get('recipes_path', '')
|
|
|
|
|
Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).
More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug.
build:
https://crrev.com/2bd2b6306f3deaf01fed284038fab4ce05e68765 Remove deprecated script compile.py (tikuta@google.com)
https://crrev.com/2220ac8ab35a3f7123d11143137124a89717198b Revert "Remove deprecated script compile.py" (mmoss@chromium.org)
https://crrev.com/928c6d59f3408ad0bc823ee1549368af03b22517 V8: Make arm chromebooks tree-closers (machenbach@chromium.org)
https://crrev.com/4daef50df40266df7d2dd58cea5b0c97b5ff9f63 Add ignore_swarming_task_failure attribute for isolated_script (nednguyen@google.com)
https://crrev.com/b780e3c6a5b6c3fbb865eb9e2dd86f12c1ab2f8c WebRTC: Add Linux ARM 64-bit Debug+Release builders + FYI bot. (kjellander@chromium.org)
https://crrev.com/83ae262fa30b20b00f65fe9bc7bd50428e6e032d On dartk/dartkp builders test all suites and not just co19 language kernel service. (vegorov@google.com)
https://crrev.com/0b81a2102a55086f3dafaccf5b79637c49b3700d On dart kernel builders set --builder-tag=no_ipv6. (vegorov@google.com)
https://crrev.com/31f9c83d3ed4fed0c3f215e94c00751d026d95bc [Findit] Bail out with no culprit found if compile passed on the last revision in range. (chanli@chromium.org)
https://crrev.com/6d14c7141290ce60514b07a14e53dd2030df44b7 [recipes.cfg] upgrade to api_version 2 (iannucci@chromium.org)
https://crrev.com/b0d19086a88ac1baba0c4d9906577e517300e5d8 Revert "[recipes.cfg] upgrade to api_version 2" (iannucci@chromium.org)
https://crrev.com/6bfba7afcf2ac793044c44527932e825c21e508a remote_run: Enable per-builder canary whitelisting (dnj@chromium.org)
https://crrev.com/af1aa0585197c0a944ce77c14f7c137f97ac504c [remote_run] bump recipes-py canary version (iannucci@chromium.org)
https://crrev.com/c3d07fd63d6378dda05d1d477e812c0aa356d325 [remote_run] bump recipes-py prod version (iannucci@chromium.org)
https://crrev.com/2798cf183e8ffb6e2903d80a71ad7d1de429a5ba [recipes.cfg] upgrade to api_version 2 (iannucci@chromium.org)
https://crrev.com/c410e27324f9ab26956b3cc8cf205a7ee8e6bc72 Install goma for more bots. (hidehiko@chromium.org)
https://crrev.com/002ddd5fabf636bdfde86ad4ebbcf26e846ca9ae [Findit] remove result report from build property so it will not be included in buildbucket response. (chanli@chromium.org)
https://crrev.com/a2ad74e50d2662f1c14e3b31ffbceed1306eb819 Add webkit_layout_tests to closing_optional list for WebKit Linux - TraceWrappables. (mcgreevy@chromium.org)
https://crrev.com/f776e58c170ce6ceeb48434f69e3c8ed027b820d call _archive_retry_summary for both webkit_layout_tests and webkit_tests. (mcgreevy@chromium.org)
https://crrev.com/f0cef60e4d34194c6a8aab855f9fb74ada412146 Revert "WebRTC: Remove low_bandwidth_audio_test on Mac and Windows." (oprypin@chromium.org)
https://crrev.com/eed61f7e2c89b7f40b723ccca13a815e40e78278 Upload test results presentation html file to google storage. (hzl@google.com)
https://crrev.com/ce0ba39742e46a234d960b7317eba7935ebc617d Revert "Upload test results presentation html file to google storage." (hzl@google.com)
https://crrev.com/356064ec92fddc7d7098067dd0d711a62d5f10f5 Revert "Retry tests without the patch on iOS try bot failures" (stgao@chromium.org)
https://crrev.com/4e41fb0cdd4bda4b5a6dd9167dde76f0f63ceb0f Make sure that step presentation is not set to FAILURE if exit_code is zero (nednguyen@google.com)
https://crrev.com/f7f8a5d24ed0d4dca19305bde7e372a149b992e9 Add mac and win battor agents (martiniss@google.com)
https://crrev.com/68c21b4d24c70d6e77727c3f7044148908fab4de Add files in gen/layout_test_data to the package. (yzshen@chromium.org)
https://crrev.com/23a7ecf5af6fd0039b2a25d9552cd706ef8c17c2 Add low_bandwidth_audio_test on Android (oprypin@chromium.org)
https://crrev.com/de288b21edf2614d47df375730777814826a93d6 Revert "Add low_bandwidth_audio_test on Android" (oprypin@chromium.org)
https://crrev.com/917efd4d8e43deb9c4c4b36c82fbc60fd578504e V8: Add node.js baseline bot (machenbach@chromium.org)
https://crrev.com/328305ad806f3bc88fe190f754463ee007d0c040 Implement a generic postprocess/merge hook for swarming tasks. (jbudorick@chromium.org)
https://crrev.com/236fd0e4571b168b58446704d8c223dd476431ed Revert "Implement a generic postprocess/merge hook for swarming tasks." (jbudorick@chromium.org)
https://crrev.com/ff11ffc8f04c2a51de1f5a1a866d29422a23eb1f Convert L low-end tester on chromium.android.fyi to swarming. (bpastene@google.com)
https://crrev.com/0987eb972f4aee77971c6fe8cad085789068c6e1 flutter: remove the dart_vm_entry_points_android.txt that was used by the dart:jni package (jsimmons@chromium.org)
https://crrev.com/69844a761f7440e967a8eeb9263a9c578d1ce81a (Reland) Upload test results presentation html file to google storage. (hzl@google.com)
https://crrev.com/d9d686021d37a70c7b48ac3ff44469f468307585 Show link to uploaded build log in upload_log step (tikuta@google.com)
https://crrev.com/368d2266581f6acdb7ad072786b17f171435bdaa Remove TraceWrappable bot (machenbach@chromium.org)
https://crrev.com/d458bc907d75625014522fbdd1005526485a1962 Migrate V8 api stability bot to v8 waterfall (machenbach@chromium.org)
https://crrev.com/4f521927f89597a9f136b0f8fd480a38d018dbde V8: Workaround for broken node.js build targets (machenbach@chromium.org)
https://crrev.com/bb9287f02c2b7377bb951a2d4b20e53f1f3394f2 Run JUnit test with wrapper scripts on bots. (mikecase@google.com)
https://crrev.com/d25f8637847fe747d459b504af5390222be56eaf Add builder to client.dart, add recipe support for checked-mode kernel builders (kustermann@google.com)
https://crrev.com/b31fffcd8035b6bf40f337ab77eecbb37ef19653 remote_run: Enable Kitchen for site isolation FYI (dnj@chromium.org)
https://crrev.com/602e92e8af3dee11015d2a03e1e8f36535b4e3e0 Run engine unit tests on Mac & Linux host_debug_unopt builds. (chinmaygarde@google.com)
https://crrev.com/90e4dcc2d924e960c3490e8255d6ca212da6ccda Tweak recipe_modules pylint blacklisting and run pylint on upload. (jbudorick@chromium.org)
https://crrev.com/51053a460a8a9b71c58e93c12cb89c3881361970 Avoid running time sensitive tests in FML and don't run channels tests on Linux. (chinmaygarde@google.com)
https://crrev.com/fc42f7d9f8368b8bc1d7dbb401d92c21c3205875 Fix the step link of result details. (hzl@google.com)
https://crrev.com/58842dc44d709faaeafa9b8377564788004b7368 Nest step triggers (martiniss@google.com)
https://crrev.com/a1adf9ee4394d73d0df7ba22b82b48351d09f41c Fix error in application on gtest_filter to fml_unittests. (chinmaygarde@google.com)
https://crrev.com/5c1b3b360e2e08837206eeac43da637cc0add200 Run FTL tests on Windows (goderbauer@google.com)
https://crrev.com/aff184bd83e19f34fafaa117b0f002eda1f7e972 Stop using and remove layout_test_wrapper.py. (qyearsley@google.com)
https://crrev.com/dbe97aafbb818ec2f067764caa8504b8fd4c1701 Use "kitchen" path config for legacy remote run. (dnj@chromium.org)
https://crrev.com/4098ffe08f199701d7a68c049ee77cb6b6ec2029 add .exe to test executables on Windows (goderbauer@google.com)
https://crrev.com/3469ad46426a9ddb7fa4f512add85ac3181e6565 Fix paths on Windows (goderbauer@google.com)
https://crrev.com/88460d6e88cf9187de8c336d9266b34b2bc7620e Revert "Stop using and remove layout_test_wrapper.py." (qyearsley@chromium.org)
https://crrev.com/ceea9270c70c12bc28faec3555937396498f22f6 Shorter timeout for Crashpad runs (scottmg@chromium.org)
https://crrev.com/885923720ca78b46817bacec215b7a0e5788253b WebRTC: Disable Linux 32-bit builds to unblock rolling. (kjellander@chromium.org)
https://crrev.com/f904c7617691ce14667a6fe5b14e663f485cc1dd Upload gomacc.*.INFO. (yyanagisawa@chromium.org)
https://crrev.com/bcecde5341a48f99d6fb5708e509735468b005b0 [pgo] Replace indexeddb_perf with storage.indexeddb_endure_tracing (perezju@chromium.org)
https://crrev.com/893412c4cd1b601cdc46a8fcac3766eb3bf546df WebRTC: Disable Linux ARM64 Debug bot to unblock rolling (kjellander@chromium.org)
https://crrev.com/b9753ba671f9adfd0c443eab24aea7a04639215c chromium_trybot: delete dont_analyze_for_non_src_project test (phajdan.jr@chromium.org)
https://crrev.com/dc34fd3833b56a98a4d5b1c6d671ed2ca80983f5 V8: Bump swarming timeout and shards on mips bot (machenbach@chromium.org)
https://crrev.com/4c955cb26a06b70be028078437fccd3000baa951 V8: Remove obsolete baseline testing from node integration bot (machenbach@chromium.org)
https://crrev.com/9295df947dea2702b69f5af9b01d989e89b145bd chromium_tests: Fix _name usage on IncrementalCoverageTest. (tansell@chromium.org)
https://crrev.com/214b9a130ddc0944ad9c509f827c9f3db70f7db3 Enable coredumps on vm-kernel-linux (non-precomp) (kustermann@google.com)
https://crrev.com/7e4ff9802920593f2bf53958f2a1a9958c8c6809 Enable LogDog for syzygy waterfalls. (dnj@chromium.org)
https://crrev.com/af7fe00e5c33f32cd517f29d91aa57575a8cdda4 remote_run: Bump Kitchen, cleanup logic. (dnj@chromium.org)
https://crrev.com/28c6eb798fca201acc3fac954c3d3433471a774c Remove vestigial android/perf bot configs. (jbudorick@chromium.org)
https://crrev.com/11d9ab91893e707116b8cdb090c31bfb7587897b Use cache directory for build checkout. (dnj@chromium.org)
https://crrev.com/dff1924a3645f45f012689c9adc74cbd82671c16 Switch android/perf recipe to devil provisioning. (jbudorick@chromium.org)
https://crrev.com/487fe058d719483abbee70d84ea5f65639e663e4 Switch bisection/android_bisect{,_staging} to devil provisioning. (jbudorick@chromium.org)
https://crrev.com/0c8cdf963550631f93f79eac2b597c96fc9d4214 flutter: update APK upload for new Gradle output path (jsimmons@chromium.org)
https://crrev.com/918574b36f597bd188ccc9f811d537c7f6f7e6fe chromite: Change cbuildbot/api to to cbuildbot_launch. (dgarrett@google.com)
https://crrev.com/fedcb6d0c2f4d0c95e510276e958b33bb4d3ae93 Switch mojo to devil provisioning. (jbudorick@chromium.org)
https://crrev.com/cbf7e4f450d1b80e563ecbcd137f992902b29035 Remove Windows and Linux GeForce GT 730 bots. (kbr@chromium.org)
https://crrev.com/a18f32f7cdd9ef73511f2e5c48164e7059936d63 Fix android_n5x_swarming_dbg trybot settings (jinsukkim@chromium.org)
https://crrev.com/eba6687000a5cab7d67476f987c5f3dcdd0def9a Revert "chromite: Change cbuildbot/api to to cbuildbot_launch." (dgarrett@chromium.org)
https://crrev.com/023f1efa527e0b4a28c4966c9efcba4fa4a5aeb4 chromium: Enable using analyze for layout tests. (tansell@chromium.org)
https://crrev.com/6543b59812744e6895e9a4c9eafdc75d9d39699e chromium_trybot: Fix martiniss OWNER email. (tansell@chromium.org)
https://crrev.com/36e8830b7720e0498a7ef95953e7596b59ee7e16 Fixing step name for WebKit Layout Tests. (tansell@chromium.org)
https://crrev.com/a8823304f7de8e54bff4afaa666650647b9ca11f Add a new win/mac goma canary builder for LocalOutputCache (shinyak@google.com)
https://crrev.com/30d05e794441b26450f739b355be33684964efce V8: Add node-integration trybot (machenbach@chromium.org)
https://crrev.com/5ae208c67eb85c76fe8b310fe1e1506f5c0761e0 Revert "chromium: Enable using analyze for layout tests." (tansell@chromium.org)
https://crrev.com/c3b30e4e13da2b50708be4c448bf109217372d85 V8: Apply patches on node integration trybot (machenbach@chromium.org)
https://crrev.com/ed723a35b8433678aeb0dc6d618714c4201be9dd [android] Fix WebView N arch configuration. (jbudorick@chromium.org)
https://crrev.com/83683ed7f818b0029d787c1da3132416e72a86c0 chromium_tests: Allow upload_results handler to understand suffix. (tansell@chromium.org)
https://crrev.com/ffb51f8389f8287c6518ce216452d4f9c7762172 Switch cronet to devil provisioning. (jbudorick@chromium.org)
https://crrev.com/884fd0b5a23ff68aef05c8442de85d8275af9728 chromium_tests: Make swarmed isolated tests fail with large error codes. (tansell@chromium.org)
https://crrev.com/9a1d214f237c09543a7af59b034792f8c4e68b81 Add auxiliary binary to CIPD bootstrap. (dnj@chromium.org)
https://crrev.com/73671ebf77a0844d6b9b9be967b7472ff64fd5d7 Update dart-flutter integration recipe, rename sky_shell -> flutter_tester (kustermann@google.com)
https://crrev.com/8d25def7aa0673ce3f1e436c5092341b32f70e6b Roll Git wrapper out to all BuildBot bots. (dnj@chromium.org)
https://crrev.com/60f9f3d7a06f9f64dc13ef1a8bc550fce7ba70d8 Configure PDFium builders to build pdfium_all. (thestig@chromium.org)
https://crrev.com/ece7e5aa69872d3551a64f9400024745b774a5c0 Fix recipe invocation of mb analyze on mac to check FORCE_MAC_TOOLCHAIN. (dpranke@chromium.org)
https://crrev.com/6328212bbe7dfa38aaa4a2dcee04d26f14028772 chromium_trybot: Fixing missing tansell@ from OWNERS (tansell@chromium.org)
https://crrev.com/8300711ed6b6396e50b6f092a77fa78491dd8dc9 Revert "WebRTC: Disable Linux ARM64 Debug bot to unblock rolling" (kjellander@chromium.org)
https://crrev.com/e0cb895e24d3daeea49a32e11f9ae0903eca77cd V8: Remove deprecated clusterfuzz builders (machenbach@chromium.org)
https://crrev.com/60b5be137284772d2fb55ac2e261aa279d87ec04 Dart: Add debug log step to recipes, make it work on Windows. (whesse@chromium.org)
https://crrev.com/7f5a5538a09ab7be09b792c7621642a048e75628 Implement a generic postprocess/merge hook for swarming tasks. (RELAND) (jbudorick@chromium.org)
https://crrev.com/217f111af09ddea4d351a371503fd02d722eae4e Revert "Implement a generic postprocess/merge hook for swarming tasks. (RELAND)" (machenbach@chromium.org)
https://crrev.com/cd0f641cf6317556e481a7958d606e69a825109a Add NVIDIA Shield TV to GPU.FYI (ynovikov@google.com)
https://crrev.com/437b20aeedbc9304008fe8d929f28a464e99aee1 Add config for linux_layout_tests_layout_ng try bot. (qyearsley@google.com)
https://crrev.com/5b00be794346c76a12dec3a81d11c24b248b7537 Simplify layout_test_wrapper.py more, again. (qyearsley@google.com)
https://crrev.com/be6a9a315bf6e9c0e45c0bbdd87c83b0a55ec28d Implement a generic postprocess/merge hook for swarming tasks. (RELAND 2) (jbudorick@chromium.org)
https://crrev.com/6e7474bc7cea2bfb3da3a5f7bbdb1f5ec8b55bcf Revert "Implement a generic postprocess/merge hook for swarming tasks. (RELAND 2)" (jbudorick@chromium.org)
https://crrev.com/84f4f2585534a98a827fb79962b2d8325ed61ecb Switch webview perf bots to the chromium recipe (martiniss@google.com)
https://crrev.com/c568a8417c9164f8a1996a1e8768bf7d67669602 Revert "Revert "Add low_bandwidth_audio_test on Android"" (oprypin@chromium.org)
https://crrev.com/ca02f065486627347da49805bd2638bedf5bea34 V8: Make sanitizer-coverage bot gerrit aware (machenbach@chromium.org)
https://crrev.com/f96cbaa627fd26af2c4cc0eb26d33a277e97a586 Dart: Allow subannotations in Dartium builder main step (whesse@chromium.org)
https://crrev.com/3c1eb1bfdf8677df9f79bccd04482a4e41e6381f V8: Add link to docu in email. (franzih@chromium.org)
https://crrev.com/e1ea0a6aef053fe91951fe4919b19d91f53d0901 Add chromium.webkit to masters_recipes_test. (dpranke@chromium.org)
https://crrev.com/2876764b52d6651834a0d8702356c968ac570eda Make Android arm/arm64 Builder download VR test APKs (bsheedy@chromium.org)
https://crrev.com/3722c6c9b98063a27319ba3f97e0d6bbd538a884 Support specifying ignore_swarming_task_failure & ignore_task_failure for swarming isolated script test (nednguyen@google.com)
https://crrev.com/00cd0ae22f4a9e2f1906dafcf861ceaa004d9442 Add new machines and FIPS builders to client.boringssl. (davidben@chromium.org)
https://crrev.com/724973cc5ea76a9359125bb437ef6c6723ce51a9 remote_run: Roll Kitchen to pick up TMPDIR (dnj@chromium.org)
https://crrev.com/0e67c706f5796cb0797e5cd09f920846a5b0a560 GetGomaLogDirectory should searches a log directory more accurately. (yyanagisawa@chromium.org)
https://crrev.com/e64c2de6c57e25b55f7c73261bdacc0a82189c54 chromium_tests: Interrupted files not considered valid. (tansell@chromium.org)
https://crrev.com/90711a4918e74aedb10d05fe9a4400d8007ba0d2 Move gtest log handling into api.test_utils. (jbudorick@chromium.org)
https://crrev.com/85dc10fad1a7ea385ab43353f414b15695052221 Revert "chromium_tests: Interrupted files not considered valid." (kjellander@chromium.org)
https://crrev.com/7f3bc2a4ae12dfc4e4c943ecee0bd24cc0c4c1db Implement a generic postprocess/merge hook for swarming tasks. (RELAND 3) (jbudorick@chromium.org)
https://crrev.com/c926e68e032bf5201fdca5f01f1ab125f7233ddb Revert "Implement a generic postprocess/merge hook for swarming tasks. (RELAND 3)" (jbudorick@chromium.org)
https://crrev.com/da635f7814c920356afaa25eebef15f010e9333e Fix flag for linux_layout_tests_layout_ng try bot. (qyearsley@google.com)
https://crrev.com/75c17b641b40ff75b5fcb90b4ec87b3eb91290bc Remove ignore_swarming_task_failure field (nednguyen@google.com)
https://crrev.com/f7b41106d64b6517c67343f2cfb03f4a9d62afc2 Bump Git wrapper staging version. (dnj@chromium.org)
depot_tools:
https://crrev.com/1345ba9bce159d42ec724dc0dd597ab93d4022d3 [recipes.cfg] upgrade to api_version 2 (iannucci@chromium.org)
https://crrev.com/f2d0ad648a8f9739b3f0a21283446df890ba15d2 Manually roll recipe engine d7f80ca:e2b4fd5 (phajdan.jr@chromium.org)
https://crrev.com/4f0fb066f93247fd8f787d2e61add6bbb5b4ba92 Manual recipe roll (trivial). (dnj@chromium.org)
recipe_engine:
https://crrev.com/9f7465ffe92dab0bcc6f4d0e60303c6bff4d0f72 [recipes.cfg] Add disable reason. (iannucci@chromium.org)
https://crrev.com/855168108b3dab668c36b56a99ca5a73f6d98932 [recipes.cfg] upgrade to api_version 2 (iannucci@chromium.org)
https://crrev.com/e77477ba61ef082e2e34d58fd1251a1cb707f698 make doc/recipes.py supported version 1 and 2 (iannucci@chromium.org)
https://crrev.com/1af805aac5b8735be9effce6251286d062755257 Convert structured output of 'test' command to protos (phajdan.jr@chromium.org)
https://crrev.com/09292e372498915b899f480ce9f384057dc5710c Implement debug (pdb) support in new 'test' command (phajdan.jr@chromium.org)
https://crrev.com/e02889f17c4ac35b7fb99915c5e05a9dde1347c0 test: promote --train to its own subcommand (phajdan.jr@chromium.org)
https://crrev.com/189f7dcc9e1151e6714987e26eb7de14c531d3ae Implement 'diff' sub-command in new 'test' command (phajdan.jr@chromium.org)
https://crrev.com/0586f16a4911be4855ce52621e143662e1d58062 Always identify test names that lead to failures (phajdan.jr@chromium.org)
https://crrev.com/e9b07327159884c40cc81744361d0018c5cf481c absolutize paths specified in args (nodir@chromium.org)
https://crrev.com/0160aa0a9b2b85379a8e80090d753fef20e6dce5 Add deprecation warning to simulation_test command (phajdan.jr@chromium.org)
https://crrev.com/ddfc94f01e4e1d3c7bf7dedfd58e6813bc5160df Assert validity of stream parameters. (dnj@chromium.org)
https://crrev.com/796247003f570b54140f9cc6e7934bcdf11880e7 Put result.proto into recipe_engine proto package (nodir@chromium.org)
https://crrev.com/d7f80cacbb5c61e5bdaaff122fb5ab0ea7b58345 Fix recipe bootstrap on Windows (phajdan.jr@chromium.org)
https://crrev.com/e2b4fd5362e043dc66e85f5c342e414c5bfb89de Enable recipe bootstrap by default (phajdan.jr@chromium.org)
https://crrev.com/0497d326e1805715e8df4095afa6d0e95b9af48f Revert of Assert validity of stream parameters. (patchset #4 id:60001 of https://codereview.chromium.org/2792333003/ ) (phajdan.jr@chromium.org)
https://crrev.com/ab1007e993f5ae367c15389afb954591bf3376dd autoroll: don't send output from "fetch" command to NUL (phajdan.jr@chromium.org)
https://crrev.com/bbe066964830adfaa2298d0fd77e02b86bcd48ea Disable bootstrap for recipes.py invocations in autoroll (phajdan.jr@chromium.org)
https://crrev.com/162f5cba2739078a1ff263c9898fa31690864481 Revert of Enable recipe bootstrap by default (patchset #1 id:1 of https://codereview.chromium.org/2801073004/ ) (phajdan.jr@chromium.org)
https://crrev.com/22e9f7a530a72ede0b5390687cfffb79e3e5bf60 Revert of Disable bootstrap for recipes.py invocations in autoroll (patchset #1 id:1 of https://codereview.chromium.org/2801273002/ ) (phajdan.jr@chromium.org)
https://crrev.com/0fdbf0025e0a814b0c2ea8c787d24aeab0ecb99b Add --disable-bootstrap option to recipe engine (phajdan.jr@chromium.org)
https://crrev.com/11a5a6648f538d56cd5a48169f7b349e2d71886c Enable bootstrap by default when invoking test command (phajdan.jr@chromium.org)
https://crrev.com/2ea2b19c4deb2f81b462754509e2c858e73078ec Refactor and clean up unit tests a bit. (iannucci@chromium.org)
https://crrev.com/86179ebcb99567b956e788bb1a100c262f533083 Work around unicode issues by re-encoding properties as utf-8 (phajdan.jr@chromium.org)
https://crrev.com/f31d525eef33613aa537e8ed954e7dfbf1cae8b2 path: Add tracking of volatile paths. (dnj@chromium.org)
https://crrev.com/3582ac2243ff0bcbd36bfb8f9ab9853a5ca5beb1 Fix test hang (phajdan.jr@chromium.org)
https://crrev.com/4e482d2131c51fd19f9a3e8840ae74c52a7b6567 Move package.ProtoFile -> package_io.PackageFile (iannucci@chromium.org)
https://crrev.com/4afdf69bc15cbcf6a88076da7074d24cb88780d2 Add test coverage for testing recipe configs and test_api (phajdan.jr@chromium.org)
https://crrev.com/56ba34248d8319cfdaff19ae55d68004fdd8ebf8 Stop running deprecated simulation_test (phajdan.jr@chromium.org)
https://crrev.com/f5e47cfc28b5964701572db12f96c7a5a3f1821a Enable strict coverage for json, path, platform, properties, raw_io (phajdan.jr@chromium.org)
TBR=borenet@google.com
Change-Id: If92ca282402a62b552e45eb5a5b89dc9dfe51b2d
Recipe-Tryjob-Bypass-Reason: Autoroller
Bugdroid-Send-Email: False
Reviewed-on: https://skia-review.googlesource.com/13653
Reviewed-by: Recipe Roller <recipe-roller@chromium.org>
Commit-Queue: Recipe Roller <recipe-roller@chromium.org>
2017-04-17 19:55:16 +00:00
|
|
|
engine = pb['deps']['recipe_engine']
|
2017-03-16 01:04:05 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
if 'url' not in engine:
|
|
|
|
raise MalformedRecipesCfg(
|
|
|
|
'Required field "url" in dependency "recipe_engine" not found',
|
|
|
|
recipes_cfg_path)
|
|
|
|
|
|
|
|
engine.setdefault('revision', '')
|
|
|
|
engine.setdefault('branch', 'refs/heads/master')
|
|
|
|
recipes_path = pb.get('recipes_path', '')
|
|
|
|
|
|
|
|
# TODO(iannucci): only support absolute refs
|
|
|
|
if not engine['branch'].startswith('refs/'):
|
|
|
|
engine['branch'] = 'refs/heads/' + engine['branch']
|
|
|
|
|
|
|
|
recipes_path = os.path.join(
|
|
|
|
repo_root, recipes_path.replace('/', os.path.sep))
|
|
|
|
return EngineDep(**engine), recipes_path
|
|
|
|
except KeyError as ex:
|
|
|
|
raise MalformedRecipesCfg(ex.message, recipes_cfg_path)
|
|
|
|
|
|
|
|
|
2018-06-22 14:38:45 +00:00
|
|
|
_BAT = '.bat' if sys.platform.startswith(('win', 'cygwin')) else ''
|
|
|
|
GIT = 'git' + _BAT
|
|
|
|
VPYTHON = 'vpython' + _BAT
|
2019-04-05 18:34:44 +00:00
|
|
|
CIPD = 'cipd' + _BAT
|
|
|
|
REQUIRED_BINARIES = {GIT, VPYTHON, CIPD}
|
|
|
|
|
|
|
|
|
|
|
|
def _is_executable(path):
|
|
|
|
return os.path.isfile(path) and os.access(path, os.X_OK)
|
|
|
|
|
|
|
|
# TODO: Use shutil.which once we switch to Python3.
|
|
|
|
def _is_on_path(basename):
|
|
|
|
for path in os.environ['PATH'].split(os.pathsep):
|
|
|
|
full_path = os.path.join(path, basename)
|
|
|
|
if _is_executable(full_path):
|
|
|
|
return True
|
|
|
|
return False
|
2017-03-16 01:04:05 +00:00
|
|
|
|
|
|
|
|
2016-07-26 18:52:17 +00:00
|
|
|
def _subprocess_call(argv, **kwargs):
|
|
|
|
logging.info('Running %r', argv)
|
|
|
|
return subprocess.call(argv, **kwargs)
|
2016-11-14 17:18:34 +00:00
|
|
|
|
2017-03-15 08:24:56 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
def _git_check_call(argv, **kwargs):
|
|
|
|
argv = [GIT]+argv
|
2016-07-26 18:52:17 +00:00
|
|
|
logging.info('Running %r', argv)
|
|
|
|
subprocess.check_call(argv, **kwargs)
|
2016-11-14 17:18:34 +00:00
|
|
|
|
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
def _git_output(argv, **kwargs):
|
|
|
|
argv = [GIT]+argv
|
|
|
|
logging.info('Running %r', argv)
|
|
|
|
return subprocess.check_output(argv, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
def parse_args(argv):
|
|
|
|
"""This extracts a subset of the arguments that this bootstrap script cares
|
|
|
|
about. Currently this consists of:
|
2018-12-08 01:42:12 +00:00
|
|
|
* an override for the recipe engine in the form of `-O recipe_engine=/path`
|
2017-05-09 18:06:48 +00:00
|
|
|
* the --package option.
|
|
|
|
"""
|
2017-03-15 08:24:56 +00:00
|
|
|
PREFIX = 'recipe_engine='
|
|
|
|
|
2017-04-19 11:12:20 +00:00
|
|
|
p = argparse.ArgumentParser(add_help=False)
|
2017-03-15 08:24:56 +00:00
|
|
|
p.add_argument('-O', '--project-override', action='append')
|
2017-05-09 18:06:48 +00:00
|
|
|
p.add_argument('--package', type=os.path.abspath)
|
2017-03-15 08:24:56 +00:00
|
|
|
args, _ = p.parse_known_args(argv)
|
|
|
|
for override in args.project_override or ():
|
|
|
|
if override.startswith(PREFIX):
|
2017-05-09 18:06:48 +00:00
|
|
|
return override[len(PREFIX):], args.package
|
|
|
|
return None, args.package
|
2017-03-15 08:24:56 +00:00
|
|
|
|
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
def checkout_engine(engine_path, repo_root, recipes_cfg_path):
|
|
|
|
dep, recipes_path = parse(repo_root, recipes_cfg_path)
|
2017-09-27 17:03:35 +00:00
|
|
|
if dep is None:
|
|
|
|
# we're running from the engine repo already!
|
|
|
|
return os.path.join(repo_root, recipes_path)
|
2016-11-14 17:18:34 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
url = dep.url
|
2017-03-15 08:24:56 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
if not engine_path and url.startswith('file://'):
|
|
|
|
engine_path = urlparse.urlparse(url).path
|
2016-11-14 17:18:34 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
if not engine_path:
|
|
|
|
revision = dep.revision
|
|
|
|
branch = dep.branch
|
2016-11-14 17:18:34 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
# Ensure that we have the recipe engine cloned.
|
2019-01-16 23:11:31 +00:00
|
|
|
engine_path = os.path.join(recipes_path, '.recipe_deps', 'recipe_engine')
|
2017-03-16 01:04:05 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
with open(os.devnull, 'w') as NUL:
|
|
|
|
# Note: this logic mirrors the logic in recipe_engine/fetch.py
|
2019-01-16 23:11:31 +00:00
|
|
|
_git_check_call(['init', engine_path], stdout=NUL)
|
2017-03-25 00:45:40 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
try:
|
|
|
|
_git_check_call(['rev-parse', '--verify', '%s^{commit}' % revision],
|
2019-01-16 23:11:31 +00:00
|
|
|
cwd=engine_path, stdout=NUL, stderr=NUL)
|
2017-05-09 18:06:48 +00:00
|
|
|
except subprocess.CalledProcessError:
|
2019-01-16 23:11:31 +00:00
|
|
|
_git_check_call(['fetch', url, branch], cwd=engine_path, stdout=NUL,
|
2017-05-09 18:06:48 +00:00
|
|
|
stderr=NUL)
|
2017-03-15 08:24:56 +00:00
|
|
|
|
|
|
|
try:
|
2019-01-16 23:11:31 +00:00
|
|
|
_git_check_call(['diff', '--quiet', revision], cwd=engine_path)
|
2017-03-15 08:24:56 +00:00
|
|
|
except subprocess.CalledProcessError:
|
2019-01-16 23:11:31 +00:00
|
|
|
_git_check_call(['reset', '-q', '--hard', revision], cwd=engine_path)
|
2017-05-09 18:06:48 +00:00
|
|
|
|
2019-03-28 20:03:40 +00:00
|
|
|
# If the engine has refactored/moved modules we need to clean all .pyc files
|
|
|
|
# or things will get squirrely.
|
|
|
|
_git_check_call(['clean', '-qxf'], cwd=engine_path)
|
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
return engine_path
|
2017-03-15 08:24:56 +00:00
|
|
|
|
2016-11-14 17:18:34 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
def main():
|
2019-04-05 18:34:44 +00:00
|
|
|
for required_binary in REQUIRED_BINARIES:
|
|
|
|
if not _is_on_path(required_binary):
|
|
|
|
return 'Required binary is not found on PATH: %s' % required_binary
|
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
if '--verbose' in sys.argv:
|
|
|
|
logging.getLogger().setLevel(logging.INFO)
|
|
|
|
|
|
|
|
args = sys.argv[1:]
|
|
|
|
engine_override, recipes_cfg_path = parse_args(args)
|
|
|
|
|
|
|
|
if recipes_cfg_path:
|
|
|
|
# calculate repo_root from recipes_cfg_path
|
|
|
|
repo_root = os.path.dirname(
|
|
|
|
os.path.dirname(
|
|
|
|
os.path.dirname(recipes_cfg_path)))
|
|
|
|
else:
|
|
|
|
# find repo_root with git and calculate recipes_cfg_path
|
|
|
|
repo_root = (_git_output(
|
|
|
|
['rev-parse', '--show-toplevel'],
|
|
|
|
cwd=os.path.abspath(os.path.dirname(__file__))).strip())
|
|
|
|
repo_root = os.path.abspath(repo_root)
|
|
|
|
recipes_cfg_path = os.path.join(repo_root, 'infra', 'config', 'recipes.cfg')
|
|
|
|
args = ['--package', recipes_cfg_path] + args
|
|
|
|
|
|
|
|
engine_path = checkout_engine(engine_override, repo_root, recipes_cfg_path)
|
|
|
|
|
2016-07-26 18:52:17 +00:00
|
|
|
return _subprocess_call([
|
2018-06-22 14:38:45 +00:00
|
|
|
VPYTHON, '-u',
|
2018-12-08 01:42:12 +00:00
|
|
|
os.path.join(engine_path, 'recipe_engine', 'main.py')] + args)
|
2016-11-14 17:18:34 +00:00
|
|
|
|
2017-05-09 18:06:48 +00:00
|
|
|
|
2016-07-26 18:52:17 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(main())
|