blob: 072cb2e1075329d162ccdf10de9c850660d76fb4 [file] [log] [blame]
FROM ubuntu:16.04
MAINTAINER {{mantainer.email}}
ENV SLEEP_MILLIS 0
USER root
##############################################################
# Define all environment variables to be used
##############################################################
ENV MARVIN_HOME=/opt/marvin
ENV MARVIN_DATA_PATH=/marvin-data
ENV MARVIN_ENGINE_HOME=$MARVIN_HOME/engine
ENV MARVIN_ENGINE_ENV=marvin-engine-env
ENV WORKON_HOME=$MARVIN_HOME/.virtualenvs
ENV SPARK_HOME=/opt/spark
ENV SPARK_CONF_DIR=$SPARK_HOME/conf
ENV HADOOP_CONF_DIR=$SPARK_CONF_DIR
ENV YARN_CONF_DIR=$SPARK_CONF_DIR
##############################################################
# Create all folders needed
##############################################################
RUN mkdir -p $MARVIN_HOME && \
mkdir -p $MARVIN_DATA_PATH && \
mkdir -p $MARVIN_ENGINE_HOME && \
mkdir -p /var/log/marvin/engines && \
mkdir -p /var/run/marvin/engines
##############################################################
# Install the system dependencies for default installation
##############################################################
RUN apt-get update -y && \
apt-get install -y build-essential && \
apt-get install -y maven git python cmake software-properties-common curl libstdc++6 && \
apt-get install -y git && \
apt-get install -y wget && \
apt-get install -y python2.7-dev && \
apt-get install -y python-pip && \
apt-get install -y ipython && \
apt-get install -y libffi-dev && \
apt-get install -y libssl-dev && \
apt-get install -y libxml2-dev && \
apt-get install -y libxslt1-dev && \
apt-get install -y libpng12-dev && \
apt-get install -y libfreetype6-dev && \
apt-get install -y python-tk && \
apt-get install -y libsasl2-dev && \
apt-get install -y python-pip && \
apt-get install -y graphviz && \
pip install --upgrade pip && \
apt-get clean
RUN pip install virtualenvwrapper
# Install Open JDK
RUN apt-get update && apt-get install -y openjdk-8-jdk
##############################################################
# Install Apache Spark
#
# Uncomment if you are using spark, note that is needed the
# spark configuration files to the think works correctly.
##############################################################
RUN mkdir -p $SPARK_CONF_DIR
##############################################################
# Create the virtualenv configuration
##############################################################
RUN /bin/bash -c "cd $MARVIN_ENGINE_HOME && \
source /usr/local/bin/virtualenvwrapper.sh && \
mkvirtualenv $MARVIN_ENGINE_ENV"
##############################################################
# <CUSTOM ENGINE INSTALLATION PROCEDURE HERE> #
##############################################################
##############################################################
# Copy and Install the marvin engine inside virtualenv
##############################################################
ADD build/engine.tar $MARVIN_ENGINE_HOME
ADD build/marvin-engine-executor-assembly.jar $MARVIN_DATA_PATH
RUN /bin/bash -c "source /usr/local/bin/virtualenvwrapper.sh && \
workon $MARVIN_ENGINE_ENV && \
cd $MARVIN_ENGINE_HOME && \
pip install . "
##############################################################
# Starts the engine http server
##############################################################
EXPOSE 8000
CMD /bin/bash -c "source /usr/local/bin/virtualenvwrapper.sh && \
workon $MARVIN_ENGINE_ENV && \
cd $MARVIN_ENGINE_HOME && \
marvin engine-httpserver -h 0.0.0.0 -p 8000"