Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Moved common parts to scripts for docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
lebeg committed Jun 5, 2018
1 parent 111fb2d commit 4481d26
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 28 deletions.
15 changes: 8 additions & 7 deletions ci/docker/Dockerfile.build.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 8 additions & 7 deletions ci/docker/Dockerfile.build.armv6
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 5 additions & 7 deletions ci/docker/Dockerfile.build.armv7
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
15 changes: 8 additions & 7 deletions ci/docker/Dockerfile.build.jetson
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 30 additions & 0 deletions ci/docker/install/install_openblas.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/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
# 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.

set -ex

git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git

cd OpenBLAS
make -j$(nproc)
PREFIX=${CROSS_ROOT} make install

cd ..

rm -rf OpenBLAS
24 changes: 24 additions & 0 deletions ci/docker/install/ubuntu_arm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/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
# 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.

set -ex

apt update
apt install -y \
unzip

0 comments on commit 4481d26

Please sign in to comment.