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

restart container tries to install packages again #28

Open
hemna opened this issue Mar 27, 2020 · 2 comments
Open

restart container tries to install packages again #28

hemna opened this issue Mar 27, 2020 · 2 comments
Labels
question Further information is requested

Comments

@hemna
Copy link

hemna commented Mar 27, 2020

I have a custom sopel module that I wrote and am using this container to run sopel.
When I restart the container, it tries to re-install my package that I have specified in EXTRA_PYPI_PACKAGES=sopel-modules.tableflip

That results in an error starting the container.
this container should only try to install packages on first run, not on restarts.

pewp    | Installing collected packages: sopel-modules-tableflip
pewp    | ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/home/sopel/.local/lib/python3.8/site-packages/sopel_modules.tableflip-0.1.2-py3.8-nspkg.pth'
pewp    | Check the permissions.
pewp    |
pewp    | FAILED!
pewp exited with code 1```

@HumorBaby
Copy link
Contributor

Currently the container "tries to reinstall" packages on each startup for simplicity. pip should not complain about packages that exist already; instead it should just move on with a simple Requirement already satisifed: ... message with minimal overhead.

Can you provide more details on your setup? I am unable to recreate this issue on a fresh sopelirc/sopel:6.6.9 container with EXTRA_PYPI_PACKAGES=sopel-modules.tableflip with multiple restarts of the same container.

The permission error you show suggests that this may be a result of how you are handling/mounting volumes.

  • are you mounting any part, or the whole, sopel user home directory? It definitely makes sense to treat the ~/.sopel directory as a separate volume, but including things that are highly variable, e.g., ~/.local (by mounting the entire home directory) can lead to issues like this.

  • did you install a development version of your plugin (e.g., via setup.py install develop or even pip install -e ...) into this container/mounted volume? If so, did you do it as the container's sopel user? If not, did the UID/GID of the other user (external/insider container) match the sopel user in the container?

  • did you change owner UID/GID for a mounted volume after the initial container startup? check/update/fix ownership of /home/sopel/.local/lib/python3.8/... in the container (or in your mount source) to match the sopel user in the container

P.S., sorry for the extreme delay in getting to this issue!! 😬

@HumorBaby HumorBaby added the question Further information is requested label May 1, 2020
@hemna
Copy link
Author

hemna commented Jun 4, 2020

Here is a copy of my docker-compose.yml

version: '3.3'

services:
  pewp:
    image: sopelirc/sopel:latest
    container_name: pewp
    volumes:
      - /opt/docker/pewp/default.cfg:/home/sopel/.sopel/default.cfg
      - /opt/docker/pewp/requirements.txt:/pypi_packages.txt
    environment:
      - EXTRA_PYPI_PACKAGES=sopel-modules.tableflip
      - EXTRA_APK_PACKAGES=git
      - PUID=1000
      - PGID=1000
cat /opt/docker/pewp/requirements.txt
git+https://github.com/hemna/sopel-tableflip.git#egg=sopel-tableflip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants