Permalink
Browse files

Update Dockerfile for TravisCI, define pipeline, upgrade Java (#1716)

* fix java dependencies, update cpprestsdk build

* add pipeline definition for docker file

* split script

* rearrange java install

* test without java

* quote credential

* do not push to latest tag

* parametize tag

* Run when updated on master

* add buildstamp as version and tag

* malformed yaml

* bad version stamp

* remove branch because of invalid character

* remove extra .

* tag build with default build number

* do not build for prs

* move dockerfile to .pipelines folder

* test installing java

* Update Dockerfile

* Update dockerfile

* add back git

* test new travis image

* revert travis back to normal now that it is confirmed to work

* Add back build tag, more explicit versioning
  • Loading branch information...
jackgerrits authored and JohnLangford committed Jan 19, 2019
1 parent 9eeb191 commit 9b1914440a902d5043df7660e76fbc912a776b1a
Showing with 87 additions and 68 deletions.
  1. +1 −0 .gitignore
  2. +64 −0 .pipelines/Dockerfile
  3. +20 −0 .pipelines/build-docker-image.yml
  4. +2 −2 .travis.yml
  5. +0 −66 Dockerfile
@@ -30,6 +30,7 @@ t_*
bin
vw
.*
!.pipelines
vw.1
*.cache
*.tgz
@@ -0,0 +1,64 @@
FROM ubuntu:14.04 AS build

# Upgrade cmake to 3.2
RUN apt-get update
RUN apt-get install -y software-properties-common python-software-properties debconf-utils
RUN add-apt-repository -y ppa:george-edison55/cmake-3.x
RUN apt-get update

# Add Open JDK repo (including license agreement), install Java
RUN echo "oracle-java11-installer shared/accepted-oracle-license-v1-2 select true" | \
debconf-set-selections && \
add-apt-repository -y ppa:openjdk-r/ppa && \
apt-get update && \
apt install -y openjdk-11-jdk

# Install build tools
RUN apt-get install -y \
gcc g++ libboost-all-dev zlib1g-dev help2man make libssl-dev cmake doxygen graphviz \
python-setuptools python-dev build-essential maven wget git && \
rm -rf /var/lib/apt/lists/*

# ppa for g++ 4.9 (first version that supports complete c++11. i.e. <regex>)
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN apt-get update
RUN apt-get install -y gcc-4.9 g++-4.9
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
RUN add-apt-repository -y --remove "ubuntu-toolchain-r-test"

# Install cpprestsdk
RUN git clone https://github.com/Microsoft/cpprestsdk.git casablanca && \
cd casablanca/Release && \
# Checkout 2.10.1 version of cpprestsdk
git checkout e8dda215426172cd348e4d6d455141f40768bf47 && \
mkdir build && \
cd build && \
cmake .. -DBUILD_TESTS=Off -DBUILD_SAMPLES=Off && \
make -j 4 && \
make install && \
cd ../../../ && \
rm -rf casablanca

# Install python tools
RUN easy_install pip && \
pip install cpp-coveralls wheel virtualenv pytest readme_renderer pandas && \
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh && \
bash miniconda.sh -b -p $HOME/miniconda && \
hash -r && \
$HOME/miniconda/bin/conda config --set always_yes yes --set changeps1 no && \
$HOME/miniconda/bin/conda update -q conda && \
$HOME/miniconda/bin/conda create -q -n test-python27 python=2.7 nomkl numpy scipy scikit-learn

# Download maven dependencies
RUN wget https://raw.githubusercontent.com/VowpalWabbit/vowpal_wabbit/master/java/pom.xml.in && \
mvn dependency:resolve -f pom.xml.in && \
rm pom.xml.in

# Cleanup
RUN apt-get clean autoclean && \
apt-get autoremove -y && \
rm -rf /var/lib/{apt,dpkg,cache,log}

# Set environment variables used by build
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
ENV JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/"
@@ -0,0 +1,20 @@
pool:
vmImage: 'ubuntu-16.04'

# Trigger dockerfile to build when updated on master
trigger:
branches:
include:
- master
paths:
include:
- Dockerfile

pr: none

steps:
- script: docker build -t $(dockerOrgId)/$(imageName):$(Build.BuildNumber) ./.pipelines/
- script: docker login -u "$(dockerCredId)" -p "$(pswd)" https://index.docker.io/v1/
- script: docker push $(dockerOrgId)/$(imageName):$(Build.BuildNumber)

# To use this pushed docker image on the CI, the image must be tagged as latest.
@@ -4,9 +4,9 @@ services:
- docker

before_install:
- docker pull vowpalwabbit/travis-base
- docker pull vowpalwabbit/travis-base:20190117.3
script:
- docker run -a STDOUT -v `pwd`:/vw -t vowpalwabbit/travis-base /bin/bash -c "cd /vw && chmod +x ./build-linux.sh && ./build-linux.sh"
- docker run -a STDOUT -v `pwd`:/vw -t vowpalwabbit/travis-base:20190117.3 /bin/bash -c "cd /vw && chmod +x ./build-linux.sh && ./build-linux.sh"

after_success:
- coveralls --exclude lib --exclude tests --gcov-options '\-lp'

This file was deleted.

Oops, something went wrong.

0 comments on commit 9b19144

Please sign in to comment.