Upload wheels before sdists

Bandersnatch and pypi have a failure case where uploading two files to
pypi very closely to each other results in bandersnatch thinking it has
synced serial X+1 which includes both the sdist and wheel but it really
has only synced serial X. But since X+1 is what bandersnatch thinks it
has done it will never sync the actual contents of the X+1 serial (the
second file uploaded).

To make matters worse the index.html for the project is synced assuming
both artifacts at serial X+1 were synced. This means any fetches for the
second artifact fail.

We can work around this by always uploading the wheel first. Pip prefers
wheels to sdists so uploading the wheel first ensures that the wheel is
synced properly, pip will prefer it, and our jobs should continue
running.

Eventually upstream pypi and bandersnatch will need to fix this bugs
properly but this is a reasonable thing we can do locally.

Change-Id: I26062b9fefa5ce484b63e2d0ee02e0ecbe64555f
This commit is contained in:
Clark Boylan 2014-12-02 10:37:21 -08:00
parent db1816dcca
commit b197db0c2d

View File

@ -6,8 +6,12 @@
- revoke-sudo
- gerrit-git-prep
- shell: |
/usr/local/jenkins/slave_scripts/pypi-tarball-upload.sh {name} {tarball-site}
# Note we upload the wheel first because pip prefers wheels
# and there is a mirroring issue where sometimes the first
# artifact uploaded is the only one you get. Since pip prefers
# wheels it is best to make the wheel the one we get.
/usr/local/jenkins/slave_scripts/pypi-wheel-upload.sh {name} {tarball-site}
/usr/local/jenkins/slave_scripts/pypi-tarball-upload.sh {name} {tarball-site}
publishers:
- console-log