Repository: incubator-singa Updated Branches: refs/heads/master f73ae5a5f -> c7f751e0e
SINGA-354 Update travis scripts to use conda-build for all platforms Use conda-build for travis test on osx and linux. Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/faa22f7e Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/faa22f7e Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/faa22f7e Branch: refs/heads/master Commit: faa22f7ed0ed8841028b8c11d13f57b46060574b Parents: f73ae5a Author: Wang Wei <[email protected]> Authored: Sat May 5 23:07:25 2018 +0800 Committer: Wang Wei <[email protected]> Committed: Sat May 5 23:10:13 2018 +0800 ---------------------------------------------------------------------- .travis.yml | 2 -- tool/docker/runtime/Dockerfile | 2 +- tool/travis/build.sh | 42 ++++++++++++++++++++++++------------- tool/travis/conda.sh | 38 --------------------------------- tool/travis/depends.sh | 41 ++++++++++++------------------------ 5 files changed, 42 insertions(+), 83 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/faa22f7e/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml index 5a032df..596a7b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,8 +29,6 @@ matrix: - os: linux dist: trusty compiler: gcc -# TODO(wangwei) include python27 and python36 - # #addons: # apt: http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/faa22f7e/tool/docker/runtime/Dockerfile ---------------------------------------------------------------------- diff --git a/tool/docker/runtime/Dockerfile b/tool/docker/runtime/Dockerfile index 679e824..271276b 100644 --- a/tool/docker/runtime/Dockerfile +++ b/tool/docker/runtime/Dockerfile @@ -27,7 +27,7 @@ RUN apt-get update \ && apt-get clean && apt-get autoremove && apt-get autoclean \ && rm -rf /var/lib/apt/lists/* -RUN wget --no-check-certificate https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; +RUN wget --no-check-certificate https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; RUN bash miniconda.sh -b -p /root/miniconda ENV PATH /root/miniconda/bin:${PATH} RUN conda config --set always_yes yes --set changeps1 no http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/faa22f7e/tool/travis/build.sh ---------------------------------------------------------------------- diff --git a/tool/travis/build.sh b/tool/travis/build.sh index f6c0308..6191ba4 100644 --- a/tool/travis/build.sh +++ b/tool/travis/build.sh @@ -16,20 +16,34 @@ # +set -ex + +# anaconda login user name +USER=nusdbsystem +OS=$TRAVIS_OS_NAME-64 + +export PATH="$HOME/miniconda/bin:$PATH" +conda config --set anaconda_upload no + +# save the package at given folder, then we can upload using singa-*.tar.bz2 +suffix=$TRAVIS_JOB_NUMBER #`TZ=Asia/Singapore date +%Y-%m-%d-%H-%M-%S` +export CONDA_BLD_PATH=~/conda-bld-$suffix +mkdir $CONDA_BLD_PATH + +conda build tool/conda/ --python 3.6 + if [[ "$TRAVIS_SECURE_ENV_VARS" == "false" ]]; + # install and run unittest then - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; - then - export CMAKE_LIBRARY_PATH=/usr/local/opt/openblas/lib:/usr/local/opt/protobuf/lib:$CMAKE_LIBRARY_PATH; - export CMAKE_INCLUDE_PATH=/usr/local/opt/openblas/include:/usr/local/opt/protobuf/include:$CMAKE_INCLUDE_PATH; - mkdir build && cd build; - cmake -DUSE_CUDA=OFF -DUSE_PYTHON=OFF -DENABLE_TEST=ON -DProtobuf_PROTOC_EXECUTABLE=/usr/local/opt/protobuf/bin/protoc ..; - else - mkdir build && cd build; - cmake -DUSE_CUDA=OFF -DUSE_PYTHON=OFF -DENABLE_TEST=ON -DUSE_MODULES=ON .. - fi - make; - ./bin/test_singa --gtest_output=xml:./../gtest.xml; + conda install --use-local + cd test/python + python run.py else - bash -e tool/travis/conda.sh; -fi + conda install --use-local + cd test/python + python run.py + # turn off debug to hide the token in travis log + set +x + # upload the package onto anaconda cloud + anaconda -t $ANACONDA_UPLOAD_TOKEN upload -u $USER -l main $CONDA_BLD_PATH/$OS/singa-*.tar.bz2 --force +fi \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/faa22f7e/tool/travis/conda.sh ---------------------------------------------------------------------- diff --git a/tool/travis/conda.sh b/tool/travis/conda.sh deleted file mode 100644 index 10def56..0000000 --- a/tool/travis/conda.sh +++ /dev/null @@ -1,38 +0,0 @@ -# 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. -# - -# to build SINGA package and upload it to anaconda - -set -x - -# anaconda login user name -USER=nusdbsystem -OS=$TRAVIS_OS_NAME-64 - -export PATH="$HOME/miniconda/bin:$PATH" -conda config --set anaconda_upload no - -# save the package at given folder, then we can upload using singa-*.tar.bz2 -suffix=$TRAVIS_JOB_NUMBER #`TZ=Asia/Singapore date +%Y-%m-%d-%H-%M-%S` -export CONDA_BLD_PATH=~/conda-bld-$suffix -mkdir $CONDA_BLD_PATH - -conda build tool/conda/ - -# turn off debug to hide the token in travis log -set +x -anaconda -t $ANACONDA_UPLOAD_TOKEN upload -u $USER -l main $CONDA_BLD_PATH/$OS/singa-*.tar.bz2 --force http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/faa22f7e/tool/travis/depends.sh ---------------------------------------------------------------------- diff --git a/tool/travis/depends.sh b/tool/travis/depends.sh index 7e4bf41..7b0cac2 100644 --- a/tool/travis/depends.sh +++ b/tool/travis/depends.sh @@ -15,34 +15,19 @@ # limitations under the License. # -# if no env var (i.e., token), then do normal build and test; -# otherwise use conda to build and package -if [[ "$TRAVIS_SECURE_ENV_VARS" == "false" ]]; + +# install miniconda +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; - then - echo "nothing to install" -# sudo apt-get -qq update; -# sudo apt-get -qq -y install libopenblas-dev libprotobuf-dev protobuf-compiler; - else - brew update; - # brew tap homebrew/science; - brew install openblas protobuf; - fi + wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; else - # install miniconda - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; - then - wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; - else - wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O miniconda.sh; - fi - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - hash -r - conda config --set always_yes yes --set changeps1 no - conda update -q conda - conda install conda-build - conda install anaconda-client - conda config --add channels conda-forge + wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh; fi +bash miniconda.sh -b -p $HOME/miniconda +export PATH="$HOME/miniconda/bin:$PATH" +hash -r +conda config --set always_yes yes --set changeps1 no +conda update -q conda +conda install conda-build +conda install anaconda-client +conda config --add channels conda-forge \ No newline at end of file
