Repository: incubator-singa Updated Branches: refs/heads/master ee93b7dda -> 33cf5461b
SINGA-280 Jenkins CI support Add Jenkins scripts Add dockerfile for singa env Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/3b8cb947 Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/3b8cb947 Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/3b8cb947 Branch: refs/heads/master Commit: 3b8cb94729e6dd04e34eb6792d8d691f62c1dfc3 Parents: ee93b7d Author: WANG Sheng <[email protected]> Authored: Thu Dec 1 16:35:46 2016 +0800 Committer: WANG Sheng <[email protected]> Committed: Tue Dec 13 15:17:04 2016 +0800 ---------------------------------------------------------------------- jenkins.sh | 51 -------------------- tool/jenkins/README.md | 42 ++++++++++++++++ .../docker/ubuntu14.04-cuda8-cudnn5/Dockerfile | 33 +++++++++++++ tool/jenkins/jenkins_pysinga.sh | 46 ++++++++++++++++++ 4 files changed, 121 insertions(+), 51 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/3b8cb947/jenkins.sh ---------------------------------------------------------------------- diff --git a/jenkins.sh b/jenkins.sh deleted file mode 100644 index 347a55e..0000000 --- a/jenkins.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env sh -#/** -# * -# * 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. -# */ - - - -if [ $1 = "CPP" ]; then - echo "CPP test" - mkdir build - rm -f gtest.xml - cd build - cmake -DUSE_CUDNN=OFF -DUSE_CUDA=OFF -DUSE_PYTHON=OFF ../ - make - ./bin/test_singa --gtest_output=xml:./../gtest.xml -fi - -if [ $1 = "CUDNN" ]; then - echo "CUDNN test" - git submodule init - git submodule update - mkdir build - rm -f gtest.xml - cd build - cmake -DUSE_CUDNN=ON -DUSE_CUDA=ON -DUSE_PYTHON=OFF ../ - make - ./bin/test_singa --gtest_output=xml:./../gtest.xml -fi - -cd .. -rm -rf build - - - - - http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/3b8cb947/tool/jenkins/README.md ---------------------------------------------------------------------- diff --git a/tool/jenkins/README.md b/tool/jenkins/README.md new file mode 100644 index 0000000..f62fa35 --- /dev/null +++ b/tool/jenkins/README.md @@ -0,0 +1,42 @@ +# Jenkins CI Support + +## Introduction + +This documentation is to guide SINGA developers to setup Jenkins service. + +We use jenkins to support continuous integration. +After each commit, we want to automatically compile and test SINGA +under different OS and settings. +Those built binaries need to be archived for users to download. + + +## Install Jenkins +[Jenkins Official Wiki](https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins) + +## Configure Jenkins Multi-configuration Project +Create a multi-configuration project and configure project as follows: + +### Description + This job automatically pulls latest commits from apache SINGA github repository. + It compiles and tests SINGA in different environments and creates PySINGA wheel distribution accordingly. + +### General + * Discard old builds - Max # of builds to keep - 50 + * GitHub project - ``https://github.com/apache/incubator-singa`` + +### Source Code Management + * Git - Repository URL - ``https://github.com/apache/incubator-singa`` + * Git - Branch Specifier - ``*/master`` + +### Build Triggers + * Poll SCM - Schedule - ``H/30 * * * *`` (pull every 30 minutes) + +### Configuration Matrix + * User-defined Axis - name ``support`` values ``blas cudnn`` + +### Build + * Execute shell - command - ``bash -ex tool/jenkins/jenkins_pysinga.sh $support`` + +### Post-build Actions + * Archive the artifacts - ``build/python/dist/**.whl`` + * Publish JUnit test result report - Test report XMLs - ``**/gtest.xml`` http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/3b8cb947/tool/jenkins/docker/ubuntu14.04-cuda8-cudnn5/Dockerfile ---------------------------------------------------------------------- diff --git a/tool/jenkins/docker/ubuntu14.04-cuda8-cudnn5/Dockerfile b/tool/jenkins/docker/ubuntu14.04-cuda8-cudnn5/Dockerfile new file mode 100644 index 0000000..2feccd3 --- /dev/null +++ b/tool/jenkins/docker/ubuntu14.04-cuda8-cudnn5/Dockerfile @@ -0,0 +1,33 @@ +FROM nvidia/cuda:8.0-cudnn5-devel + +# install dependencies +RUN apt-get update && apt-get install -y \ + git vim wget build-essential autoconf libtool cmake \ + libprotobuf-dev libopenblas-dev protobuf-compiler \ + libpcre3-dev python-dev python-pip && \ + pip install numpy + +# install swig 3.0 +RUN wget http://prdownloads.sourceforge.net/swig/swig-3.0.10.tar.gz && \ + tar zxf swig-3.0.10.tar.gz && cd swig-3.0.10 && \ + ./configure && make && make install + +# set environment +ENV CPLUS_INCLUDE_PATH /usr/local/lib/python2.7/dist-packages/numpy/core/include:${CPLUS_INCLUDE_PATH} +ENV CMAKE_INCLUDE_PATH /usr/local/cuda/include:${CMAKE_INCLUDE_PATH} +ENV CMAKE_LIBRARY_PATH /usr/local/cuda/lib64:${CMAKE_LIBRARY_PATH} + +# download singa source +RUN git clone https://github.com/apache/incubator-singa.git + +# install ssh service +RUN apt-get install -y openssh-server +RUN mkdir /var/run/sshd +RUN echo 'root:singa' | chpasswd +RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config +# SSH login fix. Otherwise user is kicked off after login +RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd + +EXPOSE 22 + +CMD ["/usr/sbin/sshd", "-D"] http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/3b8cb947/tool/jenkins/jenkins_pysinga.sh ---------------------------------------------------------------------- diff --git a/tool/jenkins/jenkins_pysinga.sh b/tool/jenkins/jenkins_pysinga.sh new file mode 100644 index 0000000..b2e920a --- /dev/null +++ b/tool/jenkins/jenkins_pysinga.sh @@ -0,0 +1,46 @@ +#!/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. +# */ + +echo Compile, test and distribute PySINGA... +echo Parameters: $1 +echo Workspace: `pwd` +echo OS env: `uname -a` +echo Cuda env: `nvcc --version` +# set parameters +CUDNN="OFF" +if [ $1 = "cudnn" ]; then + CUDNN="ON" +fi +# setup env +rm -rf build +mkdir build +# compile singa c++ +cd build +cmake -DUSE_CUDNN=$CUDNN -DUSE_CUDA=$CUDNN ../ +make +# unit test +./bin/test_singa --gtest_output=xml:./../gtest.xml +# compile pysinga +cd python +python setup.py bdist_wheel +# rename dist +cd dist +mv singa-1.0.1-py2-none-any.whl singa-1.0.0-cp27-none-linux_x86_64.whl +echo Job finished...
