Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
Docker: fix cache hugepage requirement
Browse files Browse the repository at this point in the history
Allow users to use the Crail shell without providing
hugepages via a volume mount to Docker.

Signed-off-by: Jonas Pfefferle <pepperjo@apache.org>
  • Loading branch information
PepperJo committed Aug 14, 2018
1 parent 31be5fe commit 86f1bd3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docker/Dockerfile
Expand Up @@ -17,7 +17,7 @@ FROM ubuntu:18.04
MAINTAINER Apache Crail <dev@crail.apache.org>

# TODO: automate update version on new release
ARG GIT_COMMIT="v1.0"
ARG GIT_COMMIT="master"
ENV LOG_COMMIT=$GIT_COMMIT

RUN echo "Crail-$LOG_COMMIT install openjdk8, git and envsubst" && \
Expand All @@ -41,19 +41,18 @@ RUN echo "Crail-$LOG_COMMIT clone & build Crail repo" && \
ENV CRAIL_HOME /incubator-crail/assembly/target/crail-1.0-bin
ENV PATH=${PATH}:${CRAIL_HOME}/bin

RUN echo "Crail-$LOG_COMMIT update crail script to update core-site.xml" && \
sed -i '$ienvsubst < $CRAIL_HOME/conf/core-site.xml > $CRAIL_HOME/conf/core-site.xml' $CRAIL_HOME/bin/crail

ENV NAMENODE_HOST=localhost
ENV NAMENODE_PORT=9060
ENV INTERFACE=eth0
ENV DATAPATH=/dev/hugepages/data
ENV STORAGELIMIT=1073741824
ENV CACHEPATH=/dev/hugepages/cache
ENV CACHELIMIT=1073741824
ENV CACHELIMIT=0

COPY ./start-crail-docker.sh $CRAIL_HOME/bin
COPY ./crail-env.sh $CRAIL_HOME/conf
COPY ./core-site.xml $CRAIL_HOME/conf
COPY ./crail-site.conf $CRAIL_HOME/conf

ENTRYPOINT ["crail"]
ENTRYPOINT ["start-crail-docker.sh"]
6 changes: 6 additions & 0 deletions docker/start-crail-docker.sh
@@ -0,0 +1,6 @@
#!/bin/bash

# substitude env variables in core-site.xml
envsubst < $CRAIL_HOME/conf/core-site.xml > $CRAIL_HOME/conf/core-site.xml

crail $@

0 comments on commit 86f1bd3

Please sign in to comment.