manylinux icon indicating copy to clipboard operation
manylinux copied to clipboard

Instructions to use the docker and make wheels without Travis

Open AbdealiLoKo opened this issue 9 years ago • 14 comments

I saw https://github.com/pypa/python-manylinux-demo which is neat. But it would also be nice to have instructions that I can simply run on my computer to create the wheels.

Something like:

Step 1: Install docker from the instructions at https://docs.docker.com/engine/installation/ Step 2: Pull the docker image: docker pull quay.io/pypa/manylinux1_x86_64 (For 64bit) And so on ...

The Travis build example at https://github.com/pypa/python-manylinux-demo isn't as helpful in case I want to do it locally.

AbdealiLoKo avatar Jun 18 '16 11:06 AbdealiLoKo

From what I can see:

  1. Pull docker image for your architecture

     docker pull quay.io/pypa/manylinux1_x86_64
     # or docker pull quay.io/pypa/manylinux1_i686
    

techtonik avatar May 06 '18 05:05 techtonik

  1. Run it

    docker run -it -v $(pwd):/io quay.io/pypa/manylinux1_x86_64

  2. Then in your wheelhouse/ directory there will be wheel

techtonik avatar May 06 '18 05:05 techtonik

Here's my version, expanding on @techtonik's a bit:

docker run -it -v $(pwd):/io quay.io/pypa/manylinux1_x86_64
# following, roughly, https://github.com/pypa/python-manylinux-demo/blob/master/travis/build-wheels.sh
PYBIN=/opt/python/cp36-cp36m/bin
for whl in wheelhouse/*.whl; do
    auditwheel repair "$whl" -w /io/wheelhouse/
done
cp wheelhouse/*.whl /io/wheelhouse/

Lots of wheels, including the desired one, will be in $(pwd)/wheelhouse.

riddell-stan avatar Dec 15 '18 13:12 riddell-stan

I've followed the instructions so far:

docker pull quay.io/pypa/manylinux1_x86_64
docker run -it -v $(pwd):/io quay.io/pypa/manylinux1_x86_64

But I don't see a wheelhouse directory that you guys seem to have when I'm in the container. Is there something I need to do first to create the directory?

gfairchild avatar Jan 07 '19 21:01 gfairchild

Creating a wheelhouse directory in your working directory might do the trick.

On 1/7/19 4:26 PM, Geoffrey Fairchild wrote:

I've followed the instructions so far:

|docker pull quay.io/pypa/manylinux1_x86_64 docker run -it -v $(pwd):/io quay.io/pypa/manylinux1_x86_64 |

But I don't see a |wheelhouse| directory that you guys seem to have when I'm in the container. Is there something I need to do first to create the directory?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pypa/manylinux/issues/73#issuecomment-452087558, or mute the thread https://github.com/notifications/unsubscribe-auth/AmFA1ssM9NJBZ1bXDStzJpcLixGHRSltks5vA7uCgaJpZM4I47L1.

riddell-stan avatar Jan 07 '19 21:01 riddell-stan

But the script you posted above expects *.whl files to already exist in /wheelhouse when logging into the Docker container:

for whl in wheelhouse/*.whl; do
    auditwheel repair "$whl" -w /io/wheelhouse/
done

How do those files get created?

gfairchild avatar Jan 07 '19 22:01 gfairchild

Ok, I think I figured it out. From https://github.com/pypa/python-manylinux-demo/blob/master/travis/build-wheels.sh, this is key:

for PYBIN in /opt/python/*/bin; do
    "${PYBIN}/pip" wheel /io/ -w wheelhouse/
done

gfairchild avatar Jan 07 '19 22:01 gfairchild

This process is still unclear to me. I have a repository of Python code I need to build, I'm doing a docker run -it -v $(pwd):/io quay.io/pypa/manylinux1_x86_64

but I don't see anything inside /io. What am I missing?

cdietschrun avatar Apr 12 '19 17:04 cdietschrun

I think you'll find that starts up the container only for it close immediately. I think you want something like this:

docker run --rm -it -v $(pwd):/io quay.io/pypa/manylinux1_x86_64 /bin/bash

This will drop you into the container, in the bash shell, and you will be able to see /io.

matthew-brett avatar Apr 12 '19 17:04 matthew-brett

I've run that and other flavors, and io is still empty.

cdietschrun avatar Apr 12 '19 17:04 cdietschrun

Both on x86_64 and i686 versions of the container

cdietschrun avatar Apr 12 '19 17:04 cdietschrun

To be explicit, I'm running on Powershell in Windows and have tried with pwd:/io, C:\Users\me\source\repo:/io, /c/Users/me/source/repo etc and all aren't populating io for me

cdietschrun avatar Apr 12 '19 17:04 cdietschrun

Looks like it's just some Windows issue on my setup with -v

cdietschrun avatar Apr 12 '19 19:04 cdietschrun

Ah - sorry - I haven't tried to use Linux containers on Windows.

matthew-brett avatar Apr 12 '19 22:04 matthew-brett