Make sure /home/venv is writeable by model-server user in dev docker image #1514
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR moves the creation of the virtualenv to a place where we can change the owner to model-server without creating another layer. This ensures that users of the docker image can install packages without changing to root user.
Fixes #(issue)
#1499
Type of change
Please delete options that are not relevant.
Feature/Issue validation/testing
Please describe the tests [UT/IT] that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.
Test A
Build docker with:
./build_image.sh -bt dev
Start docker:
docker run -ti --rm docker.io/pytorch/torchserve:dev-cpu bash
model-server@90d7c57df607:~$ ls -la /home/
total 16
drwxr-xr-x 1 root root 4096 Mar 16 01:09 .
drwxr-xr-x 1 root root 4096 Mar 16 02:21 ..
drwxr-xr-x 4 model-server model-server 4096 Mar 16 01:09 model-server
drwxr-xr-x 6 model-server root 4096 Mar 16 01:07 venv
Run pip install [any package] to test if installing packages works
Test B
Logs
Checklist: