glyph / deployme

Example project for deployment
92 stars 19 forks source link

Twisted dependency is not found in wheelhouse #5

Open ezegolub opened 8 years ago

ezegolub commented 8 years ago

Hello, i'm trying out this on a mac, using latest docker-machine. I can't understand why it fails to find the Twisted wheel file in the wheelhouse, although i can see it's present. This is the result of runnning build.sh:

$ ./build.sh 
+ set -e
+ mkdir -p wheelhouse
+ docker build -t deployme-base -f base.docker .
Sending build context to Docker daemon 106.5 kB
Step 1 : FROM ubuntu:trusty
 ---> 8fa7f61732d6
Step 2 : RUN echo "deb http://ppa.launchpad.net/pypy/ppa/ubuntu trusty main" >     /etc/apt/sources.list.d/pypy-ppa.list
 ---> Using cache
 ---> 2552b4a07d43
Step 3 : RUN apt-key adv --keyserver keyserver.ubuntu.com                 --recv-keys 2862D0785AFACD8C65B23DB0251104D968854915
 ---> Using cache
 ---> db52d2b56ec4
Step 4 : RUN apt-get update
 ---> Using cache
 ---> fb001a8994eb
Step 5 : RUN apt-get install -qyy     -o APT::Install-Recommends=false -o APT::Install-Suggests=false     python-virtualenv pypy libffi6 openssl
 ---> Using cache
 ---> 63fc22e06e14
Step 6 : RUN virtualenv -p /usr/bin/pypy /appenv
 ---> Using cache
 ---> 2f59079664f7
Step 7 : RUN . /appenv/bin/activate; pip install pip==6.0.8
 ---> Using cache
 ---> 133edd7743ea
Successfully built 133edd7743ea
+ docker build -t deployme-builder -f build.docker .
Sending build context to Docker daemon 106.5 kB
Step 1 : FROM deployme-base
 ---> 133edd7743ea
Step 2 : RUN apt-get install -qy libffi-dev libssl-dev pypy-dev
 ---> Using cache
 ---> 224fbc2bb801
Step 3 : RUN . /appenv/bin/activate;     pip install wheel
 ---> Using cache
 ---> cafb898f9af6
Step 4 : ENV WHEELHOUSE /wheelhouse
 ---> Using cache
 ---> 7fe3a36991c6
Step 5 : ENV PIP_WHEEL_DIR /wheelhouse
 ---> Using cache
 ---> 8b85f8c738ba
Step 6 : ENV PIP_FIND_LINKS /wheelhouse
 ---> Using cache
 ---> 61ececdc3bc1
Step 7 : VOLUME /wheelhouse
 ---> Using cache
 ---> 123393888391
Step 8 : VOLUME /application
 ---> Using cache
 ---> 0a110f2ca1e6
Step 9 : ENTRYPOINT . /appenv/bin/activate;            cd /application;            pip wheel .
 ---> Using cache
 ---> 73c46dd15d06
Successfully built 73c46dd15d06
++ pwd
++ pwd
+ docker run --rm -v /Users/ezequielgolub/whalerock/deployme_pristine:/application -v /Users/ezequielgolub/whalerock/deployme_pristine/wheelhouse:/wheelhouse deployme-builder
You are using pip version 6.0.8, however version 8.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Processing /application
Collecting twisted>=15.0.0 (from DeployMe==0.1)
  Downloading Twisted-16.1.1.tar.bz2 (2.9MB)
Collecting klein>=15.0.0 (from DeployMe==0.1)
  Downloading klein-15.3.1-py2.py3-none-any.whl
  Saved /wheelhouse/klein-15.3.1-py2.py3-none-any.whl
Collecting treq>=15.0.0 (from DeployMe==0.1)
  Downloading treq-15.1.0-py2.py3-none-any.whl
  Saved /wheelhouse/treq-15.1.0-py2.py3-none-any.whl
