Base Images

ScienceOps by default uses "base images" to run your models. These environments are Docker images which are publicly available on DockerHub. Base images are language specific--one for R and one for Python.

Below you'll find the Dockerfiles for our standard Python, R, and parent images.

yhat/base

Parent image that contains dependencies common to Python and R.

FROM ubuntu:trusty

RUN apt-get update && apt-get -y upgrade

RUN apt-get install -y build-essential software-properties-common g++ make git curl
RUN apt-get install -y gfortran libatlas-base-dev libblas-dev libfreetype6-dev liblapack-dev libxft-dev
RUN apt-get install -y wget

# install db connectors and OpenBLAS
RUN apt-get install -y libpq-dev libmysqlclient15-dev mongodb-dev libmongo-client-dev libopenblas-base
# Add java
RUN apt-get install -y --no-install-recommends default-jre openjdk-7-jdk
# Add ODBC libraries (had to split these across multiple RUNs)
RUN apt-get install -y unixodbc unixodbc-dev
RUN apt-get install -y freetds-bin freetds-dev
RUN apt-get install -y tdsodbc
RUN apt-get install -y libiodbc2 libiodbc2-dev
RUN apt-get install -y bind9-host

RUN getent group scienceops >/dev/null || groupadd -r scienceops
RUN getent passwd scienceops >/dev/null || useradd -r -u 50000 -g scienceops \
-m -d /home/scienceops -s /bin/bash -c "Sciencebox account" scienceops

RUN echo scienceops:scienceops | chpasswd

# Set locale for scienceops user to utf8
RUN locale-gen en_US.UTF-8
RUN dpkg-reconfigure locales
RUN echo "export LC_ALL=en_US.UTF-8" >> /home/scienceops/.bashrc
RUN echo "export LANG=en_US.UTF-8" >> /home/scienceops/.bashrc
RUN echo "export LANGUAGE=en_US.UTF-8" >> /home/scienceops/.bashrc

WORKDIR /root

RUN apt-get install jq -y

# Copy the resource files into the base image
COPY ./yhat-dockerfile-resources/ /opt/scienceops/

R Dockerfile

R runtime environment.

FROM yhat/scienceops-base

# Add Yhat CRAN to apt sources
RUN echo "deb http://cran.yhathq.com/bin/linux/ubuntu/ trusty/" | tee -a /etc/apt/sources.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
RUN apt-get update

# Add XML for RCurl and a couple other libs.
RUN apt-get install -y libcurl4-openssl-dev
RUN apt-get install -y libxml2-dev
RUN apt-get install -y libpq-dev
RUN apt-get install -y libgsl0-dev

# R
RUN apt-get install -y r-base-core=3.2.3-4trusty0 && apt-mark hold r-base-core
RUN apt-get install -y r-base-html=3.2.3-4trusty0 && apt-mark hold r-base-html
RUN apt-get install -y r-cran-boot=1.3-16-1cran1trusty0 \
  r-cran-cluster=2.0.1-1trusty0 \
  r-cran-foreign=0.8.63-1trusty0 \
  r-cran-mass=7.3-39-1trusty0 \
  r-cran-kernsmooth=2.23-13-1trusty0 \
  r-cran-lattice=0.20-31-1trusty0 \
  r-cran-matrix=1.2-0-1trusty0 \
  r-cran-nlme=3.1.120-1trusty0 \
  r-cran-mgcv=1.8-12-1cran1trusty0 \
  r-cran-rpart=4.1-9-1trusty0 \
  r-cran-survival=2.39-2-1cran1trusty0 \
  r-cran-class=7.3-12-1trusty0 \
  r-cran-nnet=7.3-9-1trusty0 \
  r-cran-spatial=7.3-7-1trusty0 \
  r-cran-codetools=0.2-11-1cran1trusty0

RUN apt-get install -y r-recommended=3.2.3-4trusty0 && apt-mark hold r-recommended
RUN apt-get install -y r-base=3.2.3-4trusty0 && apt-mark hold r-base
RUN apt-get install -y r-base-dev=3.2.3-4trusty0

RUN mkdir -p ~/local/R_libs
ENV R_LIBS=~/local/R_libs/

RUN echo "r <- getOption('repos'); r['CRAN'] <- 'http://cran.yhathq.com'; options(repos = r);" > ~/.Rprofile

RUN Rscript -e "install.packages('caret')" && \
 Rscript -e "install.packages('cluster')" && \
 Rscript -e "install.packages('data.table')" && \
 Rscript -e "install.packages('dplyr')" && \
 Rscript -e "install.packages('e1071')" && \
 Rscript -e "install.packages('foreach')" && \
 Rscript -e "install.packages('forecast')" && \
 Rscript -e "install.packages('gbm')" && \
 Rscript -e "install.packages('ggplot2')" && \
 Rscript -e "install.packages('glmnet')" && \
 Rscript -e "install.packages('htmlwidgets')" && \
 Rscript -e "install.packages('jsonlite')" && \
 Rscript -e "install.packages('lubridate')" && \
 Rscript -e "install.packages('plyr')" && \
 Rscript -e "install.packages('randomForest')" && \
 Rscript -e "install.packages('Rcpp')" && \
 Rscript -e "install.packages('reshape2')" && \
 Rscript -e "install.packages('RJDBC')" && \
 Rscript -e "install.packages('RMySQL')" && \
 Rscript -e "install.packages('RODBC')" && \
 Rscript -e "install.packages('rpart')" && \
 Rscript -e "install.packages('shiny')" && \
 Rscript -e "install.packages('stringr')" && \
 Rscript -e "install.packages('survival')" && \
 Rscript -e "install.packages('tm')" && \
 Rscript -e "install.packages('yhatr')" && \
 Rscript -e "install.packages('devtools')"

Python Dockerfile

Python runtime environment.

FROM yhat/scienceops-base

RUN curl http://repo.continuum.io/archive/Anaconda2-4.0.0-Linux-x86_64.sh > Anaconda2-4.0.0-Linux-x86_64.sh
RUN echo '\nyes\n\nyes' | bash Anaconda2-4.0.0-Linux-x86_64.sh -b -p /root/anaconda

ENV PATH /root/anaconda/bin:$PATH

RUN conda install -y patchelf \
  Cython \
  Flask \
  Jinja2 \
  MarkupSafe \
  PyYAML \
  boto \
  futures \
  itsdangerous \
  nltk \
  nose \
  numpy \
  pandas \
  patsy \
  requests \
  scikit-learn \
  scipy \
  six \
  statsmodels \
  statsmodels \
  pyodbc \
  pymysql \
  psycopg2

RUN pip install -U yhat

results matching ""

    No results matching ""