witty-crayon-22786
09/13/2022, 7:14 PMsparse-lifeguard-95737
09/13/2022, 7:37 PMsparse-lifeguard-95737
09/13/2022, 7:41 PMdocker_image
target, but hit a wall because:
• there are so many dependencies to tailor and include on each image (we reuse the same assets for multiple apps)
• building the assets within docker was much less performant than building directly on the host (mainly because of the docker emulation perf on M1 macs)
I had the idea to string together yarn
commands in experimental_shell_command
targets to recreate the front-end build process. we’d still need to manually tailor file
targets for everything, but ideally only specify the dependencies once. and docker_image
s would depend on the final output of the shell commands instead of all the raw sourcessparse-lifeguard-95737
09/13/2022, 7:42 PMnode_modules/
so I might have hit a dead endsparse-lifeguard-95737
09/13/2022, 7:44 PMexperimental_shell_command
use-case I considered was injecting a docker pull
for each of our docker_image
targets, to improve our cache hit-rate. I never pursued the idea because I figured out a hack to wire in buildx’s --build-from
support to get remote caching theresparse-lifeguard-95737
09/13/2022, 7:48 PMexperimental_shell_command
also isn’t very asdf
-friendly - to run yarn
(which we install via asdf
) I had to add these tools
:
bash
basename
dirname
sed
uniq
cut
awk
grep
head
tr
readlink
uname
and these `extra_env_vars`:
ASDF_DIR
HOME
and a dependency on //.tool-versions
I’m not sure if it’s on Pants to make asdf
Just Work, but it is a surprising mismatch to have dedicated support for it at the bootstrapping layer and not in process executionwitty-crayon-22786
09/13/2022, 8:02 PMI’ve primarily been trying to use it to work around other not-yet-implemented features in Pants 🙂yea, that’s definitely the intent. we’d like it to be possible to get JS applications packaged this way.
witty-crayon-22786
09/13/2022, 8:04 PMmy proof-of-concept showed that it’s possible to set this up, but still a bit messy. and I hit https://github.com/pantsbuild/pants/issues/16825 for a command that produced a bigi’ll take a look at this one…. getting a profile while it’s running would be helpful, but it sounds like it might have been capturing theso I might have hit a dead endnode_modules/
node_modules
into a snapshot? that was the goal, i assume?
if you capture a zip/tar file as the output of the process instead, does performance get better?witty-crayon-22786
09/13/2022, 8:17 PMsparse-lifeguard-95737
09/13/2022, 8:50 PMwitty-crayon-22786
09/13/2022, 9:14 PMsparse-lifeguard-95737
09/13/2022, 9:20 PMwitty-crayon-22786
09/13/2022, 9:28 PMwitty-crayon-22786
09/14/2022, 8:30 PMI assume that you are running with(the default)? If so, you might try capturing another trace withcache_content_behavior="fetch"
to see how much of a difference that makes. If it’s significant, we can probably adjust that codepath to unconditionally usecache_content_behavior="validate"
for a local cache.validate
sparse-lifeguard-95737
09/14/2022, 8:45 PMwitty-crayon-22786
09/14/2022, 8:56 PMwitty-crayon-22786
09/14/2022, 8:57 PMsetup_sandbox
workunit is still a mystery, but we can fix this bit.witty-crayon-22786
09/14/2022, 9:11 PMsparse-lifeguard-95737
09/15/2022, 3:10 PMyarn install
so nothing really proprietary about it AFAIK. will try to put something togetherwitty-crayon-22786
09/15/2022, 3:43 PMwitty-crayon-22786
09/15/2022, 3:43 PMsparse-lifeguard-95737
09/15/2022, 6:07 PMsparse-lifeguard-95737
09/15/2022, 6:08 PM.tar.gz
’d the node_modules/
output dir things would drastically improvesparse-lifeguard-95737
09/15/2022, 6:09 PMsparse-lifeguard-95737
09/15/2022, 6:20 PMsparse-lifeguard-95737
09/15/2022, 6:20 PM