You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by ma...@apache.org on 2018/06/07 16:33:13 UTC

[incubator-mxnet] 06/16: Moved common parts to scripts for docker builds

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

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit 47d1b356299c7eb9eda0cccbc3d79269153cb139
Author: Anton Chernov <me...@gmail.com>
AuthorDate: Fri Jun 1 12:29:10 2018 +0000

    Moved common parts to scripts for docker builds
---
 ci/docker/Dockerfile.build.arm64                   | 15 ++++++------
 ci/docker/Dockerfile.build.armv6                   | 15 ++++++------
 ci/docker/Dockerfile.build.armv7                   | 12 ++++------
 ci/docker/Dockerfile.build.jetson                  | 15 ++++++------
 .../install_openblas.sh}                           | 27 ++++++++--------------
 .../ubuntu_arm.sh}                                 | 27 +++++-----------------
 6 files changed, 44 insertions(+), 67 deletions(-)

diff --git a/ci/docker/Dockerfile.build.arm64 b/ci/docker/Dockerfile.build.arm64
index eeb4656..f2af47b 100755
--- a/ci/docker/Dockerfile.build.arm64
+++ b/ci/docker/Dockerfile.build.arm64
@@ -27,15 +27,16 @@ ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran
 ENV HOSTCC gcc
 ENV TARGET ARMV8
 
-RUN apt update && apt install -y unzip
+WORKDIR /work/deps
 
-WORKDIR /work
+COPY install/ubuntu_arm.sh /work/
+RUN /work/ubuntu_arm.sh
 
-# Build OpenBLAS
-RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \
-    cd OpenBLAS && \
-    make -j$(nproc) && \
-    PREFIX=${CROSS_ROOT} make install
+COPY install/install_openblas.sh /work/
+RUN /work/install_openblas.sh
+
+ENV OpenBLAS_HOME=${CROSS_ROOT}
+ENV OpenBLAS_DIR=${CROSS_ROOT}
 
 COPY runtime_functions.sh /work/
 WORKDIR /work/mxnet
diff --git a/ci/docker/Dockerfile.build.armv6 b/ci/docker/Dockerfile.build.armv6
index 53113d0..f769450 100755
--- a/ci/docker/Dockerfile.build.armv6
+++ b/ci/docker/Dockerfile.build.armv6
@@ -25,15 +25,16 @@ ENV FC=/usr/bin/${CROSS_TRIPLE}-gfortran
 ENV HOSTCC gcc
 ENV TARGET ARMV6
 
-RUN apt update && apt install -y unzip
-
 WORKDIR /work/deps
 
-# Build OpenBLAS
-RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \
-    cd OpenBLAS && \
-    make -j$(nproc) && \
-    make PREFIX=$CROSS_ROOT install
+COPY install/ubuntu_arm.sh /work/
+RUN /work/ubuntu_arm.sh
+
+COPY install/install_openblas.sh /work/
+RUN /work/install_openblas.sh
+
+ENV OpenBLAS_HOME=${CROSS_ROOT}
+ENV OpenBLAS_DIR=${CROSS_ROOT}
 
 COPY runtime_functions.sh /work/
 WORKDIR /work/mxnet
diff --git a/ci/docker/Dockerfile.build.armv7 b/ci/docker/Dockerfile.build.armv7
index 04c0892..b773e1e 100755
--- a/ci/docker/Dockerfile.build.armv7
+++ b/ci/docker/Dockerfile.build.armv7
@@ -25,15 +25,13 @@ ENV HOSTCC gcc
 ENV TARGET ARMV7
 ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran
 
-RUN apt update && apt install -y unzip
-
 WORKDIR /work/deps
 
-# Build OpenBLAS
-RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \
-    cd OpenBLAS && \
-    make -j$(nproc) && \
-    make PREFIX=$CROSS_ROOT install
+COPY install/ubuntu_arm.sh /work/
+RUN /work/ubuntu_arm.sh
+
+COPY install/install_openblas.sh /work/
+RUN /work/install_openblas.sh
 
 ENV OpenBLAS_HOME=${CROSS_ROOT}
 ENV OpenBLAS_DIR=${CROSS_ROOT}
