Skip to content

Commit

Permalink
Split up CI sanity test functions to enable fine-grained trigger (apa…
Browse files Browse the repository at this point in the history
…che#18786)

Developers can now trigger fine grained checks:

python ci/build.py -R --platform ubuntu_cpu /work/runtime_functions.sh sanity_python
python ci/build.py -R --platform ubuntu_cpu /work/runtime_functions.sh sanity_license
etc
  • Loading branch information
leezu authored Jul 25, 2020
1 parent 06b5d22 commit 2fbd182
Showing 1 changed file with 15 additions and 52 deletions.
67 changes: 15 additions & 52 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,58 +58,6 @@ EOF
fi
}

build_ccache_wrappers() {
set -ex

if [ -z ${CC+x} ]; then
echo "No \$CC set, defaulting to gcc";
export CC=gcc
fi
if [ -z ${CXX+x} ]; then
echo "No \$CXX set, defaulting to g++";
export CXX=g++
fi

# Recommended by CCache: https://ccache.samba.org/manual.html#_run_modes
# Add to the beginning of path to ensure this redirection is picked up instead
# of the original ones. Especially CUDA/NVCC appends itself to the beginning of the
# path and thus this redirect is ignored. This change fixes this problem
# This hacky approach with symbolic links is required because underlying build
# systems of our submodules ignore our CMake settings. If they use Makefile,
# we can't influence them at all in general and NVCC also prefers to hardcode their
# compiler instead of respecting the settings. Thus, we take this brutal approach
# and just redirect everything of this installer has been called.
# In future, we could do these links during image build time of the container.
# But in the beginning, we'll make this opt-in. In future, loads of processes like
# the scala make step or numpy compilation and other pip package generations
# could be heavily sped up by using ccache as well.
mkdir -p /tmp/ccache-redirects
export PATH=/tmp/ccache-redirects:$PATH
CCACHE=`which ccache`
ln -sf $CCACHE /tmp/ccache-redirects/gcc
ln -sf $CCACHE /tmp/ccache-redirects/gcc-8
ln -sf $CCACHE /tmp/ccache-redirects/g++
ln -sf $CCACHE /tmp/ccache-redirects/g++-8
ln -sf $CCACHE /tmp/ccache-redirects/clang++-3.9
ln -sf $CCACHE /tmp/ccache-redirects/clang-3.9
ln -sf $CCACHE /tmp/ccache-redirects/clang++-5.0
ln -sf $CCACHE /tmp/ccache-redirects/clang-5.0
ln -sf $CCACHE /tmp/ccache-redirects/clang++-6.0
ln -sf $CCACHE /tmp/ccache-redirects/clang-6.0
ln -sf $CCACHE /tmp/ccache-redirects/clang++-10
ln -sf $CCACHE /tmp/ccache-redirects/clang-10
#Doesn't work: https://github.com/ccache/ccache/issues/373
# ln -sf $CCACHE /tmp/ccache-redirects/nvcc
# ln -sf $CCACHE /tmp/ccache-redirects/nvcc
# export NVCC="/tmp/ccache-redirects/nvcc"

# Uncomment if you would like to debug CCache hit rates.
# You can monitor using tail -f ccache-log
#export CCACHE_LOGFILE=/work/mxnet/ccache-log
#export CCACHE_LOGFILE=/tmp/ccache-log
#export CCACHE_DEBUG=1
}

build_wheel() {

set -ex
Expand Down Expand Up @@ -787,9 +735,24 @@ build_ubuntu_blc() {
# Testing

sanity_check() {
set -ex
sanity_license
sanity_python
sanity_cpp
}

sanity_license() {
set -ex
tools/license_header.py check
}

sanity_python() {
set -ex
3rdparty/dmlc-core/scripts/lint.py mxnet cpp include src plugin tests --exclude_path src/operator/contrib/ctc_include include/mkldnn
}

sanity_cpp() {
set -ex
python3 -m pylint --rcfile=ci/other/pylintrc --ignore-patterns=".*\.so$$,.*\.dll$$,.*\.dylib$$" python/mxnet
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -n 4 tests/tutorials/test_sanity_tutorials.py
}
Expand Down

0 comments on commit 2fbd182

Please sign in to comment.