Repository: incubator-crail Updated Branches: refs/heads/master 5a85923a0 -> cef806a30
This commit fixes two minor issues for the docker build. The first issue is that core-site.xml can be 0 length after substituting variables, see: https://issues.apache.org/jira/projects/CRAIL/issues/CRAIL-51 The second issue is that CRAIL_HOME points to a hardcoded version, see: https://issues.apache.org/jira/projects/CRAIL/issues/CRAIL-52 To fix these issues, the commit makes the following changes: - Read Crail version from toplevel pom.xml - Move Crail build directory to /home/crail - Point CRAIL_HOME to /home/crail - Use template core-site.xml.env file and subsitute environment variables to a new core-site.xml file This closes #40 Signed-off-by: Adrian Schuepbach <a...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/incubator-crail/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-crail/commit/cef806a3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-crail/tree/cef806a3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-crail/diff/cef806a3 Branch: refs/heads/master Commit: cef806a3093e6f257018d962e191aad6a4504e11 Parents: 5a85923 Author: Adrian Schuepbach <a...@apache.org> Authored: Wed Sep 26 14:11:34 2018 +0000 Committer: Adrian Schuepbach <a...@apache.org> Committed: Thu Sep 27 13:37:56 2018 +0200 ---------------------------------------------------------------------- docker/Dockerfile | 13 ++++++++++--- docker/core-site.xml | 36 ------------------------------------ docker/core-site.xml.env | 36 ++++++++++++++++++++++++++++++++++++ docker/start-crail-docker.sh | 2 +- 4 files changed, 47 insertions(+), 40 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-crail/blob/cef806a3/docker/Dockerfile ---------------------------------------------------------------------- diff --git a/docker/Dockerfile b/docker/Dockerfile index e0b446d..57e381f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -24,7 +24,8 @@ RUN echo "Crail-$LOG_COMMIT install openjdk8, git and envsubst" && \ apt-get update && apt-get install --no-install-recommends -y \ openjdk-8-jdk-headless \ git \ - gettext-base + gettext-base \ + libxml2-utils ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ENV PATH=${PATH}:${JAVA_HOME}/bin @@ -38,7 +39,13 @@ RUN echo "Crail-$LOG_COMMIT clone & build Crail repo" && \ cd incubator-crail && \ git checkout ${GIT_COMMIT} && \ mvn -DskipTests package -ENV CRAIL_HOME /incubator-crail/assembly/target/crail-1.0-bin + +RUN echo "Move crail to /crail" && \ + rm -rf /crail && \ + v=`xmllint --xpath "string(/*[local-name()='project']/*[local-name()='version'])" /incubator-crail/pom.xml` && \ + mv /incubator-crail/assembly/target/crail-${v}-bin /crail + +ENV CRAIL_HOME /crail ENV PATH=${PATH}:${CRAIL_HOME}/bin @@ -52,7 +59,7 @@ 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 ./core-site.xml.env $CRAIL_HOME/conf COPY ./crail-site.conf $CRAIL_HOME/conf ENTRYPOINT ["start-crail-docker.sh"] http://git-wip-us.apache.org/repos/asf/incubator-crail/blob/cef806a3/docker/core-site.xml ---------------------------------------------------------------------- diff --git a/docker/core-site.xml b/docker/core-site.xml deleted file mode 100644 index 81e1c03..0000000 --- a/docker/core-site.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> -<!-- - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. See accompanying LICENSE file. ---> - -<!-- Put site-specific property overrides in this file. --> - -<configuration> - <property> - <name>fs.crail.impl</name> - <value>org.apache.crail.hdfs.CrailHadoopFileSystem</value> - </property> - <property> - <name>fs.defaultFS</name> - <value>crail://$NAMENODE_HOST:$NAMENODE_PORT</value> - </property> - <property> - <name>fs.AbstractFileSystem.crail.impl</name> - <value>org.apache.crail.hdfs.CrailHDFS</value> - </property> - <property> - <name>io.file.buffer.size</name> - <value>1048576</value> - </property> -</configuration> http://git-wip-us.apache.org/repos/asf/incubator-crail/blob/cef806a3/docker/core-site.xml.env ---------------------------------------------------------------------- diff --git a/docker/core-site.xml.env b/docker/core-site.xml.env new file mode 100644 index 0000000..81e1c03 --- /dev/null +++ b/docker/core-site.xml.env @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. See accompanying LICENSE file. +--> + +<!-- Put site-specific property overrides in this file. --> + +<configuration> + <property> + <name>fs.crail.impl</name> + <value>org.apache.crail.hdfs.CrailHadoopFileSystem</value> + </property> + <property> + <name>fs.defaultFS</name> + <value>crail://$NAMENODE_HOST:$NAMENODE_PORT</value> + </property> + <property> + <name>fs.AbstractFileSystem.crail.impl</name> + <value>org.apache.crail.hdfs.CrailHDFS</value> + </property> + <property> + <name>io.file.buffer.size</name> + <value>1048576</value> + </property> +</configuration> http://git-wip-us.apache.org/repos/asf/incubator-crail/blob/cef806a3/docker/start-crail-docker.sh ---------------------------------------------------------------------- diff --git a/docker/start-crail-docker.sh b/docker/start-crail-docker.sh index f2b6639..7a23db1 100755 --- a/docker/start-crail-docker.sh +++ b/docker/start-crail-docker.sh @@ -1,6 +1,6 @@ #!/bin/bash # substitude env variables in core-site.xml -envsubst < $CRAIL_HOME/conf/core-site.xml > $CRAIL_HOME/conf/core-site.xml +envsubst < $CRAIL_HOME/conf/core-site.xml.env > $CRAIL_HOME/conf/core-site.xml crail $@