diff --git a/ci/docker/Dockerfile.build.jetson b/ci/docker/Dockerfile.build.jetson
index b79c192..8dad5b9 100755
--- a/ci/docker/Dockerfile.build.jetson
+++ b/ci/docker/Dockerfile.build.jetson
@@ -31,15 +31,16 @@ ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran
 ENV HOSTCC gcc
 ENV TARGET ARMV8
 
-RUN apt update && apt-get install -y unzip
+WORKDIR /work/deps
 
-WORKDIR /work
+COPY install/ubuntu_arm.sh /work/
+RUN /work/ubuntu_arm.sh
 
-# Build OpenBLAS
-RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \
-    cd OpenBLAS && \
-    make -j$(nproc) && \
-    PREFIX=${CROSS_ROOT} make install
+COPY install/install_openblas.sh /work/
+RUN /work/install_openblas.sh
+
+ENV OpenBLAS_HOME=${CROSS_ROOT}
+ENV OpenBLAS_DIR=${CROSS_ROOT}
 
 # Setup CUDA build env (including configuring and copying nvcc)
 COPY --from=cudabuilder /usr/local/cuda /usr/local/cuda
diff --git a/ci/docker/Dockerfile.build.armv6 b/ci/docker/install/install_openblas.sh
similarity index 62%
copy from ci/docker/Dockerfile.build.armv6
copy to ci/docker/install/install_openblas.sh
index 53113d0..fa2e5ca 100755
--- a/ci/docker/Dockerfile.build.armv6
+++ b/ci/docker/install/install_openblas.sh
@@ -1,4 +1,5 @@
-# -*- mode: dockerfile -*-
+#!/usr/bin/env bash
+
 # 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
@@ -15,25 +16,15 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
-# Dockerfile to build MXNet for ARMv6
-
-FROM dockcross/linux-armv6
 
-ENV ARCH armv6l
-ENV FC=/usr/bin/${CROSS_TRIPLE}-gfortran
-ENV HOSTCC gcc
-ENV TARGET ARMV6
+set -ex
 
-RUN apt update && apt install -y unzip
+git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git
 
-WORKDIR /work/deps
+cd OpenBLAS
+make -j$(nproc)
+PREFIX=${CROSS_ROOT} make install
 
-# Build OpenBLAS
-RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \
-    cd OpenBLAS && \
-    make -j$(nproc) && \
-    make PREFIX=$CROSS_ROOT install
+cd ..
 
-COPY runtime_functions.sh /work/
-WORKDIR /work/mxnet
+rm -rf OpenBLAS
diff --git a/ci/docker/Dockerfile.build.armv6 b/ci/docker/install/ubuntu_arm.sh
similarity index 62%
copy from ci/docker/Dockerfile.build.armv6
copy to ci/docker/install/ubuntu_arm.sh
index 53113d0..becb012 100755
--- a/ci/docker/Dockerfile.build.armv6
+++ b/ci/docker/install/ubuntu_arm.sh
@@ -1,4 +1,5 @@
-# -*- mode: dockerfile -*-
+#!/usr/bin/env bash
+
 # 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
@@ -15,25 +16,9 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
-# Dockerfile to build MXNet for ARMv6
-
-FROM dockcross/linux-armv6
-
-ENV ARCH armv6l
-ENV FC=/usr/bin/${CROSS_TRIPLE}-gfortran
-ENV HOSTCC gcc
-ENV TARGET ARMV6
-
-RUN apt update && apt install -y unzip
-
-WORKDIR /work/deps
 
-# Build OpenBLAS
-RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \
-    cd OpenBLAS && \
-    make -j$(nproc) && \
-    make PREFIX=$CROSS_ROOT install
+set -ex
 
-COPY runtime_functions.sh /work/
-WORKDIR /work/mxnet
+apt update
+apt install -y \
+    unzip

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.