Collecting service-identity>=14.0.0 (from DeployMe==0.1)
  Downloading service_identity-16.0.0-py2.py3-none-any.whl
  Saved /wheelhouse/service_identity-16.0.0-py2.py3-none-any.whl
Collecting zope.interface>=3.6.0 (from twisted>=15.0.0->DeployMe==0.1)
  Downloading zope.interface-4.1.3.tar.gz (141kB)
Collecting werkzeug (from klein>=15.0.0->DeployMe==0.1)
  Downloading Werkzeug-0.11.9-py2.py3-none-any.whl (306kB)
  Saved /wheelhouse/Werkzeug-0.11.9-py2.py3-none-any.whl
Collecting pyOpenSSL>=0.13 (from treq>=15.0.0->DeployMe==0.1)
  Downloading pyOpenSSL-16.0.0-py2.py3-none-any.whl (45kB)
  Saved /wheelhouse/pyOpenSSL-16.0.0-py2.py3-none-any.whl
Collecting requests>=2.1.0 (from treq>=15.0.0->DeployMe==0.1)
  Downloading requests-2.10.0-py2.py3-none-any.whl (506kB)
  Saved /wheelhouse/requests-2.10.0-py2.py3-none-any.whl
Collecting attrs (from service-identity>=14.0.0->DeployMe==0.1)
  Downloading attrs-15.2.0-py2.py3-none-any.whl
  Saved /wheelhouse/attrs-15.2.0-py2.py3-none-any.whl
Collecting pyasn1 (from service-identity>=14.0.0->DeployMe==0.1)
  Downloading pyasn1-0.1.9-py2.py3-none-any.whl
  Saved /wheelhouse/pyasn1-0.1.9-py2.py3-none-any.whl
Collecting pyasn1-modules (from service-identity>=14.0.0->DeployMe==0.1)
  Downloading pyasn1_modules-0.0.8-py2.py3-none-any.whl
  Saved /wheelhouse/pyasn1_modules-0.0.8-py2.py3-none-any.whl
Collecting setuptools (from zope.interface>=3.6.0->twisted>=15.0.0->DeployMe==0.1)
  Downloading setuptools-21.0.0-py2.py3-none-any.whl (509kB)
  Saved /wheelhouse/setuptools-21.0.0-py2.py3-none-any.whl
Collecting cryptography>=1.3 (from pyOpenSSL>=0.13->treq>=15.0.0->DeployMe==0.1)
  Downloading cryptography-1.3.1.tar.gz (383kB)
Collecting six>=1.5.2 (from pyOpenSSL>=0.13->treq>=15.0.0->DeployMe==0.1)
  Downloading six-1.10.0-py2.py3-none-any.whl
  Saved /wheelhouse/six-1.10.0-py2.py3-none-any.whl
Collecting idna>=2.0 (from cryptography>=1.3->pyOpenSSL>=0.13->treq>=15.0.0->DeployMe==0.1)
  Downloading idna-2.1-py2.py3-none-any.whl (54kB)
  Saved /wheelhouse/idna-2.1-py2.py3-none-any.whl
Collecting enum34 (from cryptography>=1.3->pyOpenSSL>=0.13->treq>=15.0.0->DeployMe==0.1)
  Downloading enum34-1.1.4-py2.py3-none-any.whl (61kB)
  Saved /wheelhouse/enum34-1.1.4-py2.py3-none-any.whl
Collecting ipaddress (from cryptography>=1.3->pyOpenSSL>=0.13->treq>=15.0.0->DeployMe==0.1)
  Downloading ipaddress-1.0.16-py27-none-any.whl
  Saved /wheelhouse/ipaddress-1.0.16-py27-none-any.whl
