better-nail-12700
06/10/2020, 7:53 PM.cache
and .pants.d
directories from one CI pipeline to the next. However, we are now facing the issue that the .pants.d
directory regularly grows to 15+GB, which is a lot to download/upload in each CI stage and we are actually running into disk space issues with shared Gitlab runners. Does someone know if there is a way to purge or clean the cache directories without losing the ability to only rebuild the changed projects within the monorepo? We've naively tried to only persist the .cache
directory from one run to the next, however, that lead to every project being rebuilt in every CI run. Any help or input would be appreciated!witty-crayon-22786
06/10/2020, 7:55 PMwitty-crayon-22786
06/10/2020, 7:56 PM.cache
directory might not be getting much.fast-nail-55400
06/10/2020, 7:57 PMwitty-crayon-22786
06/10/2020, 7:58 PM--cache-read-from="['<str>', '<str>', ...]" (default: [])
The URIs of artifact caches to read directly from. Each entry is a URL of a RESTful cache, a path of a filesystem cache, or a pipe-separated list of alternate caches to choose from. This list is also used as input to the resolver. When resolver is 'none' list is used as is.
directory?witty-crayon-22786
06/10/2020, 7:58 PMwitty-crayon-22786
06/10/2020, 7:59 PMbetter-nail-12700
06/10/2020, 8:05 PM--cache-read-from
param. However, if my understanding is correct, Pants will default to the .cache
and .pants.d
directory to store dependencies and intermediary build artifacts. We are manually persisting those two directories between pipeline runs. The .cache
directory is actually not too big, however, .pants.d
grows to very large sizes. We are using Pants version 1.26.0.witty-crayon-22786
06/10/2020, 8:06 PM--cache-read-from
option has a default value (although you cannot tell it from the docsite! oy). can check that you’re caching the right thing by running something like ./pants options | grep 'cache.*read.*from'
better-nail-12700
06/10/2020, 8:07 PM.pants.d
are python-setup
and pyprep
if that is relevant informationwitty-crayon-22786
06/10/2020, 8:07 PMbetter-nail-12700
06/10/2020, 8:07 PMcache.read_from
points to the correct .cache
directorywitty-crayon-22786
06/10/2020, 8:07 PMwitty-crayon-22786
06/10/2020, 8:07 PMwitty-crayon-22786
06/10/2020, 8:08 PMbetter-nail-12700
06/10/2020, 8:09 PMwitty-crayon-22786
06/10/2020, 8:09 PMbetter-nail-12700
06/10/2020, 8:09 PMwitty-crayon-22786
06/10/2020, 8:09 PM.pants.d/build_invalidator
directorywitty-crayon-22786
06/10/2020, 8:10 PM.pants.d
directory isn’t really supposed to be a public api… so i can’t really recommend trying to cache portions of itwitty-crayon-22786
06/10/2020, 8:11 PMbetter-nail-12700
06/10/2020, 8:13 PMwitty-crayon-22786
06/10/2020, 8:14 PMwitty-crayon-22786
06/10/2020, 8:16 PMwitty-crayon-22786
06/10/2020, 8:19 PMbetter-nail-12700
06/10/2020, 8:20 PMpantsbuild.pants.contrib.node
to build an Angular app inside our monorepo with pants, however, we could theoretically build that outside of Pantswitty-crayon-22786
06/10/2020, 8:22 PMbetter-nail-12700
06/10/2020, 8:27 PMwitty-crayon-22786
06/10/2020, 8:28 PM1.28.0
… it has reasonably good support for v2witty-crayon-22786
06/10/2020, 8:29 PM1.29.0
will likely be released this week… it’s currently on rc3witty-crayon-22786
06/10/2020, 8:30 PMbetter-nail-12700
06/10/2020, 8:30 PMdynamic_ui
setting in pants.toml which seems to be not supported by 1.28.witty-crayon-22786
06/10/2020, 8:31 PMwitty-crayon-22786
06/10/2020, 8:31 PMv2_ui
in 1.28, with a deprecation at 1.29.better-nail-12700
06/10/2020, 8:31 PMbetter-nail-12700
06/10/2020, 8:31 PMwitty-crayon-22786
06/10/2020, 8:31 PMwitty-crayon-22786
06/10/2020, 8:32 PMwitty-crayon-22786
06/10/2020, 8:33 PMbetter-nail-12700
06/10/2020, 8:34 PMhundreds-father-404
06/10/2020, 9:06 PMbetter-nail-12700
06/10/2020, 9:14 PMModuleNotFoundError: No module named 'pkg_resources'
better-nail-12700
06/10/2020, 9:15 PMhundreds-father-404
06/10/2020, 9:16 PMpkg_resources
? Do you have setuptools
in your requirements.txt
already?happy-kitchen-89482
06/10/2020, 9:16 PMhundreds-father-404
06/10/2020, 9:17 PMbetter-nail-12700
06/10/2020, 9:40 PMpkg_resources
. I've added setuptools to the requirements.txt, but that did not do the trick 🤔better-nail-12700
06/10/2020, 9:41 PMtrafilatura
that's causing the issuehundreds-father-404
06/10/2020, 9:41 PMpython_tests
target or whichever target uses that problematic third party library. For example, if your requirements.txt is located at 3rdparty/python
, then add to the dependencies
field 3rdparty/python:setuptools
hundreds-father-404
06/10/2020, 9:44 PMThe package is trafilatura that’s causing the issueIt’s common for open source projects to leave off
setuptools
as a dependency, and almost always it’s an oversight. Fairly easy to fix. See https://github.com/pytest-dev/pytest-rerunfailures/pull/98 for an example if you’d be interested in making a contribution to the trafilatura
projectbetter-nail-12700
06/10/2020, 10:08 PM