astonishing-river-87155
03/27/2024, 3:19 PMastonishing-river-87155
03/27/2024, 3:23 PMpoetry export
to make a lockfile, which means we're doing run_against_entire_lockfile
so I know we're getting bad cache performance on requirements changes.
โข We are a medium/large sized Python mono repo.
โข We're running 2.17
until 2.20
comes out because of an issue with --changed-since
, but we're using the Rust Python parser.
Stats from a sampled job:
- 13:42:21 -- started scheduler / inferring deps
- 13:43:52 -- started installing dependencies
- 13:47:24 -- finished installing dependencies
- 13:48:39 -- finished building requirements pex
- 13:50:58 -- finished running pytest
dep inference = 1:31min
installing deps = 3:36min
building pex = 1:15min
running tests = 1:19min
Output from `scc`:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Language Files Lines Blanks Comments Code Complexity
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Python 34722 7680515 496115 455043 6729357 240871
JSON 2182 2538838 262 0 2538576 0
Plain Text 589 53129 2158 0 50971 0
YAML 377 13368 419 384 12565 0
License 278 20437 3578 0 16859 0
CSV 268 50417 12 0 50405 0
XML 204 14629 619 62 13948 0
Cython 108 35698 4163 1510 30025 4007
Protocol Buffers 108 16731 1756 9885 5090 0
C Header 65 28529 2928 6770 18831 1170
Markdown 64 3407 876 0 2531 0
Shell 62 3040 486 242 2312 242
SQL 56 3803 317 316 3170 25
ReStructuredText 55 3317 825 0 2492 0
Rust 47 7760 516 324 6920 139
TOML 39 986 81 83 822 6
Jinja 32 691 14 5 672 220
C 25 131528 5748 19207 106573 23789
HTML 23 5186 80 2769 2337 0
XML Schema 22 4892 310 0 4582 0
JavaScript 18 1789 219 271 1299 205
CSS 17 3546 604 92 2850 0
CMake 16 2203 297 391 1515 203
Mako 13 717 173 4 540 5
C++ Header 11 3846 487 854 2505 166
Dockerfile 10 299 64 30 205 40
... truncated things which do not have 10 or more files
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Total 39472 10661743 525317 499569 9636857 271523
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
astonishing-river-87155
03/27/2024, 3:27 PM.pex
file for our requirements set? I would expect it to take less time to essentially copy files around and pack a venv
into a file.astonishing-river-87155
03/27/2024, 3:28 PMrun_against_entire_lockfile
.
โข Boot our CI workers with a recently-up-to-date pip cache on disk for when requirements change.
But I was hoping folks would also have more ideas on how to help!astonishing-river-87155
03/27/2024, 3:29 PMhappy-kitchen-89482
03/27/2024, 4:50 PMhappy-kitchen-89482
03/27/2024, 4:51 PMhappy-kitchen-89482
03/27/2024, 4:51 PMastonishing-river-87155
03/27/2024, 4:51 PM13:50:59.28 [INFO] Counters:
backtrack_attempts: 0
docker_execution_errors: 0
docker_execution_requests: 0
docker_execution_successes: 0
local_cache_read_errors: 0
local_cache_requests: 11
local_cache_requests_cached: 0
local_cache_requests_uncached: 11
local_cache_total_time_saved_ms: 0
local_cache_write_errors: 0
local_execution_requests: 12
local_process_total_time_run_ms: 427923
remote_cache_read_errors: 0
remote_cache_request_timeouts: 0
remote_cache_requests: 6
remote_cache_requests_cached: 2
remote_cache_requests_uncached: 4
remote_cache_speculation_local_completed_first: 0
remote_cache_speculation_remote_completed_first: 2
remote_cache_total_time_saved_ms: 6487
remote_cache_write_attempts: 4
remote_cache_write_errors: 0
remote_cache_write_successes: 4
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_missing_digest: 0
remote_store_request_timeouts: 0
astonishing-river-87155
03/27/2024, 4:53 PMastonishing-river-87155
03/27/2024, 4:54 PMhappy-kitchen-89482
03/27/2024, 4:57 PMhappy-kitchen-89482
03/27/2024, 4:58 PMastonishing-river-87155
03/27/2024, 7:07 PMcurved-manchester-66006
03/27/2024, 7:11 PMIs there anything I can do to make Python dependency inference faster on a cold boot?The cold performance is a CI specific concern, correct? Or are you seeing the local
pantsd
cache not help on your workstation.
A lot of that dependency installation time comes building and installing wheels which do not have wheels available on PyPI. These also aren't being cached on our remote caching provider. Do we have the option to remotely cache wheels that are built as part of a build?To solve unrelated problem of people trying to develop on an OS (mac!) that doesn't match the deployment target (Linux), we pre-build wheels for all 3rdparty dependencies. This incidentally sidesteps the problem you described.
Does anyone know why it takes so long to make the .pex file for our requirements set? I would expect it to take less time to essentially copy files around and pack a venv into a file.I'm in ML-land with lots of crazy huge wheels so my intuition is for that operation to be slow!
happy-kitchen-89482
03/27/2024, 7:39 PMastonishing-river-87155
03/27/2024, 7:40 PMastonishing-river-87155
03/27/2024, 7:40 PMThe cold performance is a CI specific concern, correct?Yep, just cold performance. We keep pantsd alive between runs and it is typically pretty quick afterwards. Maybe we could warm a machine before marking it as "ready," but then we just make people wait for available compute instead of waiting for tests.
we pre-build wheels for all 3rdparty dependenciesYeah I've been thinking about this already. We don't have a particularly mature package management ecosystem, so it would take a non-zero amount of work to set this up. Still something we should do eventually.
astonishing-river-87155
03/27/2024, 7:58 PMastonishing-river-87155
03/27/2024, 8:00 PMhappy-kitchen-89482
03/27/2024, 8:24 PMhappy-kitchen-89482
03/27/2024, 8:24 PMhappy-kitchen-89482
03/27/2024, 8:25 PMhappy-kitchen-89482
03/27/2024, 8:25 PMastonishing-river-87155
03/27/2024, 9:24 PM34722
python files, at least according to scc
astonishing-river-87155
03/27/2024, 9:25 PM