Add bindep.txt file

OpenStack CI uses bindep to figure out which packages need to be
installed on the host. However, when a bindep.txt file is not
available, a default one is used which may or may not be good enough
for all cases. It's best to have control over the packages which are
going to be installed on the host and as such we add our own bindep.txt
file.

Change-Id: Idab36eb82d916183f2fb40d326d095c5a8ee34b2
This commit is contained in:
Markos Chandras 2017-06-19 14:38:09 +01:00
parent 7c9bb5e07c
commit 24d81ac061
3 changed files with 53 additions and 17 deletions

17
bindep.txt Normal file
View File

@ -0,0 +1,17 @@
gcc
git
libffi-devel [platform:rpm]
libffi-dev [platform:dpkg]
libopenssl-devel [platform:suse]
openssl-devel [platform:redhat]
libssl-dev [platform:dpkg]
lsb-release [platform:suse platform:dpkg]
redhat-lsb [platform:redhat]
make
net-tools
python [platform:rpm]
python-minimal [platform:dpkg]
python-devel [platform:rpm]
python-dev [platform:dpkg]
python-virtualenv
wget

View File

@ -0,0 +1,14 @@
---
other:
- bifrost host dependencies are now being installed using the
``bindep`` tool. New dependencies should be added to the bindep.txt
file with the appropriate profile information if necessary. Core
dependencies (ie those needed to bootstrap the system such as python,
gcc, libffi, etc) must be listed in both the bindep.txt file and the
scripts/install-deps.sh one for mainly two reasons. First of all, the
OpenStack CI may only consult the bindep.txt in order to pull the
necessary dependencies. Second, ``bindep`` needs certain packages to
be present in order to its dependencies to build properly.
More information about the ``bindep`` tool can be found at
https://docs.openstack.org/infra/bindep/

View File

@ -5,12 +5,13 @@ declare -A PKG_MAP
CHECK_CMD_PKGS=(
gcc
git
libffi
libopenssl
lsb-release
make
net-tools
python-devel
python
venv
wget
)
@ -23,9 +24,9 @@ if [ -x '/usr/bin/zypper' ]; then
CHECK_CMD="zypper search --match-exact --installed"
PKG_MAP=(
[gcc]=gcc
[git]=git
[libffi]=libffi-devel
[libopenssl]=libopenssl-devel
[lsb-release]=lsb-release
[make]=make
[net-tools]=net-tools
[python]=python
@ -43,17 +44,18 @@ elif [ -x '/usr/bin/apt-get' ]; then
OS_FAMILY="Debian"
INSTALLER_CMD="sudo -H -E apt-get -y install"
CHECK_CMD="dpkg -l"
PKG_MAP=( [gcc]=gcc
[git]=git
[libffi]=libffi-dev
[libopenssl]=libssl-dev
[make]=make
[net-tools]=net-tools
[python]=python-minimal
[python-devel]=libpython-dev
[venv]=python-virtualenv
[wget]=wget
)
PKG_MAP=(
[gcc]=gcc
[libffi]=libffi-dev
[libopenssl]=libssl-dev
[lsb-release]=lsb-release
[make]=make
[net-tools]=net-tools
[python]=python-minimal
[python-devel]=libpython-dev
[venv]=python-virtualenv
[wget]=wget
)
EXTRA_PKG_DEPS=()
elif [ -x '/usr/bin/dnf' ] || [ -x '/usr/bin/yum' ]; then
OS_FAMILY="RedHat"
@ -62,9 +64,9 @@ elif [ -x '/usr/bin/dnf' ] || [ -x '/usr/bin/yum' ]; then
CHECK_CMD="rpm -q"
PKG_MAP=(
[gcc]=gcc
[git]=git
[libffi]=libffi-devel
[libopenssl]=openssl-devel
[lsb-release]=redhat-lsb
[make]=make
[net-tools]=net-tools
[python]=python
@ -83,9 +85,6 @@ fi
if ! $(gcc -v &>/dev/null); then
${INSTALLER_CMD} ${PKG_MAP[gcc]}
fi
if ! $(git --version &>/dev/null); then
${INSTALLER_CMD} ${PKG_MAP[git]}
fi
if ! $(wget --version &>/dev/null); then
${INSTALLER_CMD} ${PKG_MAP[wget]}
fi
@ -158,3 +157,9 @@ PIP=$(which pip)
sudo -H -E ${PIP} install "pip>6.0"
sudo -H -E ${PIP} install -r "$(dirname $0)/../requirements.txt"
# Install the rest of required packages using bindep
sudo -H -E ${PIP} install bindep
# bindep returns 1 if packages are missing
bindep -b &> /dev/null || ${INSTALLER_CMD} $(bindep -b)