Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Split up CI sanity test functions to enable fine-grained trigger #18786

Merged
merged 2 commits into from
Jul 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed unused function (this was only used for makefile builds)

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