pypiserver / pypiserver

Minimal PyPI server for uploading & downloading packages with pip/easy_install

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

After using the local installation package under docker mapped packages, no package file is found

zhenzi0322 opened this issue · comments

After using the local installation package under docker mapped packages, no package file is found

Hi @zhenzi0322! Thanks for reporting the issue! It's unfortunate that you're having some problems with pypiserver. Could you share what command are you using the start the pypiserver docker and how are you searching for the package? If you see any warning/error messages in the container logs, they are also very relevant. This will help a lot to identify what could be the source of the problem. ✌️ :)

Hi @zhenzi0322! Thanks for reporting the issue! It's unfortunate that you're having some problems with pypiserver. Could you share what command are you using the start the pypiserver docker and how are you searching for the package? If you see any warning/error messages in the container logs, they are also very relevant. This will help a lot to identify what could be the source of the problem. ✌️ :)

image

Hi @zhenzi0322! Thanks for reporting the issue! It's unfortunate that you're having some problems with pypiserver. Could you share what command are you using the start the pypiserver docker and how are you searching for the package? If you see any warning/error messages in the container logs, they are also very relevant. This will help a lot to identify what could be the source of the problem. ✌️ :)

image

Hi @zhenzi0322, thanks a lot for the screenshot! This shows that the server has booted well. That's good news. Could you show the command you use to start this docker container though? Something like docker run ...., or if you are using docker compose could you provide a snippet where you configure pypiserver as a service in docker-compose.yml (or similar file)?

Hi @zhenzi0322! Thanks for reporting the issue! It's unfortunate that you're having some problems with pypiserver. Could you share what command are you using the start the pypiserver docker and how are you searching for the package? If you see any warning/error messages in the container logs, they are also very relevant. This will help a lot to identify what could be the source of the problem. ✌️ :)

image

Hi @zhenzi0322, thanks a lot for the screenshot! This shows that the server has booted well. That's good news. Could you show the command you use to start this docker container though? Something like docker run ...., or if you are using docker compose could you provide a snippet where you configure pypiserver as a service in docker-compose.yml (or similar file)?

docker run -itd -p 88:8080 -v /home/xx/xx/packages:/data/packages --name pypiserver pypiserver/pypiserver:latest

Great, thanks for sharing, @zhenzi0322. I will try to reproduce this locally to see what can be going wrong and will come up with some suggestions. I will keep you updated!

Ok.

Great, thanks for sharing, @zhenzi0322. I will try to reproduce this locally to see what can be going wrong and will come up with some suggestions. I will keep you updated!

What's the progress so far?

Hello @zhenzi0322! Sorry for taking a long time, I've managed to create a simple setup trying to reproduce your issue and I have the following observations:

  1. Double check that the packages are uploading to your pypiserver correctly
    In the docker command you provide, you don't specify any authentication details. AFAIK, pypiserver by default will protect the upload and require authentication. If the uploads fail here, you should get a response with a 401 status code. Then you have two options:
    1. create an auth file as described here - something like docker run -p 80:8080 -v ~/.htpasswd:/data/.htpasswd pypiserver/pypiserver:latest -P .htpasswd packages
    2. explicitly override the authorization parameters with -P . -a ..
      Then you can upload your packages without any username or password.
      Starting the docker container with docker run -itd -p 88:8080 ... pypiserver/pypiserver:latest -P . -a .
      I have tested both approaches, and they work, with the uploaded packages showing up in the specified directory, resulting in a response with a status code 200.
  2. Double check the volume mapping specified for docker
    I have had a few troubles with this myself, but it is important to be precise in which paths are specified when starting the docker container. Make sure that the volume specification follows the expected pattern -v <part 1 - local>:<part 2 - container> where part 1 - local refers to a directory in your host file system, and part 2 - container - to the directory in the container. So if we map, say -v ~/.data/packages:/data/packages and all goes well, the uploaded packages that end up in /data/packages on the container side, will end up in ~/.data/packages in the local file system. This is where we should expect the upload results.

My replication package is here: https://github.com/dee-me-tree-or-love/pypiserver-local-docker-upload-example
Hope this helps! Let me know if any of this works for you.