5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

manylinux1 wheelhouse 作成手順

Last updated at Posted at 2016-11-04

はじめに

デプロイやCI + tox などにおいて、依存ライブラリインストールを安定・高速化するためのwheelhouse作成手順をまとめておきます。
※ プラットフォームはmanylinux1
PyCon JPのweb構築から学んだ作成手順

## 勉強になったもの

Dockerfile

# PyPAが提供するmanylinux1 wheelビルド用Docker
FROM quay.io/pypa/manylinux1_x86_64

COPY ./requirements /app/requirements
COPY ./scripts/make-wheels.sh  /app/make-wheels.sh

VOLUME /app/wheelhouse /app/wheelhouse_new
WORKDIR /app/wheelhouse_new

CMD ["bash", "/app/make-wheels.sh"]

Shell Script

make-wheels.sh
set -ex

WHEELHOUSE_OLD=/app/wheelhouse
WHEELHOUSE_NEW=/app/wheelhouse_new

# Python-2.7.11(cp27mu)向けに依存パッケージをwheel化
/opt/python/cp27-cp27mu/bin/pip wheel -r /app/requirements/online.txt -f ${WHEELHOUSE_OLD} -w ${WHEELHOUSE_NEW}

# wheelのmanylinux化
cd ${WHEELHOUSE_NEW}
for f in ./*linux_*; do
  if [ -f $f ]; then
    auditwheel repair $f -w .
    rm $f
  fi
done

Commands

$docker build -f Dockerfile -t massa142/wheelhouse .
$docker run -it --rm -v `pwd`/wheelhouse:/app/$wheelhouse:ro -v `pwd`/wheelhouse_new:/app/wheelhouse_new massa142/wheelhouse
$rm -R wheelhouse
$mv wheelhouse_new wheelhouse
5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?