Commit Graph

101 Commits (chrome/3987)

Author SHA1 Message Date
Andrii Shyshkalov c50b0963e3 git_cache: don't lose options in upload_bootstrap.
I noticed that chromium/src archive grew 2x from 7.3GiB in August
to 15+ GiB now. Turns out --aggressive-gc had no effect.

R=iannucci

Change-Id: I6a27f67f5a4dd2101ac1622221106e094af4688a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1928583
Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
5 years ago
Edward Lemur e9024d00d2 gclient: Make smoke tests use local dir instead of git daemon.
Running gclient_smoketests times out on windows when using git daemon,
so use a local directory as remote instead.

Bug: 1024683
Change-Id: I6ca506d74de463d914317f176eefbe74996298c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1879723
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
5 years ago
John Budorick 3da78c4bb7 Revert git cache diagnostic tracing.
This reverts commit ebba8d75bf.
This reverts commit fcde3ba0a6.
This reverts commit fd843fa456.

Bug: 1019824
Change-Id: I14ad2d4f620ac316421f1c3d168b66176af2d26e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1917496
Auto-Submit: John Budorick <jbudorick@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
5 years ago
danakj c41f72cf44 Allow the bot_update api to not fetch tags from the git server.
There are 3 layers modified, starting from the bottom up:

1. git_cache.py populate

Now takes a --no-fetch-tags option. If specified, the cache will not
fetch updated tags from the server by passing --no-tags to git fetch.
This prevents the server from sending all the tag refs. In chromium
this prevents significant time bottlenecks dealing with 10k+ tags.

2. bot_update.py

bot_update has to deal with multiple git repos, it has the root repo
that is checked out through git-cache, as well as repos synched via
DEPS and gclient.

The script now takes a --no_fetch_tags option. If specified,
the git-cache populate call will include --no-fetch-tags. Otherwise, it
won't. So this controls (for chromium) if fetches to the src.git server
are passed --no-tags.

3. bot_update/api.py

This is the entry point for recipes and also has to deal with multiple
git repos. The behaviour at this point is not changed from the default.
A |no_fetch_tags| parameter is added to ensure_checkout() that defaults
to False.


This CL is a refactor with no intended behavior change.

The next step will be to change the chromium build repo to pass True
for ensure_checkout(no_fetch_tags) on chromium trybots.

This represents solution #2 in
https://docs.google.com/document/d/1hDIunJjjfpmr50y3YnZ4o3aq1NZF4gJa1TS0p7AIL64/edit#

Bug: 1019824
Change-Id: I935430603299daa9e301a95a5184c0ce486fd912
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1894352
Reviewed-by: Aaron Gable <agable@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Auto-Submit: danakj <danakj@chromium.org>
5 years ago
John Budorick 48823c2854 Revert "Add more git tracing."
This reverts commit 1e4dbf3f64.

Reason for revert: unlikely but possible cause of http://shortn/_sgL4PqICVB

Original change's description:
> Add more git tracing.
> 
> This CL adds more perf tracing to `git fetch` from bot_update.py and
> git_cache.py
> 
> Change-Id: I9b69c60b6c81fc0c5f23f82fcc889b4d45a27556
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: infra
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1888433
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
> Commit-Queue: Erik Chen <erikchen@chromium.org>
> Auto-Submit: Erik Chen <erikchen@chromium.org>

TBR=danakj@chromium.org,tandrii@google.com,erikchen@chromium.org

Change-Id: I03b33bf1532212f83a6b89b1de32fafb6b8aafc4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1891001
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
5 years ago
Erik Chen 1e4dbf3f64 Add more git tracing.
This CL adds more perf tracing to `git fetch` from bot_update.py and
git_cache.py

Change-Id: I9b69c60b6c81fc0c5f23f82fcc889b4d45a27556
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: infra
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1888433
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Auto-Submit: Erik Chen <erikchen@chromium.org>
5 years ago
Erik Chen ebba8d75bf Add more tracing to git cache.
Change-Id: Iad21c3fa60f563f479ad0a0cadcfd8c1beb2fcc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1881910
Auto-Submit: Erik Chen <erikchen@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
5 years ago
Erik Chen fcde3ba0a6 Store up to 30000 packet log lines for git fetch.
We currently fetch tags, which consumes ~17k lines. This limit ensures that we
won't blow up the log files in exceptional circumstances [currently setting
around ~2MB], but still allows us to get all the logs.

