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

PACKAGE_BASE_DIR sometimes can't be created in user folder #481

Open
mincomp opened this issue Mar 9, 2021 · 2 comments
Open

PACKAGE_BASE_DIR sometimes can't be created in user folder #481

mincomp opened this issue Mar 9, 2021 · 2 comments

Comments

@mincomp
Copy link

mincomp commented Mar 9, 2021

Bug

When bootstrapping Neuropod Python models, pip packages would be installed in the "current user" folder, which might be readonly (which is typical in production docker environment).

PACKAGE_BASE_DIR = os.path.abspath(
    os.path.expanduser(
        "~/.neuropod/pythonpackages/py{}{}/".format(
            sys.version_info.major, sys.version_info.minor
        )
    )
)

To Reproduce

Steps to reproduce the behavior:

Create a Neuropod python model and make inference in the user folder which is read only. model bootstrap will fail.

Environment

  • Neuropod Version 0.3.0 rc1:
  • Linux:
  • Language (Python):
@mincomp
Copy link
Author

mincomp commented Mar 9, 2021

think we can simply change it to /tmp/.neuropod/pythonpackages/py{}{}/ any concerns?

@VivekPanyam
Copy link
Collaborator

Thanks for the bug report!

The purpose of the ~/.neuropod/pythonpackages/py{}{}/ directory is to store model dependencies (installed from pypi) so we don't need to reinstall packages every time a given model is loaded.

This is especially important for large pip packages (e.g. torch, tensorflow).

Moving this dir under /tmp by default partly defeats its purpose as these dependencies won't be available across restarts, etc.

I think it makes sense to allow the location of this directory to be configurable with an environment variable though.

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

2 participants