buildbuddy
buildbuddy copied to clipboard
Prevent delete_build_root_on_startup from wiping image cache
Running the executor with --executor.delete_build_root_on_startup
deletes the contents of --executor.build_root_directory
. This is where temporary files are stored (action workspaces, firecracker chroot dirs, etc.).
Unfortunately, this is also where cached firecracker / OCI images are stored (under an executor
subdir).
This PR adds a temporary fix for this issue which is to only delete the executor
directory if a separate flag executor.delete_image_cache_on_startup
is set.
Eventually, we should move persistent files and temporary files to separate directories. Ideally, cached artifacts would be somehow stored in filecache - this is a little tricky though because OCI image layers in particular are represented as extracted directories, not single files.