Change-Id: Ib690aaa07e2bde8549d221b90511b6c4863c3358
Recipe-Nontrivial-Roll: chromiumos
Recipe-Nontrivial-Roll: skia
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1867971
Commit-Queue: Erik Chen <erikchen@chromium.org>
Auto-Submit: Erik Chen <erikchen@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
5 years ago
Erik Chen fd843fa456 Add diagnostics to git_cache.
These confirm that we're correctly using protocol v2.

Change-Id: Ib8bd8a4dba27d44fc0ae14835ce5253dfa056318
Recipe-Nontrivial-Roll: skia
Recipe-Nontrivial-Roll: chromiumos
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1867195
Commit-Queue: Erik Chen <erikchen@chromium.org>
Auto-Submit: Erik Chen <erikchen@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
5 years ago
Robert Iannucci 09315982bc [git_cache] Add option to break locks on populate.
R=ehmaldonado@chromium.org, tandrii@chromium.org

Change-Id: Icd7b0afc98e6d9365f74e8a6eb232700c6362d17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1842832
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
5 years ago
Edward Lesmes 451e8babe2 depot_tools: Fix gclient_test on Windows.
Bug: 1007580
Change-Id: I8265b3f4e64b95d7f107b50eb8c68983d6002468
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1828080
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
5 years ago
Robert Iannucci 0081c0ff17 [git-cache] Add option to update_bootstrap to skip the populate step.
This will allow us to separate the 'populate' and 'upload' phases
in the git cache updater recipe, which will allow us to do all the
'populate' steps in parallel, but then limit the parallelism of the
`pack/gc/upload` operations.

R=tandrii@chromium.org

