From 577e05be6106849109716da36e283509431ffa7a Mon Sep 17 00:00:00 2001 From: Jonathan Hseu Date: Fri, 23 Sep 2016 16:56:39 -0800 Subject: [PATCH] Add a CI build for tests that require a Hadoop installation. Change: 134138480 --- tensorflow/tools/ci_build/Dockerfile.hadoop | 20 +++++++++++++++ tensorflow/tools/ci_build/builds/hadoop.sh | 25 +++++++++++++++++++ .../tools/ci_build/install/install_hadoop.sh | 22 ++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 tensorflow/tools/ci_build/Dockerfile.hadoop create mode 100755 tensorflow/tools/ci_build/builds/hadoop.sh create mode 100755 tensorflow/tools/ci_build/install/install_hadoop.sh diff --git a/tensorflow/tools/ci_build/Dockerfile.hadoop b/tensorflow/tools/ci_build/Dockerfile.hadoop new file mode 100644 index 00000000000..8a97a4b466c --- /dev/null +++ b/tensorflow/tools/ci_build/Dockerfile.hadoop @@ -0,0 +1,20 @@ +FROM ubuntu:14.04 + +MAINTAINER Jonathan Hseu + +# Copy and run the install scripts. +COPY install/*.sh /install/ +RUN /install/install_bootstrap_deb_packages.sh +RUN add-apt-repository -y ppa:openjdk-r/ppa && \ + add-apt-repository -y ppa:mc3man/trusty-media && \ + add-apt-repository -y ppa:george-edison55/cmake-3.x +RUN /install/install_deb_packages.sh +RUN /install/install_pip_packages.sh +RUN /install/install_bazel.sh +RUN /install/install_proto3.sh +RUN /install/install_buildifier.sh +RUN /install/install_hadoop.sh + +# Set up bazelrc. +COPY install/.bazelrc /root/.bazelrc +ENV BAZELRC /root/.bazelrc diff --git a/tensorflow/tools/ci_build/builds/hadoop.sh b/tensorflow/tools/ci_build/builds/hadoop.sh new file mode 100755 index 00000000000..ee55b9d13a4 --- /dev/null +++ b/tensorflow/tools/ci_build/builds/hadoop.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# Copyright 2016 The TensorFlow Authors. All Rights Reserved. +# +# 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. +# ============================================================================== + +set -e + +export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 +export HADOOP_HDFS_HOME=/usr/local/hadoop +bazel test \ + --test_env=CLASSPATH=$($HADOOP_HDFS_HOME/bin/hadoop classpath --glob) \ + --test_env=HADOOP_HDFS_HOME=/usr/local/hadoop \ + --test_env=LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server \ + //tensorflow/core/platform/hadoop:hadoop_file_system_test diff --git a/tensorflow/tools/ci_build/install/install_hadoop.sh b/tensorflow/tools/ci_build/install/install_hadoop.sh new file mode 100755 index 00000000000..cb590dab372 --- /dev/null +++ b/tensorflow/tools/ci_build/install/install_hadoop.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# Copyright 2016 The TensorFlow Authors. All Rights Reserved. +# +# 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. +# ============================================================================== +# Install Hadoop + +set -e + +wget -q http://www-us.apache.org/dist/hadoop/common/hadoop-2.7.3/hadoop-2.7.3.tar.gz +tar xzf hadoop-2.7.3.tar.gz -C /usr/local +ln -s /usr/local/hadoop-2.7.3 /usr/local/hadoop