2017-07-20 22:26:42 +00:00
|
|
|
|
#!/usr/bin/env bash
|
2017-11-10 01:32:13 +00:00
|
|
|
|
# -*- mode:sh; tab-width:8; indent-tabs-mode:t -*-
|
2014-11-25 16:25:26 +00:00
|
|
|
|
#
|
|
|
|
|
# Ceph distributed storage system
|
|
|
|
|
#
|
2015-05-02 13:59:12 +00:00
|
|
|
|
# Copyright (C) 2014, 2015 Red Hat <contact@redhat.com>
|
2014-11-25 16:25:26 +00:00
|
|
|
|
#
|
|
|
|
|
# Author: Loic Dachary <loic@dachary.org>
|
|
|
|
|
#
|
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
#
|
2017-07-20 22:26:42 +00:00
|
|
|
|
set -e
|
2014-11-25 16:25:26 +00:00
|
|
|
|
DIR=/tmp/install-deps.$$
|
|
|
|
|
trap "rm -fr $DIR" EXIT
|
|
|
|
|
mkdir -p $DIR
|
2014-12-20 17:57:59 +00:00
|
|
|
|
if test $(id -u) != 0 ; then
|
|
|
|
|
SUDO=sudo
|
|
|
|
|
fi
|
2022-01-27 11:32:28 +00:00
|
|
|
|
export LC_ALL=en_US.UTF-8 # the following is vulnerable to i18n
|
2015-02-03 15:26:17 +00:00
|
|
|
|
|
2018-08-01 10:33:58 +00:00
|
|
|
|
ARCH=$(uname -m)
|
2018-02-14 15:53:47 +00:00
|
|
|
|
|
2022-03-25 21:29:44 +00:00
|
|
|
|
function in_jenkins() {
|
|
|
|
|
test -n "$JENKINS_HOME"
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-27 07:45:09 +00:00
|
|
|
|
function munge_ceph_spec_in {
|
2019-06-06 03:10:41 +00:00
|
|
|
|
local with_seastar=$1
|
|
|
|
|
shift
|
2020-09-17 06:21:40 +00:00
|
|
|
|
local with_zbd=$1
|
|
|
|
|
shift
|
2019-02-13 12:47:38 +00:00
|
|
|
|
local for_make_check=$1
|
|
|
|
|
shift
|
2017-06-27 07:45:09 +00:00
|
|
|
|
local OUTFILE=$1
|
2019-02-13 12:47:38 +00:00
|
|
|
|
sed -e 's/@//g' < ceph.spec.in > $OUTFILE
|
|
|
|
|
# http://rpm.org/user_doc/conditional_builds.html
|
2019-06-06 03:10:41 +00:00
|
|
|
|
if $with_seastar; then
|
2018-07-03 09:06:47 +00:00
|
|
|
|
sed -i -e 's/%bcond_with seastar/%bcond_without seastar/g' $OUTFILE
|
|
|
|
|
fi
|
2020-09-17 06:21:40 +00:00
|
|
|
|
if $with_zbd; then
|
|
|
|
|
sed -i -e 's/%bcond_with zbd/%bcond_without zbd/g' $OUTFILE
|
|
|
|
|
fi
|
2019-02-13 12:47:38 +00:00
|
|
|
|
if $for_make_check; then
|
|
|
|
|
sed -i -e 's/%bcond_with make_check/%bcond_without make_check/g' $OUTFILE
|
|
|
|
|
fi
|
2017-06-27 07:45:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-13 11:56:00 +00:00
|
|
|
|
function munge_debian_control {
|
|
|
|
|
local version=$1
|
|
|
|
|
shift
|
2019-02-13 12:25:21 +00:00
|
|
|
|
local control=$1
|
2019-02-13 11:56:00 +00:00
|
|
|
|
case "$version" in
|
|
|
|
|
*squeeze*|*wheezy*)
|
|
|
|
|
control="/tmp/control.$$"
|
|
|
|
|
grep -v babeltrace debian/control > $control
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
echo $control
|
2017-06-27 07:45:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-08-01 10:52:45 +00:00
|
|
|
|
function ensure_decent_gcc_on_ubuntu {
|
2022-03-25 21:29:44 +00:00
|
|
|
|
in_jenkins && echo "CI_DEBUG: Start ensure_decent_gcc_on_ubuntu() in install-deps.sh"
|
2017-11-12 05:07:35 +00:00
|
|
|
|
# point gcc to the one offered by g++-7 if the used one is not
|
|
|
|
|
# new enough
|
2018-10-26 06:32:09 +00:00
|
|
|
|
local old=$(gcc -dumpfullversion -dumpversion)
|
2017-12-08 08:34:59 +00:00
|
|
|
|
local new=$1
|
2018-08-01 10:52:45 +00:00
|
|
|
|
local codename=$2
|
2019-05-14 14:37:00 +00:00
|
|
|
|
if dpkg --compare-versions $old ge ${new}.0; then
|
2017-11-12 05:07:35 +00:00
|
|
|
|
return
|
|
|
|
|
fi
|
|
|
|
|
|
2017-12-13 06:22:39 +00:00
|
|
|
|
if [ ! -f /usr/bin/g++-${new} ]; then
|
2017-12-14 11:06:51 +00:00
|
|
|
|
$SUDO tee /etc/apt/sources.list.d/ubuntu-toolchain-r.list <<EOF
|
2018-09-28 03:45:03 +00:00
|
|
|
|
deb [lang=none] http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu $codename main
|
2019-06-07 16:13:04 +00:00
|
|
|
|
deb [arch=amd64 lang=none] http://mirror.nullivex.com/ppa/ubuntu-toolchain-r-test $codename main
|
2017-12-13 06:22:39 +00:00
|
|
|
|
EOF
|
|
|
|
|
# import PPA's signing key into APT's keyring
|
2018-07-10 12:23:48 +00:00
|
|
|
|
cat << ENDOFKEY | $SUDO apt-key add -
|
|
|
|
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
|
|
|
|
Version: SKS 1.1.6
|
|
|
|
|
Comment: Hostname: keyserver.ubuntu.com
|
|
|
|
|
|
|
|
|
|
mI0ESuBvRwEEAMi4cDba7xlKaaoXjO1n1HX8RKrkW+HEIl79nSOSJyvzysajs7zUow/OzCQp
|
|
|
|
|
9NswqrDmNuH1+lPTTRNAGtK8r2ouq2rnXT1mTl23dpgHZ9spseR73s4ZBGw/ag4bpU5dNUSt
|
|
|
|
|
vfmHhIjVCuiSpNn7cyy1JSSvSs3N2mxteKjXLBf7ABEBAAG0GkxhdW5jaHBhZCBUb29sY2hh
|
|
|
|
|
aW4gYnVpbGRziLYEEwECACAFAkrgb0cCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRAe
|
|
|
|
|
k3eiup7yfzGKA/4xzUqNACSlB+k+DxFFHqkwKa/ziFiAlkLQyyhm+iqz80htRZr7Ls/ZRYZl
|
|
|
|
|
0aSU56/hLe0V+TviJ1s8qdN2lamkKdXIAFfavA04nOnTzyIBJ82EAUT3Nh45skMxo4z4iZMN
|
|
|
|
|
msyaQpNl/m/lNtOLhR64v5ZybofB2EWkMxUzX8D/FQ==
|
|
|
|
|
=LcUQ
|
|
|
|
|
-----END PGP PUBLIC KEY BLOCK-----
|
|
|
|
|
ENDOFKEY
|
2018-09-28 03:45:03 +00:00
|
|
|
|
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get update -y || true
|
2019-05-14 14:37:00 +00:00
|
|
|
|
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get install -y g++-${new}
|
2017-12-09 11:29:58 +00:00
|
|
|
|
fi
|
2017-12-13 06:22:39 +00:00
|
|
|
|
|
2019-09-24 19:48:27 +00:00
|
|
|
|
case "$codename" in
|
2017-12-13 06:22:39 +00:00
|
|
|
|
trusty)
|
|
|
|
|
old=4.8;;
|
|
|
|
|
xenial)
|
|
|
|
|
old=5;;
|
2019-06-07 16:08:37 +00:00
|
|
|
|
bionic)
|
|
|
|
|
old=7;;
|
2017-12-13 06:22:39 +00:00
|
|
|
|
esac
|
2017-12-09 11:29:58 +00:00
|
|
|
|
$SUDO update-alternatives --remove-all gcc || true
|
2017-11-12 05:07:35 +00:00
|
|
|
|
$SUDO update-alternatives \
|
2017-12-09 09:35:28 +00:00
|
|
|
|
--install /usr/bin/gcc gcc /usr/bin/gcc-${new} 20 \
|
|
|
|
|
--slave /usr/bin/g++ g++ /usr/bin/g++-${new}
|
2017-11-12 05:07:35 +00:00
|
|
|
|
|
2018-04-14 15:23:58 +00:00
|
|
|
|
if [ -f /usr/bin/g++-${old} ]; then
|
|
|
|
|
$SUDO update-alternatives \
|
|
|
|
|
--install /usr/bin/gcc gcc /usr/bin/gcc-${old} 10 \
|
|
|
|
|
--slave /usr/bin/g++ g++ /usr/bin/g++-${old}
|
|
|
|
|
fi
|
2017-11-12 05:07:35 +00:00
|
|
|
|
|
|
|
|
|
$SUDO update-alternatives --auto gcc
|
|
|
|
|
|
|
|
|
|
# cmake uses the latter by default
|
2019-09-24 19:48:27 +00:00
|
|
|
|
$SUDO ln -nsf /usr/bin/gcc /usr/bin/${ARCH}-linux-gnu-gcc
|
|
|
|
|
$SUDO ln -nsf /usr/bin/g++ /usr/bin/${ARCH}-linux-gnu-g++
|
2022-03-25 21:29:44 +00:00
|
|
|
|
|
|
|
|
|
in_jenkins && echo "CI_DEBUG: End ensure_decent_gcc_on_ubuntu() in install-deps.sh"
|
2017-11-12 05:07:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-06-25 11:54:55 +00:00
|
|
|
|
function ensure_python3_sphinx_on_ubuntu {
|
2022-03-25 21:29:44 +00:00
|
|
|
|
in_jenkins && echo "CI_DEBUG: Running ensure_python3_sphinx_on_ubuntu() in install-deps.sh"
|
2020-06-25 11:54:55 +00:00
|
|
|
|
local sphinx_command=/usr/bin/sphinx-build
|
|
|
|
|
# python-sphinx points $sphinx_command to
|
|
|
|
|
# ../share/sphinx/scripts/python2/sphinx-build when it's installed
|
|
|
|
|
# let's "correct" this
|
|
|
|
|
if test -e $sphinx_command && head -n1 $sphinx_command | grep -q python$; then
|
|
|
|
|
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove python-sphinx
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-08 15:06:45 +00:00
|
|
|
|
function install_pkg_on_ubuntu {
|
2022-03-25 21:29:44 +00:00
|
|
|
|
in_jenkins && echo "CI_DEBUG: Running install_pkg_on_ubuntu() in install-deps.sh"
|
2018-09-08 15:06:45 +00:00
|
|
|
|
local project=$1
|
|
|
|
|
shift
|
|
|
|
|
local sha1=$1
|
|
|
|
|
shift
|
|
|
|
|
local codename=$1
|
|
|
|
|
shift
|
2019-08-04 03:41:26 +00:00
|
|
|
|
local force=$1
|
|
|
|
|
shift
|
2018-09-08 15:06:45 +00:00
|
|
|
|
local pkgs=$@
|
|
|
|
|
local missing_pkgs
|
2019-08-04 03:41:26 +00:00
|
|
|
|
if [ $force = "force" ]; then
|
|
|
|
|
missing_pkgs="$@"
|
|
|
|
|
else
|
|
|
|
|
for pkg in $pkgs; do
|
2019-12-23 08:45:42 +00:00
|
|
|
|
if ! apt -qq list $pkg 2>/dev/null | grep -q installed; then
|
2019-08-04 03:41:26 +00:00
|
|
|
|
missing_pkgs+=" $pkg"
|
2022-03-25 21:29:44 +00:00
|
|
|
|
in_jenkins && echo "CI_DEBUG: missing_pkgs=$missing_pkgs"
|
2019-08-04 03:41:26 +00:00
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
fi
|
2018-09-08 15:06:45 +00:00
|
|
|
|
if test -n "$missing_pkgs"; then
|
|
|
|
|
local shaman_url="https://shaman.ceph.com/api/repos/${project}/master/${sha1}/ubuntu/${codename}/repo"
|
|
|
|
|
$SUDO curl --silent --location $shaman_url --output /etc/apt/sources.list.d/$project.list
|
|
|
|
|
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get update -y -o Acquire::Languages=none -o Acquire::Translation=none || true
|
|
|
|
|
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get install --allow-unauthenticated -y $missing_pkgs
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-20 04:43:34 +00:00
|
|
|
|
function install_boost_on_ubuntu {
|
2022-03-25 21:29:44 +00:00
|
|
|
|
in_jenkins && echo "CI_DEBUG: Running install_boost_on_ubuntu() in install-deps.sh"
|
2021-03-30 01:45:41 +00:00
|
|
|
|
local ver=1.75
|
2021-03-20 05:00:01 +00:00
|
|
|
|
local installed_ver=$(apt -qq list --installed ceph-libboost*-dev 2>/dev/null |
|
|
|
|
|
grep -e 'libboost[0-9].[0-9]\+-dev' |
|
|
|
|
|
cut -d' ' -f2 |
|
|
|
|
|
cut -d'.' -f1,2)
|
|
|
|
|
if test -n "$installed_ver"; then
|
|
|
|
|
if echo "$installed_ver" | grep -q "^$ver"; then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove "ceph-libboost.*${installed_ver}.*"
|
|
|
|
|
$SUDO rm -f /etc/apt/sources.list.d/ceph-libboost${installed_ver}.list
|
|
|
|
|
fi
|
2019-11-14 13:05:55 +00:00
|
|
|
|
fi
|
2021-03-20 05:00:01 +00:00
|
|
|
|
local codename=$1
|
2019-11-14 13:05:55 +00:00
|
|
|
|
local project=libboost
|
2020-06-26 07:26:46 +00:00
|
|
|
|
local sha1=7aba8a1882670522ee1d1ee1bba0ea170b292dec
|
2018-11-20 04:43:34 +00:00
|
|
|
|
install_pkg_on_ubuntu \
|
2019-11-14 13:05:55 +00:00
|
|
|
|
$project \
|
|
|
|
|
$sha1 \
|
2018-11-20 04:43:34 +00:00
|
|
|
|
$codename \
|
2019-08-04 03:41:26 +00:00
|
|
|
|
check \
|
2019-11-14 13:05:55 +00:00
|
|
|
|
ceph-libboost-atomic$ver-dev \
|
|
|
|
|
ceph-libboost-chrono$ver-dev \
|
|
|
|
|
ceph-libboost-container$ver-dev \
|
|
|
|
|
ceph-libboost-context$ver-dev \
|
|
|
|
|
ceph-libboost-coroutine$ver-dev \
|
|
|
|
|
ceph-libboost-date-time$ver-dev \
|
|
|
|
|
ceph-libboost-filesystem$ver-dev \
|
|
|
|
|
ceph-libboost-iostreams$ver-dev \
|
|
|
|
|
ceph-libboost-program-options$ver-dev \
|
|
|
|
|
ceph-libboost-python$ver-dev \
|
|
|
|
|
ceph-libboost-random$ver-dev \
|
|
|
|
|
ceph-libboost-regex$ver-dev \
|
|
|
|
|
ceph-libboost-system$ver-dev \
|
|
|
|
|
ceph-libboost-test$ver-dev \
|
|
|
|
|
ceph-libboost-thread$ver-dev \
|
|
|
|
|
ceph-libboost-timer$ver-dev
|
2018-11-20 04:43:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-25 06:11:46 +00:00
|
|
|
|
function install_libzbd_on_ubuntu {
|
2022-03-25 21:29:44 +00:00
|
|
|
|
in_jenkins && echo "CI_DEBUG: Running install_libzbd_on_ubuntu() in install-deps.sh"
|
2021-01-26 10:20:45 +00:00
|
|
|
|
local codename=$1
|
2021-01-25 06:11:46 +00:00
|
|
|
|
local project=libzbd
|
2021-01-26 10:20:45 +00:00
|
|
|
|
local sha1=1fadde94b08fab574b17637c2bebd2b1e7f9127b
|
2021-01-25 06:11:46 +00:00
|
|
|
|
install_pkg_on_ubuntu \
|
|
|
|
|
$project \
|
|
|
|
|
$sha1 \
|
|
|
|
|
$codename \
|
|
|
|
|
check \
|
|
|
|
|
libzbd-dev
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-06 12:17:12 +00:00
|
|
|
|
function install_libpmem_on_ubuntu {
|
2022-03-25 21:29:44 +00:00
|
|
|
|
in_jenkins && echo "CI_DEBUG: Running install_libpmem_on_ubuntu() in install-deps.sh"
|
2021-04-06 12:17:12 +00:00
|
|
|
|
local codename=$1
|
|
|
|
|
local project=pmem
|
|
|
|
|
local sha1=7c18b4b1413ae965ea8bcbfc69eb9784f9212319
|
|
|
|
|
install_pkg_on_ubuntu \
|
|
|
|
|
$project \
|
|
|
|
|
$sha1 \
|
|
|
|
|
$codename \
|
|
|
|
|
check \
|
|
|
|
|
libpmem-dev \
|
|
|
|
|
libpmemobj-dev
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-08 08:34:59 +00:00
|
|
|
|
function version_lt {
|
|
|
|
|
test $1 != $(echo -e "$1\n$2" | sort -rV | head -n 1)
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-27 01:22:34 +00:00
|
|
|
|
for_make_check=false
|
|
|
|
|
if tty -s; then
|
|
|
|
|
# interactive
|
|
|
|
|
for_make_check=true
|
|
|
|
|
elif [ $FOR_MAKE_CHECK ]; then
|
|
|
|
|
for_make_check=true
|
|
|
|
|
else
|
|
|
|
|
for_make_check=false
|
|
|
|
|
fi
|
|
|
|
|
|
2018-08-01 10:33:58 +00:00
|
|
|
|
if [ x$(uname)x = xFreeBSDx ]; then
|
2016-03-24 11:48:20 +00:00
|
|
|
|
$SUDO pkg install -yq \
|
2017-07-24 16:20:19 +00:00
|
|
|
|
devel/babeltrace \
|
2019-03-06 22:23:33 +00:00
|
|
|
|
devel/binutils \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
devel/git \
|
2016-08-09 16:28:07 +00:00
|
|
|
|
devel/gperf \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
devel/gmake \
|
2016-10-16 20:10:03 +00:00
|
|
|
|
devel/cmake \
|
2020-10-22 06:41:34 +00:00
|
|
|
|
devel/nasm \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
devel/boost-all \
|
2016-10-16 20:10:03 +00:00
|
|
|
|
devel/boost-python-libs \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
devel/valgrind \
|
|
|
|
|
devel/pkgconf \
|
|
|
|
|
devel/libedit \
|
|
|
|
|
devel/libtool \
|
|
|
|
|
devel/google-perftools \
|
|
|
|
|
lang/cython \
|
|
|
|
|
databases/leveldb \
|
2018-09-04 15:39:59 +00:00
|
|
|
|
net/openldap24-client \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
archivers/snappy \
|
2018-04-10 16:32:46 +00:00
|
|
|
|
archivers/liblz4 \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
ftp/curl \
|
|
|
|
|
misc/e2fsprogs-libuuid \
|
2016-10-18 09:33:09 +00:00
|
|
|
|
misc/getopt \
|
2017-07-07 08:13:35 +00:00
|
|
|
|
net/socat \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
textproc/expat2 \
|
2017-03-09 12:42:34 +00:00
|
|
|
|
textproc/gsed \
|
2018-09-06 09:10:32 +00:00
|
|
|
|
lang/gawk \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
textproc/libxml2 \
|
|
|
|
|
textproc/xmlstarlet \
|
2017-07-24 16:20:19 +00:00
|
|
|
|
textproc/jq \
|
|
|
|
|
textproc/py-sphinx \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
emulators/fuse \
|
|
|
|
|
java/junit \
|
2018-11-25 14:06:07 +00:00
|
|
|
|
lang/python36 \
|
2017-07-24 16:20:19 +00:00
|
|
|
|
devel/py-pip \
|
2018-11-25 14:06:07 +00:00
|
|
|
|
devel/py-flake8 \
|
2019-07-30 14:56:01 +00:00
|
|
|
|
devel/py-tox \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
devel/py-argparse \
|
|
|
|
|
devel/py-nose \
|
2017-07-24 16:20:19 +00:00
|
|
|
|
devel/py-prettytable \
|
2021-04-13 08:17:01 +00:00
|
|
|
|
devel/py-yaml \
|
2018-11-25 14:06:07 +00:00
|
|
|
|
www/py-routes \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
www/py-flask \
|
2018-11-25 14:06:07 +00:00
|
|
|
|
www/node \
|
|
|
|
|
www/npm \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
www/fcgi \
|
2018-12-23 20:24:45 +00:00
|
|
|
|
security/nss \
|
2019-05-28 18:05:16 +00:00
|
|
|
|
security/krb5 \
|
2018-11-25 14:06:07 +00:00
|
|
|
|
security/oath-toolkit \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
sysutils/flock \
|
2017-04-02 00:08:51 +00:00
|
|
|
|
sysutils/fusefs-libs \
|
2016-03-24 11:48:20 +00:00
|
|
|
|
|
2017-06-10 10:12:23 +00:00
|
|
|
|
# Now use pip to install some extra python modules
|
|
|
|
|
pip install pecan
|
|
|
|
|
|
2016-03-24 11:48:20 +00:00
|
|
|
|
exit
|
2016-06-29 07:40:07 +00:00
|
|
|
|
else
|
2019-06-06 03:10:41 +00:00
|
|
|
|
[ $WITH_SEASTAR ] && with_seastar=true || with_seastar=false
|
2020-09-17 06:21:40 +00:00
|
|
|
|
[ $WITH_ZBD ] && with_zbd=true || with_zbd=false
|
2021-04-06 12:17:12 +00:00
|
|
|
|
[ $WITH_PMEM ] && with_pmem=true || with_pmem=false
|
2021-11-01 21:39:39 +00:00
|
|
|
|
[ $WITH_RADOSGW_MOTR ] && with_rgw_motr=true || with_rgw_motr=false
|
|
|
|
|
motr_pkgs_url='https://github.com/Seagate/cortx-motr/releases/download/2.0.0-rgw'
|
2016-09-05 13:40:33 +00:00
|
|
|
|
source /etc/os-release
|
2019-09-24 19:48:27 +00:00
|
|
|
|
case "$ID" in
|
2021-07-15 11:15:56 +00:00
|
|
|
|
debian|ubuntu|devuan|elementary|softiron)
|
2016-06-29 07:40:07 +00:00
|
|
|
|
echo "Using apt-get to install dependencies"
|
2018-08-01 10:52:45 +00:00
|
|
|
|
$SUDO apt-get install -y devscripts equivs
|
2017-11-12 05:07:35 +00:00
|
|
|
|
$SUDO apt-get install -y dpkg-dev
|
2020-06-25 11:54:55 +00:00
|
|
|
|
ensure_python3_sphinx_on_ubuntu
|
2017-11-12 05:07:35 +00:00
|
|
|
|
case "$VERSION" in
|
2018-11-20 04:43:34 +00:00
|
|
|
|
*Bionic*)
|
2019-06-07 16:08:37 +00:00
|
|
|
|
ensure_decent_gcc_on_ubuntu 9 bionic
|
2019-04-24 01:14:51 +00:00
|
|
|
|
[ ! $NO_BOOST_PKGS ] && install_boost_on_ubuntu bionic
|
2021-01-25 06:11:46 +00:00
|
|
|
|
$with_zbd && install_libzbd_on_ubuntu bionic
|
2019-09-16 12:28:06 +00:00
|
|
|
|
;;
|
2021-03-18 11:43:06 +00:00
|
|
|
|
*Focal*)
|
2021-03-18 11:50:58 +00:00
|
|
|
|
[ ! $NO_BOOST_PKGS ] && install_boost_on_ubuntu focal
|
2021-03-18 11:43:06 +00:00
|
|
|
|
$with_zbd && install_libzbd_on_ubuntu focal
|
2021-04-06 12:17:12 +00:00
|
|
|
|
$with_pmem && install_libpmem_on_ubuntu focal
|
2021-03-18 11:43:06 +00:00
|
|
|
|
;;
|
2017-11-12 05:07:35 +00:00
|
|
|
|
*)
|
|
|
|
|
$SUDO apt-get install -y gcc
|
|
|
|
|
;;
|
|
|
|
|
esac
|
2015-02-05 13:46:41 +00:00
|
|
|
|
if ! test -r debian/control ; then
|
|
|
|
|
echo debian/control is not a readable file
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2014-11-25 16:25:26 +00:00
|
|
|
|
touch $DIR/status
|
2016-03-24 00:43:53 +00:00
|
|
|
|
|
2022-03-25 21:29:44 +00:00
|
|
|
|
in_jenkins && echo "CI_DEBUG: Running munge_debian_control() in install-deps.sh"
|
2016-03-24 00:43:53 +00:00
|
|
|
|
backports=""
|
2020-12-02 07:48:38 +00:00
|
|
|
|
control=$(munge_debian_control "$VERSION" "debian/control")
|
2018-08-01 10:52:45 +00:00
|
|
|
|
case "$VERSION" in
|
|
|
|
|
*squeeze*|*wheezy*)
|
|
|
|
|
backports="-t $codename-backports"
|
2014-11-25 16:25:26 +00:00
|
|
|
|
;;
|
|
|
|
|
esac
|
2016-03-24 00:43:53 +00:00
|
|
|
|
|
|
|
|
|
# make a metapackage that expresses the build dependencies,
|
|
|
|
|
# install it, rm the .deb; then uninstall the package as its
|
|
|
|
|
# work is done
|
2020-12-02 07:31:41 +00:00
|
|
|
|
build_profiles=""
|
|
|
|
|
if $for_make_check; then
|
|
|
|
|
build_profiles+=",pkg.ceph.check"
|
|
|
|
|
fi
|
2020-12-02 07:48:38 +00:00
|
|
|
|
if $with_seastar; then
|
|
|
|
|
build_profiles+=",pkg.ceph.crimson"
|
|
|
|
|
fi
|
parquet implementation:
(1) adding arrow/parquet to make(install is missing)
(2) s3select-operation contains 2 flows CSV and Parquet
(3) upon parquet-flow s3select processing engine is calling (via callback) to get-size and range-request, the range-requests are a-sync, thus the caller is waiting until notification.
(4) flow : execute --> s3select --(arrow layer)--> range-request --> GetObj::execute --> send_response_data --> notify-range-request --> (back-to) --> s3select
(5) on parquet flow the s3select is handling the response (using call-backs) because of aws-response-limitation (16mb)
add unique pointer (rgw_api); verify magic number for parquet objects; s3select module update
fix buffer-over-flow (copy range request)
change the range-request flow. now,it needs to use the callback parametrs (ofs & len) and not to use the element length
refactoring. seperate the CSV flow from the parquet flow, a phase before adding conditional build(depend on arrow package installation)
adding arrow/parquet installation to debian/control
align s3select repo with RGW (missing API"s, such as get_error_description)
undefined reference to arrow symbol
fix comment: using optional_yield by value
fix comments; remove future/promise
s3select: a leak fix
s3select: fixing result production
s3select,s3tests : parquet alignments
typo: git-remote --> git_remote
s3select: remove redundant comma(end of projections); bug fix in parquet flow upon aggregation queries
adding arrow/parquet
editorial. remove blank lines
s3select: merged with master(output serialization,presto alignments)
merging(not rebase) master functionlities into parquet branch
(*) a dedicated source-files for s3select operation.
(*) s3select-engine: fix leaks on parquet flows, enabling allocate csv_object and parquet_object on stack
(*) the csv_object and parquet object allocated on stack (no heap allocation)
move data-members from heap to stack allocation, refactoring, separate flows for CSV and parquet. s3select: bug fix
conditional build: upon arrow package is installed the parquet flow become visable, thus enables to process parquet object. in case the package is not installed only CSV is usable
remove redundant try/catch, s3select: fix compile warning
arrow-devel version should be higher than 4.0.0, where arrow::io::AsyncContext become depecrated
missing sudo; wrong url;move the rm -f arrow.list
replace codename with $(lsb_release -sc)
arrow version should be >= 4.0.0; iocontext not exists in namespace on lower versions
RGW points to s3select/master
s3select submodule
sudo --> $SUDO
Signed-off-by: gal salomon <gal.salomon@gmail.com>
2021-04-12 05:54:37 +00:00
|
|
|
|
|
2022-03-25 21:29:44 +00:00
|
|
|
|
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
|
|
|
|
|
|
2020-12-02 07:31:41 +00:00
|
|
|
|
$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
|
2022-03-25 21:29:44 +00:00
|
|
|
|
in_jenkins && echo "CI_DEBUG: Removing ceph-build-deps"
|
2016-03-24 00:43:53 +00:00
|
|
|
|
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove ceph-build-deps
|
2019-02-13 11:56:00 +00:00
|
|
|
|
if [ "$control" != "debian/control" ] ; then rm $control; fi
|
2021-11-01 21:39:39 +00:00
|
|
|
|
|
|
|
|
|
# for rgw motr backend build checks
|
2022-01-28 11:33:12 +00:00
|
|
|
|
if ! dpkg -l cortx-motr-dev &> /dev/null &&
|
|
|
|
|
{ [[ $FOR_MAKE_CHECK ]] || $with_rgw_motr; }; then
|
2021-11-01 21:39:39 +00:00
|
|
|
|
deb_arch=$(dpkg --print-architecture)
|
|
|
|
|
motr_pkg="cortx-motr_2.0.0.git3252d623_$deb_arch.deb"
|
|
|
|
|
motr_dev_pkg="cortx-motr-dev_2.0.0.git3252d623_$deb_arch.deb"
|
|
|
|
|
$SUDO curl -sL -o/var/cache/apt/archives/$motr_pkg $motr_pkgs_url/$motr_pkg
|
|
|
|
|
$SUDO curl -sL -o/var/cache/apt/archives/$motr_dev_pkg $motr_pkgs_url/$motr_dev_pkg
|
|
|
|
|
# For some reason libfabric pkg is not available in arm64 version
|
|
|
|
|
# of Ubuntu 20.04 (Focal Fossa), so we borrow it from more recent
|
|
|
|
|
# versions for now.
|
|
|
|
|
if [[ "$deb_arch" == 'arm64' ]]; then
|
|
|
|
|
lf_pkg='libfabric1_1.11.0-2_arm64.deb'
|
|
|
|
|
$SUDO curl -sL -o/var/cache/apt/archives/$lf_pkg http://ports.ubuntu.com/pool/universe/libf/libfabric/$lf_pkg
|
|
|
|
|
$SUDO apt-get install -y /var/cache/apt/archives/$lf_pkg
|
|
|
|
|
fi
|
|
|
|
|
$SUDO apt-get install -y /var/cache/apt/archives/{$motr_pkg,$motr_dev_pkg}
|
|
|
|
|
$SUDO apt-get install -y libisal-dev
|
2022-01-28 11:33:12 +00:00
|
|
|
|
fi
|
2014-11-25 16:25:26 +00:00
|
|
|
|
;;
|
2021-11-01 21:39:39 +00:00
|
|
|
|
rocky|centos|fedora|rhel|ol|virtuozzo)
|
2019-10-25 05:51:38 +00:00
|
|
|
|
builddepcmd="dnf -y builddep --allowerasing"
|
2020-06-25 11:40:50 +00:00
|
|
|
|
echo "Using dnf to install dependencies"
|
2019-09-24 19:48:27 +00:00
|
|
|
|
case "$ID" in
|
2018-08-01 10:52:45 +00:00
|
|
|
|
fedora)
|
2020-06-25 11:40:50 +00:00
|
|
|
|
$SUDO dnf install -y dnf-utils
|
2014-11-25 16:25:26 +00:00
|
|
|
|
;;
|
2021-11-01 21:39:39 +00:00
|
|
|
|
rocky|centos|rhel|ol|virtuozzo)
|
2019-02-01 00:36:17 +00:00
|
|
|
|
MAJOR_VERSION="$(echo $VERSION_ID | cut -d. -f1)"
|
2020-06-25 11:40:50 +00:00
|
|
|
|
$SUDO dnf install -y dnf-utils
|
2019-09-27 02:26:54 +00:00
|
|
|
|
rpm --quiet --query epel-release || \
|
2020-06-25 11:40:50 +00:00
|
|
|
|
$SUDO dnf -y install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJOR_VERSION.noarch.rpm
|
2019-02-01 00:36:17 +00:00
|
|
|
|
$SUDO rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$MAJOR_VERSION
|
2015-03-04 12:47:37 +00:00
|
|
|
|
$SUDO rm -f /etc/yum.repos.d/dl.fedoraproject.org*
|
2020-06-25 11:37:58 +00:00
|
|
|
|
if test $ID = centos -a $MAJOR_VERSION = 8 ; then
|
2020-11-09 23:43:45 +00:00
|
|
|
|
# Enable 'powertools' or 'PowerTools' repo
|
|
|
|
|
$SUDO dnf config-manager --set-enabled $(dnf repolist --all 2>/dev/null|gawk 'tolower($0) ~ /^powertools\s/{print $1}')
|
2019-10-30 04:53:29 +00:00
|
|
|
|
# before EPEL8 and PowerTools provide all dependencies, we use sepia for the dependencies
|
2020-03-12 06:14:28 +00:00
|
|
|
|
$SUDO dnf config-manager --add-repo http://apt-mirror.front.sepia.ceph.com/lab-extras/8/
|
|
|
|
|
$SUDO dnf config-manager --setopt=apt-mirror.front.sepia.ceph.com_lab-extras_8_.gpgcheck=0 --save
|
2020-06-16 12:49:29 +00:00
|
|
|
|
$SUDO dnf -y module enable javapackages-tools
|
2020-03-12 06:14:28 +00:00
|
|
|
|
elif test $ID = rhel -a $MAJOR_VERSION = 8 ; then
|
2021-04-03 06:56:42 +00:00
|
|
|
|
$SUDO dnf config-manager --set-enabled "codeready-builder-for-rhel-8-${ARCH}-rpms"
|
2019-10-30 04:53:29 +00:00
|
|
|
|
$SUDO dnf config-manager --add-repo http://apt-mirror.front.sepia.ceph.com/lab-extras/8/
|
2020-02-28 01:47:55 +00:00
|
|
|
|
$SUDO dnf config-manager --setopt=apt-mirror.front.sepia.ceph.com_lab-extras_8_.gpgcheck=0 --save
|
2020-06-16 12:49:29 +00:00
|
|
|
|
$SUDO dnf -y module enable javapackages-tools
|
2017-04-03 13:35:49 +00:00
|
|
|
|
fi
|
2015-03-04 12:47:37 +00:00
|
|
|
|
;;
|
2014-11-25 16:25:26 +00:00
|
|
|
|
esac
|
2022-02-01 11:18:18 +00:00
|
|
|
|
munge_ceph_spec_in $with_seastar $with_zbd $for_make_check $DIR/ceph.spec
|
2019-10-10 02:40:53 +00:00
|
|
|
|
# for python3_pkgversion macro defined by python-srpm-macros, which is required by python3-devel
|
2020-06-25 11:40:50 +00:00
|
|
|
|
$SUDO dnf install -y python3-devel
|
2016-09-16 04:29:15 +00:00
|
|
|
|
$SUDO $builddepcmd $DIR/ceph.spec 2>&1 | tee $DIR/yum-builddep.out
|
2018-06-24 01:48:50 +00:00
|
|
|
|
[ ${PIPESTATUS[0]} -ne 0 ] && exit 1
|
2019-07-30 16:45:44 +00:00
|
|
|
|
IGNORE_YUM_BUILDEP_ERRORS="ValueError: SELinux policy is not managed or store cannot be accessed."
|
|
|
|
|
sed "/$IGNORE_YUM_BUILDEP_ERRORS/d" $DIR/yum-builddep.out | grep -qi "error:" && exit 1
|
2021-11-01 21:39:39 +00:00
|
|
|
|
# for rgw motr backend build checks
|
2022-01-28 11:33:12 +00:00
|
|
|
|
if ! rpm --quiet -q cortx-motr-devel &&
|
|
|
|
|
{ [[ $FOR_MAKE_CHECK ]] || $with_rgw_motr; }; then
|
2021-11-01 21:39:39 +00:00
|
|
|
|
$SUDO dnf install -y \
|
|
|
|
|
"$motr_pkgs_url/isa-l-2.30.0-1.el7.${ARCH}.rpm" \
|
|
|
|
|
"$motr_pkgs_url/cortx-motr-2.0.0-1_git3252d623_any.el8.${ARCH}.rpm" \
|
|
|
|
|
"$motr_pkgs_url/cortx-motr-devel-2.0.0-1_git3252d623_any.el8.${ARCH}.rpm"
|
2022-01-28 11:33:12 +00:00
|
|
|
|
fi
|
2014-11-25 16:25:26 +00:00
|
|
|
|
;;
|
2018-07-02 13:23:58 +00:00
|
|
|
|
opensuse*|suse|sles)
|
2016-06-29 07:40:07 +00:00
|
|
|
|
echo "Using zypper to install dependencies"
|
2018-02-14 10:49:03 +00:00
|
|
|
|
zypp_install="zypper --gpg-auto-import-keys --non-interactive install --no-recommends"
|
2019-12-06 14:29:30 +00:00
|
|
|
|
$SUDO $zypp_install systemd-rpm-macros rpm-build || exit 1
|
2022-02-01 11:18:18 +00:00
|
|
|
|
munge_ceph_spec_in $with_seastar false $for_make_check $DIR/ceph.spec
|
2018-02-14 10:49:03 +00:00
|
|
|
|
$SUDO $zypp_install $(rpmspec -q --buildrequires $DIR/ceph.spec) || exit 1
|
2015-03-23 20:28:20 +00:00
|
|
|
|
;;
|
2016-06-29 07:40:07 +00:00
|
|
|
|
*)
|
2016-09-05 13:40:33 +00:00
|
|
|
|
echo "$ID is unknown, dependencies will have to be installed manually."
|
2016-08-31 21:29:30 +00:00
|
|
|
|
exit 1
|
2014-11-25 16:25:26 +00:00
|
|
|
|
;;
|
2016-06-29 07:40:07 +00:00
|
|
|
|
esac
|
|
|
|
|
fi
|
2015-05-02 13:59:12 +00:00
|
|
|
|
|
2015-06-04 08:00:45 +00:00
|
|
|
|
function populate_wheelhouse() {
|
2022-03-25 21:29:44 +00:00
|
|
|
|
in_jenkins && echo "CI_DEBUG: Running populate_wheelhouse() in install-deps.sh"
|
2015-05-28 23:34:45 +00:00
|
|
|
|
local install=$1
|
2015-06-04 03:45:55 +00:00
|
|
|
|
shift
|
2015-05-28 23:34:45 +00:00
|
|
|
|
|
|
|
|
|
# although pip comes with virtualenv, having a recent version
|
|
|
|
|
# of pip matters when it comes to using wheel packages
|
2019-07-19 16:10:49 +00:00
|
|
|
|
PIP_OPTS="--timeout 300 --exists-action i"
|
|
|
|
|
pip $PIP_OPTS $install \
|
2021-09-17 13:35:28 +00:00
|
|
|
|
'setuptools >= 0.8' 'pip >= 21.0' 'wheel >= 0.24' 'tox >= 2.9.1' || return 1
|
2015-06-04 03:45:55 +00:00
|
|
|
|
if test $# != 0 ; then
|
2021-09-20 04:42:41 +00:00
|
|
|
|
# '--use-feature=fast-deps --use-deprecated=legacy-resolver' added per
|
|
|
|
|
# https://github.com/pypa/pip/issues/9818 These should be able to be
|
|
|
|
|
# removed at some point in the future.
|
|
|
|
|
pip --use-feature=fast-deps --use-deprecated=legacy-resolver $PIP_OPTS $install $@ || return 1
|
2015-06-04 03:45:55 +00:00
|
|
|
|
fi
|
2015-05-28 23:34:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-06-04 05:44:00 +00:00
|
|
|
|
function activate_virtualenv() {
|
2022-03-25 21:29:44 +00:00
|
|
|
|
in_jenkins && echo "CI_DEBUG: Running activate_virtualenv() in install-deps.sh"
|
2015-06-04 05:44:00 +00:00
|
|
|
|
local top_srcdir=$1
|
2019-12-18 10:33:24 +00:00
|
|
|
|
local env_dir=$top_srcdir/install-deps-python3
|
2015-06-04 05:44:00 +00:00
|
|
|
|
|
|
|
|
|
if ! test -d $env_dir ; then
|
2021-07-31 12:55:55 +00:00
|
|
|
|
python3 -m venv ${env_dir}
|
2015-06-04 05:44:00 +00:00
|
|
|
|
. $env_dir/bin/activate
|
2015-06-04 08:00:45 +00:00
|
|
|
|
if ! populate_wheelhouse install ; then
|
2015-06-04 05:44:00 +00:00
|
|
|
|
rm -rf $env_dir
|
|
|
|
|
return 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
. $env_dir/bin/activate
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-27 01:22:34 +00:00
|
|
|
|
function preload_wheels_for_tox() {
|
2022-03-25 21:29:44 +00:00
|
|
|
|
in_jenkins && echo "CI_DEBUG: Running preload_wheels_for_tox() in install-deps.sh"
|
2019-08-27 01:22:34 +00:00
|
|
|
|
local ini=$1
|
|
|
|
|
shift
|
2019-12-18 11:56:22 +00:00
|
|
|
|
pushd . > /dev/null
|
2019-08-27 01:22:34 +00:00
|
|
|
|
cd $(dirname $ini)
|
|
|
|
|
local require_files=$(ls *requirements*.txt 2>/dev/null) || true
|
|
|
|
|
local constraint_files=$(ls *constraints*.txt 2>/dev/null) || true
|
|
|
|
|
local require=$(echo -n "$require_files" | sed -e 's/^/-r /')
|
|
|
|
|
local constraint=$(echo -n "$constraint_files" | sed -e 's/^/-c /')
|
|
|
|
|
local md5=wheelhouse/md5
|
|
|
|
|
if test "$require"; then
|
|
|
|
|
if ! test -f $md5 || ! md5sum -c $md5 > /dev/null; then
|
|
|
|
|
rm -rf wheelhouse
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
if test "$require" && ! test -d wheelhouse ; then
|
2019-12-18 10:33:24 +00:00
|
|
|
|
type python3 > /dev/null 2>&1 || continue
|
|
|
|
|
activate_virtualenv $top_srcdir || exit 1
|
|
|
|
|
populate_wheelhouse "wheel -w $wip_wheelhouse" $require $constraint || exit 1
|
2019-08-27 01:22:34 +00:00
|
|
|
|
mv $wip_wheelhouse wheelhouse
|
|
|
|
|
md5sum $require_files $constraint_files > $md5
|
|
|
|
|
fi
|
2019-12-18 11:56:22 +00:00
|
|
|
|
popd > /dev/null
|
2019-08-27 01:22:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-05-30 08:53:51 +00:00
|
|
|
|
# use pip cache if possible but do not store it outside of the source
|
|
|
|
|
# tree
|
|
|
|
|
# see https://pip.pypa.io/en/stable/reference/pip_install.html#caching
|
2019-08-27 01:22:34 +00:00
|
|
|
|
if $for_make_check; then
|
|
|
|
|
mkdir -p install-deps-cache
|
|
|
|
|
top_srcdir=$(pwd)
|
|
|
|
|
export XDG_CACHE_HOME=$top_srcdir/install-deps-cache
|
|
|
|
|
wip_wheelhouse=wheelhouse-wip
|
|
|
|
|
#
|
|
|
|
|
# preload python modules so that tox can run without network access
|
|
|
|
|
#
|
|
|
|
|
find . -name tox.ini | while read ini ; do
|
|
|
|
|
preload_wheels_for_tox $ini
|
|
|
|
|
done
|
2019-12-18 10:33:24 +00:00
|
|
|
|
rm -rf $top_srcdir/install-deps-python3
|
2019-08-27 01:22:34 +00:00
|
|
|
|
rm -rf $XDG_CACHE_HOME
|
2019-12-18 11:58:04 +00:00
|
|
|
|
type git > /dev/null || (echo "Dashboard uses git to pull dependencies." ; false)
|
2019-08-27 01:22:34 +00:00
|
|
|
|
fi
|
2022-03-25 21:29:44 +00:00
|
|
|
|
|
2022-04-06 07:39:26 +00:00
|
|
|
|
in_jenkins && echo "CI_DEBUG: End install-deps.sh" || true
|