Skip to content

Commit

Permalink
Merge pull request #234 from HazyResearch/adam-docker
Browse files Browse the repository at this point in the history
Updated volume mounting instructions

LGTM --mjc
  • Loading branch information
mikecafarella committed Feb 16, 2015
2 parents 01d995b + 018d2e4 commit 32ed301
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 38 deletions.
60 changes: 23 additions & 37 deletions Dockerfile
@@ -1,47 +1,33 @@
FROM ubuntu
MAINTAINER adamwgoldberg@gmail.com
RUN sudo apt-get update
RUN sudo apt-get -y install emacs
RUN sudo apt-get -y install default-jre default-jdk
RUN sudo apt-get -y install python
RUN sudo apt-get -y install gnuplot
RUN sudo apt-get -y install postgresql postgresql-contrib
RUN sudo apt-get -y install git
RUN sudo apt-get -y install build-essential
RUN sudo apt-get -y install libnuma-dev
RUN sudo apt-get -y install bc
RUN sudo apt-get update && apt-get install -y gnuplot python libpython2.7-dev default-jre default-jdk emacs postgresql postgresql-contrib git build-essential libnuma-dev bc unzip locales
RUN locale-gen en_US en_US.UTF-8 && \
dpkg-reconfigure locales
RUN cd ~/ && git clone https://github.com/HazyResearch/deepdive.git
RUN sudo apt-get install zip unzip
RUN cd ~/deepdive && make

# Configure environment variables
RUN echo 'export PGPORT=$DB_PORT_5432_TCP_PORT' >> ~/.bashrc
RUN echo 'export PGHOST=$DB_PORT_5432_TCP_ADDR' >> ~/.bashrc
RUN echo 'export PGPASSWORD=' >> ~/.bashrc
RUN echo 'export PGUSER=gpadmin' >> ~/.bashrc
RUN echo 'export DEEPDIVE_HOME=~/deepdive' >> ~/.bashrc
RUN echo 'export LD_LIBRARY_PATH=$DEEPDIVE_HOME/lib/dw_linux/lib:$DEEPDIVE_HOME/sbt:$DEEPDIVE_HOME/lib/dw_linux/lib64' >> ~/.bashrc
RUN echo 'export PATH=~/deepdive/sbt:$PATH' >> ~/.bashrc

# Initialize script to wait for greenplum
RUN echo 'DeepDive needs a database connection to run and is waiting for the DB to finish initializing. After it finishes, the shell will return control to you.' >> ~/.bashrc
RUN echo 'while true; do' >> ~/.bashrc
RUN echo ' psql -q -h $DB_PORT_5432_TCP_ADDR -p $DB_PORT_5432_TCP_PORT -U gpadmin deepdive -c "SELECT 1;" > /dev/null 2>&1' >> ~/.bashrc
RUN echo ' RETVAL=$?' >> ~/.bashrc
RUN echo ' [ $RETVAL -eq 0 ] && break' >> ~/.bashrc
RUN echo ' echo -ne "DeepDive is waiting for the DB to finish initializing\r"' >> ~/.bashrc
RUN echo ' sleep 1' >> ~/.bashrc
RUN echo ' echo -ne "DeepDive is waiting for the DB to finish initializing.\r"' >> ~/.bashrc
RUN echo ' sleep 1' >> ~/.bashrc
RUN echo ' echo -ne "DeepDive is waiting for the DB to finish initializing..\r"' >> ~/.bashrc
RUN echo ' sleep 1' >> ~/.bashrc
RUN echo ' echo -ne "DeepDive is waiting for the DB to finish initializing...\r"' >> ~/.bashrc
RUN echo ' sleep 1' >> ~/.bashrc
RUN echo 'done' >> ~/.bashrc
RUN echo 'echo -ne "\nGreenplum is up and running! You may now use deepdive.\n"' >> ~/.bashrc
# Configure environment variables and initialize script to wait for the deepdive database
RUN echo 'export PGPORT=$DB_PORT_5432_TCP_PORT' >> ~/.bashrc && echo 'export PGHOST=$DB_PORT_5432_TCP_ADDR' >> ~/.bashrc && \
echo 'export PGPASSWORD=' >> ~/.bashrc && echo 'export PGUSER=gpadmin' >> ~/.bashrc && \
echo 'export DEEPDIVE_HOME=~/deepdive' >> ~/.bashrc && \
echo 'export LD_LIBRARY_PATH=$DEEPDIVE_HOME/lib/dw_linux/lib:$DEEPDIVE_HOME/sbt:$DEEPDIVE_HOME/lib/dw_linux/lib64' >> ~/.bashrc && \
echo 'export PATH=~/deepdive/sbt:$PATH' >> ~/.bashrc && \
echo 'echo "DeepDive needs a database connection to run and is waiting for the DB to finish initializing. After it finishes, the shell will return control to you."' >> ~/.bashrc && \
echo 'while true; do' >> ~/.bashrc && \
echo ' psql -q -h $DB_PORT_5432_TCP_ADDR -p $DB_PORT_5432_TCP_PORT -U gpadmin deepdive -c "SELECT 1;" > /dev/null 2>&1' >> ~/.bashrc && \
echo ' RETVAL=$?' >> ~/.bashrc && echo ' [ $RETVAL -eq 0 ] && break' >> ~/.bashrc && \
echo ' echo -ne "DeepDive is waiting for the DB to finish initializing\r"' >> ~/.bashrc && \
echo ' sleep 1' >> ~/.bashrc && \
echo ' echo -ne "DeepDive is waiting for the DB to finish initializing.\r"' >> ~/.bashrc && \
echo ' sleep 1' >> ~/.bashrc && \
echo ' echo -ne "DeepDive is waiting for the DB to finish initializing..\r"' >> ~/.bashrc && \
echo ' sleep 1' >> ~/.bashrc && \
echo ' echo -ne "DeepDive is waiting for the DB to finish initializing...\r"' >> ~/.bashrc &&\
echo ' sleep 1' >> ~/.bashrc && echo 'done' >> ~/.bashrc && \
echo 'echo -ne "\nGreenplum is up and running! You may now use deepdive.\n"' >> ~/.bashrc

RUN sed -i s/'sbt "test-only org.deepdive.test.integration.ChunkingApp -- -oF"'/'echo "Skipping ChunkingApp" \#sbt "test-only org.deepdive.test.integration.ChunkingApp -- -oF"'/g /root/deepdive/test/test_psql.sh

RUN mkdir -p ~/deepdive/app

VOLUME ["/root/deepdive/app"]
VOLUME ["/root/deepdive/app"]
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -20,7 +20,7 @@ docker pull adamwgoldberg/deepdive-github
# All deepdive application code should be created in /root/deepdive/app
# Make sure the deepdive-github tag matches the above one.
# This assumes you have a db container named db.
docker run -t -d --link db:db --name deepdive adamwgoldberg/deepdive-github bash
docker run -t -d --link db:db --name deepdive -v /home/ubuntu/deepdive/app:/root/deepdive/app adamwgoldberg/deepdive-github bash

# Attach shell to Deepdive
# You may need to wait several minutes for your database to initialize.
Expand Down

0 comments on commit 32ed301

Please sign in to comment.