Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker] Split dependencies from tuttleofx build #557

Merged
merged 21 commits into from
Oct 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2ea2261
Build: install clint and argcomplete from apt
aoblet May 26, 2016
6e44f22
Dockerfile set ubuntu to 16.04
aoblet May 26, 2016
b5bc3cf
Build dependencies storage optimization
aoblet May 26, 2016
9c9bc24
Travis: fixed install of LibRaw dependency
May 27, 2016
ce55cd0
Docker: moved Dockerfiles to project root directory
May 27, 2016
a7204de
docker: split dependencies from tuttleofx build
fabiencastan May 28, 2016
062c978
Travis: updated how to check if a script is run on Travis CI
May 30, 2016
d726b76
Travis: refactored how to skip build of dependencies if the cache exists
May 30, 2016
29a72b4
Travis: install python packages to run sam command line using pip
May 30, 2016
b7c2539
Travis: clean indentation of script to install dependencies
May 30, 2016
1f1fb35
Travis: fixed script to install dependencies
May 30, 2016
1331fee
[travis] fix inverted condition to use pip on travis
fabiencastan Sep 11, 2016
e6a3e59
[travis] test only the major version of python
fabiencastan Sep 11, 2016
0247bd2
[travis] install pip3 before using it
fabiencastan Sep 11, 2016
b95c87b
Merge branch 'develop' of github.com:tuttleofx/TuttleOFX into docker
fabiencastan Sep 11, 2016
3660432
[travis] fix bash if
fabiencastan Sep 11, 2016
ebdf369
[travis] update get-pip url
fabiencastan Sep 12, 2016
003b44b
[travis] add missing quotes in bash if
fabiencastan Sep 12, 2016
12c9379
[travis] use pip 3 url
fabiencastan Sep 12, 2016
d31be45
Merge branch 'develop' of github.com:tuttleofx/TuttleOFX into docker
fabiencastan Sep 12, 2016
d5a438d
[travis] libraw is compiled manually so don't install a concurrent ve…
fabiencastan Oct 15, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ addons:
- python3-dev
- python3-setuptools
- python3-nose
# - python-clint # not available in https://github.com/travis-ci/apt-package-whitelist
# - python-argcomplete # not available in https://github.com/travis-ci/apt-package-whitelist
- libfreetype6-dev
- libbz2-dev
- libltdl-dev
- libpng-dev
- libjpeg-dev
- libraw-dev
# - libraw-dev
- libglew-dev
- libtiff4-dev
- libilmbase-dev
Expand Down
14 changes: 6 additions & 8 deletions tools/docker/python2.7/Dockerfile → Dockerfile-env-python2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:latest
FROM ubuntu:16.04

MAINTAINER TuttleOFX <tuttleofx-dev@googlegroups.com>

Expand All @@ -14,7 +14,6 @@ RUN apt-get update && apt-get install -y \
python-numpy \
python-clint \
python-argcomplete \
python-pip\
python-nose \
python-imaging \
libfreetype6-dev \
Expand Down Expand Up @@ -57,11 +56,10 @@ ENV PYTHON_VERSION=2.7 \
DEPENDENCIES_INSTALL=/usr/local \
PYTHONPATH=${PYTHONPATH}:/usr/local/lib/python2.7/site-packages

RUN mkdir ${TUTTLEOFX_BUILD} ${TRAVIS_BUILD_DIR}

COPY . ${TUTTLEOFX_DEV}
RUN cd ${TUTTLEOFX_DEV} && git submodule update --init --recursive

RUN cd ${TUTTLEOFX_DEV} && ${TUTTLEOFX_DEV}/tools/travis/install_dependencies.sh && \
cd ${TUTTLEOFX_DEV} && ${TUTTLEOFX_DEV}/tools/travis/build.sh && \
rm -rf ${TUTTLEOFX_BUILD} ${TRAVIS_BUILD_DIR}
RUN mkdir ${TRAVIS_BUILD_DIR} && \
cd ${TUTTLEOFX_DEV} && \
${TUTTLEOFX_DEV}/tools/travis/install_dependencies.sh && \
rm -rf ${TRAVIS_BUILD_DIR}

14 changes: 6 additions & 8 deletions tools/docker/python3.5/Dockerfile → Dockerfile-env-python3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:latest
FROM ubuntu:16.04

MAINTAINER TuttleOFX <tuttleofx-dev@googlegroups.com>

Expand All @@ -14,7 +14,6 @@ RUN apt-get update && apt-get install -y \
python3-numpy \
python3-clint \
python3-argcomplete \
python3-pip \
python3-nose \
libfreetype6-dev \
libbz2-dev \
Expand Down Expand Up @@ -56,11 +55,10 @@ ENV PYTHON_VERSION=3.5 \
DEPENDENCIES_INSTALL=/usr/local \
PYTHONPATH=${PYTHONPATH}:/usr/local/lib/python3.5/site-packages

RUN mkdir ${TUTTLEOFX_BUILD} ${TRAVIS_BUILD_DIR}

COPY . ${TUTTLEOFX_DEV}
RUN cd ${TUTTLEOFX_DEV} && git submodule update --init --recursive

RUN cd ${TUTTLEOFX_DEV} && ${TUTTLEOFX_DEV}/tools/travis/install_dependencies.sh && \
cd ${TUTTLEOFX_DEV} && ${TUTTLEOFX_DEV}/tools/travis/build.sh && \
rm -rf ${TUTTLEOFX_BUILD} ${TRAVIS_BUILD_DIR}
RUN mkdir ${TRAVIS_BUILD_DIR} && \
cd ${TUTTLEOFX_DEV} && \
${TUTTLEOFX_DEV}/tools/travis/install_dependencies.sh && \
rm -rf ${TRAVIS_BUILD_DIR}

10 changes: 10 additions & 0 deletions Dockerfile-python2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM tuttleofx/tuttleofx-env:python2-latest

MAINTAINER TuttleOFX <tuttleofx-dev@googlegroups.com>

RUN mkdir ${TUTTLEOFX_BUILD} && \
cd ${TUTTLEOFX_DEV} && \
git submodule update --init --recursive && \
${TUTTLEOFX_DEV}/tools/travis/build.sh && \
rm -rf ${TUTTLEOFX_BUILD}

10 changes: 10 additions & 0 deletions Dockerfile-python3
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM tuttleofx/tuttleofx-env:python3-latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including the python minor version is maybe clearer because it depends on the OS distrib image. Don't you think ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only provide multiple images for the major versions, so it's easier to maintain like that.


MAINTAINER TuttleOFX <tuttleofx-dev@googlegroups.com>

RUN mkdir ${TUTTLEOFX_BUILD} && \
cd ${TUTTLEOFX_DEV} && \
git submodule update --init --recursive && \
${TUTTLEOFX_DEV}/tools/travis/build.sh && \
rm -rf ${TUTTLEOFX_BUILD}

166 changes: 87 additions & 79 deletions tools/travis/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,86 +5,94 @@ set -e
# Print commands and their arguments as they are executed.
set -x

if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then

# Install python packages to run sam command line
if [[ ${PYTHON_VERSION} == "2.7" ]]; then
pip install --user clint argcomplete
# elif [[ ${PYTHON_VERSION} == "3.2" ]]; then
# easy_install3 pip --prefix=$HOME/local
# pip3 install --user clint argcomplete
# Use TRAVIS_JOB_ID environment variable to detect if the script is run on Travis CI.
if [ -n "${TRAVIS_JOB_ID}" ]; then
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
# Install python packages to run sam command line
# On travis we need to install some python packages not available in the https://github.com/travis-ci/apt-package-whitelist
if [[ ${PYTHON_VERSION} == 2* ]]; then
pip install --user clint argcomplete
elif [[ ${PYTHON_VERSION} == 3* ]]; then
# For pip3: https://github.com/travis-ci/travis-ci/issues/1528
cd $TRAVIS_BUILD_DIR
wget https://bootstrap.pypa.io/3.2/get-pip.py
python3 get-pip.py --user

pip3 install --user clint argcomplete
fi
# If the cache of dependencies exists
if [ -d "${DEPENDENCIES_INSTALL}/lib/" ]; then
echo 'Using cached directory.';
exit 0
fi
fi
fi

# Use TRAVIS_JOB_ID to detect that we are in travis.
# In that case, use a simple check to detect if the cache is already there.
if [ -z ${TRAVIS_JOB_ID} ] || [ ! -d "${DEPENDENCIES_INSTALL}/lib/" ]; then

# Target versions
FFMPEG_RELEASE=ffmpeg-2.2.9
ACES_RELEASE=aces_container-1.0
CTL_RELEASE=ctl-1.5.2
SEEXPR_VERSION=1.0.1
SEEXPR_RELEASE=SeExpr-rel-$SEEXPR_VERSION
OCIO_VERSION=1.0.9
OCIO_RELEASE=OpenColorIO-$OCIO_VERSION
LIBRAW_VERSION=0.16.2
LIBRAW_RELEASE=LibRaw-$LIBRAW_VERSION
OIIO_VERSION=1.6.13
OIIO_RELEASE=oiio-Release-$OIIO_VERSION

cd $TRAVIS_BUILD_DIR
wget https://www.ffmpeg.org/releases/$FFMPEG_RELEASE.tar.bz2
bunzip2 $FFMPEG_RELEASE.tar.bz2
tar -xf $FFMPEG_RELEASE.tar > /dev/null 2>&1
cd $FFMPEG_RELEASE
./configure --prefix=${DEPENDENCIES_INSTALL} --enable-shared --disable-static --disable-yasm && make && make install

cd $TRAVIS_BUILD_DIR
wget https://github.com/ampas/aces_container/archive/v1.0.tar.gz -O $ACES_RELEASE.tar.gz
tar -xzf $ACES_RELEASE.tar.gz > /dev/null 2>&1
mkdir $ACES_RELEASE/build
cd $ACES_RELEASE/build
cmake .. -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} && make && make install

cd $TRAVIS_BUILD_DIR
wget https://github.com/ampas/CTL/archive/$CTL_RELEASE.tar.gz -O $CTL_RELEASE.tar.gz
tar -xzf $CTL_RELEASE.tar.gz > /dev/null 2>&1
mkdir CTL-$CTL_RELEASE/build
cd CTL-$CTL_RELEASE/build
cmake .. -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} && make && make install

cd $TRAVIS_BUILD_DIR
wget https://github.com/wdas/SeExpr/archive/rel-$SEEXPR_VERSION.tar.gz -O $SEEXPR_RELEASE.tar.gz
tar -xzf $SEEXPR_RELEASE.tar.gz > /dev/null 2>&1
mkdir $SEEXPR_RELEASE/build
cd $SEEXPR_RELEASE/build
cmake .. -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} && make && make install

cd $TRAVIS_BUILD_DIR
wget https://github.com/imageworks/OpenColorIO/archive/v$OCIO_VERSION.tar.gz -O $OCIO_RELEASE.tar.gz
tar -xzf $OCIO_RELEASE.tar.gz > /dev/null 2>&1
mkdir $OCIO_RELEASE/build
cd $OCIO_RELEASE/build
cmake .. -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} && make && make install

cd $TRAVIS_BUILD_DIR
wget https://github.com/LibRaw/LibRaw/archive/$LIBRAW_VERSION.tar.gz -O $LIBRAW_RELEASE.tar.gz
tar -xzf $LIBRAW_RELEASE.tar.gz > /dev/null 2>&1
mkdir $LIBRAW_RELEASE/build
cd $LIBRAW_RELEASE/build
./configure --prefix=${DEPENDENCIES_INSTALL} && make && make install

cd $TRAVIS_BUILD_DIR
wget https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION.tar.gz -O $OIIO_RELEASE.tar.gz
tar -xzf $OIIO_RELEASE.tar.gz > /dev/null 2>&1
mkdir $OIIO_RELEASE/build
cd $OIIO_RELEASE/build
cmake .. -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} -DCMAKE_PREFIX_PATH=${DEPENDENCIES_INSTALL} -DCMAKE_CXX_FLAGS="-D__STDC_CONSTANT_MACROS" && make && make install

else
echo 'Using cached directory.';
fi
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then

# Target versions
FFMPEG_RELEASE=ffmpeg-2.2.9
ACES_RELEASE=aces_container-1.0
CTL_RELEASE=ctl-1.5.2
SEEXPR_VERSION=1.0.1
SEEXPR_RELEASE=SeExpr-rel-$SEEXPR_VERSION
OCIO_VERSION=1.0.9
OCIO_RELEASE=OpenColorIO-$OCIO_VERSION
LIBRAW_VERSION=0.16.2
LIBRAW_RELEASE=LibRaw-$LIBRAW_VERSION
OIIO_VERSION=1.6.13
OIIO_RELEASE=oiio-Release-$OIIO_VERSION

cd $TRAVIS_BUILD_DIR
wget https://www.ffmpeg.org/releases/$FFMPEG_RELEASE.tar.bz2
bunzip2 $FFMPEG_RELEASE.tar.bz2
tar -xf $FFMPEG_RELEASE.tar > /dev/null 2>&1
cd $FFMPEG_RELEASE
./configure --prefix=${DEPENDENCIES_INSTALL} --enable-shared --disable-static --disable-yasm --disable-debug && make && make install

cd $TRAVIS_BUILD_DIR
wget https://github.com/ampas/aces_container/archive/v1.0.tar.gz -O $ACES_RELEASE.tar.gz
tar -xzf $ACES_RELEASE.tar.gz > /dev/null 2>&1
mkdir $ACES_RELEASE/build
cd $ACES_RELEASE/build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} && make && make install/strip

cd $TRAVIS_BUILD_DIR
wget https://github.com/ampas/CTL/archive/$CTL_RELEASE.tar.gz -O $CTL_RELEASE.tar.gz
tar -xzf $CTL_RELEASE.tar.gz > /dev/null 2>&1
mkdir CTL-$CTL_RELEASE/build
cd CTL-$CTL_RELEASE/build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} && make && make install/strip

cd $TRAVIS_BUILD_DIR
wget https://github.com/wdas/SeExpr/archive/rel-$SEEXPR_VERSION.tar.gz -O $SEEXPR_RELEASE.tar.gz
tar -xzf $SEEXPR_RELEASE.tar.gz > /dev/null 2>&1
mkdir $SEEXPR_RELEASE/build
cd $SEEXPR_RELEASE/build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} && make && make install/strip

cd $TRAVIS_BUILD_DIR
wget https://github.com/imageworks/OpenColorIO/archive/v$OCIO_VERSION.tar.gz -O $OCIO_RELEASE.tar.gz
tar -xzf $OCIO_RELEASE.tar.gz > /dev/null 2>&1
mkdir $OCIO_RELEASE/build
cd $OCIO_RELEASE/build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} && make && make install/strip

cd $TRAVIS_BUILD_DIR
wget https://github.com/LibRaw/LibRaw/archive/$LIBRAW_VERSION.tar.gz -O $LIBRAW_RELEASE.tar.gz
tar -xzf $LIBRAW_RELEASE.tar.gz > /dev/null 2>&1
mkdir $LIBRAW_RELEASE/build
cd $LIBRAW_RELEASE/build
# edit CMake file to avoid LibRaw to install some files to /usr/ (permissions error)
sed -l 590 -i 's/${CMAKE_ROOT}/share/g' ../CMakeLists.txt
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} && make && make install/strip

cd $TRAVIS_BUILD_DIR
wget https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION.tar.gz -O $OIIO_RELEASE.tar.gz
tar -xzf $OIIO_RELEASE.tar.gz > /dev/null 2>&1
mkdir $OIIO_RELEASE/build
cd $OIIO_RELEASE/build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL} -DCMAKE_PREFIX_PATH=${DEPENDENCIES_INSTALL} -DCMAKE_CXX_FLAGS="-D__STDC_CONSTANT_MACROS" && make && make install/strip

elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then

Expand All @@ -94,11 +102,11 @@ elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
brew tap homebrew/science

echo "Brew install python & nose"
if [[ ${PYTHON_VERSION} == "2.7" ]]; then
if [[ ${PYTHON_VERSION} == 2* ]]; then
brew install python
pip install nose
pip install clint argcomplete
elif [[ ${PYTHON_VERSION} == "3.2" ]]; then
elif [[ ${PYTHON_VERSION} == 3* ]]; then
brew install python3
pip3 install nose
pip3 install clint argcomplete
Expand Down