I have some largish files in S3 - up to 40G
I want to set multiple containers to work on each file using AWS Batch - each container will take a smallish slice of the larger file and analyse it, returning it's small chunk of results to S3.
Because of the size, I don't want to retrieve an individual copy of the large file for each and every container.
Because I'm using AWS Batch, the number of underlying servers and there individual sizes is not necessarily known ( it depends on spot pricing), so pre-copying of all raster to all servers isn't a good option.
At some point a container will be tasked to process chunk of a file which is not yet on the local volume - it's easy to copy it across, the problem is, what happens when 2 or more containers find that the file isn't there and start to copy it over at the same time?
So, my question is 'What is the best pattern to use to ensure that the file each container needs is available on a shared volume on the host that that particular container is running on, without creating race conditions and container inter-dependencies?'
TIA Simon