add jaeger support, link hot container & req span (#840)

* add jaeger support, link hot container & req span

* adds jaeger support now with FN_JAEGER_URL, there's a simple tutorial in the
operating/metrics.md file now and it's pretty easy to get up and running.
* links a hot request span to a hot container span. when we change this to
sample at a lower ratio we'll need to finagle the hot container span to always
sample or something, otherwise we'll hide that info. at least, since we're
sampling at 100% for now if this is flipped on, can see freeze/unfreeze etc.
if they hit. this is useful for debugging. note that zipkin's exporter does
not follow the link at all, hence jaeger... and they're backed by the Cloud
Empire now (CNCF) so we'll probably use it anyway.

* vendor: add thrift for jaeger
This commit is contained in:
Reed Allman
2018-03-13 15:57:12 -07:00
committed by GitHub
parent a7347a88b7
commit 9eaf824398
2953 changed files with 2334535 additions and 35 deletions

168
vendor/git.apache.org/thrift.git/build/docker/README.md generated vendored Normal file
View File

@@ -0,0 +1,168 @@
# Docker Integration #
Due to the large number of language requirements to build Apache Thrift, docker containers are used to build and test the project on a variety of platforms to provide maximum test coverage.
## Travis CI Integration ##
The Travis CI scripts use the following environment variables and logic to determine their behavior.
### Environment Variables ###
| Variable | Default | Usage |
| -------- | ----- | ------- |
| `DISTRO` | `ubuntu-xenial` | Set by various build jobs in `.travis.yml` to run builds in different containers. Not intended to be set externally.|
| `DOCKER_REPO` | `thrift/thrift-build` | The name of the Docker Hub repository to obtain and store docker images. |
| `DOCKER_USER` | `<none>` | The Docker Hub account name containing the repository. |
| `DOCKER_PASS` | `<none>` | The Docker Hub account password to use when pushing new tags. |
For example, the default docker image that is used in builds if no overrides are specified would be: `thrift/thrift-build:ubuntu-xenial`
### Forks ###
If you have forked the Apache Thrift repository and you would like to use your own Docker Hub account to store thrift build images, you can use the Travis CI web interface to set the `DOCKER_USER`, `DOCKER_PASS`, and `DOCKER_REPO` variables in a secure manner. Your fork builds will then pull, push, and tag the docker images in your account.
### Logic ###
The Travis CI build runs in two phases - first the docker images are rebuilt for each of the three supported containers if they do not match the Dockerfile that was used to build the most recent tag. If a `DOCKER_PASS` environment variable is specified, the docker stage builds will attempt to log into Docker Hub and push the resulting tags.
## Supported Containers ##
The Travis CI (continuous integration) builds use the Ubuntu Trusty, Xenial, and Artful images to maximize language level coverage.
### Ubuntu ###
* trusty (legacy)
* xenial (stable)
* artful (latest)
## Unsupported Containers ##
These containers may be in various states, and may not build everything.
### CentOS ###
* 7.3
* make check in lib/py may hang in test_sslsocket - root cause unknown
### Debian ###
* jessie
* stretch
* make check in lib/cpp fails due to https://svn.boost.org/trac10/ticket/12507
## Building like Travis CI does, locally ##
We recommend you build locally the same way Travis CI does, so that when you submit your pull request you will run into fewer surprises. To make it a little easier, put the following into your `~/.bash_aliases` file:
# Kill all running containers.
alias dockerkillall='docker kill $(docker ps -q)'
# Delete all stopped containers.
alias dockercleanc='printf "\n>>> Deleting stopped containers\n\n" && docker rm $(docker ps -a -q)'
# Delete all untagged images.
alias dockercleani='printf "\n>>> Deleting untagged images\n\n" && docker rmi $(docker images -q -f dangling=true)'
# Delete all stopped containers and untagged images.
alias dockerclean='dockercleanc || true && dockercleani'
# Build a thrift docker image (run from top level of git repo): argument #1 is image type (ubuntu, centos, etc).
function dockerbuild
{
docker build -t $1 build/docker/$1
}
# Run a thrift docker image: argument #1 is image type (ubuntu, centos, etc).
function dockerrun
{
docker run -v $(pwd):/thrift/src -it $1 /bin/bash
}
To pull down the current image being used to build (the same way Travis CI does it) - if it is out of date in any way it will build a new one for you:
thrift$ DOCKER_REPO=thrift/thrift-build DISTRO=ubuntu-xenial build/docker/refresh.sh
To run all unit tests (just like Travis CI):
thrift$ dockerrun ubuntu-xenial
root@8caf56b0ce7b:/thrift/src# build/docker/scripts/autotools.sh
To run the cross tests (just like Travis CI):
thrift$ dockerrun ubuntu-xenial
root@8caf56b0ce7b:/thrift/src# build/docker/scripts/cross-test.sh
When you are done, you want to clean up occasionally so that docker isn't using lots of extra disk space:
thrift$ dockerclean
You need to run the docker commands from the root of the git repository for them to work.
When you are done in the root docker shell you can `exit` to go back to your user host shell. Once the unit tests and cross test passes locally, then submit he changes, and squash the pull request to one commit to make it easier to merge. Thanks. I am going to update the docker README.md with this information so others can leverage it too. Now you are building like Travis CI does!
## Raw Commands for Building with Docker ##
If you do not want to use the same scripts Travis CI does, you can do it manually:
Build the image:
thrift$ docker build -t thrift build/docker/ubuntu-xenial
Open a command prompt in the image:
thrift$ docker run -v $(pwd):/thrift/src -it thrift /bin/bash
## Core Tool Versions per Dockerfile ##
Last updated: October 1, 2017
| Tool | ubuntu-trusty | ubuntu-xenial | ubuntu-artful | Notes |
| :-------- | :------------ | :------------ | :------------ | :---- |
| ant | 1.9.3 | 1.9.6 | 1.9.9 | |
| autoconf | 2.69 | 2.69 | 2.69 | |
| automake | 1.14.1 | 1.15 | 1.15 | |
| bison | 3.0.2 | 3.0.4 | 3.0.4 | |
| boost | 1.54.0 | 1.58.0 | 1.63.0 | artful: stock boost 1.62.0 has problems running unit tests |
| cmake | 3.2.2 | 3.5.1 | 3.9.1 | |
| cppcheck | 1.61 | 1.72 | 1.80 | |
| flex | 2.5.35 | 2.6.0 | 2.6.1 | |
| glibc | 2.19 | 2.23 | 2.26 | |
| libevent | 2.0.21 | 2.0.21 | 2.1 | |
| libstdc++ | 4.8.4 | 5.4.0 | 7.2.0 | |
| make | 3.81 | 4.1 | 4.1 | |
| openssl | 1.0.1f | 1.0.2g | 1.0.2g | |
| qt5 | 5.2.1 | 5.5.1 | 5.9.1 | |
## Compiler/Language Versions per Dockerfile ##
Last updated: October 1, 2017
| Language | ubuntu-trusty | ubuntu-xenial | ubuntu-artful | Notes |
| :-------- | :------------ | :------------ | :------------ | :---- |
| as3 | | | | Not in CI |
| C++ gcc | 4.8.4 | 5.4.0 | 7.2.0 | |
| C++ clang | 3.4 | 3.8 | 4.0 | |
| C# (mono) | 3.2.8.0 | 4.2.1 | 4.6.2.7 | |
| c_glib | 2.40.2 | 2.48.2 | 2.54.0 | |
| cocoa | | | | Not in CI |
| d | 2.070.2 | 2.073.2 | 2.076.0 | |
| dart | 1.20.1 | 1.24.2 | 1.24.2 | |
| delphi | | | | Not in CI |
| dotnet | | 2.0.3 | 2.0.3 | |
| erlang | R16B03 | 18.3 | 20.0.4 | |
| go | 1.2.1 | 1.6.2 | 1.8.3 | |
| haskell | 7.6.3 | 7.10.3 | 8.0.2 | |
| haxe | | 3.2.1 | 3.4.2 | disabled in trusty builds - cores on install v3.0.0, disabled in artful builds - see THRIFT-4352 |
| java | 1.7.0_151 | 1.8.0_131 | 1.8.0_151 | |
| js | | | | Unsure how to look for version info? |
| lua | 5.1.5 | 5.2.4 | 5.2.4 | Lua 5.3: see THRIFT-4386 |
| nodejs | | 4.2.6 | 8.9.1 | trusty has node.js 0.10.0 which is too old |
| ocaml | | 4.02.3 | 4.04.0 | |
| perl | 5.18.2 | 5.22.1 | 5.26.0 | |
| php | 5.5.9 | 7.0.22 | 7.1.8 | |
| python | 2.7.6 | 2.7.12 | 2.7.14 | |
| python3 | 3.4.3 | 3.5.2 | 3.6.3 | |
| ruby | 1.9.3p484 | 2.3.1p112 | 2.3.3p222 | |
| rust | 1.15.1 | 1.15.1 | 1.18.0 | |
| smalltalk | | | | Not in CI |
| swift | | | | Not in CI |

View File

@@ -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

View File

@@ -0,0 +1,199 @@
# 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:
# - dotnet (will update to 2.0.0 separately)
# - haxe (not in centos)
FROM centos:7.3.1611
MAINTAINER Apache Thrift <dev@thrift.apache.org>
RUN yum install -y epel-release
# General dependencies
RUN yum install -y \
autoconf \
bison \
bison-devel \
clang \
clang-analyzer \
cmake3 \
curl \
flex \
gcc \
gcc-c++ \
gdb \
git \
libtool \
m4 \
make \
tar \
unzip \
valgrind \
wget && \
ln -s /usr/bin/cmake3 /usr/bin/cmake && \
ln -s /usr/bin/cpack3 /usr/bin/cpack && \
ln -s /usr/bin/ctest3 /usr/bin/ctest
# C++ dependencies
RUN yum install -y \
boost-devel-static \
zlib-devel \
openssl-devel \
libevent-devel && \
cd /usr/lib64 && \
ln -s libboost_thread-mt.a libboost_thread.a
# C# Dependencies
RUN yum install -y \
mono-core \
mono-devel \
mono-web-devel \
mono-extras
# D Dependencies
RUN yum install -y http://downloads.dlang.org/releases/2.x/2.076.0/dmd-2.076.0-0.fedora.x86_64.rpm xdg-utils
RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
mv libevent-master/deimos/* openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
mv libevent-master/C/* openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
rm -rf libevent-master openssl-master
# Dart
RUN cd /usr/local && \
wget -q https://storage.googleapis.com/dart-archive/channels/stable/release/1.24.2/sdk/dartsdk-linux-x64-release.zip && \
unzip -q dartsdk-linux-x64-release.zip && \
rm dartsdk-linux-x64-release.zip
ENV PATH /usr/local/dart-sdk/bin:$PATH
# Erlang Dependencies
RUN curl -sSL http://packages.erlang-solutions.com/rpm/centos/erlang_solutions.repo -o /etc/yum.repos.d/erlang_solutions.repo && \
yum install -y \
erlang-kernel \
erlang-erts \
erlang-stdlib \
erlang-eunit \
erlang-rebar \
erlang-tools
# GLibC Dependencies
RUN yum install -y glib2-devel
# Go Dependencies
RUN curl -sSL https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz | tar -C /usr/local/ -xz
ENV PATH /usr/local/go/bin:$PATH
# Haskell Dependencies
RUN yum -y install haskell-platform
# Haxe Dependencies
# Not in debian/stretch
# Java Dependencies
RUN yum install -y \
ant \
junit \
ant-junit \
java-1.8.0-openjdk-devel
# Lua Dependencies
# Lua in epel is too old (5.1.4, need 5.2) so we get the latest
RUN yum install -y readline-devel && \
wget -q http://www.lua.org/ftp/lua-5.3.4.tar.gz && \
tar xzf lua-5.3.4.tar.gz && \
cd lua-5.3.4 && \
sed -i 's/CFLAGS= /CFLAGS= -fPIC /g' src/Makefile && \
make linux && \
make install && \
cd .. && \
rm -rf lua-5*
# MinGW Dependencies
RUN yum install -y \
mingw32-binutils \
mingw32-crt \
mingw32-nsis
# Node.js Dependencies
# Work around epel issue where they removed http-parser that nodejs depends on!
RUN yum -y install https://opensource.enda.eu/packages/http-parser-2.7.1-3.el7.x86_64.rpm
RUN yum install -y \
nodejs \
npm
# Ocaml Dependencies
RUN yum install -y \
ocaml \
ocaml-ocamldoc && \
wget -q https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh -O - | sh -s /usr/local/bin && \
opam init --yes && \
opam install --yes oasis && \
echo '. /root/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true' >> ~/.bashrc
# Perl Dependencies
RUN yum install -y \
perl \
perl-version \
perl-Bit-Vector \
perl-Class-Accessor \
perl-ExtUtils-MakeMaker \
perl-Test-Simple \
perl-IO-Socket-SSL \
perl-Net-SSLeay \
perl-Crypt-SSLeay
# PHP Dependencies
RUN yum install -y \
php \
php-devel \
php-pear \
re2c \
php-phpunit-PHPUnit \
bzip2
# Python Dependencies
RUN yum install -y \
python \
python-devel \
python-pip \
python-setuptools \
python34 \
python34-devel \
python34-pip \
python34-setuptools
RUN pip2 install --upgrade pip
RUN pip2 install --upgrade backports.ssl_match_hostname ipaddress setuptools six tornado tornado-testing twisted virtualenv zope-interface
RUN pip3 install --upgrade pip
RUN pip3 install --upgrade backports.ssl_match_hostname ipaddress setuptools six tornado tornado-testing twisted virtualenv zope-interface
# Ruby Dependencies
RUN yum install -y \
ruby \
ruby-devel \
rubygems && \
gem install bundler rake
# Rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.17.0
ENV PATH /root/.cargo/bin:$PATH
# Clean up
RUN rm -rf /tmp/* && \
yum clean all
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src

View File

@@ -0,0 +1,204 @@
# 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 Debian
#
# Known missing client libraries:
# - dotnetcore
# - rust
FROM buildpack-deps:jessie-scm
MAINTAINER Apache Thrift <dev@thrift.apache.org>
ENV DEBIAN_FRONTEND noninteractive
# Add apt sources
# jessie-backports for cmake and some ruby bits
RUN echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
# Dart
RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g'
RUN apt-get update && apt-get install -y --no-install-recommends \
`# General dependencies` \
bison \
build-essential \
clang \
debhelper \
flex \
pkg-config && \
apt-get -t jessie-backports install -y --no-install-recommends cmake
RUN apt-get install -y --no-install-recommends \
`# C++ dependencies` \
libboost-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-test-dev \
libboost-thread-dev \
libevent-dev \
libssl-dev \
qt5-default \
qtbase5-dev \
qtbase5-dev-tools
RUN apt-get install -y --no-install-recommends \
`# Java dependencies` \
ant \
ant-optional \
openjdk-7-jdk \
maven
RUN apt-get install -y --no-install-recommends \
`# Python dependencies` \
python-all \
python-all-dbg \
python-all-dev \
python-pip \
python-setuptools \
python-twisted \
python-zope.interface \
python3-all \
python3-all-dbg \
python3-all-dev \
python3-setuptools \
python3-pip
RUN apt-get install -y --no-install-recommends \
`# Ruby dependencies` \
ruby \
ruby-dev \
`# Perl dependencies` \
libbit-vector-perl \
libclass-accessor-class-perl \
libcrypt-ssleay-perl \
libio-socket-ssl-perl \
libnet-ssleay-perl
RUN apt-get -t jessie-backports install -y ruby-bundler
RUN apt-get install -y --no-install-recommends \
`# Php dependencies` \
php5 \
php5-dev \
php5-cli \
php-pear \
re2c \
phpunit \
`# GlibC dependencies` \
libglib2.0-dev
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Erlang dependencies` \
erlang-base \
erlang-eunit \
erlang-dev \
erlang-tools \
rebar
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Haskell dependencies` \
ghc \
cabal-install \
`# Haxe dependencies` \
neko \
neko-dev \
libneko0
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Node.js dependencies` \
nodejs \
nodejs-dev \
nodejs-legacy \
npm
RUN apt-get update && apt-get install -y --no-install-recommends \
`# CSharp dependencies` \
libmono-system-web2.0-cil \
mono-devel
RUN apt-get update && apt-get install -y --no-install-recommends \
`# D dependencies` \
xdg-utils \
`# Dart dependencies` \
dart \
`# Lua dependencies` \
lua5.2 \
lua5.2-dev \
`# MinGW dependencies` \
mingw32 \
mingw32-binutils \
`# mingw32-runtime` \
nsis \
`# Clean up` \
&& rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /var/tmp/*
# Ruby
RUN gem install bundler --no-ri --no-rdoc
# Python optional dependencies
RUN pip2 install -U ipaddress backports.ssl_match_hostname tornado
RUN pip3 install -U backports.ssl_match_hostname tornado
# Go
RUN curl -sSL https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /usr/local/ -xz
ENV PATH /usr/local/go/bin:$PATH
# Haxe
RUN mkdir -p /usr/lib/haxe && \
wget -O - https://github.com/HaxeFoundation/haxe/releases/download/3.2.1/haxe-3.2.1-linux64.tar.gz | \
tar -C /usr/lib/haxe --strip-components=1 -xz && \
ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \
mkdir -p /usr/lib/haxe/lib && \
chmod -R 777 /usr/lib/haxe/lib && \
haxelib setup /usr/lib/haxe/lib && \
haxelib install hxcpp
# D
RUN curl -sSL http://downloads.dlang.org/releases/2.x/2.070.0/dmd_2.070.0-0_amd64.deb -o /tmp/dmd_2.070.0-0_amd64.deb && \
dpkg -i /tmp/dmd_2.070.0-0_amd64.deb && \
rm /tmp/dmd_2.070.0-0_amd64.deb && \
curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
mv libevent-master/deimos/* openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
mv libevent-master/C/* openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
rm -rf libevent-master openssl-master && \
echo 'gcc -Wl,--no-as-needed $*' > /usr/local/bin/gcc-dmd && \
chmod 755 /usr/local/bin/gcc-dmd && \
echo 'CC=/usr/local/bin/gcc-dmd' >> /etc/dmd.conf
# Dart
ENV PATH /usr/lib/dart/bin:$PATH
# OCaml
RUN echo 'deb http://ppa.launchpad.net/avsm/ppa/ubuntu trusty main' > /etc/apt/sources.list.d/avsm-official-ocaml.list && \
gpg --keyserver keyserver.ubuntu.com --recv 61707B09 && \
gpg --export --armor 61707B09 | apt-key add - && \
apt-get update && \
apt-get install -y ocaml opam && \
opam init && \
opam install oasis
# Force utf8 locale to successfully build Haskell tf-random
ENV LC_ALL C.UTF-8
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src

View File

@@ -0,0 +1,231 @@
# 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 Debian Stretch
#
# Known issues:
# - d: deimos for libevent and openssl disabled - build errors
# - dotnetcore, because netcore is for 1.0.0-preview and 2.0.0 is out
# - rust: cargo not in debian repo - perhaps not needed?
FROM buildpack-deps:stretch-scm
MAINTAINER Apache Thrift <dev@thrift.apache.org>
ENV DEBIAN_FRONTEND noninteractive
### Add apt repos
RUN apt-get update && apt-get install -y --no-install-recommends apt apt-transport-https curl wget apt-utils
# D
RUN wget 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
# Dart
RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g'
# dotnet (core) 2.0.0 - project isn't ready for this yet:
# RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
# echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list
# node.js (this step runs apt-get update internally)
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash
### install general dependencies
RUN apt-get install -y --no-install-recommends \
`# General dependencies` \
bash-completion \
bison \
build-essential \
clang \
cmake \
debhelper \
flex \
gdb \
ninja-build \
pkg-config \
valgrind \
vim
### languages
RUN apt-get install -y --no-install-recommends \
`# C++ dependencies` \
libboost-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-test-dev \
libboost-thread-dev \
libevent-dev \
libssl-dev \
qt5-default \
qtbase5-dev \
qtbase5-dev-tools
RUN apt-get install -y --no-install-recommends \
`# csharp (mono) dependencies` \
mono-devel
RUN apt-get install -y --no-install-recommends \
`# D dependencies` \
dmd-bin \
libevent-dev \
libssl-dev \
xdg-utils
# libevent deimos disabled - build errors
# RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
# curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
# mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
# mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
# rm -rf libevent-master
# openssl deimos doesn't work with openssl-1.1.0 - disabling it for now:
# RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
# mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
# mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
# rm -rf openssl-master
RUN apt-get install -y --no-install-recommends \
`# Dart dependencies` \
dart
ENV PATH /usr/lib/dart/bin:$PATH
# project isn't ready for this quite yet:
# RUN apt-get install -y --no-install-recommends \
# `# dotnet core dependencies` \
# dotnet-sdk-2.0.0
RUN apt-get install -y --no-install-recommends \
`# Erlang dependencies` \
erlang-base \
erlang-eunit \
erlang-dev \
erlang-tools \
rebar
RUN apt-get install -y --no-install-recommends \
`# GlibC dependencies` \
libglib2.0-dev
RUN apt-get install -y --no-install-recommends \
`# golang (go) dependencies` \
golang-go
RUN apt-get install -y --no-install-recommends \
`# Haskell dependencies` \
ghc \
cabal-install
RUN apt-get install -y --no-install-recommends \
`# Haxe dependencies` \
haxe \
neko \
neko-dev
RUN haxelib setup --always /usr/share/haxe/lib && \
haxelib install --always hxcpp
RUN apt-get install -y --no-install-recommends \
`# Java dependencies` \
ant \
ant-optional \
openjdk-8-jdk \
maven
RUN apt-get install -y --no-install-recommends \
`# Lua dependencies` \
lua5.2 \
lua5.2-dev
# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
# same for debian stretch
# lua5.3 does not install alternatives so stick with 5.2 here
RUN apt-get install -y --no-install-recommends \
`# Node.js dependencies` \
nodejs
RUN apt-get install -y --no-install-recommends \
`# OCaml dependencies` \
ocaml \
opam && \
opam init --yes && \
opam install --yes oasis
RUN apt-get install -y --no-install-recommends \
`# Perl dependencies` \
libbit-vector-perl \
libclass-accessor-class-perl \
libcrypt-ssleay-perl \
libio-socket-ssl-perl \
libnet-ssleay-perl
RUN apt-get install -y --no-install-recommends \
`# Php dependencies` \
php7.0 \
php7.0-cli \
php7.0-dev \
php-pear \
re2c \
phpunit
RUN apt-get install -y --no-install-recommends \
`# Python dependencies` \
python-all \
python-all-dbg \
python-all-dev \
python-backports.ssl-match-hostname \
python-ipaddress \
python-pip \
python-setuptools \
python-six \
python-tornado \
python-twisted \
python-wheel \
python-zope.interface \
python3-all \
python3-all-dbg \
python3-all-dev \
python3-setuptools \
python3-six \
python3-tornado \
python3-twisted \
python3-wheel \
python3-zope.interface && \
pip install --upgrade backports.ssl_match_hostname
RUN apt-get install -y --no-install-recommends \
`# Ruby dependencies` \
ruby \
ruby-dev \
ruby-bundler
RUN gem install bundler --no-ri --no-rdoc
RUN apt-get install -y --no-install-recommends \
`# Rust dependencies` \
rustc
# Update anything else left hanging
RUN apt-get dist-upgrade -y
# Clean up
RUN rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /var/tmp/*
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src

82
vendor/git.apache.org/thrift.git/build/docker/refresh.sh generated vendored Executable file
View File

@@ -0,0 +1,82 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
#
# The build has two stages: "docker" and "test"
# The "docker" stage is meant to rebuild the docker images
# if needed. If we cannot push that result however then
# there is no reason to do anything.
# The "test" stage is an actual test job. Even if the docker
# image doesn't match what's in the repo, we still build
# the image so the build job can run properly.
#
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DOCKER_TAG=$DOCKER_REPO:$DISTRO
function dockerfile_changed {
# image may not exist yet, so we have to let it fail silently:
docker pull $DOCKER_TAG || true
docker run $DOCKER_TAG bash -c 'cd .. && sha512sum Dockerfile' > .Dockerfile.sha512
sha512sum -c .Dockerfile.sha512
}
#
# If this build has no DOCKER_PASS and it is in the docker stage
# then there's no reason to do any processing because we cannot
# push the result if the Dockerfile changed.
#
if [[ "$TRAVIS_BUILD_STAGE" == "docker" ]] && [[ -z "$DOCKER_PASS" ]]; then
echo Detected docker stage build and no defined DOCKER_PASS, this build job will be skipped.
echo Subsequent jobs in the test stage may each rebuild the docker image.
exit 0
fi
pushd ${SCRIPT_DIR}/$DISTRO
if dockerfile_changed; then
echo Dockerfile has not changed. No need to rebuild.
exit 0
else
echo Dockerfile has changed.
fi
popd
#
# Dockerfile has changed - rebuild it for the current build job.
# If it is a "docker" stage build then we want to push it back
# to the DOCKER_REPO. If it is a "test" stage build then we do
# not. If nobody defined a DOCKER_PASS then it doesn't matter.
#
echo Rebuilding docker image $DISTRO
docker build --tag $DOCKER_TAG build/docker/$DISTRO
if [[ "$TRAVIS_BUILD_STAGE" == "docker" ]] && [[ ! -z "$DOCKER_USER" ]] && [[ ! -z "$DOCKER_PASS" ]]; then
echo Pushing docker image $DOCKER_TAG
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push $DOCKER_TAG
else
echo Not pushing docker image: either not a docker stage build job, or one of DOCKER_USER or DOCKER_PASS is undefined.
fi

30
vendor/git.apache.org/thrift.git/build/docker/run.sh generated vendored Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DOCKER_TAG=$DOCKER_REPO:$DISTRO
printenv | sort
docker run --net=host -e BUILD_LIBS="$BUILD_LIBS" $BUILD_ENV -v $(pwd):/thrift/src \
-it $DOCKER_TAG build/docker/scripts/$SCRIPT $BUILD_ARG

View File

@@ -0,0 +1,6 @@
#!/bin/sh
set -ev
./bootstrap.sh
./configure $*
make check -j3

View File

@@ -0,0 +1,23 @@
#!/bin/sh
set -ev
CMAKE_FLAGS=$*
MAKEPROG=make
if ninja --version >/dev/null 2>&1; then
MAKEPROG=ninja
CMAKE_FLAGS="-GNinja $CMAKE_FLAGS"
fi
mkdir -p cmake_build && cd cmake_build
cmake $CMAKE_FLAGS ..
for LIB in $BUILD_LIBS; do
if ! grep "^BUILD_${LIB}:BOOL=ON$" CMakeCache.txt ; then
echo "failed to configure $LIB"
exit 1
fi
done
$MAKEPROG -j3
cpack
ctest -VV -E "(python_test)"
# disabled cmake python_test for now since it fails in travis under centos

View File

@@ -0,0 +1,16 @@
#!/bin/sh
set -ev
./bootstrap.sh
./configure --enable-tutorial=no
make -j3 precross
set +e
make cross$1
RET=$?
if [ $RET -ne 0 ]; then
cat test/log/unexpected_failures.log
fi
exit $RET

View File

@@ -0,0 +1,5 @@
#!/bin/sh
set -ev
dpkg-buildpackage -tc -us -uc
ls -al ..

View File

@@ -0,0 +1,9 @@
#!/bin/sh
set -ev
./bootstrap.sh
./configure $*
make dist
tar xvf thrift-*.tar.gz
cd thrift-*
./build/docker/scripts/cmake.sh

62
vendor/git.apache.org/thrift.git/build/docker/scripts/sca.sh generated vendored Executable file
View File

@@ -0,0 +1,62 @@
#!/bin/sh
set -ev
#
# Generate thrift files so the static code analysis includes an analysis
# of the files the thrift compiler spits out. If running interactively
# set the NOBUILD environment variable to skip the boot/config/make phase.
#
if [[ -z "$NOBUILD" ]]; then
./bootstrap.sh
./configure --enable-tutorial=no
make -j3 precross
fi
#
# C/C++ static code analysis with cppcheck
# add --error-exitcode=1 to --enable=all as soon as everything is fixed
#
# Python code style check with flake8
#
# search for TODO etc within source tree
# some statistics about the code base
# some info about the build machine
# Compiler cppcheck (All)
cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
# C++ cppcheck (All)
cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
# C Glib cppcheck (All)
cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
# Silent error checks
# See THRIFT-4371 : flex generated code triggers "possible null pointer dereference" in yy_init_buffer
cppcheck --force --quiet --inline-suppr --suppress="*:thrift/thriftl.cc" --error-exitcode=1 -j2 compiler/cpp/src
cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
# Python code style
flake8 --ignore=E501 lib/py
flake8 tutorial/py
# THRIFT-4371 : generated files are excluded because they haven't been scrubbed yet
flake8 --ignore=E501 --exclude="*/gen-py*/*" test/py
flake8 test/py.twisted
flake8 test/py.tornado
flake8 --ignore=E501 test/test.py
flake8 --ignore=E501,E722 test/crossrunner
flake8 test/features
# TODO etc
echo FIXMEs: `grep -r FIXME * | wc -l`
echo HACKs: `grep -r HACK * | wc -l`
echo TODOs: `grep -r TODO * | wc -l`
# LoC
sloccount .
# System Info
dpkg -l
uname -a

View File

@@ -0,0 +1,30 @@
#!/bin/sh
set -e
# Wraps autotools.sh, but each binary crashes if it exhibits undefined behavior.
# Set the undefined behavior flags. This crashes on all undefined behavior except for
# undefined casting, aka "vptr".
# TODO: fix undefined vptr behavior and turn this option back on.
export CFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined -O0 -ggdb3 -fno-omit-frame-pointer"
export CXXFLAGS="${CFLAGS}"
export LDFLAGS="-lubsan"
export UBSAN_OPTIONS=print_stacktrace=1
#
# work around https://svn.boost.org/trac10/ticket/11632 if present
#
sed -i 's/, stream_t(rdbuf()) /, stream_t(pbase_type::member.get())/g' /usr/include/boost/format/alt_sstream.hpp
# llvm-symbolizer must be on PATH to get a stack trace on error
CLANG_PATH="$(mktemp -d)"
trap "rm -rf ${CLANG_PATH}" EXIT
ln -s "$(whereis llvm-symbolizer-4.0 | rev | cut -d ' ' -f 1 | rev)" \
"${CLANG_PATH}/llvm-symbolizer"
export PATH="${CLANG_PATH}:${PATH}"
llvm-symbolizer -version
build/docker/scripts/autotools.sh $*

View File

@@ -0,0 +1,254 @@
# 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 Ubuntu Artful
# Using all stock Ubuntu Artful packaging except for:
# - cpp: stock boost 1.62 in artful has a nasty bug so we use stock boost 1.63
# - d: does not come with Ubuntu so we're installing the latest
# - d: deimos for libevent and openssl omitted - not compatible / build errors
# - haxe: see THRIFT-4352, but test/haxe cores during testing
# and hxcpp 3.4.64 is not compatible with artful
#
FROM buildpack-deps:artful-scm
MAINTAINER Apache Thrift <dev@thrift.apache.org>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y --no-install-recommends \
apt \
apt-transport-https \
apt-utils \
curl \
dirmngr \
software-properties-common \
wget
# csharp (mono) - if we ever want a later version
# RUN echo "deb http://download.mono-project.com/repo/debian xenial main" | tee /etc/apt/sources.list.d/mono.list && \
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF
# dotnet (core)
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-artful-prod artful main" > /etc/apt/sources.list.d/dotnetdev.list
# node.js (this step runs apt-get update internally) - if we ever want a later version
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
### install general dependencies
RUN apt-get install -y --no-install-recommends \
`# General dependencies` \
bash-completion \
bison \
build-essential \
clang \
cmake \
debhelper \
flex \
gdb \
llvm \
ninja-build \
pkg-config \
valgrind \
vim
ENV PATH /usr/lib/llvm-3.8/bin:$PATH
# boost-1.62 has a terrible bug in boost::test, see https://svn.boost.org/trac10/ticket/12507
RUN apt-get install -y --no-install-recommends \
`# C++ dependencies` \
libboost1.63-all-dev \
libevent-dev \
libssl-dev \
qt5-default \
qtbase5-dev \
qtbase5-dev-tools
RUN apt-get install -y --no-install-recommends \
`# csharp (mono) dependencies` \
mono-devel
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EBCF975E5BA24D5E && \
wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list && \
wget -qO - https://dlang.org/d-keyring.gpg | apt-key add - && \
apt-get update && \
apt-get install -y --no-install-recommends \
`# D dependencies` \
dmd-bin \
libphobos2-dev \
dub \
dfmt \
dscanner \
libevent-dev \
libssl-dev \
xdg-utils
# libevent deimos doesn't seem to work so not enabling it:
# RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
# curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
# mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
# mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
# rm -rf libevent-master
# openssl deimos doesn't work with openssl-1.0.2 so not enabling it:
# RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
# mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
# mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
# rm -rf openssl-master
# dart cannot be downloaded by aptitude because of
# https://github.com/dart-lang/sdk/issues/30512
# RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
# curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
# apt-get update && \
# apt-get install -y --no-install-recommends \
# `# Dart dependencies` \
# dart
# so instead we do:
RUN wget https://storage.googleapis.com/dart-archive/channels/stable/release/latest/linux_packages/dart_1.24.2-1_amd64.deb && \
dpkg -i dart_1.24.2-1_amd64.deb && \
rm dart_1.24.2-1_amd64.deb
ENV PATH /usr/lib/dart/bin:$PATH
RUN apt-get install -y --no-install-recommends \
`# dotnet core dependencies` \
dotnet-sdk-2.0.3
RUN apt-get install -y --no-install-recommends \
`# Erlang dependencies` \
erlang-base \
erlang-eunit \
erlang-dev \
erlang-tools \
rebar
RUN apt-get install -y --no-install-recommends \
`# GlibC dependencies` \
libglib2.0-dev
RUN apt-get install -y --no-install-recommends \
`# golang (go) dependencies` \
golang-go \
golang-race-detector-runtime
RUN apt-get install -y --no-install-recommends \
`# Haskell dependencies` \
ghc \
cabal-install
# see THRIFT-4352, test/haxe cores on artful
# RUN apt-get install -y --no-install-recommends \
# `# Haxe dependencies` \
# haxe \
# neko \
# neko-dev
# RUN haxelib setup --always /usr/share/haxe/lib && \
# haxelib install --always hxcpp
RUN apt-get install -y --no-install-recommends \
`# Java dependencies` \
ant \
ant-optional \
openjdk-8-jdk \
maven
RUN apt-get install -y --no-install-recommends \
`# Lua dependencies` \
lua5.2 \
lua5.2-dev
# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
# lua5.3 does not install alternatives!
# need to update our luasocket code, lua doesn't have luaL_openlib any more
RUN apt-get install -y --no-install-recommends \
`# Node.js dependencies` \
nodejs
RUN apt-get install -y --no-install-recommends \
`# OCaml dependencies` \
ocaml \
opam && \
opam init --yes && \
opam install --yes oasis
RUN apt-get install -y --no-install-recommends \
`# Perl dependencies` \
libbit-vector-perl \
libclass-accessor-class-perl \
libcrypt-ssleay-perl \
libio-socket-ssl-perl \
libnet-ssleay-perl
RUN apt-get install -y --no-install-recommends \
`# Php dependencies` \
php \
php-cli \
php-dev \
php-pear \
re2c \
phpunit
RUN apt-get install -y --no-install-recommends \
`# Python dependencies` \
python-all \
python-all-dbg \
python-all-dev \
python-ipaddress \
python-pip \
python-setuptools \
python-six \
python-tornado \
python-twisted \
python-wheel \
python-zope.interface && \
pip install --upgrade backports.ssl_match_hostname
RUN apt-get install -y --no-install-recommends \
`# Python3 dependencies` \
python3-all \
python3-all-dbg \
python3-all-dev \
python3-pip \
python3-setuptools \
python3-six \
python3-tornado \
python3-twisted \
python3-wheel \
python3-zope.interface
RUN apt-get install -y --no-install-recommends \
`# Ruby dependencies` \
ruby \
ruby-dev \
ruby-bundler
RUN gem install bundler --no-ri --no-rdoc
RUN apt-get install -y --no-install-recommends \
`# Rust dependencies` \
cargo \
rustc
RUN apt-get install -y --no-install-recommends \
`# Static Code Analysis dependencies` \
cppcheck \
sloccount && \
pip install flake8
# Clean up
RUN rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /var/tmp/*
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src

View File

@@ -0,0 +1,223 @@
# 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 Ubuntu Trusty
# Using all stock Ubuntu Trusty packaging except for:
# - d: does not come with Ubuntu so we're installing 2.070.0
# - dart: does not come with Ubuntu so we're installing 1.20.1
# - dotnetcore, disabled because netcore is for 1.0.0-preview and 2.0.0 is out
# - haxe, disabled because the distro comes with 3.0.0 and it cores while installing
# - node.js, disabled because it is at 0.10.0 in the distro which is too old (need 4+)
# - ocaml, disabled because it fails to install properly
#
FROM buildpack-deps:trusty-scm
MAINTAINER Apache Thrift <dev@thrift.apache.org>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y --no-install-recommends \
apt \
apt-transport-https \
apt-utils \
curl \
dirmngr \
software-properties-common \
wget
RUN apt-get update && apt-get install -y --no-install-recommends \
`# General dependencies` \
bash-completion \
bison \
build-essential \
clang \
cmake \
debhelper \
flex \
gdb \
llvm \
ninja-build \
pkg-config \
valgrind \
vim
ENV PATH /usr/lib/llvm-3.8/bin:$PATH
RUN apt-get install -y --no-install-recommends \
`# C++ dependencies` \
libboost-all-dev \
libevent-dev \
libssl-dev \
qt5-default \
qtbase5-dev \
qtbase5-dev-tools
RUN apt-get install -y --no-install-recommends \
`# csharp (mono) dependencies` \
mono-devel
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EBCF975E5BA24D5E && \
wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list && \
wget -qO - https://dlang.org/d-keyring.gpg | apt-key add - && \
apt-get update && \
apt-get install -y --no-install-recommends \
`# D dependencies` \
dmd-bin=2.070.2-0 \
libphobos2-dev=2.070.2-0 \
dub \
dfmt \
dscanner \
xdg-utils
# RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
# curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
# mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
# mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
# rm -rf libevent-master
# RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
# mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
# mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
# rm -rf openssl-master
RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
`# Dart dependencies` \
dart=1.20.1-1
ENV PATH /usr/lib/dart/bin:$PATH
RUN apt-get install -y --no-install-recommends \
`# Erlang dependencies` \
erlang-base \
erlang-eunit \
erlang-dev \
erlang-tools \
rebar
RUN apt-get install -y --no-install-recommends \
`# GlibC dependencies` \
libglib2.0-dev
RUN apt-get install -y --no-install-recommends \
`# golang (go) dependencies` \
golang-go
RUN apt-get install -y --no-install-recommends \
`# Haskell dependencies` \
ghc \
cabal-install
# disabled because it cores while installing
# RUN apt-get install -y --no-install-recommends \
# `# Haxe dependencies` \
# haxe \
# neko \
# neko-dev && \
# haxelib setup /usr/share/haxe/lib && \
# haxelib install hxcpp 3.2.102
RUN apt-get install -y --no-install-recommends \
`# Java dependencies` \
ant \
ant-optional \
openjdk-7-jdk \
maven
RUN apt-get install -y --no-install-recommends \
`# Lua dependencies` \
lua5.1 \
lua5.1-dev
# disabled because it is too old
# RUN apt-get install -y --no-install-recommends \
# `# Node.js dependencies` \
# nodejs \
# npm
# disabled because it fails to install properly
# RUN apt-get install -y --no-install-recommends \
# `# OCaml dependencies` \
# ocaml \
# opam && \
# opam init --yes && \
# opam install --yes oasis
RUN apt-get install -y --no-install-recommends \
`# Perl dependencies` \
libbit-vector-perl \
libclass-accessor-class-perl \
libcrypt-ssleay-perl \
libio-socket-ssl-perl \
libnet-ssleay-perl
RUN apt-get install -y --no-install-recommends \
`# Php dependencies` \
php5 \
php5-cli \
php5-dev \
php-pear \
re2c \
phpunit
RUN apt-get install -y --no-install-recommends \
`# Python dependencies` \
python-all \
python-all-dbg \
python-all-dev \
python-pip \
python-setuptools \
python-six \
python-twisted \
python-wheel \
python-zope.interface \
python3-all \
python3-all-dbg \
python3-all-dev \
python3-pip \
python3-setuptools \
python3-six \
python3-wheel \
python3-zope.interface && \
pip install -U ipaddress backports.ssl_match_hostname tornado && \
pip3 install -U backports.ssl_match_hostname tornado
# installing tornado by pip/pip3 instead of debian package
# if we install the debian package, the build fails in py2
RUN apt-get install -y --no-install-recommends \
`# Ruby dependencies` \
ruby \
ruby-dev \
ruby-bundler
RUN gem install bundler --no-ri --no-rdoc
RUN apt-get install -y --no-install-recommends \
`# Rust dependencies` \
cargo \
rustc
RUN apt-get install -y --no-install-recommends \
`# Static Code Analysis dependencies` \
cppcheck \
sloccount && \
pip install flake8
# Clean up
RUN rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /var/tmp/*
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src

View File

@@ -0,0 +1,231 @@
# 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 Ubuntu
#
# Known missing client libraries:
# - dotnetcore
FROM buildpack-deps:trusty-scm
MAINTAINER Apache Thrift <dev@thrift.apache.org>
ENV DEBIAN_FRONTEND noninteractive
# Add apt sources
# CMAKE
RUN apt-get update && \
apt-get install -y --no-install-recommends software-properties-common && \
add-apt-repository -y ppa:george-edison55/cmake-3.x
# Erlang
RUN echo 'deb http://packages.erlang-solutions.com/debian trusty contrib' > /etc/apt/sources.list.d/erlang_solutions.list && \
curl -sSL https://packages.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add -
# Dart
RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g'
# Consider using mirror nearby when building locally
# TODO: Provide option via --build-arg=...
# RUN sed -i /etc/apt/sources.list -e 's!http://archive.ubuntu.com/ubuntu/!http://your/mirror/!g'
RUN apt-get update && apt-get install -y --no-install-recommends \
`# General dependencies` \
bison \
build-essential \
clang \
cmake \
debhelper \
flex \
ninja-build \
pkg-config \
`# Included in buildpack-deps` \
`# autoconf` \
`# automake` \
`# g++` \
`# git` \
`# libtool` \
`# make`
RUN apt-get install -y --no-install-recommends \
`# C++ dependencies` \
`# libevent and OpenSSL are needed by D too` \
libboost-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-test-dev \
libboost-thread-dev \
libevent-dev \
libssl-dev \
qt5-default \
qtbase5-dev \
qtbase5-dev-tools
RUN apt-get install -y --no-install-recommends \
`# Java dependencies` \
ant \
ant-optional \
openjdk-7-jdk \
maven
RUN apt-get install -y --no-install-recommends \
`# Python dependencies` \
`# TODO:` \
`# Install twisted and zope.interface via pip. we need twisted at ./configure time, otherwise` \
`# py.twisted tests are skipped.` \
python-all \
python-all-dbg \
python-all-dev \
python-pip \
python-setuptools \
python-twisted \
python-zope.interface \
python3-all \
python3-all-dbg \
python3-all-dev \
python3-setuptools \
python3-pip
RUN apt-get install -y --no-install-recommends \
`# Ruby dependencies` \
ruby \
ruby-dev \
ruby-bundler \
`# Perl dependencies` \
libbit-vector-perl \
libclass-accessor-class-perl \
libcrypt-ssleay-perl \
libio-socket-ssl-perl \
libnet-ssleay-perl
RUN apt-get install -y --no-install-recommends \
`# Php dependencies` \
php5 \
php5-dev \
php5-cli \
php-pear \
re2c \
phpunit \
`# GlibC dependencies` \
libglib2.0-dev
RUN apt-get update && apt-get install -y --no-install-recommends \
`# Erlang dependencies` \
erlang-base \
erlang-eunit \
erlang-dev \
erlang-tools \
rebar
RUN apt-get install -y --no-install-recommends \
`# Haskell dependencies` \
ghc \
cabal-install \
`# Haxe dependencies` \
neko \
neko-dev \
libneko0
# Newer release of nodejs
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash
RUN apt-get install -y --no-install-recommends \
`# Node.js dependencies` \
nodejs
# Add mono package repository url to get latest version of mono
RUN echo "deb http://download.mono-project.com/repo/debian trusty main" | tee /etc/apt/sources.list.d/mono.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF
RUN apt-get update && apt-get install -y --no-install-recommends \
`# CSharp dependencies` \
mono-devel
RUN apt-get install -y --no-install-recommends \
`# D dependencies` \
xdg-utils \
`# Dart dependencies` \
dart \
`# Lua dependencies` \
lua5.2 \
lua5.2-dev \
`# MinGW dependencies` \
mingw32 \
mingw32-binutils \
mingw32-runtime \
nsis \
`# Clean up` \
&& rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /var/tmp/*
# Ruby
RUN gem install bundler --no-ri --no-rdoc
# Python optional dependencies
RUN pip2 install -U ipaddress backports.ssl_match_hostname tornado
RUN pip3 install -U backports.ssl_match_hostname tornado
# Go
RUN curl -sSL https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /usr/local/ -xz
ENV PATH /usr/local/go/bin:$PATH
# Haxe
RUN mkdir -p /usr/lib/haxe && \
wget -O - https://github.com/HaxeFoundation/haxe/releases/download/3.2.1/haxe-3.2.1-linux64.tar.gz | \
tar -C /usr/lib/haxe --strip-components=1 -xz && \
ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \
mkdir -p /usr/lib/haxe/lib && \
chmod -R 777 /usr/lib/haxe/lib && \
haxelib setup --always /usr/lib/haxe/lib && \
haxelib install --always hxcpp 3.4.64
# Node.js
# temporarily removed since this breaks the build (and is not needed to test C# code)
# RUN curl -sSL https://www.npmjs.com/install.sh | sh
# D
RUN curl -sSL http://downloads.dlang.org/releases/2.x/2.070.0/dmd_2.070.0-0_amd64.deb -o /tmp/dmd_2.070.0-0_amd64.deb && \
dpkg -i /tmp/dmd_2.070.0-0_amd64.deb && \
rm /tmp/dmd_2.070.0-0_amd64.deb && \
curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
mv libevent-master/deimos/* openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
mv libevent-master/C/* openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
rm -rf libevent-master openssl-master && \
echo 'gcc -Wl,--no-as-needed $*' > /usr/local/bin/gcc-dmd && \
chmod 755 /usr/local/bin/gcc-dmd && \
echo 'CC=/usr/local/bin/gcc-dmd' >> /etc/dmd.conf
# Dart
ENV PATH /usr/lib/dart/bin:$PATH
# OCaml
RUN echo 'deb http://ppa.launchpad.net/avsm/ppa/ubuntu trusty main' > /etc/apt/sources.list.d/avsm-official-ocaml.list && \
gpg --keyserver keyserver.ubuntu.com --recv 61707B09 && \
gpg --export --armor 61707B09 | apt-key add - && \
apt-get update && \
apt-get install -y ocaml opam && \
opam init && \
opam install oasis
# Rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.17.0
ENV PATH /root/.cargo/bin:$PATH
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src

View File

@@ -0,0 +1,249 @@
# 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 Ubuntu Xenial
# Using all stock Ubuntu Xenial packaging except for:
# - d: does not come with Ubuntu so we're installing 2.073.2 for coverage
# - dart: does not come with Ubuntu so we're installing 1.22.1 for coverage
#
#
# Known missing or disabled libraries:
# - d: deimos for libevent and openssl omitted - not compatible / build errors
FROM buildpack-deps:xenial-scm
MAINTAINER Apache Thrift <dev@thrift.apache.org>
ENV DEBIAN_FRONTEND noninteractive
### Add apt repos
RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y --no-install-recommends apt apt-transport-https curl wget apt-utils
# csharp (mono)
# RUN echo "deb http://download.mono-project.com/repo/debian xenial main" | tee /etc/apt/sources.list.d/mono.list && \
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6A19B38D3D831EF
# D
RUN wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list && \
wget -qO - https://dlang.org/d-keyring.gpg | apt-key add -
ENV D_VERSION 2.073.2-0
# Dart
RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g'
# since ubuntu-artful can't run dart, we'll run 1.240 on xenial for now
ENV DART_VERSION 1.24.2-1
# dotnet (core)
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \
echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list
# node.js (this step runs apt-get update internally)
# note: node 8.5 introduced some issues with directory handling / jsdoc / something... using 7.x for now
# RUN curl -sL https://deb.nodesource.com/setup_7.x | bash
### install general dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
`# General dependencies` \
bash-completion \
bison \
build-essential \
clang \
cmake \
debhelper \
flex \
gdb \
llvm \
ninja-build \
pkg-config \
valgrind \
vim
ENV PATH /usr/lib/llvm-3.8/bin:$PATH
### languages
RUN apt-get install -y --no-install-recommends \
`# C++ dependencies` \
libboost-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-test-dev \
libboost-thread-dev \
libevent-dev \
libssl-dev \
qt5-default \
qtbase5-dev \
qtbase5-dev-tools
RUN apt-get install -y --no-install-recommends \
`# csharp (mono) dependencies` \
mono-devel
RUN apt-get install -y --allow-unauthenticated --no-install-recommends \
`# D dependencies` \
dmd-bin=$D_VERSION \
libphobos2-dev=$D_VERSION \
dub \
dfmt \
dscanner \
libevent-dev \
libssl-dev \
xdg-utils
# libevent deimos doesn't seem to work so not enabling it:
# RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \
# curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \
# mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
# mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \
# rm -rf libevent-master
# openssl deimos doesn't work with openssl-1.0.2 so not enabling it:
# RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \
# mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \
# mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \
# rm -rf openssl-master
RUN apt-get install -y --no-install-recommends \
`# Dart dependencies` \
dart=$DART_VERSION
ENV PATH /usr/lib/dart/bin:$PATH
RUN apt-get install -y --no-install-recommends \
`# dotnet core dependencies` \
dotnet-sdk-2.0.3
RUN apt-get install -y --no-install-recommends \
`# Erlang dependencies` \
erlang-base \
erlang-eunit \
erlang-dev \
erlang-tools \
rebar
RUN apt-get install -y --no-install-recommends \
`# GlibC dependencies` \
libglib2.0-dev
RUN apt-get install -y --no-install-recommends \
`# golang (go) dependencies` \
golang-go \
golang-race-detector-runtime
RUN apt-get install -y --no-install-recommends \
`# Haskell dependencies` \
ghc \
cabal-install
RUN apt-get install -y --no-install-recommends \
`# Haxe dependencies` \
haxe \
neko \
neko-dev \
libneko0
RUN haxelib setup --always /usr/share/haxe/lib && \
haxelib install --always hxcpp 3.4.64
# note: hxcpp 3.4.185 (latest) no longer ships static libraries, and caused a build failure
RUN apt-get install -y --no-install-recommends \
`# Java dependencies` \
ant \
ant-optional \
openjdk-8-jdk \
maven
RUN apt-get install -y --no-install-recommends \
`# Lua dependencies` \
lua5.2 \
lua5.2-dev
# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
# lua5.3 does not install alternatives so stick with 5.2 here
RUN apt-get install -y --no-install-recommends \
`# Node.js dependencies` \
nodejs \
npm && \
ln -s /usr/bin/nodejs /usr/bin/node
RUN apt-get install -y --no-install-recommends \
`# OCaml dependencies` \
ocaml \
opam && \
opam init --yes && \
opam install --yes oasis
RUN apt-get install -y --no-install-recommends \
`# Perl dependencies` \
libbit-vector-perl \
libclass-accessor-class-perl \
libcrypt-ssleay-perl \
libio-socket-ssl-perl \
libnet-ssleay-perl
RUN apt-get install -y --no-install-recommends \
`# Php dependencies` \
php7.0 \
php7.0-cli \
php7.0-dev \
php-pear \
re2c \
phpunit
RUN apt-get install -y --no-install-recommends \
`# Python dependencies` \
python-all \
python-all-dbg \
python-all-dev \
python-backports.ssl-match-hostname \
python-ipaddress \
python-pip \
python-setuptools \
python-six \
python-tornado \
python-twisted \
python-wheel \
python-zope.interface \
python3-all \
python3-all-dbg \
python3-all-dev \
python3-setuptools \
python3-six \
python3-tornado \
python3-twisted \
python3-wheel \
python3-zope.interface && \
pip install --upgrade backports.ssl_match_hostname
RUN apt-get install -y --no-install-recommends \
`# Ruby dependencies` \
ruby \
ruby-dev \
ruby-bundler
RUN gem install bundler --no-ri --no-rdoc
RUN apt-get install -y --no-install-recommends \
`# Rust dependencies` \
cargo \
rustc
# Clean up
RUN rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /var/tmp/*
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV THRIFT_ROOT /thrift
RUN mkdir -p $THRIFT_ROOT/src
COPY Dockerfile $THRIFT_ROOT/
WORKDIR $THRIFT_ROOT/src