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

Commit 2fbd182

Browse files
authored
Split up CI sanity test functions to enable fine-grained trigger (#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
1 parent 06b5d22 commit 2fbd182

File tree

1 file changed

+15
-52
lines changed

1 file changed

+15
-52
lines changed

ci/docker/runtime_functions.sh

Lines changed: 15 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -58,58 +58,6 @@ EOF
5858
fi
5959
}
6060

61-
build_ccache_wrappers() {
62-
set -ex
63-
64-
if [ -z ${CC+x} ]; then
65-
echo "No \$CC set, defaulting to gcc";
66-
export CC=gcc
67-
fi
68-
if [ -z ${CXX+x} ]; then
69-
echo "No \$CXX set, defaulting to g++";
70-
export CXX=g++
71-
fi
72-
73-
# Recommended by CCache: https://ccache.samba.org/manual.html#_run_modes
74-
# Add to the beginning of path to ensure this redirection is picked up instead
75-
# of the original ones. Especially CUDA/NVCC appends itself to the beginning of the
76-
# path and thus this redirect is ignored. This change fixes this problem
77-
# This hacky approach with symbolic links is required because underlying build
78-
# systems of our submodules ignore our CMake settings. If they use Makefile,
79-
# we can't influence them at all in general and NVCC also prefers to hardcode their
80-
# compiler instead of respecting the settings. Thus, we take this brutal approach
81-
# and just redirect everything of this installer has been called.
82-
# In future, we could do these links during image build time of the container.
83-
# But in the beginning, we'll make this opt-in. In future, loads of processes like
84-
# the scala make step or numpy compilation and other pip package generations
85-
# could be heavily sped up by using ccache as well.
86-
mkdir -p /tmp/ccache-redirects
87-
export PATH=/tmp/ccache-redirects:$PATH
88-
CCACHE=`which ccache`
89-
ln -sf $CCACHE /tmp/ccache-redirects/gcc
90-
ln -sf $CCACHE /tmp/ccache-redirects/gcc-8
91-
ln -sf $CCACHE /tmp/ccache-redirects/g++
92-
ln -sf $CCACHE /tmp/ccache-redirects/g++-8
93-
ln -sf $CCACHE /tmp/ccache-redirects/clang++-3.9
94-
ln -sf $CCACHE /tmp/ccache-redirects/clang-3.9
95-
ln -sf $CCACHE /tmp/ccache-redirects/clang++-5.0
96-
ln -sf $CCACHE /tmp/ccache-redirects/clang-5.0
97-
ln -sf $CCACHE /tmp/ccache-redirects/clang++-6.0
98-
ln -sf $CCACHE /tmp/ccache-redirects/clang-6.0
99-
ln -sf $CCACHE /tmp/ccache-redirects/clang++-10
100-
ln -sf $CCACHE /tmp/ccache-redirects/clang-10
101-
#Doesn't work: https://github.com/ccache/ccache/issues/373
102-
# ln -sf $CCACHE /tmp/ccache-redirects/nvcc
103-
# ln -sf $CCACHE /tmp/ccache-redirects/nvcc
104-
# export NVCC="/tmp/ccache-redirects/nvcc"
105-
106-
# Uncomment if you would like to debug CCache hit rates.
107-
# You can monitor using tail -f ccache-log
108-
#export CCACHE_LOGFILE=/work/mxnet/ccache-log
109-
#export CCACHE_LOGFILE=/tmp/ccache-log
110-
#export CCACHE_DEBUG=1
111-
}
112-
11361
build_wheel() {
11462

11563
set -ex
@@ -787,9 +735,24 @@ build_ubuntu_blc() {
787735
# Testing
788736

789737
sanity_check() {
738+
set -ex
739+
sanity_license
740+
sanity_python
741+
sanity_cpp
742+
}
743+
744+
sanity_license() {
790745
set -ex
791746
tools/license_header.py check
747+
}
748+
749+
sanity_python() {
750+
set -ex
792751
3rdparty/dmlc-core/scripts/lint.py mxnet cpp include src plugin tests --exclude_path src/operator/contrib/ctc_include include/mkldnn
752+
}
753+
754+
sanity_cpp() {
755+
set -ex
793756
python3 -m pylint --rcfile=ci/other/pylintrc --ignore-patterns=".*\.so$$,.*\.dll$$,.*\.dylib$$" python/mxnet
794757
OMP_NUM_THREADS=$(expr $(nproc) / 4) pytest -n 4 tests/tutorials/test_sanity_tutorials.py
795758
}

0 commit comments

Comments
 (0)