ARCH=$(uname -m)
+function in_jenkins() {
+ test -n "$JENKINS_HOME"
+}
+
function munge_ceph_spec_in {
local with_seastar=$1
shift
}
function ensure_decent_gcc_on_ubuntu {
+ in_jenkins && echo "CI_DEBUG: Start ensure_decent_gcc_on_ubuntu() in install-deps.sh"
# point gcc to the one offered by g++-7 if the used one is not
# new enough
local old=$(gcc -dumpfullversion -dumpversion)
# cmake uses the latter by default
$SUDO ln -nsf /usr/bin/gcc /usr/bin/${ARCH}-linux-gnu-gcc
$SUDO ln -nsf /usr/bin/g++ /usr/bin/${ARCH}-linux-gnu-g++
+
+ in_jenkins && echo "CI_DEBUG: End ensure_decent_gcc_on_ubuntu() in install-deps.sh"
}
function ensure_python3_sphinx_on_ubuntu {
+ in_jenkins && echo "CI_DEBUG: Running ensure_python3_sphinx_on_ubuntu() in install-deps.sh"
local sphinx_command=/usr/bin/sphinx-build
# python-sphinx points $sphinx_command to
# ../share/sphinx/scripts/python2/sphinx-build when it's installed
}
function install_pkg_on_ubuntu {
+ in_jenkins && echo "CI_DEBUG: Running install_pkg_on_ubuntu() in install-deps.sh"
local project=$1
shift
local sha1=$1
for pkg in $pkgs; do
if ! apt -qq list $pkg 2>/dev/null | grep -q installed; then
missing_pkgs+=" $pkg"
+ in_jenkins && echo "CI_DEBUG: missing_pkgs=$missing_pkgs"
fi
done
fi
}
function install_boost_on_ubuntu {
+ in_jenkins && echo "CI_DEBUG: Running install_boost_on_ubuntu() in install-deps.sh"
local ver=1.75
local installed_ver=$(apt -qq list --installed ceph-libboost*-dev 2>/dev/null |
grep -e 'libboost[0-9].[0-9]\+-dev' |
}
function install_libzbd_on_ubuntu {
+ in_jenkins && echo "CI_DEBUG: Running install_libzbd_on_ubuntu() in install-deps.sh"
local codename=$1
local project=libzbd
local sha1=1fadde94b08fab574b17637c2bebd2b1e7f9127b
}
function install_libpmem_on_ubuntu {
+ in_jenkins && echo "CI_DEBUG: Running install_libpmem_on_ubuntu() in install-deps.sh"
local codename=$1
local project=pmem
local sha1=7c18b4b1413ae965ea8bcbfc69eb9784f9212319
fi
touch $DIR/status
+ in_jenkins && echo "CI_DEBUG: Running munge_debian_control() in install-deps.sh"
backports=""
control=$(munge_debian_control "$VERSION" "debian/control")
case "$VERSION" in
build_profiles+=",pkg.ceph.jaeger"
fi
+ in_jenkins && cat <<EOF
+CI_DEBUG: for_make_check=$for_make_check
+CI_DEBUG: with_seastar=$with_seastar
+CI_DEBUG: with_jaeger=$with_jaeger
+CI_DEBUG: build_profiles=$build_profiles
+CI_DEBUG: Now running 'mk-build-deps' and installing ceph-build-deps package
+EOF
+
$SUDO env DEBIAN_FRONTEND=noninteractive mk-build-deps \
--build-profiles "${build_profiles#,}" \
--install --remove \
--tool="apt-get -y --no-install-recommends $backports" $control || exit 1
+ in_jenkins && echo "CI_DEBUG: Removing ceph-build-deps"
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove ceph-build-deps
if [ "$control" != "debian/control" ] ; then rm $control; fi
fi
function populate_wheelhouse() {
+ in_jenkins && echo "CI_DEBUG: Running populate_wheelhouse() in install-deps.sh"
local install=$1
shift
}
function activate_virtualenv() {
+ in_jenkins && echo "CI_DEBUG: Running activate_virtualenv() in install-deps.sh"
local top_srcdir=$1
local env_dir=$top_srcdir/install-deps-python3
}
function preload_wheels_for_tox() {
+ in_jenkins && echo "CI_DEBUG: Running preload_wheels_for_tox() in install-deps.sh"
local ini=$1
shift
pushd . > /dev/null
rm -rf $XDG_CACHE_HOME
type git > /dev/null || (echo "Dashboard uses git to pull dependencies." ; false)
fi
+
+in_jenkins && echo "CI_DEBUG: End install-deps.sh"
ORIGINAL_CCACHE_CONF="$HOME/.ccache/ccache.conf"
SAVED_CCACHE_CONF="$HOME/.run-make-check-saved-ccache-conf"
+function in_jenkins() {
+ test -n "$JENKINS_HOME"
+}
+
function save_ccache_conf() {
test -f $ORIGINAL_CCACHE_CONF && cp $ORIGINAL_CCACHE_CONF $SAVED_CCACHE_CONF || true
}
if test $ret -eq 100 ; then
# dpkg was interrupted
$DRY_RUN sudo dpkg --configure -a
+ in_jenkins && echo "CI_DEBUG: Running 'sudo $install_cmd $pkgs'"
$DRY_RUN sudo $install_cmd $pkgs
else
return $ret
exit 1
fi
if [ -n "$install_cmd" ]; then
+ in_jenkins && echo "CI_DEBUG: Running '$install_cmd ccache $which_pkg clang'"
do_install "$install_cmd" ccache $which_pkg clang
else
echo "WARNING: Don't know how to install packages" >&2
fi
if test -f ./install-deps.sh ; then
+ in_jenkins && echo "CI_DEBUG: Running install-deps.sh"
$DRY_RUN source ./install-deps.sh || return 1
trap clean_up_after_myself EXIT
fi
$DRY_RUN export SOURCE_DATE_EPOCH="946684800"
$DRY_RUN ccache -o sloppiness=time_macros
$DRY_RUN ccache -o run_second_cpp=true
- if [ -n "$JENKINS_HOME" ]; then
+ if in_jenkins; then
# Build host has plenty of space available, let's use it to keep
# various versions of the built objects. This could increase the cache hit
# if the same or similar PRs are running several times
function configure() {
local cmake_build_opts=$(detect_ceph_dev_pkgs)
+ in_jenkins && echo "CI_DEBUG: Running do_cmake.sh"
$DRY_RUN ./do_cmake.sh $cmake_build_opts $@ || return 1
}
BUILD_MAKEOPTS=${BUILD_MAKEOPTS:-$DEFAULT_MAKEOPTS}
test "$BUILD_MAKEOPTS" && echo "make will run with option(s) $BUILD_MAKEOPTS"
# older cmake does not support --parallel or -j, so pass it to underlying generator
+ in_jenkins && echo "CI_DEBUG: Running cmake"
$DRY_RUN cmake --build . $targets -- $BUILD_MAKEOPTS || return 1
$DRY_RUN ccache -s # print the ccache statistics to evaluate the efficiency
}