Skip to content

Instantly share code, notes, and snippets.

@geoHeil
Created October 16, 2016 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geoHeil/338ccd04a3f9cc3d7ef3916fe11912c9 to your computer and use it in GitHub Desktop.
Save geoHeil/338ccd04a3f9cc3d7ef3916fe11912c9 to your computer and use it in GitHub Desktop.
Prediction.IO v0.10.0-incubating
FROM openjdk:8-jdk
MAINTAINER geoHeil
# Environment variables
ENV PIO_VERSION 0.10.0-incubating
ENV SPARK_VERSION 1.6.2
ENV ELASTICSEARCH_VERSION 1.7.5
ENV HBASE_VERSION 1.0.3
# Base paths
ENV PIO_HOME /PredictionIO-${PIO_VERSION}
ENV PATH=${PIO_HOME}/bin:$PATH
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
# Install other dependencies
RUN apt-get update && \
apt-get install -y curl libgfortran3 python-pip nano
# create base directory
RUN mkdir $PIO_HOME
# Install prediction.io itself
RUN curl -O https://dist.apache.org/repos/dist/release/incubator/predictionio/${PIO_VERSION}/apache-predictionio-${PIO_VERSION}.tar.gz && \
tar -xvzf apache-predictionio-${PIO_VERSION}.tar.gz -C ${PIO_HOME} && \
mkdir -p ${PIO_HOME}/vendors && \
rm apache-predictionio-${PIO_VERSION}.tar.gz
# Add prediction.io configuration
ADD files/pio-env.sh ${PIO_HOME}/conf/pio-env.sh
# Install Elasticsearch
RUN curl -O https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}.tar.gz && \
tar -xvzf elasticsearch-${ELASTICSEARCH_VERSION}.tar.gz -C ${PIO_HOME}/vendors && \
rm elasticsearch-${ELASTICSEARCH_VERSION}.tar.gz && \
echo 'cluster.name: predictionio' >> ${PIO_HOME}/vendors/elasticsearch-${ELASTICSEARCH_VERSION}/config/elasticsearch.yml && \
echo 'network.host: 127.0.0.1' >> ${PIO_HOME}/vendors/elasticsearch-${ELASTICSEARCH_VERSION}/config/elasticsearch.yml
# Install HBase
RUN curl -O http://archive.apache.org/dist/hbase/hbase-${HBASE_VERSION}/hbase-${HBASE_VERSION}-bin.tar.gz && \
tar -xvzf hbase-${HBASE_VERSION}-bin.tar.gz -C ${PIO_HOME}/vendors && \
rm hbase-${HBASE_VERSION}-bin.tar.gz && \
rm -rf ${PIO_HOME}/vendors/hbase-${HBASE_VERSION}/docs
# Add HBase configuration template
ADD files/hbase-site.xml ${PIO_HOME}/vendors/hbase-${HBASE_VERSION}/conf/hbase-site.xml
# Configure HBase configuration template
RUN sed -i "s|%%PIO_HOME%%|${PIO_HOME}|" ${PIO_HOME}/vendors/hbase-${HBASE_VERSION}/conf/hbase-site.xml && \
sed -i "s|%%HBASE_VERSION%%|${HBASE_VERSION}|" ${PIO_HOME}/vendors/hbase-${HBASE_VERSION}/conf/hbase-site.xml
# Install Spark
RUN curl -O http://d3kbcqa49mib13.cloudfront.net/spark-${SPARK_VERSION}-bin-hadoop2.6.tgz && \
tar -xvzf spark-${SPARK_VERSION}-bin-hadoop2.6.tgz -C ${PIO_HOME}/vendors && \
rm spark-${SPARK_VERSION}-bin-hadoop2.6.tgz && \
rm -rf ${PIO_HOME}/vendors/spark-${SPARK_VERSION}-bin-hadoop2.6/examples
# Triggers fetching the complete sbt environment
RUN ${PIO_HOME}/apache-predictionio-${PIO_VERSION}/sbt/sbt -batch
# Add scripts
ADD files/deploy_engine.sh .
ADD files/entrypoint.sh .
RUN chmod +x entrypoint.sh && chmod +x deploy_engine.sh
# Expose HTTP ports (event server and recommendation server)
EXPOSE 7070 8000
# Entrypoint definition -> Run services
ENTRYPOINT ["/entrypoint.sh"]
@geoHeil
Copy link
Author

geoHeil commented Oct 16, 2016

This is a port from https://github.com/tobilg/docker-predictionio to try to install the latest 0.10.0-incubating release

There is a problem with this - it seems to get stuck on

Launching sbt from /PredictionIO-0.10.0-incubating/apache-predictionio-0.10.0-incubating/sbt/sbt-launch-0.13.7.jar
Getting org.scala-sbt sbt 0.13.7 ...

edit

after a long while I see the error:

:: problems summary ::
:::: WARNINGS
        module not found: org.scala-sbt#compiler-integration;0.13.7

    ==== local: tried

      /root/.ivy2/local/org.scala-sbt/compiler-integration/0.13.7/ivys/ivy.xml

      -- artifact org.scala-sbt#compiler-integration;0.13.7!compiler-integration.jar:

      /root/.ivy2/local/org.scala-sbt/compiler-integration/0.13.7/jars/compiler-integration.jar

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-integration/0.13.7/ivys/ivy.xml

    ==== Maven Central: tried

      https://repo1.maven.org/maven2/org/scala-sbt/compiler-integration/0.13.7/compiler-integration-0.13.7.pom

      -- artifact org.scala-sbt#compiler-integration;0.13.7!compiler-integration.jar:

      https://repo1.maven.org/maven2/org/scala-sbt/compiler-integration/0.13.7/compiler-integration-0.13.7.jar

        ::::::::::::::::::::::::::::::::::::::::::::::

        ::          UNRESOLVED DEPENDENCIES         ::

        ::::::::::::::::::::::::::::::::::::::::::::::

        :: org.scala-sbt#compiler-integration;0.13.7: not found

        ::::::::::::::::::::::::::::::::::::::::::::::


:::: ERRORS
    Server access Error: Connection reset url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-integration/0.13.7/ivys/ivy.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment