diff options
author | jfarrell <jfarrell@apache.org> | 2015-02-18 23:25:54 -0500 |
---|---|---|
committer | jfarrell <jfarrell@apache.org> | 2015-02-18 23:25:54 -0500 |
commit | e03f7e8e75f4ecb41b5f82a5fb9ae3712959e74c (patch) | |
tree | c85cfbfe5f3ba581e51c54eef8be74c5f24487ed | |
parent | 80aa53e6bcc766a985d7a05c20e85e21e2bdd65f (diff) | |
download | thrift-e03f7e8e75f4ecb41b5f82a5fb9ae3712959e74c.tar.gz |
THRIFT-2962:Docker Thrift env for development and testing
Client: build
Patch: jfarrell
Adds build folder and moves all travis, cmake and docker build scripts into
one location for easier maintainability.
-rw-r--r-- | .travis.yml | 8 | ||||
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | build/cmake/CPackConfig.cmake (renamed from cmake/CPackConfig.cmake) | 0 | ||||
-rw-r--r-- | build/cmake/ConfigureChecks.cmake (renamed from cmake/ConfigureChecks.cmake) | 0 | ||||
-rw-r--r-- | build/cmake/DefineCMakeDefaults.cmake (renamed from cmake/DefineCMakeDefaults.cmake) | 0 | ||||
-rw-r--r-- | build/cmake/DefineInstallationPaths.cmake (renamed from cmake/DefineInstallationPaths.cmake) | 0 | ||||
-rw-r--r-- | build/cmake/DefineOptions.cmake (renamed from cmake/DefineOptions.cmake) | 0 | ||||
-rw-r--r-- | build/cmake/DefinePlatformSpecifc.cmake (renamed from cmake/DefinePlatformSpecifc.cmake) | 0 | ||||
-rw-r--r-- | build/cmake/FindAnt.cmake (renamed from cmake/FindAnt.cmake) | 0 | ||||
-rw-r--r-- | build/cmake/FindGLIB.cmake (renamed from cmake/FindGLIB.cmake) | 0 | ||||
-rw-r--r-- | build/cmake/README.md (renamed from cmake/README.md) | 0 | ||||
-rw-r--r-- | build/cmake/ThriftMacros.cmake (renamed from cmake/ThriftMacros.cmake) | 0 | ||||
-rw-r--r-- | build/cmake/config.h.in (renamed from cmake/config.h.in) | 0 | ||||
-rw-r--r-- | build/docker/README.md | 27 | ||||
-rw-r--r-- | build/docker/Vagrantfile | 59 | ||||
-rw-r--r-- | build/docker/centos/Dockerfile | 118 | ||||
-rw-r--r-- | build/docker/ubuntu/Dockerfile | 103 | ||||
-rwxr-xr-x[-rw-r--r--] | build/travis/installCXXDependencies.sh (renamed from contrib/installCXXDependencies.sh) | 0 | ||||
-rwxr-xr-x | build/travis/installDependencies.sh (renamed from contrib/installDependencies.sh) | 0 |
19 files changed, 312 insertions, 5 deletions
diff --git a/.travis.yml b/.travis.yml index e29f5559e..cfa3c85ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,8 +31,8 @@ compiler: - gcc before_install: - - sh contrib/installCXXDependencies.sh - - if [ "$ALL_DEPS" != "no" ] ; then sh contrib/installDependencies.sh 1> /dev/null ; fi + - sh build/travis/installCXXDependencies.sh + - if [ "$ALL_DEPS" != "no" ] ; then sh build/travis/installDependencies.sh 1> /dev/null ; fi - if [ "$ALL_DEPS" != "no" ] ; then export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.20/bin:$PATH ; fi - if [ "$ALL_DEPS" != "no" ] ; then cabal update ; fi @@ -112,8 +112,8 @@ matrix: - TEST_NAME="Debian Packages" compiler: clang before_install: - - sh contrib/installCXXDependencies.sh; - - sh contrib/installDependencies.sh 1> /dev/null; + - sh build/travis/installCXXDependencies.sh; + - sh build/travis/installDependencies.sh 1> /dev/null; - sudo apt-get install build-essential mono-gmcs mono-devel libmono-system-web2.0-cil erlang-base ruby1.8-dev python-all python-all-dev python-all-dbg php5 php5-dev script: - dpkg-buildpackage -tc -us -uc diff --git a/CMakeLists.txt b/CMakeLists.txt index 712a5cac9..3fe0f92c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ cmake_minimum_required(VERSION 2.8) project(thrift) -set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") # TODO: add `git rev-parse --short HEAD` # Read the version information from the Autoconf file diff --git a/cmake/CPackConfig.cmake b/build/cmake/CPackConfig.cmake index 0941a8074..0941a8074 100644 --- a/cmake/CPackConfig.cmake +++ b/build/cmake/CPackConfig.cmake diff --git a/cmake/ConfigureChecks.cmake b/build/cmake/ConfigureChecks.cmake index 9295d383d..9295d383d 100644 --- a/cmake/ConfigureChecks.cmake +++ b/build/cmake/ConfigureChecks.cmake diff --git a/cmake/DefineCMakeDefaults.cmake b/build/cmake/DefineCMakeDefaults.cmake index 2fe41d37a..2fe41d37a 100644 --- a/cmake/DefineCMakeDefaults.cmake +++ b/build/cmake/DefineCMakeDefaults.cmake diff --git a/cmake/DefineInstallationPaths.cmake b/build/cmake/DefineInstallationPaths.cmake index 122f0f6a9..122f0f6a9 100644 --- a/cmake/DefineInstallationPaths.cmake +++ b/build/cmake/DefineInstallationPaths.cmake diff --git a/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake index 457deb6a6..457deb6a6 100644 --- a/cmake/DefineOptions.cmake +++ b/build/cmake/DefineOptions.cmake diff --git a/cmake/DefinePlatformSpecifc.cmake b/build/cmake/DefinePlatformSpecifc.cmake index 282cad300..282cad300 100644 --- a/cmake/DefinePlatformSpecifc.cmake +++ b/build/cmake/DefinePlatformSpecifc.cmake diff --git a/cmake/FindAnt.cmake b/build/cmake/FindAnt.cmake index 16b9afda1..16b9afda1 100644 --- a/cmake/FindAnt.cmake +++ b/build/cmake/FindAnt.cmake diff --git a/cmake/FindGLIB.cmake b/build/cmake/FindGLIB.cmake index acbe433e3..acbe433e3 100644 --- a/cmake/FindGLIB.cmake +++ b/build/cmake/FindGLIB.cmake diff --git a/cmake/README.md b/build/cmake/README.md index a5dde191b..a5dde191b 100644 --- a/cmake/README.md +++ b/build/cmake/README.md diff --git a/cmake/ThriftMacros.cmake b/build/cmake/ThriftMacros.cmake index d35ec1085..d35ec1085 100644 --- a/cmake/ThriftMacros.cmake +++ b/build/cmake/ThriftMacros.cmake diff --git a/cmake/config.h.in b/build/cmake/config.h.in index 8b75e8c52..8b75e8c52 100644 --- a/cmake/config.h.in +++ b/build/cmake/config.h.in diff --git a/build/docker/README.md b/build/docker/README.md new file mode 100644 index 000000000..2ae309b90 --- /dev/null +++ b/build/docker/README.md @@ -0,0 +1,27 @@ +# Apache Thrift Docker containers +A set of docker containers used to build and test Apache Thrift + +### Available Containers + +* Ubuntu +* Centos + +## Dependencies + +* A working Docker environment. A Vagrantfile is provided which will setup an Ubuntu host and working Docker environment as well as build the Apache Thrift Docker container for testing and development + +## Usage +From the Apache Thrift code base root + +* Build + + docker build -t thrift contrib/docker/ubuntu + + or + + docker build -t thrift contrib/docker/centos + +* Run + + docker run -v $(pwd):/thrift -it thrift /bin/bash + diff --git a/build/docker/Vagrantfile b/build/docker/Vagrantfile new file mode 100644 index 000000000..5eac6e686 --- /dev/null +++ b/build/docker/Vagrantfile @@ -0,0 +1,59 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Base system bootstrap script +$bootstrap_script = <<__BOOTSTRAP__ +echo "Provisioning defaults" + +sudo apt-get update -y +sudo apt-get upgrade -y + +# Install default packages +sudo apt-get install -y build-essential curl git + +# Install latest Docker version +sudo curl -sSL https://get.docker.io/gpg | sudo apt-key add - +sudo echo "deb http://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list +sudo apt-get update -y +sudo apt-get install -y linux-image-extra-`uname -r` aufs-tools +sudo apt-get install -y lxc-docker + +echo "Finished provisioning defaults" +__BOOTSTRAP__ + +Vagrant.configure("2") do |config| + config.vm.box = "trusty64" + config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" + config.ssh.forward_agent = true + + config.vm.provider :virtualbox do |vbox| + vbox.customize ["modifyvm", :id, "--memory", "1024"] + vbox.customize ["modifyvm", :id, "--cpus", "2"] + end + + # Setup the default bootstrap script for our ubuntu base box image + config.vm.provision "shell", inline: $bootstrap_script + + # Setup the custom docker image from our Ubuntu Dockerfile + config.vm.provision "docker" do |d| + d.build_image "/vagrant/ubuntu", args: "-t thrift" + end + + # Setup the custom docker image from our Centos Dockerfile + #config.vm.provision "docker" do |d| + # d.build_image "/vagrant/centos", args: "-t thrift-centos" + #end + +end diff --git a/build/docker/centos/Dockerfile b/build/docker/centos/Dockerfile new file mode 100644 index 000000000..999a98fe0 --- /dev/null +++ b/build/docker/centos/Dockerfile @@ -0,0 +1,118 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Apache Thrift Docker build environment for Centos +# +# Known missing client libraries: +# - D +# - Haxe +# + +FROM centos:6.6 +MAINTAINER Apache Thrift <dev@thrift.apache.org> + +ENV HOME /root + +RUN yum -y update + +# General dependencies +RUN yum -y install -y tar m4 perl gcc git libtool libevent-devel zlib-devel openssl-devel + +RUN mkdir -p /tmp/epel && \ + curl -SL "http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm" -o /tmp/epel/epel-release-6-8.noarch.rpm && \ + cd /tmp/epel && \ + rpm -ivh epel-release-6-8.noarch.rpm && \ + cd $HOME + +# Autoconf +RUN mkdir -p /tmp/autoconf && \ + curl -SL "http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz" | tar -xzC /tmp/autoconf && \ + cd /tmp/autoconf/autoconf-2.69 && \ + ./configure --prefix=/usr && \ + make && \ + make install && \ + cd $HOME + +# Automake +RUN mkdir -p /tmp/automake && \ + curl -SL "http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz" | tar -xzC /tmp/automake && \ + cd /tmp/automake/automake-1.14 && \ + ./configure --prefix=/usr && \ + make && \ + make install && \ + cd $HOME + +# Bison +RUN mkdir -p /tmp/bison && \ + curl -SL "http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz" | tar -xzC /tmp/bison && \ + cd /tmp/bison/bison-2.5.1 && \ + ./configure --prefix=/usr && \ + make && \ + make install && \ + cd $HOME + +# Install an updated Boost library +RUN mkdir -p /tmp/boost && \ + curl -SL "http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz" | tar -xzC /tmp/boost && \ + cd /tmp/boost/boost_1_55_0 && \ + ./bootstrap.sh && \ + ./b2 install && \ + cd $HOME + +# Java Dependencies +RUN yum install -y ant junit ant-nodeps ant-junit java-1.7.0-openjdk-devel + +# Python Dependencies +RUN yum install -y python-devel python-setuptools python-twisted + +# Ruby Dependencies +RUN yum install -y ruby ruby-devel rubygems && \ + gem install bundler rake + +# Node.js Dependencies +RUN yum install -y nodejs nodejs-devel npm + +# Perl Dependencies +RUN yum install -y perl-Bit-Vector perl-Class-Accessor perl-ExtUtils-MakeMaker perl-Test-Simple + +# PHP Dependencies +RUN yum install -y php php-devel php-pear re2c + +# GLibC Dependencies +RUN yum install -y glib2-devel + +# Erlang Dependencies +RUN yum install -y erlang-kernel erlang-erts erlang-stdlib erlang-eunit erlang-rebar + +# Lua Dependencies +RUN yum install -y lua-devel + +# Go Dependencies +RUN yum install -y golang golang-pkg-linux-amd64 + +# C# Dependencies +RUN yum install -y mono-core mono-devel mono-web-devel mono-extras mingw32-binutils mingw32-runtime mingw32-nsis + +# Haskell Dependencies +RUN mkdir -p /tmp/haskell &&\ + curl -SL "http://sherkin.justhub.org/el6/RPMS/x86_64/justhub-release-2.0-4.0.el6.x86_64.rpm" -o /tmp/haskell/justhub-release-2.0-4.0.el6.x86_64.rpm && \ + cd /tmp/haskell && \ + rpm -ivh justhub-release-2.0-4.0.el6.x86_64.rpm && \ + yum -y install haskell && \ + cabal update && \ + cabal install cabal-install && \ + cd $HOME + +# Clean up +RUN rm -rf /tmp/* + +WORKDIR $HOME
\ No newline at end of file diff --git a/build/docker/ubuntu/Dockerfile b/build/docker/ubuntu/Dockerfile new file mode 100644 index 000000000..eff474fec --- /dev/null +++ b/build/docker/ubuntu/Dockerfile @@ -0,0 +1,103 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Apache Thrift Docker build environment for Centos +# +# Known missing client libraries: +# - None + +FROM ubuntu:trusty +MAINTAINER Apache Thrift <dev@thrift.apache.org> + +ENV HOME /root +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update -y && apt-get dist-upgrade -y + +# General dependencies +RUN apt-get install -y automake libtool flex bison pkg-config g++ libssl-dev make libqt4-dev git \ + debhelper + +# C++ dependencies +RUN apt-get install -y libboost-dev libboost-test-dev libboost-program-options-dev \ + libboost-filesystem-dev libboost-system-dev libevent-dev + +# Java dependencies +RUN apt-get install -y ant openjdk-7-jdk maven && \ + update-java-alternatives -s java-1.7.0-openjdk-amd64 + +# Python dependencies +RUN apt-get install -y python-all python-all-dev python-all-dbg python-setuptools python-support + +# Ruby dependencies +RUN apt-get install -y ruby ruby-dev && \ + gem install bundler rake + +# Perl dependencies +RUN apt-get install -y libbit-vector-perl libclass-accessor-class-perl + +# Php dependencies +RUN apt-get install -y php5 php5-dev php5-cli php-pear re2c phpunit + +# GlibC dependencies +RUN apt-get install -y libglib2.0-dev + +# Erlang dependencies +RUN apt-get install -y erlang-base erlang-eunit erlang-dev + +# GO dependencies +RUN echo "golang-go golang-go/dashboard boolean false" | debconf-set-selections && \ + apt-get install -y golang golang-go + +# Haskell dependencies +RUN apt-get install -y ghc cabal-install libghc-binary-dev libghc-network-dev libghc-http-dev \ + libghc-hashable-dev libghc-unordered-containers-dev libghc-vector-dev && \ + cabal update + +# Haxe +RUN apt-get install -y libneko0 && \ + mkdir -p /tmp/haxe /usr/lib/haxe && \ + curl http://haxe.org/website-content/downloads/3,1,3/downloads/haxe-3.1.3-linux64.tar.gz -o /tmp/haxe/haxe-3.1.3-linux64.tar.gz && \ + tar -xvzf /tmp/haxe/haxe-3.1.3-linux64.tar.gz -C /usr/lib/haxe --strip-components=1 && \ + ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \ + ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \ + ln -s /usr/lib/libneko.so.0 /usr/lib/libneko.so && \ + mkdir -p /usr/lib/haxe/lib && \ + chmod -R 777 /usr/lib/haxe/lib && \ + haxelib setup /usr/lib/haxe/lib && \ + haxelib install hxcpp + +# Lua dependencies +RUN apt-get install -y lua5.2 lua5.2-dev + +# Node.js dependencies +RUN apt-get install -y nodejs nodejs-dev nodejs-legacy npm + +# CSharp +RUN apt-get install -y mono-gmcs mono-devel mono-xbuild mono-complete libmono-system-web2.0-cil \ + mingw32 mingw32-binutils mingw32-runtime nsis + +# D dependencies +# THRIFT-2916: DMD pinned to 2.065.0-0 due to regression in 2.066 +RUN curl http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -o /etc/apt/sources.list.d/d-apt.list && \ + apt-get update && apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring && \ + apt-get update && \ + apt-get install -y xdg-utils dmd-bin=2.065.0-0 libphobos2-dev=2.065.0-0 + +# Clean up +RUN apt-get clean && \ + rm -rf /var/cache/apt/* && \ + rm -rf /var/lib/apt/lists/* && \ + rm -rf /tmp/* && \ + rm -rf /var/tmp/* + +WORKDIR $HOME diff --git a/contrib/installCXXDependencies.sh b/build/travis/installCXXDependencies.sh index ac3edf381..ac3edf381 100644..100755 --- a/contrib/installCXXDependencies.sh +++ b/build/travis/installCXXDependencies.sh diff --git a/contrib/installDependencies.sh b/build/travis/installDependencies.sh index 852a80569..852a80569 100755 --- a/contrib/installDependencies.sh +++ b/build/travis/installDependencies.sh |