Hi all, I wanted to setup remote caching, but not ...
# general
p
Hi all, I wanted to setup remote caching, but not necessarily remote execution for pants. So I tried https://github.com/buchgr/bazel-remote, because I found it very easy to setup, just a single docker command. It's not in the list of tested REAPI servers in the documentation, but I tried it out with my main project (~1k files, ~150kLOC) and it seems to work very well. I did get the following warning a couple of times (not always) on our CI when running
pants export
but it worked correctly, so no worries there.
pants test
does use the remote cache and does not output any warning or error.
Copy code
+ ./pants export ::
12:21:19.72 [WARN] Failed to read from remote cache (1 occurrences so far): Unavailable: "Pants client timeout"
12:21:19.72 [WARN] Failed to read from remote cache (2 occurrences so far): Unavailable: "Pants client timeout"
12:21:19.72 [WARN] Failed to read from remote cache (4 occurrences so far): Unavailable: "Pants client timeout"
12:21:19.72 [WARN] Failed to read from remote cache (8 occurrences so far): Unavailable: "Pants client timeout"
12:21:19.72 [WARN] Failed to read from remote cache (16 occurrences so far): Unavailable: "Pants client timeout"
12:21:19.72 [WARN] Failed to read from remote cache (32 occurrences so far): Unavailable: "Pants client timeout"
12:21:19.73 [WARN] Failed to read from remote cache (64 occurrences so far): Unavailable: "Pants client timeout"
12:21:19.73 [WARN] Failed to read from remote cache (128 occurrences so far): Unavailable: "Pants client timeout"
12:21:19.83 [WARN] Failed to read from remote cache (256 occurrences so far): Unavailable: "Pants client timeout"
12:21:20.24 [WARN] Failed to read from remote cache (512 occurrences so far): Unavailable: "Pants client timeout"
Two questions: • Are those warnings in any way significant? • Is there something I can do to help add bazel-remote to the list of servers tested with pants? E.g. run a build of a pants-based project and check for success? If something like that can be easily done (without having to setup complex environment, or if they are available as docker images), I'd be willing to do it and give feedback.
1
1
w
they are somewhat significant: the timeout is controlled by this flag: https://www.pantsbuild.org/docs/reference-global#remote_cache_read_timeout_millis … BUT, currently the timeout is applied above a concurrency limit that is applied: https://www.pantsbuild.org/docs/reference-global#remote_cache_rpc_concurrency
if you increase concurrency, you may not need to increase the timeout very much. see https://github.com/pantsbuild/pants/issues/16188 about that
p
Thanks, I think that explains the output. I'll try increasing the concurrency and observe the behavior. It could also be that the server or its filesystem gets overwhelmed by too many queries, although it should theoretically be fast enough (SSD backed, 10GbE connection and little other load) If I have the local cache disabled and only use the remore cache, does a timed out query get retried, or does pants fall back to executing locally?
w
If I have the local cache disabled and only use the remore cache, does a timed out query get retried, or does pants fall back to executing locally?
the latter
p
Ok, then it would be good to avoid it as much as possible. Thanks for the info!
w
sure thing.
as to your second question: Pants runs in https://gitlab.com/remote-apis-testing/remote-apis-testing … if you were to get that server added there, that would be best for Pants and for the server 😃
p
I stumbled on exactly this repo. I'll take a better look and try it out, it shouldn't be too much work :)