Open pkienzle opened 5 years ago
Trac update at 2018/03/05 23:43:57
: pkienzle commented:
For now put compiled models in ~/.sasmdoels/compiled_models
like happens in windows.
Consider other locations.
And still, consider the problem of plugin name collision.
sasmodels uses a number of environment variables to control file locations. Check that the defaults are sensible. https://github.com/SasView/sasmodels/blob/9fac5f5b2fd6a440d3b4df58c692047b489d5ba3/sasmodels/compare.py#L116
dlls are in SAS_DLL_PATH: https://github.com/SasView/sasmodels/blob/9fac5f5b2fd6a440d3b4df58c692047b489d5ba3/sasmodels/kerneldll.py#L109
opencl cache is in XDG_CACHE_HOME (linux only): https://github.com/SasView/sasmodels/blob/9fac5f5b2fd6a440d3b4df58c692047b489d5ba3/sasmodels/compare.py#L119
Don't know where pycuda caches its files, but it is the same author as pyopencl, so probably a similar location.
Adding md5 sum to the file name changes the problem a bit (#212, #218). Then a hostile user can put a corrupted .so file in the public space which matches the hash of another users model. Next time that user runs the model the corrupted code is run. So, put models in private space and have each user compile their own.
Could each sasview session create its own sub-directory for compiled models, then delete it when the session ends? - thus not clogging up our hard drives for ever more with old compiled code.
I have several times had issues on WIndows (OK messing around with developer stuff) when I have had to delete all the .so, but even then have had one locked by another sasview session; also had to do likewise when hopping between 32 & 64 bit versions.
On a linux system the compiled models are placed in
/tmp/MODELNAME.so
. If one user creates a model and another user updates it, there will be a permission collision.Also, what happens to the .so if the plugin model has the same name as a builtin model?
Migrated from http://trac.sasview.org/ticket/1078