WIP: more work on the docker structure, still not finished with 4_run

1_base: builds a base image, based on Ubuntu 16.10
2_buildpy: builds two images:
	2a: an image that can build Python 3.6
	2b: an image that contains the built Python 3.6 in /opt/python
3_buildwheels: builds an image to build wheel files, puts them in ../4_run
4_run: the production runtime image, which can't build anything and just runs.
This commit is contained in:
2017-03-07 22:41:05 +01:00
parent af14910fa9
commit d7e4995cfa
20 changed files with 150 additions and 119 deletions

View File

@@ -0,0 +1,15 @@
FROM pillar_py:3.6
MAINTAINER Sybren A. Stüvel <sybren@blender.studio>
RUN apt-get install -qy \
git \
build-essential \
checkinstall \
libffi-dev \
libssl-dev
ENV WHEELHOUSE=/data/wheelhouse
ENV PIP_WHEEL_DIR=/data/wheelhouse
ENV PIP_FIND_LINKS=/data/wheelhouse
VOLUME /data/wheelhouse

43
docker/3_buildwheels/build.sh Executable file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/env bash
# macOS does not support readlink -f, so we use greadlink instead
if [ $(uname) == 'Darwin' ]; then
command -v greadlink 2>/dev/null 2>&1 || { echo >&2 "Install greadlink using brew."; exit 1; }
readlink='greadlink'
else
readlink='readlink'
fi
TOPDEVDIR="$($readlink -f ../../..)"
echo "Top-level development dir is $TOPDEVDIR"
WHEELHOUSE="$($readlink -f ../4_run/wheelhouse)"
if [ -z "$WHEELHOUSE" ]; then
echo "Error, ../4_run might not exist." >&2
exit 2
fi
echo "Wheelhouse is $WHEELHOUSE"
mkdir -p "$WHEELHOUSE"
#docker build -t pillar_wheelbuilder -f build.docker .
GID=$(id --group)
docker run --rm -i \
-v "$WHEELHOUSE:/data/wheelhouse" \
-v "$TOPDEVDIR:/data/topdev" \
pillar_wheelbuilder <<EOT
set -e
# Build wheels for all dependencies.
cd /data/topdev/blender-cloud
# pip3 install wheel
# pip3 wheel --wheel-dir=/data/wheelhouse -r requirements.txt
# chown -R $UID:$GID /data/wheelhouse
# Install the dependencies so that we can get a full freeze.
pip3 install --no-index --find-links=/data/wheelhouse -r requirements.txt
pip3 freeze | grep -v '^-[ef] ' > /data/wheelhouse/requirements.txt
EOT
# Remove our own projects, they shouldn't be installed as wheel (for now).
rm -f $WHEELHOUSE/{attract,flamenco,pillar,pillarsdk}*.whl