Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Commit

Permalink
Change builder to use pypiserver and not copy wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
psyduck787 committed Jul 26, 2016
1 parent 2c33072 commit 889ca5a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ data
logs
docker-compose-aws-s3-storage-test.yml
docker-compose-aws-s3-loader-test.yml
wheelhouse
test.yml
wheelhouse
17 changes: 7 additions & 10 deletions builder
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
#!/bin/bash

# # Build wheels for all projects
# export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $THUMBOR_VERSION; fi`
# echo "TAG: $TAG"
# echo "TRAVIS_BRANCH: $TRAVIS_BRANCH"
# echo "THUMBOR_VERSION: $THUMBOR_VERSION"

echo "--> Wheelhousing requirements in /wheelhouse"
docker build -t builder -f Dockerfile.build .
mkdir -p wheelhouse
docker run --rm -v "$(pwd)"/wheelhouse:/wheelhouse builder

mv wheelhouse thumbor/wheelhouse
echo "Launch Pypiserver"
docker-compose -f docker-compose-travis.yml up -d pypiserver

echo "--> BUILDING apsl/thumbor"
docker build -f thumbor/Dockerfile -t apsl/thumbor thumbor/
echo "--> TAGGING apsl/thumbor:$THUMBOR_VERSION"
docker tag apsl/thumbor apsl/thumbor:$THUMBOR_VERSION
docker tag apsl/thumbor apsl/thumbor:latest
mv thumbor/wheelhouse thumbor-multiprocess/wheelhouse

echo "--> BUILDING apsl/thumbor-multiprocess"
docker build -f thumbor-multiprocess/Dockerfile -t apsl/thumbor-multiprocess thumbor-multiprocess/
echo "--> TAGGING apsl/thumbor-multiprocess:$THUMBOR_VERSION"
docker tag apsl/thumbor-multiprocess apsl/thumbor-multiprocess:$THUMBOR_VERSION
docker tag apsl/thumbor-multiprocess apsl/thumbor-multiprocess:latest

echo "--> BUILDING apsl/thumbor-nginx"
docker build -f nginx/Dockerfile -t apsl/thumbor-nginx nginx/
echo "--> TAGGING apsl/thumbor-nginx:$THUMBOR_VERSION"
docker tag apsl/thumbor-nginx apsl/thumbor-nginx:$THUMBOR_VERSION
docker tag apsl/thumbor-nginx apsl/thumbor-nginx:latest
mv thumbor-multiprocess/wheelhouse remotecv/wheelhouse

echo "--> BUILDING apsl/remotecv"
docker build -f remotecv/Dockerfile -t apsl/remotecv remotecv/
echo "--> TAGGING apsl/remotecv:$THUMBOR_VERSION"
docker tag apsl/remotecv apsl/remotecv:$THUMBOR_VERSION
docker tag apsl/remotecv apsl/remotecv:latest
mv remotecv/wheelhouse wheelhouse
7 changes: 7 additions & 0 deletions docker-compose-travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
version: '2'
services:
pypiserver:
image: jcsaaddupuy/pypiserver
#command: pypi-server -P '' -u ''
volumes:
- "./wheelhouse:/data/packages"
ports:
- "0.0.0.0:9009:8080"
thumbor:
image: apsl/thumbor
environment:
Expand Down
13 changes: 4 additions & 9 deletions remotecv/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,15 @@ ENV SHELL bash
ENV WORKON_HOME /usr/src/app
WORKDIR /usr/src/app

ENV WHEELHOUSE=/wheelhouse
ENV PIP_WHEEL_DIR=/wheelhouse
ENV PIP_FIND_LINKS=/wheelhouse

COPY wheelhouse /wheelhouse

COPY requirements.txt /usr/src/app/requirements.txt
RUN pip install --no-cache-dir --use-wheel --find-links /wheelhouse -r /usr/src/app/requirements.txt
RUN pip install --trusted-host None --no-cache-dir --use-wheel \
--extra-index-url http://172.17.0.1:9009/simple/ \
--trusted-host 172.17.0.1 \
-r /usr/src/app/requirements.txt

RUN \
ln /usr/lib/python2.7/dist-packages/cv2.x86_64-linux-gnu.so /usr/local/lib/python2.7/cv2.so && \
ln /usr/lib/python2.7/dist-packages/cv.py /usr/local/lib/python2.7/cv.py

RUN rm -Rf /wheelhouse

COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
Expand Down
13 changes: 4 additions & 9 deletions thumbor-multiprocess/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@ FROM apsl/thumbor

MAINTAINER Edu Herraiz <ghark@gmail.com>

ENV WHEELHOUSE=/wheelhouse
ENV PIP_WHEEL_DIR=/wheelhouse
ENV PIP_FIND_LINKS=/wheelhouse

COPY wheelhouse /wheelhouse

COPY requirements.txt /usr/src/app/requirements.txt
RUN pip install --no-cache-dir --use-wheel --find-links /wheelhouse -r /usr/src/app/requirements.txt
RUN pip install --trusted-host None --no-cache-dir --use-wheel \
--extra-index-url http://172.17.0.1:9009/simple/ \
--trusted-host 172.17.0.1 \
-r /usr/src/app/requirements.txt

ADD conf/circus.ini.tpl /etc/
RUN mkdir /etc/circus.d /etc/setup.d
ADD conf/thumbor.ini.tpl /etc/circus.d/

RUN rm -Rf /wheelhouse

COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["circus"]
Expand Down
11 changes: 4 additions & 7 deletions thumbor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,19 @@ ENV HOME /usr/src/app
ENV SHELL bash
ENV WORKON_HOME /usr/src/app
WORKDIR /usr/src/app
ENV WHEELHOUSE=/wheelhouse
ENV PIP_WHEEL_DIR=/wheelhouse
ENV PIP_FIND_LINKS=/wheelhouse

COPY wheelhouse /wheelhouse
COPY requirements.txt /usr/src/app/requirements.txt
RUN pip install --no-cache-dir --use-wheel --find-links /wheelhouse -r /usr/src/app/requirements.txt
RUN pip install --trusted-host None --no-cache-dir --use-wheel \
--extra-index-url http://172.17.0.1:9009/simple/ \
--trusted-host 172.17.0.1 \
-r /usr/src/app/requirements.txt

COPY conf/thumbor.conf.tpl /usr/src/app/thumbor.conf.tpl

RUN \
ln /usr/lib/python2.7/dist-packages/cv2.x86_64-linux-gnu.so /usr/local/lib/python2.7/cv2.so && \
ln /usr/lib/python2.7/dist-packages/cv.py /usr/local/lib/python2.7/cv.py

RUN rm -Rf /wheelhouse

COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["thumbor"]
Expand Down

0 comments on commit 889ca5a

Please sign in to comment.