broad-processor-92400
11/28/2022, 1:47 AMpackage
-able Python targets: mostly python_awslambda
but some pex_binary
too. We run ./pants package ::
in CI to validate that they're all packageable, but this ends up spending a lot of time bundling up requirements (~10s per target, as a rule of thumb), and thus it'd be nice to make this faster. I've made two observations:
1. changing our code without changing the dependency structure seems to require repackaging the dependencies from scratch (I ran ./pants package ::
before modification locally, made the change, and then ./pants package ::
after, with the same pantsd process)
2. multiple targets that have the same set of requirements seem to build their requirements separately (more details in thread)
Is this expected behaviour? Any tips for improving it?broad-processor-92400
11/28/2022, 1:48 AMfirst.zip
and second.zip
) that use the same dependencies:
22:39:03.55 [INFO] Starting: Building 16 requirements for first.zip from the 3rdparty/python/default.lock resolve: asyncpg==0.27.0; python_version >= "3.9" and py... (1124 characters truncated)
22:39:12.91 [INFO] Completed: Building 16 requirements for first.zip from the 3rdparty/python/default.lock resolve: asyncpg==0.27.0; python_version >= "3.9" and py... (1124 characters truncated)
22:39:22.45 [INFO] Starting: Building 16 requirements for second.zip from the 3rdparty/python/default.lock resolve: asyncpg==0.27.0; python_version >= "3.9" and python... (1120 characters truncated)
22:39:31.71 [INFO] Completed: Building 16 requirements for second.zip from the 3rdparty/python/default.lock resolve: asyncpg==0.27.0; python_version >= "3.9" and python... (1120 characters truncated)
• Based on the timestamps these builds are running sequentially (i.e. it doesn't seem like there'd be concurrency issues that inhibit cache usage)
• Both steps take ~9 secondshappy-kitchen-89482
11/29/2022, 1:38 AMhappy-kitchen-89482
11/29/2022, 1:38 AMhappy-kitchen-89482
11/29/2022, 1:39 AMhappy-kitchen-89482
11/29/2022, 1:40 AMbroad-processor-92400
11/29/2022, 1:52 AMhappy-kitchen-89482
11/29/2022, 4:50 AMhappy-kitchen-89482
11/29/2022, 4:51 AMhundreds-father-404
11/29/2022, 1:50 PMpackage
is our slowest Python goal because it builds a single PEX with both source files and requirements in the same thing. Normally we use a dedicated requirements.pex and then loose source files so that changes to source code don't result in needing to build any new pexhappy-kitchen-89482
11/29/2022, 6:39 PMbroad-processor-92400
11/29/2022, 7:11 PMbroad-processor-92400
11/29/2022, 7:12 PM