You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by ns...@apache.org on 2018/11/17 05:10:52 UTC

[incubator-mxnet] branch master updated: [MXNET-1213] add Cent OS build for Scala (#13279)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new f87db9e  [MXNET-1213] add Cent OS build for Scala (#13279)
f87db9e is described below

commit f87db9eed45c208f9c13098205193c4cd41d04ee
Author: Lanking <la...@live.com>
AuthorDate: Fri Nov 16 21:10:38 2018 -0800

    [MXNET-1213] add Cent OS build for Scala (#13279)
    
    * add centos build for Scala
    
    * migrate the build portion to docker
    
    * update build script and chmod +x
    
    * address Jenkins change
    
    * allow CentOS provide all depdencies
---
 Jenkinsfile                                        | 13 ++++++++-
 ci/docker/Dockerfile.build.centos7_cpu             |  2 ++
 .../centos7_scala.sh}                              | 34 ++++++++--------------
 ci/docker/install/ubuntu_scala.sh                  |  6 ----
 ci/docker/runtime_functions.sh                     |  7 +++++
 5 files changed, 33 insertions(+), 29 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 3f72843..fca8539 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -152,7 +152,7 @@ core_logic: {
           timeout(time: max_time, unit: 'MINUTES') {
             utils.init_git()
             utils.docker_run('centos7_cpu', 'build_centos7_cpu', false)
-            utils.pack_lib('centos7_cpu', mx_lib, true)
+            utils.pack_lib('centos7_cpu', mx_dist_lib, true)
           }
         }
       }
@@ -698,6 +698,17 @@ core_logic: {
         }
       }
     },
+    'Scala: CentOS CPU': {
+      node(NODE_LINUX_CPU) {
+        ws('workspace/ut-scala-centos7-cpu') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            utils.unpack_and_init('centos7_cpu', mx_dist_lib, true)
+            utils.docker_run('centos7_cpu', 'unittest_centos7_cpu_scala', false)
+            utils.publish_test_coverage()
+          }
+        }
+      }
+    },
     'Clojure: CPU': {
       node(NODE_LINUX_CPU) {
         ws('workspace/ut-clojure-cpu') {
diff --git a/ci/docker/Dockerfile.build.centos7_cpu b/ci/docker/Dockerfile.build.centos7_cpu
index 076ef5d..e2802aa 100644
--- a/ci/docker/Dockerfile.build.centos7_cpu
+++ b/ci/docker/Dockerfile.build.centos7_cpu
@@ -28,6 +28,8 @@ COPY install/centos7_ccache.sh /work/
 RUN /work/centos7_ccache.sh
 COPY install/centos7_python.sh /work/
 RUN /work/centos7_python.sh
+COPY install/centos7_scala.sh /work/
+RUN /work/centos7_scala.sh
 COPY install/ubuntu_mklml.sh /work/
 RUN /work/ubuntu_mklml.sh
 
diff --git a/ci/docker/Dockerfile.build.centos7_cpu b/ci/docker/install/centos7_scala.sh
old mode 100644
new mode 100755
similarity index 59%
copy from ci/docker/Dockerfile.build.centos7_cpu
copy to ci/docker/install/centos7_scala.sh
index 076ef5d..ea46de9
--- a/ci/docker/Dockerfile.build.centos7_cpu
+++ b/ci/docker/install/centos7_scala.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,27 +16,16 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
-# Dockerfile to build and run MXNet on CentOS 7 for CPU
-
-FROM centos:7
-
-WORKDIR /work/deps
-
-COPY install/centos7_core.sh /work/
-RUN /work/centos7_core.sh
-COPY install/centos7_ccache.sh /work/
-RUN /work/centos7_ccache.sh
-COPY install/centos7_python.sh /work/
-RUN /work/centos7_python.sh
-COPY install/ubuntu_mklml.sh /work/
-RUN /work/ubuntu_mklml.sh
 
-ARG USER_ID=0
-COPY install/centos7_adduser.sh /work/
-RUN /work/centos7_adduser.sh 
+# build and install are separated so changes to build don't invalidate
+# the whole docker cache for the image
 
-ENV PYTHONPATH=./python/
-WORKDIR /work/mxnet
+set -ex
 
-COPY runtime_functions.sh /work/
+yum install -y java-1.8.0-openjdk-devel
+# Build from source with Maven
+wget http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
+tar xzf apache-maven-3.3.9-bin.tar.gz
+mkdir /usr/local/maven
+mv apache-maven-3.3.9/ /usr/local/maven/
+alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
diff --git a/ci/docker/install/ubuntu_scala.sh b/ci/docker/install/ubuntu_scala.sh
index c71c751..6ecb8d8 100755
--- a/ci/docker/install/ubuntu_scala.sh
+++ b/ci/docker/install/ubuntu_scala.sh
@@ -30,13 +30,7 @@ apt-get update || true
 apt-get install -y openjdk-8-jdk
 apt-get install -y openjdk-8-jre
 
-echo "deb https://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list
-# ubuntu keyserver is very flaky
-#apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
-#apt-key adv --keyserver keys.gnupg.net --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
-apt-key add sbt.gpg
 apt-get update || true
 apt-get install -y \
     maven \
-    sbt \
     scala
diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh
index 27c93b5..39631f9 100755
--- a/ci/docker/runtime_functions.sh
+++ b/ci/docker/runtime_functions.sh
@@ -761,6 +761,13 @@ unittest_ubuntu_cpu_scala() {
     make scalaunittest USE_BLAS=openblas USE_DIST_KVSTORE=1 ENABLE_TESTCOVERAGE=1
 }
 
+unittest_centos7_cpu_scala() {
+    set -ex
+    cd /work/mxnet
+    make scalapkg USE_BLAS=openblas USE_DIST_KVSTORE=1 ENABLE_TESTCOVERAGE=1
+    make scalaunittest USE_BLAS=openblas USE_DIST_KVSTORE=1 ENABLE_TESTCOVERAGE=1
+}
+
 unittest_ubuntu_cpu_clojure() {
     set -ex
     make scalapkg USE_OPENCV=1 USE_BLAS=openblas USE_DIST_KVSTORE=1 ENABLE_TESTCOVERAGE=1