I am getting a read-only error when running pystan3 build() in a UDF.
I think the issue is related to the location that the code is being run from, which is read-only. I am looking to set a custom cache location to be set. Anyone can help?
Hi,
httpstan (which does the caching) uses appdirs
Then you can follow appdirs user_cache_dir logic.
Are you running on Linux or something else?
Thank you for the respond.
Yes I am running on Linux.
I followed your suggestion and was able to change the cache_directory by setting
os.environ[“XDG_CACHE_HOME”] = “/tmp/httpstan-cache”.
My question is if it is possible to write the model cache to another file system. We are using databricks clusters and by using UDF, it tries to write the model cache on the worker node directory which we dont have write access, I am trying to set this cache model directory to a DBFS, is there any functionality for that?
I see Path().mkdir() is used in httpstan.models.build_services_extension_module.
Can you compile your models before calling UDF?
Yes, without UDF it works fine.
So maybe try to compile first with some global directory, then on each node either use this directory as a ref or copy them to local space?
I assume you have a wrapping function that does call pystan, so this config could be done there?