Change-Id: I8b8a9155f86350be37ed5a67c592ff1fec4d42ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1830857
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
5 years ago
Quinten Yearsley 3841eaa164 Remove unused imports in depot_tools/*.py
I know that sometimes imports can have side-effects,
so unused imports shouldn't always be removed, but these
ones look like they could be.

Change-Id: Iea9f82afa99b0ea35f29a28f20ce0493b579cfee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1819860
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
6 years ago
Andrii Shyshkalov fdb59f0d90 Revert "git-cache: don't limit pack files to 2GiB."
This reverts commit 82ae4b4b7d.

Reason for revert: didn't help. Something else limits 'git gc' by 2GB.
However, even so, total amount of .pack files for chromium/src is <7.5GB.

Original change's description:
> git-cache: don't limit pack files to 2GiB.
>
> This is only relevant to 1 builder which updates git cache bundles.
> Since some time in 2018-2019, it started creating several 2GiB packs
> for chromium/src. I verified that the setting affecting it is
>   core.deltaBaseCacheLimit
>
> Log file of a build which I observed while ssd-ed into the machine (internal):
>   https://logs.chromium.org/logs/infra-internal/buildbucket/cr-buildbucket.appspot.com/8901682638839779824/+/steps/Updating_https:__chromium.googlesource.com_chromium_src/0/stdout
> Git version: version:2.21.0.chromium16
>
> R=​ehmaldonado
>
> Change-Id: I52cadfb9f34faea09a57d53387cab7e0538362b9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1818076
> Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

TBR=tandrii@google.com,ehmaldonado@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I24915555c703bc92fda921524820405de5d69f7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1817101
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Andrii Shyshkalov 7cb60e812f git-cache: fix bug in prior CL.
cwd param isn't necessary, because actual cwd is already correct --
see 'git gc' invocation below.

R=ehmaldonado, iannucci

Change-Id: Ia885ad32b11b0de37d3b0e4e5359d2031b6852d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1818455
Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
6 years ago
Andrii Shyshkalov 82ae4b4b7d git-cache: don't limit pack files to 2GiB.
This is only relevant to 1 builder which updates git cache bundles.
Since some time in 2018-2019, it started creating several 2GiB packs
for chromium/src. I verified that the setting affecting it is
  core.deltaBaseCacheLimit

Log file of a build which I observed while ssd-ed into the machine (internal):
  https://logs.chromium.org/logs/infra-internal/buildbucket/cr-buildbucket.appspot.com/8901682638839779824/+/steps/Updating_https:__chromium.googlesource.com_chromium_src/0/stdout
Git version: version:2.21.0.chromium16

R=ehmaldonado

Change-Id: I52cadfb9f34faea09a57d53387cab7e0538362b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1818076
Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Andrii Shyshkalov dcfe55f13f git-cache: add --gc-aggressive support.
This will be used on internal cache updater.

For instance, I've just compressed chromium/src resulting bootstrap
files from 20GiB to 7.5 GiB.

R=ehmaldonado

Change-Id: I15411700eb2ac3a26d1c658a12288cc49e48fd48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1802877
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
6 years ago
Edward Lesmes 98eda3f3e4 Revert "depot_tools: Run Python scripts using vpython (Part 1)"
This reverts commit d6186f9936.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> depot_tools: Run Python scripts using vpython (Part 1)
> 
> Tbr: iannucci@chromium.org
> Bug: 984182
> Change-Id: If36722e190d305f89d63dce91d0a600ddc34ebe3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1748589
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

TBR=iannucci@chromium.org,ehmaldonado@chromium.org

Change-Id: I7686985852608d0703bcbbab137df1ce82b29723
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 984182
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1749853
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur d6186f9936 depot_tools: Run Python scripts using vpython (Part 1)
Tbr: iannucci@chromium.org
Bug: 984182
Change-Id: If36722e190d305f89d63dce91d0a600ddc34ebe3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1748589
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur df746d0e6f depot_tools: Make git_cache Python 3 compatible.
Bug: 984182
Change-Id: Ia413435af80d03dcfa01bb2ab7480cd6a37b4161
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1717496
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Karen Qian ccd2b4da9a Pruning old directories/ready files.
Bug: 943696
Change-Id: I7732688ae28ccc9a917c32d139b53066d24c043d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1592563
Commit-Queue: Karen Qian <karenqian@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
John Budorick 47ec0697f0 git_cache: remove the mirror_path if it exists in an incomplete state.
Bug: 958286
Change-Id: If8351dfc0790e1db5867c103139a067c651fca3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1590500
Commit-Queue: John Budorick <jbudorick@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Karen Qian 0cbd5a5ec2 Stop using compression for git cache.
Change git cache download from GS git directory directly.
Bug: 943696
Change-Id: Ibe473effbf18d5635736c3ca0ab0ef0bbf21be8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1575003
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Karen Qian <karenqian@google.com>
6 years ago
Andrii Shyshkalov 199182fd64 git_cache: on upload, run "git gc" only if necessary.
If the destination cache file already exists, "git gc" isn't useful.

R=karenqian

Bug: 943696
Change-Id: I1fe3ab04713996b962012242edb6cbdb279f4874
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1585707
Reviewed-by: Karen Qian <karenqian@google.com>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Andrii Shyshkalov c62691b671 git_cache: print if cache bundle under the same number already exists.
Led-proof: https://chromium-swarm.appspot.com/task?id=4470d83a68228610

R=karenqian

Bug: 943696
Change-Id: Id01e7bae788b52488c536cfc2d93c278d56592fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1585643
Reviewed-by: Karen Qian <karenqian@google.com>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Andrii Shyshkalov 7a2205ca50 git_cache: allow self-bootstrapping when updating bootstrap.
The only upside of fetching everything directly from GoB
is that git cache would get just 1 .pack. However, git cache
already runs "git gc" before uploading cache to GS, so
this point is moot.

R=maruel

Bug: 943696
Change-Id: Ie8e77a81aa81489dae240b7c767c5842a12c6f19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1585641
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Karen Qian dcad7498c3 Reland "Stop using compression for git cache update bootstrap."
This is a reland of 749139969f

Original change's description:
> Stop using compression for git cache update bootstrap.
>
> Change git cache to stop zipping the git directory and instead upload directly to GS.
>
> Bug: 943696
> Change-Id: I310fb48ff3d7fd6781914e14e0e17530d5d9b328
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1585029
> Commit-Queue: Karen Qian <karenqian@google.com>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

Bug: 943696
Change-Id: Ifd3a3a07445345ab647572682ebc6423fb7135b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1585272
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Karen Qian <karenqian@google.com>
6 years ago
Andrii Shyshkalov fb86a01835 Revert "Stop using compression for git cache update bootstrap."
This reverts commit 749139969f.

Reason for revert: check for existence is wrong:
Failed to check GS:
CommandException: One or more URLs matched no objects.
See more https://logs.chromium.org/logs/infra-internal/buildbucket/cr-buildbucket.appspot.com/8915157478918019280/+/steps/Updating_https:__chromium.googlesource.com_android_apks/0/stdout

Original change's description:
> Stop using compression for git cache update bootstrap.
> 
> Change git cache to stop zipping the git directory and instead upload directly to GS.
> 
> Bug: 943696
> Change-Id: I310fb48ff3d7fd6781914e14e0e17530d5d9b328
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1585029
> Commit-Queue: Karen Qian <karenqian@google.com>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

TBR=tandrii@chromium.org,karenqian@google.com

Change-Id: I4c57cd6b2defdb2cf842eb0acb9c1b1cd7a96298
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 943696
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1585445
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Karen Qian 749139969f Stop using compression for git cache update bootstrap.
Change git cache to stop zipping the git directory and instead upload directly to GS.

Bug: 943696
Change-Id: I310fb48ff3d7fd6781914e14e0e17530d5d9b328
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1585029
Commit-Queue: Karen Qian <karenqian@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Andrii Shyshkalov 4b79c3870c git_cache: add OVERRIDE_BOOTSTRAP_BUCKET option.
Will use used by led-triggered tests of git_cache_updater builder.
Companion recipe CL: https://chromium-review.googlesource.com/c/infra/infra/+/1568156

R=hinoka

Change-Id: Ib25824d4d04cfb8aa0831fc5ae666a94808b289e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1567999
Reviewed-by: Ryan Tseng <hinoka@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Dirk Pranke db58954c8c Use the same git-cache bucket for authenticated and unauthenticated repos.
We should only be maintaining one cache bundle per repo, but it turns
out that we've had two in the past due to GoB supporting two different
paths to the repo, and users were getting stale bundles as a result.

This CL fixes things so that we should only get a single bundle per
repo.

Bug: 935084
Change-Id: I0d6713280a2abbc20e35ff87e7be115870dd5140
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1566431
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
6 years ago
Raul Tambre b946b2389c Improve gclient Python 3 compatibility
This enables gclient sync and gclient runhooks to run, barring hook script failures.
git cl upload also now works.

The scripts still work with Python 2.
There are no intended behaviour changes.

Bug: 942522
Change-Id: I2ac587b5f803ba7f5bb5e412337ce049f4b1a741
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1524583
Commit-Queue: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
6 years ago
Yuwei Huang a1fbdff177 Fix filename sorting logic in git_cache.py
We have trouble rolling dep of the grpc library. It looks like buildbots
use git_cache to download cache of the library from cloud storage, but
the way it picks up the latest cache is to do a string sort on the
filenames then pick the last one. This won't work if the filenames have
digit carrying, say you have both 9999.zip and 10000.zip, then 9999.zip
will get picked up.

This CL fixes this by implementing a new filename sorting logic that
extracts the numeral part of the filename and sort on it.

Bug: 927154
Change-Id: I68fce3fe67e55ce5092e7e9dc1dca606b427fe87
Reviewed-on: https://chromium-review.googlesource.com/c/1448954
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
6 years ago
Jeremy Apthorp d795ab891c Use system unzip on macOS
Modern macOS has no problem unzipping big zip files. To test:

$ gsutil cp gs://chromium-git-cache/chromium.googlesource.com-chromium-src/516491.zip test.zip
$ unzip -l test.zip

Change-Id: I84b3cff21cb9b7033c04b427e23f27a75ab1d8ae
Reviewed-on: https://chromium-review.googlesource.com/1152294
Commit-Queue: Jeremy Apthorp <jeremya@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
7 years ago
Edward Lemur 2f38df65f9 gclient: Reset the fetch config also when --force is passed.
The update_scripts step doesn't set '--reset'
Additionally, if there was no fetch config, don't fail trying to unset it.

Tbr: agable@chromium.org
No-Try: True
Bug: 862547
Change-Id: I90886ca7d1dd20ae59b378a5998de47dc67c60f9
Reviewed-on: https://chromium-review.googlesource.com/1137693
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Edward Lemur 579c98612b Reset the fetch config in the bots before each run.
If a ref is incorrectly set, it will affect later runs.
For example, [1] caused a bad refspec to be added to the fetch config,
(+refs/branch-heads/refs/branch-heads/6.7:refs/branch-heads/refs/branch-heads/6.7)
which affects all subsequent runs in the same bot: [2], [3].

This makes bot_update clear the fetch config before each run, so it is more
robust against these kind of failures.

[1] https://logs.chromium.org/v/?s=v8%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8942033142534034848%2F%2B%2Fsteps%2Fbot_update%2F0%2Fstdout
[2] https://logs.chromium.org/v/?s=v8%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8941307871443322944%2F%2B%2Fsteps%2Fbot_update%2F0%2Fstdout
[3] https://logs.chromium.org/v/?s=v8%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8941333453153279680%2F%2B%2Fsteps%2Fbot_update%2F0%2Fstdout

Bug: 862547
Change-Id: I2f849c604656e81ebd7377465d287226b8bdea1a
Reviewed-on: https://chromium-review.googlesource.com/1135645
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
7 years ago
Robert Iannucci a19649b86b Clean up cache_dir handling in gclient/git_cache/bot_update.
This CL makes a couple changes:
  * The goal here is to be able to specify git cache entirely from the
    environment variable $GIT_CACHE_PATH and not require special treatment from
    bot_update. Eventually this will be specified at the swarming task level
    instead of in the recipe (i.e. "cached git" will eventually be an
    implementation detail of git on the bots and completely transparent to
    all other software).
  * Removal of the general --cache-dir option from gclient. This option was
    error-prone; it doesn't actually make sense to configure this on
    a per-invocation basis. The sole exception was `gclient config`, which
    now allows this option to be set directly.
  * Consolidation of GitWrapper.cache_dir and GitWrapper._GetMirror; previously
    these two things could disagree, leading to weird intermediate states. Now
    they're the same value.

R=agable@chromium.org, ehmaldonado@chromium.org, tandrii@chromium.org

Bug: 823434
Change-Id: I14adc7619b5fc10768ce32be2651c6215ba94aff
Reviewed-on: https://chromium-review.googlesource.com/1105473
Reviewed-by: Aaron Gable <agable@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
7 years ago
Takuto Ikuta 4fbf4bece2 Remove windows specific git pack limit
This is full version of
https://chromium-review.googlesource.com/823544

After the CL landing, we see no performance regression in bot_update step.
And regular 95%ile in 1h window improved from more than 300s to less than or around 200s.
See tandrii's query in https://bugs.chromium.org/p/chromium/issues/detail?id=749709#c91 for detail.

Let me reduce frequency of slow bot_update step more like below.
https://ci.chromium.org/buildbot/tryserver.chromium.win/win7_chromium_rel_ng/69844
https://ci.chromium.org/buildbot/tryserver.chromium.win/win7_chromium_rel_ng/69886
https://ci.chromium.org/buildbot/tryserver.chromium.win/win7_chromium_rel_ng/69892

Bug: 749709
Change-Id: I44474aa9ecdd733d68fd13fe8b791820fb80381f
Reviewed-on: https://chromium-review.googlesource.com/838766
Commit-Queue: Takuto Ikuta <tikuta@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Takuto Ikuta 9fce213bdb Partial revert of "git_cache: lower max num of .pack files before re-bootstrap on Win."
This partially reverts commit d51ed57edb.

Reason for revert:
New git client for windows was rolled including fix for slow `git fetch`.
I guess smaller pack limit causes frequent bootstrap taking 2~3 minutes longer than
the case it does not happen.
Let me see what happen if we increase pack limit 9 -> 30.
I will increase this to 50 if this won't cause regression again.

Original change's description:
> git_cache: lower max num of .pack files before re-bootstrap on Win.
>
> It used to be 50, I think ~9 gives best results for Chromium on Win:
>   on golo VM, it takes <4 minutes to re-boostrap + git fetch small
>   delta, assuming zipped git checkout for bootstrap is fresh (~1day).
>
> For other repos, which are significantly smaller, this change should
> have minor effect if at all.
>
> Test: I tested this using `led` tool on Win7 machines running LUCI
> stack extensively. For example,
>
>   * https://ci.chromium.org/swarming/task/3a0102e8c8657410
>     shows case with few .pack files, hence just 1 fetch
>
>   * https://ci.chromium.org/swarming/task/3a010282f9fd8010
>     shows case with 39 .pack files and so bootstrapping + fetch.
>     If you look at prior tasks on the same VM, you'd find this:
>     https://ci.chromium.org/swarming/task/39ffe843d01ed010
>     which spent 8 minutes doing 1 incremental fetch with 39 .pack
>     files.
>
> **Troopers/Sheriffs**: This change is safe to revert.
> However, beware that you should also at the same time revert the recipe
> roll of this CL to the repo, in which the failed builder's recipe is
> located, typically `chromium/tools/build`.
>
> Bug: 749709
> Change-Id: I18e2b63283100d466e9fb981a9094862463f6909
> Reviewed-on: https://chromium-review.googlesource.com/787174
> Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
> Reviewed-by: Takuto Ikuta <tikuta@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 749709
Change-Id: I3052abe4a9b53277a60c0791a85355e7a0bbdf8f
Reviewed-on: https://chromium-review.googlesource.com/823544
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@google.com>
7 years ago
Andrii Shyshkalov 46a672bafa gclient: don't update cache if needed revision is already there.
Tested end-to-end, for example
  https://ci.chromium.org/swarming/task/3a0147207378b910
which contains:
  src/media/cdm/api (Elapsed: 0:00:01)
  ----------------------------------------
  [0:00:00] Started.
  _____ src\media\cdm\api at ea5df8e78fbd0a4c24cc3a1f3faefefcd1b45237
  [0:00:00] running "git cat-file -e ea5df8e78fbd0a4c24cc3a1f3faefefcd1b45237" in "e:\b\s\w\ir\cache\git\chromium.googlesource.com-chromium-cdm"
  skipping mirror update, it has rev=ea5df8e78fbd0a4c24cc3a1f3faefefcd1b45237 already

thereby saving on needless git fetch (~40s in glcient sync on win trybots),
and reducing the rate of .pack file accumulation inside cache directories.


Risks: silently broken recipes which run gclient sync (or worse, bot_update)
as a means of fetching latest commits in all repos of a solution. I think
the benefit of faster bot_update in chromium CQ is worth the potential risk.

PSA: https://groups.google.com/a/chromium.org/d/msg/infra-dev/UYLdBwAXm1Y/OV9QB6JnBQAJ

Bug: 749709
Change-Id: I7a9e8ab82a5e2b848e450f19a798ac18a0b5e201
Reviewed-on: https://chromium-review.googlesource.com/787331
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
7 years ago
Andrii Shyshkalov d51ed57edb git_cache: lower max num of .pack files before re-bootstrap on Win.
It used to be 50, I think ~9 gives best results for Chromium on Win:
  on golo VM, it takes <4 minutes to re-boostrap + git fetch small
  delta, assuming zipped git checkout for bootstrap is fresh (~1day).

For other repos, which are significantly smaller, this change should
have minor effect if at all.

Test: I tested this using `led` tool on Win7 machines running LUCI
stack extensively. For example,

  * https://ci.chromium.org/swarming/task/3a0102e8c8657410
    shows case with few .pack files, hence just 1 fetch

  * https://ci.chromium.org/swarming/task/3a010282f9fd8010
    shows case with 39 .pack files and so bootstrapping + fetch.
    If you look at prior tasks on the same VM, you'd find this:
    https://ci.chromium.org/swarming/task/39ffe843d01ed010
    which spent 8 minutes doing 1 incremental fetch with 39 .pack
    files.

**Troopers/Sheriffs**: This change is safe to revert.
However, beware that you should also at the same time revert the recipe
roll of this CL to the repo, in which the failed builder's recipe is
located, typically `chromium/tools/build`.

Bug: 749709
Change-Id: I18e2b63283100d466e9fb981a9094862463f6909
Reviewed-on: https://chromium-review.googlesource.com/787174
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@google.com>
7 years ago
Andrii Shyshkalov 4f56f234f9 git_cache: add more diagnostic logging wrt bootstrapping.
This is short of sending this metrics to ts_mon, but is still useful
for diagnose and then claim improvements in git cache performance on
bots.

This change has been tested for realz with led, particularly on windows
https://ci.chromium.org/swarming/task/3a01358af14a7d10

Bug: 749709
Change-Id: I2b3589079d2caa7f70007f90fcbce85a0205d24b
Reviewed-on: https://chromium-review.googlesource.com/787173
Reviewed-by: Takuto Ikuta <tikuta@google.com>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Andrii Shyshkalov 82d8dcd6e5 git_cache: remove redundant code.
R=iannucci@chromium.org, nodir@chromium.org

Change-Id: If7d48775b01a55e884a4c1fd6c26b1ff65992f4e
Reviewed-on: https://chromium-review.googlesource.com/786823
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Vadim Shtayura 08049e2db2 Revert "git_cache: Remove locks"
This reverts commit c3eb3fa335.

Reason for revert: lots of "runhooks" failure everywhere

Example: https://build.chromium.org/p/chromium.linux/builders/Linux%20Builder/builds/92720

Original change's description:
> git_cache: Remove locks
> 
> These aren't in use, and the original problem they were
> meant to solve has been solved at the gclient.py layer 
> using resource locking:
>   https://codereview.chromium.org/2049583003
> 
> Bug: 773008
> Change-Id: I6609f39d7f15604e0bb3d742a41c4f9fec87a57a
> Reviewed-on: https://chromium-review.googlesource.com/707728
> Reviewed-by: Aaron Gable <agable@chromium.org>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Ryan Tseng <hinoka@chromium.org>

TBR=iannucci@chromium.org,hinoka@chromium.org,agable@chromium.org,phajdan.jr@chromium.org

Change-Id: I31d5fef94f39f3a9f97b9e59121073b1f433d11e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 773008
Reviewed-on: https://chromium-review.googlesource.com/711054
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
7 years ago
Ryan Tseng c3eb3fa335 git_cache: Remove locks
These aren't in use, and the original problem they were
meant to solve has been solved at the gclient.py layer 
using resource locking:
  https://codereview.chromium.org/2049583003

Bug: 773008
Change-Id: I6609f39d7f15604e0bb3d742a41c4f9fec87a57a
Reviewed-on: https://chromium-review.googlesource.com/707728
Reviewed-by: Aaron Gable <agable@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Ryan Tseng <hinoka@chromium.org>
7 years ago
Ryan Tseng 3beabd0aa4 git_cache.py: Don't bootstrap from Google storage for unrecognized repos.
Also - Turn on GC for the unrecognized repos.

BUG=skia:6241
TEST=local
  git_cache.py populate with chromium and non-chromium repo.

Change-Id: I100d3665e317b29c5b3f69b49c165ce88cd019d6
Reviewed-on: https://chromium-review.googlesource.com/455979
Commit-Queue: Ryan Tseng <hinoka@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
8 years ago
Quinten Yearsley b2cc4a94da depot_tools: Replace pylint error numbers with symbolic names.
This affects a bunch of files, but only changes comments,
and shouldn't make any difference to behavior.

The purpose is to slightly improve readability of pylint
disable comments.

Change-Id: Ic6cd0f8de792b31d91c6125f6da2616450b30f11
Reviewed-on: https://chromium-review.googlesource.com/420412
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
8 years ago
dnj 4625b5adb8 Add retries to file operations for Windows.
BUG=chromium:663990
TEST=None
R=hinoka@chromium.org, nodir@chromium.org

Review-Url: https://codereview.chromium.org/2497503002
8 years ago
dnj b445ef568c bot_update: Use 'gclient' from same repository.
Currently, 'bot_update' uses the 'gclient' that is on the system path.
Now, it will use the 'gclient.py' that is in the same 'depot_tools'
checkout as the 'bot_update' recipe module.

Also don't ignore "git_cache" move errors.

BUG=664254,663990,663440
TEST=None

Review-Url: https://codereview.chromium.org/2492963002
8 years ago
hinoka dcd840489d Reland: git_cache.py: Clobber git repos if the config is corrupt
Reland of: https://codereview.chromium.org/2049463003/

See https://build.chromium.org/p/tryserver.chromium.win/builders/win10_chromium_x64_rel_ng_exp/builds/1801/steps/bot_update/logs/stdio
[Mirror] https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Ftryserver.chromium.win%2Fwin10_chromium_x64_rel_ng_exp%2F1801%2F%2B%2Frecipes%2Fsteps%2Fbot_update%2F0%2Fstdout

Sometimes repos become corrupt and bot_update fails spectacularly.  This usually happens due to the process being interrupted during a fetch. Git
cache should be able to recover from this by clobbering.

BUG=

Review-Url: https://codereview.chromium.org/2045243004
9 years ago