Skip to content

Commit

Permalink
pretty sure dockerized tests are passing
Browse files Browse the repository at this point in the history
  • Loading branch information
dcrankshaw committed Aug 30, 2017
1 parent 1180ea4 commit 97d8383
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 10 deletions.
41 changes: 34 additions & 7 deletions ClipperTestsDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,50 @@ FROM clipper/lib_base:${CODE_VERSION}
# install docker
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install --fix-missing -y \
wget apt-transport-https ca-certificates curl software-properties-common \
openjdk-8-jdk clang-format \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install --fix-missing -y docker-ce
&& apt-get install -y docker-ce

RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh \
&& wget --quiet 'https://repo.continuum.io/archive/Anaconda2-4.2.0-Linux-x86_64.sh' -O /tmp/anaconda.sh \
&& /bin/bash /tmp/anaconda.sh -b -p /opt/conda \
&& rm /tmp/anaconda.sh
ENV PATH "/opt/conda/bin:$PATH"
RUN conda install -y pyzmq
RUN conda install -y libgcc pyzmq

RUN pip install requests subprocess32 scikit-learn numpy scipy fabric pyyaml docker kubernetes pyspark
RUN pip install requests subprocess32 scikit-learn numpy scipy fabric pyyaml docker \
kubernetes pyspark docker-compose findspark

RUN mkdir /spark && cd /spark \
&& curl -o spark.tgz https://d3kbcqa49mib13.cloudfront.net/spark-2.1.1-bin-hadoop2.7.tgz \
&& tar zxf spark.tgz && rm spark.tgz

ENV SPARK_HOME /spark/spark-2.1.1-bin-hadoop2.7

# Install maven
ARG MAVEN_VERSION=3.5.0
ARG SHA=beb91419245395bd69a4a6edad5ca3ec1a8b64e41457672dc687c173a495f034
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries

RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-$MAVEN_VERSION-bin.tar.gz \
&& echo "${SHA} /tmp/apache-maven.tar.gz" | sha256sum -c - \
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
&& rm -f /tmp/apache-maven.tar.gz \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn \
&& git clone https://github.com/zeromq/jzmq.git /root/jzmq \
&& cd /root/jzmq/jzmq-jni \
&& ./autogen.sh \
&& ./configure \
&& make \
&& make install

ENV MAVEN_HOME /usr/share/maven
ENV MAVEN_CONFIG /root/.m2
ENV JZMQ_HOME /usr/local/lib/

# RUN gpasswd -a $NB_USER docker

RUN DEBIAN_FRONTEND=noninteractive apt-get install --fix-missing -y clang-format

COPY ./ /clipper

Expand All @@ -29,6 +56,6 @@ RUN cd /clipper/src/libs/spdlog \
&& git apply ../patches/make_spdlog_compile_linux.patch


ENTRYPOINT ["/clipper/bin/check_format.sh"]
ENTRYPOINT ["/clipper/bin/ci_checks.sh"]

# vim: set filetype=dockerfile:
5 changes: 2 additions & 3 deletions bin/build_docker_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ tag=$(<VERSION.txt)

# Build the Clipper Docker images
time docker build -t clipper/lib_base:$tag -f ./ClipperLibBaseDockerfile ./
# time docker build --build-arg CODE_VERSION=$tag -t clipper/query_frontend:$tag -f QueryFrontendDockerfile ./
# time docker build --build-arg CODE_VERSION=$tag -t clipper/management_frontend:$tag -f ManagementFrontendDockerfile ./
time docker build --build-arg CODE_VERSION=$tag -t clipper/query_frontend:$tag -f QueryFrontendDockerfile ./
time docker build --build-arg CODE_VERSION=$tag -t clipper/management_frontend:$tag -f ManagementFrontendDockerfile ./
time docker build --build-arg CODE_VERSION=$tag -t clipper/unittests:$tag -f ClipperTestsDockerfile ./
exit
cd -

# Build Spark JVM Container
Expand Down
15 changes: 15 additions & 0 deletions bin/ci_checks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -e
set -u
set -o pipefail

unset CDPATH
# one-liner from http://stackoverflow.com/a/246128
# Determines absolute path of the directory containing
# the script.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Let the user start this script from anywhere in the filesystem.
$DIR/check_format.sh
$DIR/run_unittests.sh

0 comments on commit 97d8383

Please sign in to comment.