Skipping klein, due to already being wheel.
Skipping treq, due to already being wheel.
Skipping service-identity, due to already being wheel.
Skipping werkzeug, due to already being wheel.
Skipping pyOpenSSL, due to already being wheel.
Skipping requests, due to already being wheel.
Skipping attrs, due to already being wheel.
Skipping pyasn1, due to already being wheel.
Skipping pyasn1-modules, due to already being wheel.
Skipping setuptools, due to already being wheel.
Skipping six, due to already being wheel.
Skipping idna, due to already being wheel.
Skipping enum34, due to already being wheel.
Skipping ipaddress, due to already being wheel.
Building wheels for collected packages: twisted, DeployMe, zope.interface, cryptography
  Running setup.py bdist_wheel for twisted
  Destination directory: /wheelhouse
  Running setup.py bdist_wheel for DeployMe
  Destination directory: /wheelhouse
  Running setup.py bdist_wheel for zope.interface
  Destination directory: /wheelhouse
  Running setup.py bdist_wheel for cryptography
  Destination directory: /wheelhouse
Successfully built twisted DeployMe zope.interface cryptography
+ docker build -t deployme-run -f run.docker .
Sending build context to Docker daemon 5.198 MB
Step 1 : FROM deployme-base
 ---> 133edd7743ea
Step 2 : ADD wheelhouse /wheelhouse
 ---> 75908963ed8f
Removing intermediate container 6ae018e88d0e
Step 3 : RUN . /appenv/bin/activate;     pip install --no-index -f wheelhouse DeployMe
 ---> Running in ed25f33559be
Ignoring indexes: https://pypi.python.org/simple
Collecting DeployMe
Collecting klein>=15.0.0 (from DeployMe)
Collecting service-identity>=14.0.0 (from DeployMe)
Collecting treq>=15.0.0 (from DeployMe)
Collecting twisted>=15.0.0 (from DeployMe)
  Could not find any downloads that satisfy the requirement twisted>=15.0.0 (from DeployMe)
  No distributions at all found for twisted>=15.0.0 (from DeployMe)
The command '/bin/sh -c . /appenv/bin/activate;     pip install --no-index -f wheelhouse DeployMe' returned a non-zero code: 1

And if i do a ls wheelhouse i get:

$ ls wheelhouse/
DeployMe-0.1-py2-none-any.whl               idna-2.1-py2.py3-none-any.whl               requests-2.10.0-py2.py3-none-any.whl
Twisted-16.1.1-pp250-pypy_41-linux_x86_64.whl       ipaddress-1.0.16-py27-none-any.whl          service_identity-16.0.0-py2.py3-none-any.whl
Werkzeug-0.11.9-py2.py3-none-any.whl            klein-15.3.1-py2.py3-none-any.whl           setuptools-21.0.0-py2.py3-none-any.whl
attrs-15.2.0-py2.py3-none-any.whl           pyOpenSSL-16.0.0-py2.py3-none-any.whl           six-1.10.0-py2.py3-none-any.whl
cryptography-1.3.1-pp250-pypy_41-linux_x86_64.whl   pyasn1-0.1.9-py2.py3-none-any.whl           treq-15.1.0-py2.py3-none-any.whl
enum34-1.1.4-py2.py3-none-any.whl           pyasn1_modules-0.0.8-py2.py3-none-any.whl       zope.interface-4.1.3-py2-none-any.whl

So clearly the wheel file is getting created, but i cannot understand why it's not getting picked up by run container :sad:

ezegolub commented 8 years ago

Ok, so this seems to be somewhat unrelated to this, it's an issue with the wheel package, right now it's using the latest one, 0.29.0, but it has some bug and generates incompatible wheel files.

I've reported it to the wheels project here https://bitbucket.org/pypa/wheel/issues/163/wheel-is-building-incompatible-packages

The workaround i've found is downgrading the wheel package to 0.26.0

alercunha commented 8 years ago

I had a similar issue but it was just my mistake. Reading this issue you reported helped me figure it out so I will post here in case somebody makes the same mistake I did.

My build.docker image had python 3.5 installed but my host had python 3.4. Then obviously the wheels generated were not compatible and the whole thing failed with that same error.

Pretty noob mistake but took me a while to find out what was wrong.