It is created by dask.distributed wherever you start LiberTEM - it should instead be created in a fixed location (~/.cache? Mac OS X / Win?)
@sk1p what is in that folder?
Did some research:
https://github.com/dask/distributed/pull/1543
https://stackoverflow.com/questions/48657374/what-is-the-default-directory-where-dask-workers-store-results-or-files
https://distributed.readthedocs.io/en/latest/worker.html#spill-data-to-disk
https://github.com/dask/distributed/issues/1540
https://github.com/dask/distributed/issues/2113
Is this a different directory?
https://github.com/dask/dask/issues/1659
Deactivate dumping data there. I guess we should do that because we read from files anyway and it should never be necessary, if I understand correctly. I'd rather have workers die than clutter disk space.
http://dask.pydata.org/en/latest/setup/hpc.html#no-local-storage
So that would mean:
What about using %TEMP%\libertem\dask on Windows? That expands to C:\Users\<user>\AppData\Local\Temp\libertem\dask on my system (Windows 10).
On Unix this sounds like a job for a private subdirectory in /tmp/, I guess?
http://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s18.html
Or maybe this is relevant? https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
I'm not sure if the current behavior of dask to just use the working directory to store large intermediate data is what the user would expect. IMO it should by default just use a normal temporary directory for locking or small data and throw an error if it runs out of memory. The "out of memory" error message could contain a helpful suggestion to specify a folder for large intermediary data IF that is what the user wants.
Probably what you want to use here is the tempfile module:
https://docs.python.org/3/library/tempfile.html#tempfile.TemporaryDirectory
Thanks @robbmcleod - I wasn't aware of the TemporaryDirectory class. It appears to be a nice, modern approach to mkdtemp! Temporary storage should also work nicely (always supports locking AFAIK), at least for our case of no spilling.
There is also https://pypi.org/project/appdirs/ - specifically user_cache_dir
+1
This is also an issue for read-only container images.
Closed via #345