You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by zh...@apache.org on 2018/05/07 12:49:11 UTC
[1/3] incubator-singa git commit: SINGA-354 Update travis scripts to
use conda-build for all platforms
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 <dc...@nus.edu.sg>
Authored: Sat May 5 23:07:25 2018 +0800
Committer: Wang Wei <dc...@nus.edu.sg>
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
[3/3] incubator-singa git commit: use absolute python path
Posted by zh...@apache.org.
use absolute python path
Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/c7f751e0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/c7f751e0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/c7f751e0
Branch: refs/heads/master
Commit: c7f751e0ecd7bfdea585776ae728d099f429599a
Parents: 4b3a914
Author: Wang Wei <dc...@nus.edu.sg>
Authored: Mon May 7 10:10:00 2018 +0800
Committer: Wang Wei <dc...@nus.edu.sg>
Committed: Mon May 7 10:10:00 2018 +0800
----------------------------------------------------------------------
tool/travis/build.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/c7f751e0/tool/travis/build.sh
----------------------------------------------------------------------
diff --git a/tool/travis/build.sh b/tool/travis/build.sh
index 96af82c..7ac3df8 100644
--- a/tool/travis/build.sh
+++ b/tool/travis/build.sh
@@ -33,7 +33,7 @@ mkdir $CONDA_BLD_PATH
conda build tool/conda/ --python 3.6
conda install --use-local singa
cd test/python
-python run.py
+$HOME/miniconda/bin/python run.py
if [[ "$TRAVIS_SECURE_ENV_VARS" == "false" ]];
# install and run unittest
[2/3] incubator-singa git commit: SINGA-354 Update travis scripts to
use conda-build for all platforms
Posted by zh...@apache.org.
SINGA-354 Update travis scripts to use conda-build for all platforms
Add xmlrunner into conda dependency list
update XMLTestRunner args to fix running bugs
Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/4b3a914b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/4b3a914b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/4b3a914b
Branch: refs/heads/master
Commit: 4b3a914b84fc73f0b2e8d9c0ab10cdcd61fcfe92
Parents: faa22f7
Author: Wang Wei <dc...@nus.edu.sg>
Authored: Sat May 5 23:22:29 2018 +0800
Committer: Wang Wei <dc...@nus.edu.sg>
Committed: Sun May 6 23:09:12 2018 +0800
----------------------------------------------------------------------
test/python/run.py | 6 ++----
tool/conda/meta.yaml | 1 +
tool/travis/build.sh | 10 ++++------
3 files changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/4b3a914b/test/python/run.py
----------------------------------------------------------------------
diff --git a/test/python/run.py b/test/python/run.py
index 8f7a45f..ef2c671 100644
--- a/test/python/run.py
+++ b/test/python/run.py
@@ -22,8 +22,6 @@ import xmlrunner
loader = unittest.TestLoader()
tests = loader.discover('.')
# testRunner = unittest.runner.TextTestRunner()
-with open('unittest.xml', 'wb') as output:
- testRunner = xmlrunner.XMLTestRunner(output=output,
- failfast=False,
- buffer=False)
+with open('unittest.xml', 'w') as output:
+ testRunner = xmlrunner.XMLTestRunner(output=output)
testRunner.run(tests)
http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/4b3a914b/tool/conda/meta.yaml
----------------------------------------------------------------------
diff --git a/tool/conda/meta.yaml b/tool/conda/meta.yaml
index de542cd..9b9b3f5 100644
--- a/tool/conda/meta.yaml
+++ b/tool/conda/meta.yaml
@@ -36,6 +36,7 @@ requirements:
- flask-cors >=3.0.2
- pillow >=2.3.0
- future >=0.16.0
+ - xmlrunner 1.7.7
test:
source_files:
http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/4b3a914b/tool/travis/build.sh
----------------------------------------------------------------------
diff --git a/tool/travis/build.sh b/tool/travis/build.sh
index 6191ba4..96af82c 100644
--- a/tool/travis/build.sh
+++ b/tool/travis/build.sh
@@ -31,17 +31,15 @@ export CONDA_BLD_PATH=~/conda-bld-$suffix
mkdir $CONDA_BLD_PATH
conda build tool/conda/ --python 3.6
+conda install --use-local singa
+cd test/python
+python run.py
if [[ "$TRAVIS_SECURE_ENV_VARS" == "false" ]];
# install and run unittest
then
- conda install --use-local
- cd test/python
- python run.py
+ echo "no uploading if ANACONDA_UPLOAD_TOKEN not set"
else
- 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