gorgeous-winter-99296
05/05/2023, 1:20 PMFailed to digest inputs: "Error storing Digest { hash: Fingerprint<30eeb2aa047b16db33b65652c344c6fa8c41c2e8f8d34741532b8b44f9d65227>, size_bytes: 2210641920 }: Input/output error"
The pex itself works fine using layout=packed, but an image layer has to be a .tar, which again breaks the digest. I've seen something called named caches in the code? Would that avoid this? Or do I need to do some ugly hack with splitting the file?bitter-ability-32190
05/05/2023, 1:55 PMnamed_caches
is something plugins get to use, and not users, unfortunately.
I'm curious if https://github.com/pantsbuild/pants/pull/18153 might work here. We now handle "large" files differently.
Can you try out Pants 2.17.0.dev4
or later?gorgeous-winter-99296
05/05/2023, 2:09 PMNot sure I understand! This would be used by a plugin/backend.is something plugins get to use, and not users, unfortunately.named_caches
gorgeous-winter-99296
05/05/2023, 2:10 PMgorgeous-winter-99296
05/05/2023, 2:38 PMbitter-ability-32190
05/05/2023, 2:45 PMnamed_caches
bitter-ability-32190
05/05/2023, 2:46 PMbitter-ability-32190
05/05/2023, 2:46 PMgorgeous-winter-99296
05/05/2023, 2:46 PMbitter-ability-32190
05/05/2023, 3:01 PMnamed_caches
is a performance hack, mostly. That part should probably be internalized. It isn't cached in terms of the Pants engine. That also means it doesn't participate in remote caching.
Under the hood, Process sandboxes whose Process
object has append_only_caches
entries get a symlink into the Pants cache named caches root (whatever the value of the global option is). And that's it. Enjoy the disk space and footgun.
What this means, in practice, for plugin authors is:
⢠You need to be completely sure the code you're running is 100% concurrency-proof. Usually this means writing to a tempfile and `rename`ing the temp file to the destination. (This also explains the named append_only_caches
, it's a hint that you probably don't want to try and edit/remove anything, as treationg is as append-only means you'll be concurrency-safe. In reality, do what you want, but be very sure_)_
⢠Likewise, ensure your code is kill-safe. Your process could be killed at any point, and can also be restarted (and in parallel). SO at any point in time, you must leave the cache "valid".
With those two in mind, if your Process
object is somehow creating this 2GB file (so it isn't coming from the input_digest
) then you could cp
it to a append_only_cache
in a temporary file, then rename
that file to the final destination. And then in every single Process
that could want the file, you'll need to pass the append_only_cache
and load the file from the symlink.
Does that make sense?bitter-ability-32190
05/05/2023, 3:01 PMgorgeous-winter-99296
05/05/2023, 3:04 PMoutput_dirs=...
, I'd write it to the named cache and pass around something that lets me retrieve it from the caches?bitter-ability-32190
05/05/2023, 3:04 PMappend_only_caches
bitter-ability-32190
05/05/2023, 3:04 PMProcess
that could want that value,gorgeous-winter-99296
05/05/2023, 3:07 PMbitter-ability-32190
05/05/2023, 3:08 PMgorgeous-winter-99296
05/05/2023, 3:11 PMbitter-ability-32190
05/05/2023, 3:11 PMbitter-ability-32190
05/05/2023, 3:11 PMgorgeous-winter-99296
05/05/2023, 3:13 PMgorgeous-winter-99296
05/05/2023, 3:14 PMgorgeous-winter-99296
05/05/2023, 5:10 PME Engine traceback:
E in `run` goal
E in Build OCI image
E in Resolve transitive targets
E in Resolve direct dependencies of target - tmpc2qc5x8d/oci:example
E in Inferring dependency from the pex_binary `entry_point` field
E in Creating map of first party Python targets to Python modules
E in Find all Python targets in project
E in Find all targets in the project
E in Finding files: **
E
E Exception: Failed to read link "/tmp/pants-sandbox-pSiPlO/.python-build-standalone": Absolute symlink: "/tmp/immutable_inputstGflKc/.tmpEYXnDy/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
Any thoughts? It seems like I can build images fine locally, but tests don't work... wondering whether it's something related to test/pants bootstrap in that situation.bitter-ability-32190
05/05/2023, 5:14 PMbitter-ability-32190
05/05/2023, 5:15 PMappend_only_cache
that uses that namegorgeous-winter-99296
05/05/2023, 5:22 PMbitter-ability-32190
05/05/2023, 5:22 PME in Finding files: **
bitter-ability-32190
05/05/2023, 5:23 PMgorgeous-winter-99296
05/05/2023, 5:24 PMbitter-ability-32190
05/05/2023, 5:34 PMpants.toml
or in a flag: https://www.pantsbuild.org/v2.17/docs/reference-global#pants_ignoregorgeous-winter-99296
05/05/2023, 7:03 PME Exception: Failed to read link "/tmp/pants-sandbox-jJqAyo/.cache/pex_root": Absolute symlink: "/home/runner/.cache/pants/named_caches/pex_root"
bitter-ability-32190
05/05/2023, 7:05 PMgorgeous-winter-99296
05/05/2023, 7:05 PMbitter-ability-32190
05/05/2023, 7:05 PMbitter-ability-32190
05/05/2023, 7:07 PMgorgeous-winter-99296
05/05/2023, 7:08 PMbitter-ability-32190
05/05/2023, 7:08 PMgorgeous-winter-99296
05/05/2023, 7:26 PMgorgeous-winter-99296
05/05/2023, 7:26 PMgorgeous-winter-99296
05/09/2023, 6:45 PMgorgeous-winter-99296
05/11/2023, 7:54 PMpackage
+ named caches? I just tried my "split tarballs" approach but it doesn't work because completed layers ends up over 2 G anyways. So now I'm eyeing named caches; but if that still has a 2GB limit due to needing a digest output I'm hardblocked until 2.17 is stabilized. š