echoing-farmer-15630
01/07/2022, 3:28 PM./pants test ::
step takes ages on CircleCI creating all the wee mini-venvs), and tried a too-simple test: set up a bazel-remote
instance on an EC2 instance and tried running multiple builds with remote_cache_X
items set in pants.toml (or not, for the original clean local build). I then simulated a "clean build on a fresh CI node" by rm -rf
ing ~/.cache/pants
and in the repository both .pids
and .pants.d
and doing pants version
to at least populate the base tool before timing.
...and it seemed to make no difference; ie:
Clean build local
________________________________________________________
Executed in 386.20 secs fish external
usr time 461.72 millis 876.00 micros 460.84 millis
sys time 65.67 millis 240.00 micros 65.43 millis
Clean build remote cache empty but on (for initial population)
________________________________________________________
Executed in 387.25 secs fish external
usr time 450.78 millis 863.00 micros 449.92 millis
sys time 58.88 millis 239.00 micros 58.64 millis
Clean build remote cache populated and on
________________________________________________________
Executed in 371.61 secs fish external
usr time 449.75 millis 0.00 micros 449.75 millis
sys time 67.19 millis 1258.00 micros 65.94 millis
... and when I was watching, the bulk of the time (up to 340 seconds) was spent Resolving constraints.txt
. I'm using 2.10.0.dev0 with
[python]
interpreter_constraints = ["CPython==3.9.*"]
requirement_constraints = "constraints.txt"
...the constraints.txt file generated by pip freeze
and then hand-edited for a few things.
Of course, successive runs of pants test
are nearly instant, but when I can't count on a CI instance having any existing cache (and thus relying on the remote) it doesn't help to the degree I'd hoped. The --stats-log output is
local_cache_read_errors: 0
local_cache_requests: 65
local_cache_requests_cached: 0
local_cache_requests_uncached: 65
local_cache_total_time_saved_ms: 0
local_cache_write_errors: 0
local_execution_requests: 61
local_process_total_time_run_ms: 398394
remote_cache_read_errors: 0
remote_cache_requests: 29
remote_cache_requests_cached: 4
remote_cache_requests_uncached: 25
remote_cache_speculation_local_completed_first: 36
remote_cache_speculation_remote_completed_first: 4
remote_cache_total_time_saved_ms: 5162
remote_cache_write_attempts: 59
remote_cache_write_errors: 0
remote_cache_write_successes: 57
remote_execution_errors: 0
remote_execution_requests: 0
remote_execution_rpc_errors: 0
remote_execution_rpc_execute: 0
remote_execution_rpc_retries: 0
remote_execution_rpc_wait_execution: 0
remote_execution_success: 0
remote_execution_timeouts: 0
remote_process_total_time_run_ms: 0
remote_store_blob_bytes_downloaded: 1283423
remote_store_blob_bytes_uploaded: 115816367
remote_store_missing_digest: 0
...which implies a lot of misses. So I'm not sure what I'm missing myself (probably a lot; new territory!); why is "Resolving constraints.txt" taking so long, and how could I use remote caching to help, or have I just bolloxed up the setup entirely?
(searching slack, it sounds like "Resolving constraints.txt" basically installs every package in constraints.txt; not sure how to speed that or if it's cacheable in any useful sense, so that could be most of the story right there)enough-analyst-54434
01/07/2022, 4:57 PMpython3.9 -mvenv test && test/bin/pip install -r constraints.txt -c constraints.txt
? We can't do much better than that since we indirectly use Pip; so if it's in the ballpark we can't do much except resolve less often 😕 If its way off though in Pip's favor, that should be actionable / indicate some sort of bug in Pex.echoing-farmer-15630
01/07/2022, 7:52 PMechoing-farmer-15630
01/07/2022, 8:01 PMpython3.9 -mvenv...
command got me 119 seconds. But that was leveraging my existing pip cache. If I rm -rf ~/.cache/pip
and try again, 184 seconds. So I'm confused now; not sure why it would be different (pip 21.3.1)enough-analyst-54434
01/07/2022, 8:29 PMrm -rf ~/.cache/pants && pkill pantsd && ./pants -V && time ./pants XYZ
?echoing-farmer-15630
01/07/2022, 8:52 PMrm -rf ~/.cache/pants
rm -rf ./.pants.d
rm -rf ./.pids
./pants version (to repopulate pants)
time ./pants test (subdir)::
So as mentioned, may have done something strange there; wasn't sure how best to simulate a new machine. I started with the full suite (ie time ./pants test ::
) but the iterations took too long so I started with a subset.
Getting latish here (GMT) so I will try to pursue more Monday; thanks for your patience and help on this. Would really love to speed this up for us.