The symlinked immutable venv is mentioned to be ca...
# general
h
The symlinked immutable venv is mentioned to be cacheable. Does this mean we can store it in a remote cache?
Simply by turning on remote cache read/write settings to an appropriate remote store address I mean
From my experimentation, it doesn't seem like it interacts with the remote cache
Not the best at reading the source code, but I do see the
PER_SESSION
cache scope configuration here
I guess I don't need the symlinked venv to be the thing that's cached and I'm likely confusing the intent of that feature
I more just want to not have ephemeral CI runners rebuild pexes every time they want a virtual environment
Getting all our CI runners off using virtual environments is a longer effort
So I guess the last part of this investigation is why is making a venv so slow when I don't have any local cache. I can see if I point to a silly remote cache that there are errors about it being unreachable. So I know it's reaching out to the remote cache for something.
Successive
pants export
calls are very fast, but if I blow away local cache and rerun that part is always slow
I can see this venv pex being successfully remotely cached and retrieved. Why might it be taking 6 minutes to retrieve something?
Copy code
15:47:12.93 [DEBUG] remote cache hit for: "Build pex for resolve `python-default`" digest=Digest { hash: Fingerprint<b2adbffc0781dde3e3b2cac57273c63e3bd151c094418b64ab9dfeb181a4b2c5>, size_bytes: 142 } response=FallibleProcessResultWithPlatform { stdout_digest: Digest { hash: Fingerprint<e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855>, size_bytes: 0 }, stderr_digest: Digest { hash: Fingerprint<e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855>, size_bytes: 0 }, exit_code: 0, output_directory: DirectoryDigest { digest: Digest { hash: Fingerprint<7c1f0a76ba01093be9aef4811bdf1ce447533a9a579e09ce9ab4f6bd6c13e315>, size_bytes: 93 }, tree: "Some(..)" }, metadata: ProcessResultMetadata { total_elapsed: Some(Duration { secs: 356, nanos: 935175537 }), saved_by_cache: None, source: HitRemotely, environment: ProcessExecutionEnvironment { name: None, platform: Linux_x86_64, strategy: Local }, source_run_id: RunId(2) } }
c
Sorry if I"m misreading all of this, but isn't 935175537 nanoseconds < 1 second?
h
Yes
The
secs
field is
356
though
c
ah, thank you. (To your original question I don't have a good guess offhand)
h
I guess maybe I can approach this from another angle
I know that my vpn was throttling my connection speed to ~13 Mbps
So with that fetch time, it suggests that my file size was somewhere 500MB+
Does that sounds like right order of magnitude for a pex made by
pants export
?
I could convince myself of that if it's a large venv
c
500MB
I think Tensorflow or Pytorch alone is that size :-( So if you have a bunch of ML stuff I would believe it.
h
Any tricks to get the pex into
dist
that
pants export
makes?
Would be great to confirm the size manually
c
You might be able to spot it with
--keep-sandboxes=always