Add an element to install python-hardware

Requires returning EPEL support because of some dependencies.

Co-Authored-By: Mark Goddard <mark@stackhpc.com>
Co-Authored-By: Will Szumski <will@stackhpc.com>
Change-Id: I8da33dabda34e626baf6e7895fc450973d0a8fef
This commit is contained in:
Dmitry Tantsur 2020-09-24 10:08:35 +02:00
parent 58a0a37830
commit 8adfcc65c6
10 changed files with 88 additions and 4 deletions

View File

@ -0,0 +1,21 @@
========================================
Ironic Python Agent (IPA) Extra Hardware
========================================
This element adds the `hardware <https://pypi.python.org/pypi/hardware>`_
python package to the Ironic Python Agent (IPA) ramdisk. It also installs
several package dependencies of the ``hardware`` module.
The ``hardware`` package provides improved hardware introspection capabilities
and supports benchmarking. This functionality may be enabled by adding the
``extra-hardware`` collector in the ``[DEFAULT] inspection_collectors`` option
or the ``ipa-inspection-collectors`` kernel command line argument.
The following environment variables may be set to configure the element when
doing a source-based installation:
* ``DIB_IPA_HARDWARE_PACKAGE`` the full ``hardware`` Python package descriptor
to use. If unset, ``DIB_IPA_HARDWARE_VERSION`` will be used.
* ``DIB_IPA_HARDWARE_VERSION`` the version of the ``hardware`` package to
install when ``DIB_IPA_HARDWARE_PACKAGE`` is unset. If unset, the latest
version will be installed.

View File

@ -0,0 +1,5 @@
epel
install-types
ironic-python-agent-ramdisk
package-installs
pkg-map

View File

@ -0,0 +1,21 @@
#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
export LC_ALL=C.UTF-8
VENVDIR=/opt/ironic-python-agent
UPPER_CONSTRAINTS=/tmp/requirements/upper-constraints.txt
PACKAGE=${DIB_IPA_HARDWARE_PACKAGE:-hardware${DIB_IPA_HARDWARE_VERSION:+==}${DIB_IPA_HARDWARE_VERSION:-}}
$VENVDIR/bin/pip install -c "$UPPER_CONSTRAINTS" "$PACKAGE"
# Because the ironic-python-agent systemd unit does not activate the virtualenv
# before executing the ironic-python-agent script, the PATH is not updated to
# point to the bin directory in the virtual environment. We add this symlink so
# that ironic-python-agent sees the hardware-detect tool in its PATH.
ln -s $VENVDIR/bin/hardware-detect /usr/local/bin/hardware-detect

View File

@ -0,0 +1,10 @@
biosdevname:
ethtool:
fio:
hdparm:
infiniband-diags:
lldpad:
pciutils:
sdparm:
smartmontools:
sysbench:

View File

@ -0,0 +1,17 @@
{
"release": {
"rhel": {
"8": {
"python-hardware": "python3-hardware-detect"
}
},
"centos": {
"8": {
"python-hardware": "python3-hardware-detect"
}
}
},
"default": {
"python-hardware": "python-hardware"
}
}

View File

@ -1,4 +0,0 @@
if [[ "$DISTRO_NAME" == "centos" ]] && [[ "$DIB_RELEASE" == 8 ]]; then
# Disable EPEL unless enabled explicitly
export DIB_EPEL_DISABLED=${DIB_EPEL_DISABLED:-1}
fi

View File

@ -0,0 +1,5 @@
---
features:
- |
Adds a new element ``extra-hardware`` for configuring extra hardware
collection in the ramdisk.

View File

@ -100,6 +100,12 @@
image_distro: 'centos-minimal'
image_release: 8
- job:
name: ironic-python-agent-check-image-dib-centos8-extra
parent: ironic-python-agent-check-image-dib-centos8
vars:
extra_elements: ["extra-hardware"]
- job:
name: ironic-python-agent-check-image-dib-fedora
parent: ironic-python-agent-check-image-base

View File

@ -11,6 +11,7 @@
- ipa-tempest-bios-ipmi-iscsi-tinyipa-src
- ironic-python-agent-check-image-tinyipa
- ironic-python-agent-check-image-dib-centos8
- ironic-python-agent-check-image-dib-centos8-extra
- ironic-python-agent-check-image-dib-centos7
# Non-voting jobs
- ironic-python-agent-check-image-dib-centos7-python3:
@ -37,6 +38,7 @@
- ipa-tempest-bios-ipmi-iscsi-tinyipa-src
- ironic-python-agent-check-image-tinyipa
- ironic-python-agent-check-image-dib-centos8
- ironic-python-agent-check-image-dib-centos8-extra
- ironic-python-agent-check-image-dib-centos7
post:
jobs: