Open viktor-yunenko opened 4 years ago
The issue remains and the situations worsens - I'm finding more packages that aren't installable from pypi every other week.
@GaretJax could you give us a helping hand? We dont know whats hitting us here.
Can we do something to invalidate the cache or add a specific version or package to the cache? Or is the problem completely elsewhere?
if we just use pip-tools in the Dockerfile: HTTPError: 500 Server Error on deployment
We need the requirements.txt
and requirements.in
files to help you out.
If you want to stop using the wheelsproxy, it's enough to:
pip-reqs
command from your DockerfileBeside "caching", using the wheelsproxy has a lot of advantages:
pip install requirements.in
could lead to the installation of packages with conflicting dependencies)If there are other packages failing to install from the wheelsproxy, please let me know. To help you out quickly, we need to know the package/version and in case of 500s, also a copy of the requirements.in/requirements.txt files.
In general, the wheelsproxy is a pypi-compatible index and you can browse it yourself at:
https://wheels.aldryn.net/v1/INDEXES/IMAGE/+simple/PACKAGE/
where INDEXES is a +
separated list of indexes to use (by default aldryn-extras+pypi
), IMAGE is the base image in use (e.g. aldryn-baseproject-v4-py36
) and PACKAGE is the package name. For example:
https://wheels.aldryn.net/v1/aldryn-extras+pypi/aldryn-baseproject-v4-py36/+simple/django/
Oh, just to add, usage of the wheelsproxy should be completely optional and if something is not working without it, we shall fix it. ;-)
Thank you @GaretJax for your quick reply, it's much appreciated!
I also had such a problem with a fresh version I released to pypi, it was subsequently not available within 1-2h so I switched to using the gitlab repo URL directly. Is there a delay and if yes what would be a normal delay in hours or days?
@victor-yunenko can you please list any other packages here that cause problems in case there are any remaining?
There can be a delay, but it should be in the order of minutes (with the normal case being < 1 minute).
There is from time to time a longer delay caused by PyPI's CDN not picking up new packages quickly enough, but we should have workarounds for that as well.
Feel free to ping us in such cases.
Another thing @macolo, we always pick the source distribution (.tar.gz
) even for packages with wheels available. There are some packages which don't publish any source distribution at all (only wheels) and these result in the releases not being available via the wheelsproxy.
Hi @GaretJax, thank you for following up on this.
It probably became unclear now, but initially this ticket was raised as a summary of my conversations with Daniele.
If you want to stop using the wheelsproxy, it's enough to:
Remove the pip-reqs command from your Dockerfile Remove and INDEX_URLs env vars you may still have in your dockerfile.
Basically that's what we tried with Daniele back then, in various combinations, few notes that I left:
In the meantime I tried to remove pip-reqs in my base image - https://gitlab.com/what-digital/djangocms-template/-/blob/divio/base.Dockerfile
Now all the package are installed normally. Docker build runs without issues locally. But divio deployment fails without an error message. Are there any ways of removing pip-reqs? I've been resolving issues with it before, would be very nice to utilize pip-tools instead.
Attaching the last deployment logs below:
===== docker migrate release ===== [...] ----> python manage.py cms fix-tree fixing page tree fixing plugin tree all done
This also happens when the ENV commands in docker are placed after pip install. Again it builds fine locally.
As an experiment I tried to do that again on another project, but I'm seeing the similar outcome, where the deployment fails without an error after:
fixing page tree
fixing plugin tree
all done
Perhaps there's something I can do to avoid that problem?
I would be happy to stay with pip-reqs, but over the last years the amount of problems with it has been rather problematic. Personally I can handle it well, but when I find out that a new to divio developer quitely spent a whole day - or sometimes several days - on trying to install few packages - the impact of those issues on the given project's schedule and budget becomes highly salient.
Here are the files from my last attempt of disabling pip-reqs:
Perhaps there's an existing project that was able to disable them successfully?
I will have to look into it, but my first guess would be to say that the version of uwsgi from PyPI is not built with support for some required lib. On the wheels proxy we build it with:
printf '[uwsgi]\nmain_plugin=python,gevent,emperor_pg\ninherit = base\nbin_name = uwsgi' >/tmp/profile.ini
export UWSGI_PROFILE=/tmp/profile.ini
pip-reqs is not doing anything at startup, as such if you try to run your images in live mode locally (or look at the runtime logs, not the deployment logs, when your deployment fails without message) you may be able to see the cause of the issue, as it seems that the server fails to start.
@GaretJax we have a couple of packages that are missing in the wheels proxy:
@GaretJax FYI this might be related to the following (from Dennis):
It looks like you are using a python 3.6 package registry on a new python 3.7 image. You have to use https://wheels.aldryn.net/v1/aldryn-extras+pypi/stretch-py37/+simple/ instead of https://wheels.aldryn.net/v1/aldryn-extras+pypi/aldryn-baseproject-v4-py36/+simple/ We are not pulling docker images in regular intervals so it is strongly advised to not pin the base image to latest in the Dockerfile and use a proper version (e.g. 1.1.2 )instead.
Note: about a month ago the error messaging in pip-reqs has been improved by @kinkerl - it should be much more speaking now when there are problems with packages in requirements.txt.
pip-tools wheels repository
Resources
Description
The caching can be out of date for 1 week, but eg boto package is 2 years behind pypi.org.
I think the 500 server error during deployment (related to pip-reqs) used to disappear after 1-3 days, but now it doesn't.
In other cases a package building error might be raised only inside docker with custom wheels (django-spurl 0.6.6), or a package version added by pip-reqs won't exist on pypi.org (django-standard-form 1.1.3). This is the case for djangocms-socialshare 1.0.0.0, only an older version is accessible.
Initial debugging log
I've been having an odd issue with deployments probably during the last 2 weeks:
For example the following project had no changes in its dockerfile, but the deployment stopped working this morning (working at midnight) - https://control.divio.com/control/6065/edit/78738/
My dockerfiles can be seen below:
Source of the problem
I just tracked down the problem to a pypi package - https://pypi.org/project/djangocms-aldryn-forms-bootstrap4-templates/#history
The projects that are working use 1.0.0.1, but I need 1.0.0.2. It appears that divio is using a separate pypi repository that has 1.0.0.1, but not the latest version?
Few hours ago we had another problem with pip-reqs on another project, it started failing because one of the package - poetry - didn't work when installed through pip-reqs, standard pip install is working within the docker, we added
RUN pip install poetry
to Dockerfile.In the meantime I tried to remove pip-reqs in my base image - https://gitlab.com/what-digital/djangocms-template/-/blob/divio/base.Dockerfile
Now all the package are installed normally. Docker build runs without issues locally. But divio deployment fails without an error message. Are there any ways of removing pip-reqs? I've been resolving issues with it before, would be very nice to utilize pip-tools instead.
Attaching the last deployment logs below:
This also happens when the
ENV
commands in docker are placed afterpip install
. Again it builds fine locally.boto python package
On another project boto 2.49 can't be found during divio deployment, while it was pushed to pypi.org back in 2018. The deployment error:
django-spurl
Version 0.6.6 isn't installable by divio pip-reqs. Version 0.6.5 works.