You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by fo...@apache.org on 2019/05/28 07:47:27 UTC

[avro] branch master updated: AVRO-2408: Create local dev environment with Apache Forrest (#530)

This is an automated email from the ASF dual-hosted git repository.

fokko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 41759e6  AVRO-2408: Create local dev environment with Apache Forrest (#530)
41759e6 is described below

commit 41759e6c92d1d2578db0e878ead822a7f1abef99
Author: Niels Basjes <nb...@bol.com>
AuthorDate: Tue May 28 09:47:21 2019 +0200

    AVRO-2408: Create local dev environment with Apache Forrest (#530)
---
 build.sh                     |  3 ++-
 share/docker/Dockerfile      |  4 ++--
 share/docker/DockerfileLocal | 36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/build.sh b/build.sh
index 315fe85..7f0eec3 100755
--- a/build.sh
+++ b/build.sh
@@ -246,7 +246,8 @@ do
         DOCKER_XTRA_ARGS=$2
         shift 2
       fi
-      docker build -t avro-build -f share/docker/Dockerfile .
+      docker build -t avro-build-ci -f share/docker/Dockerfile .
+      docker build -t avro-build -f share/docker/DockerfileLocal .
       if [ "$(uname -s)" == "Linux" ]; then
         USER_NAME=${SUDO_USER:=$USER}
         USER_ID=$(id -u $USER_NAME)
diff --git a/share/docker/Dockerfile b/share/docker/Dockerfile
index b350480..335d395 100644
--- a/share/docker/Dockerfile
+++ b/share/docker/Dockerfile
@@ -79,8 +79,8 @@ RUN apt-get -qq update && \
   rm -rf /var/lib/apt/lists/*
 
 # Install Perl modules
-RUN curl -L http://cpanmin.us | perl - --self-upgrade && \
-  cpanm install Module::Install Module::Install::ReadmeFromPod \
+RUN curl -L https://cpanmin.us | perl - --mirror https://www.cpan.org/ --self-upgrade && \
+  cpanm install --mirror https://www.cpan.org/ Module::Install Module::Install::ReadmeFromPod \
   Module::Install::Repository \
   Math::BigInt JSON::XS Try::Tiny Regexp::Common Encode \
   IO::String Object::Tiny Compress::Zlib Test::More \
diff --git a/share/docker/DockerfileLocal b/share/docker/DockerfileLocal
new file mode 100644
index 0000000..7775a6b
--- /dev/null
+++ b/share/docker/DockerfileLocal
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+# Dockerfile for installing the necessary dependencies for building Avro.
+# See BUILD.txt.
+FROM avro-build-ci
+
+# Install Forrest in /usr/local/apache-forrest
+RUN curl -L -s "https://www.apache.org/dyn/closer.lua?action=download&filename=/forrest/apache-forrest-0.9-sources.tar.gz" | tar -xzf - -C /usr/local/ && \
+    curl -L -s "https://www.apache.org/dyn/closer.lua?action=download&filename=/forrest/apache-forrest-0.9-dependencies.tar.gz" | tar -xzf - -C /usr/local/ && \
+    mv /usr/local/apache-forrest-0.9 /usr/local/apache-forrest && \
+    cd /usr/local/apache-forrest/main && \
+    ./build.sh
+
+# The solution for https://issues.apache.org/jira/browse/PIG-3906
+# Configure where forrest can be found
+RUN mkdir -p /usr/local/apache-forrest/plugins       && chmod a+rwX -R /usr/local/apache-forrest/plugins && \
+    mkdir -p /usr/local/apache-forrest/build/plugins && chmod a+rwX -R /usr/local/apache-forrest/build/plugins && \
+    echo 'forrest.home=/usr/local/apache-forrest' > build.properties
+
+ENV FORREST_HOME /usr/local/apache-forrest
+
+CMD ["/bin/bash", "-i"]