Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

containers - set .cache dir for python libraries #446

Open
qaixerabbas opened this issue Aug 29, 2023 · 0 comments
Open

containers - set .cache dir for python libraries #446

qaixerabbas opened this issue Aug 29, 2023 · 0 comments

Comments

@qaixerabbas
Copy link

I am working on a voice transcription project and using AWS Lambda for deployment. I am trying to run a voice transcription model in AWS Lambda. I am using few third party libraries that use their cache dir but in Lambda that path is read only.

How can I set a single cache dir for all the possible libraries so I can use Lambda's /tmp for storing cache. I do not want to set path for each library I want to set a single cache dir for all libraries. How can I do this? I know I can use following two methods for individual libraries for setting cache directories.

in Docker file:

ENV LIBRARY_CACHE_DIR /tmp/library_cache

In Python Code:
os.environ['LIBRARY_CACHE_DIR'] = '/tmp/library_cache'

Issue with this approach is that I do not know in advance what libraries are required by my current third party libraries. If I have 1 or 2 libraries I can set their cache dir easily. But I am facing issues with multiple libraries. I have to set path for each library and test on Lambda. So I was thinking is there any way so that all the libraries cache dir is set via single command?

@mwunderl mwunderl changed the title How to set .cache dir for python libraries in AWS Lambda environment containers - set .cache dir for python libraries Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant