I think there may be a problem with using cloud storage. When a SpatRaster is stored with repository = "aws", for example, and a user tries to load it with tar_read() or tar_load(), I think what happens is the file is downloaded from AWS into tempdir()/_targets/scratch, then read in using the read function stored in format, then the file is deleted from the scratch dir once the target is loaded into memory. This means the SpatRaster object makes it into memory, but the file it points to is gone.
I've confirmed this behavior with a S3 bucket hosted on Jetstream2 and I can share (privately) the credentials for it if you'd like to test to confirm this.
I can't find an argument or option in targets that overrides this behavior, although I would have expected memory = "persistent" to maybe do something here.
I think there may be a problem with using cloud storage. When a SpatRaster is stored with
repository = "aws"
, for example, and a user tries to load it withtar_read()
ortar_load()
, I think what happens is the file is downloaded from AWS intotempdir()/_targets/scratch
, then read in using the read function stored informat
, then the file is deleted from the scratch dir once the target is loaded into memory. This means theSpatRaster
object makes it into memory, but the file it points to is gone.I've confirmed this behavior with a S3 bucket hosted on Jetstream2 and I can share (privately) the credentials for it if you'd like to test to confirm this.
I can't find an argument or option in
targets
that overrides this behavior, although I would have expectedmemory = "persistent"
to maybe do something here.