Skip to content

containers - set .cache dir for python libraries #446

Open
@qaixerabbas

Description

@qaixerabbas

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions