Browse Source

Remove the deprecated ironic-agent element

Despite having several issues (like missing firmware), it is still
used by people. It seems that the only way to stop that is to remove it.

Change-Id: I4baed8e8ab663c624dcc8d06ff0293d57b082abb
changes/08/771808/1
Dmitry Tantsur 3 months ago
parent
commit
fd1848282f
28 changed files with 22 additions and 439 deletions
  1. +0
    -48
      diskimage_builder/elements/ironic-agent/README.rst
  2. +0
    -58
      diskimage_builder/elements/ironic-agent/cleanup.d/99-ramdisk-create
  3. +0
    -10
      diskimage_builder/elements/ironic-agent/element-deps
  4. +0
    -1
      diskimage_builder/elements/ironic-agent/element-provides
  5. +0
    -6
      diskimage_builder/elements/ironic-agent/environment.d/01-ironic-agent.sh
  6. +0
    -12
      diskimage_builder/elements/ironic-agent/extra-data.d/15-ssl-ca-copy
  7. +0
    -31
      diskimage_builder/elements/ironic-agent/finalise.d/99-remove-extra-packages
  8. +0
    -1
      diskimage_builder/elements/ironic-agent/install.d/ironic-agent-package-install/package-installs-ironic-agent
  9. +0
    -49
      diskimage_builder/elements/ironic-agent/install.d/ironic-agent-source-install/60-ironic-agent-install
  10. +0
    -22
      diskimage_builder/elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.conf
  11. +0
    -31
      diskimage_builder/elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.init
  12. +0
    -13
      diskimage_builder/elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.service
  13. +0
    -25
      diskimage_builder/elements/ironic-agent/package-installs.yaml
  14. +0
    -42
      diskimage_builder/elements/ironic-agent/pkg-map
  15. +0
    -36
      diskimage_builder/elements/ironic-agent/post-install.d/80-ironic-agent
  16. +0
    -1
      diskimage_builder/elements/ironic-agent/source-repository-ironic-agent
  17. +0
    -8
      diskimage_builder/elements/ironic-agent/static/etc/systemd/system/ironic-agent-create-rescue-user.path
  18. +0
    -10
      diskimage_builder/elements/ironic-agent/static/etc/systemd/system/ironic-agent-create-rescue-user.service
  19. +0
    -12
      diskimage_builder/elements/ironic-agent/static/usr/local/bin/ironic-python-agent-create-rescue-user.sh
  20. +0
    -4
      diskimage_builder/elements/ironic-agent/svc-map
  21. +0
    -2
      diskimage_builder/elements/ironic-agent/test-elements/build-succeeds-fedora/element-deps
  22. +0
    -1
      diskimage_builder/elements/ironic-agent/test-elements/build-succeeds-fedora/element-type
  23. +7
    -4
      diskimage_builder/elements/iso/README.rst
  24. +1
    -1
      diskimage_builder/elements/iso/cleanup.d/100-build-iso
  25. +3
    -3
      diskimage_builder/elements/no-final-image/README.rst
  26. +5
    -5
      diskimage_builder/elements/proliant-tools/README.rst
  27. +1
    -3
      doc/source/developer/components.rst
  28. +5
    -0
      releasenotes/notes/no-ironic-agent-689e58268e1bf44f.yaml

+ 0
- 48
diskimage_builder/elements/ironic-agent/README.rst View File

@ -1,48 +0,0 @@
============
ironic-agent
============
warning::
This element is deprecated and copied to
ironic-python-agent-builder and can be found at:
https://opendev.org/openstack/ironic-python-agent-builder/src/branch/master/dib/ironic-python-agent-ramdisk
The ramdisk can be build from the ironic-python-agent-builder and
the "ironic-element" in diskimage-builder is deprecated.
Builds a ramdisk with ironic-python-agent. More information can be found at:
https://opendev.org/openstack/ironic-python-agent/
Beyond installing the ironic-python-agent, this element does the following:
* Installs the ``dhcp-all-interfaces`` so the node, upon booting, attempts to
obtain an IP address on all available network interfaces.
* Disables the ``iptables`` service on SysV and systemd based systems.
* Disables the ``ufw`` service on Upstart based systems.
* Installs packages required for the operation of the ironic-python-agent::
``qemu-utils`` ``parted`` ``hdparm`` ``util-linux`` ``genisoimage``
* When installing from source, ``python-dev`` and ``gcc`` are also installed
in order to support source based installation of ironic-python-agent and its
dependencies.
* Install the certificate if any, which is set to the environment variable
``DIB_IPA_CERT`` for validating the authenticity by ironic-python-agent. The
certificate can be self-signed certificate or CA certificate.
* Compresses initramfs with command specified in environment variable
``DIB_IPA_COMPRESS_CMD``, which is 'gzip' by default. This command should listen
for raw data from stdin and write compressed data to stdout. Command can be
with arguments.
This element outputs three files:
- ``$IMAGE-NAME.initramfs``: The deploy ramdisk file containing the
ironic-python-agent (IPA) service.
- ``$IMAGE-NAME.kernel``: The kernel binary file.
- ``$IMAGE-NAME.vmlinuz``: A hard link pointing to the ``$IMAGE-NAME.kernel``
file; this is just a backward compatibility layer, please do not rely
on this file.
.. note::
The package based install currently only enables the service when using the
systemd init system. This can easily be changed if there is an agent
package which includes upstart or sysv packaging.
.. note::
Using the ramdisk will require at least 1.5GB of ram

+ 0
- 58
diskimage_builder/elements/ironic-agent/cleanup.d/99-ramdisk-create View File

@ -1,58 +0,0 @@
#!/bin/bash
# dib-lint: disable=safe_sudo
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
[ -n "$TARGET_ROOT" ]
USER=${USER:-$(whoami)}
source $_LIB/img-functions
IMAGE_PATH=$(readlink -f $IMAGE_NAME)
cd $TARGET_ROOT
DIB_IPA_COMPRESS_CMD="${DIB_IPA_COMPRESS_CMD:-gzip}"
echo "#disabled" > ./tmp/fstab.new
sudo mv ./tmp/fstab.new ./etc/fstab
sudo ln -s ./sbin/init ./
# Note: The pci.ids, which is used by lshw, locate on Ubuntu
# in /usr/share/misc. Therefore we are removing only the
# ./usr/share/misc/m* (will remove the magic and magic.mgc files).
# on RHEL pci.ids is locate on /usr/share/hwdata/pci.ids.
sudo find . -xdev \
-path './sys/*' -prune -o \
-path './tmp/*' -prune -o \
-path './boot/*' -prune -o \
-path './root/.cache' -prune -o \
-path './usr/include/*' -prune -o \
-path './usr/lib/locale/*' -prune -o \
-path './usr/share/doc/*' -prune -o \
-path './usr/share/man/*' -prune -o \
-path './usr/share/info/*' -prune -o \
-path './usr/share/licenses/*' -prune -o \
-path './usr/share/misc/m*' -prune -o \
-path './usr/src/kernels/*' -prune -o \
-path './var/cache/*' -prune -o \
-name '*.pyc' -prune -o \
-name '*.pyo' -prune -o \
-print | sudo cpio -o -H newc | ${DIB_IPA_COMPRESS_CMD} > ${IMAGE_PATH}.initramfs
select_boot_kernel_initrd $TARGET_ROOT
sudo cp $BOOTDIR/$KERNEL ${IMAGE_PATH}.kernel
sudo chown $USER: ${IMAGE_PATH}.kernel
# TODO(lucasagomes): Create a hard link for the .vmlinuz file to keep
# it backward compatible. Remove it after it has been consistent and
# documented in both places for at least one full OpenStack release cycle
echo "WARNING: The kernel extension .vmlinuz has been deprecated. Please rely on the file with the extension .kernel instead."
sudo rm -f ${IMAGE_PATH}.vmlinuz
ln ${IMAGE_PATH}.kernel ${IMAGE_PATH}.vmlinuz

+ 0
- 10
diskimage_builder/elements/ironic-agent/element-deps View File

@ -1,10 +0,0 @@
dhcp-all-interfaces
ibft-interfaces
install-static
no-final-image
package-installs
pip-and-virtualenv
pkg-map
runtime-ssh-host-keys
source-repositories
svc-map

+ 0
- 1
diskimage_builder/elements/ironic-agent/element-provides View File

@ -1 +0,0 @@
ironic-python-agent

+ 0
- 6
diskimage_builder/elements/ironic-agent/environment.d/01-ironic-agent.sh View File

@ -1,6 +0,0 @@
# backwards compatibility with the previous environment
# variable for the ironic-agent source repository
if [ -n "${DIB_REPOREF_agent:-}" ]; then
echo "WARNING: DIB_REPOREF_agent is deprecated. Please update to use DIB_REPOREF_ironic_agent instead."
export DIB_REPOREF_ironic_agent=${DIB_REPOREF_agent}
fi

+ 0
- 12
diskimage_builder/elements/ironic-agent/extra-data.d/15-ssl-ca-copy View File

@ -1,12 +0,0 @@
#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
if [ -n "${DIB_IPA_CERT:=}" ]; then
cp $DIB_IPA_CERT $TMP_HOOKS_PATH/ipa-trusted-cert.pem
fi

+ 0
- 31
diskimage_builder/elements/ironic-agent/finalise.d/99-remove-extra-packages View File

@ -1,31 +0,0 @@
#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
# TODO(lucasagomes): optimize the ramdisk for other OSs
if [ $DISTRO_NAME = 'fedora' ] ; then
_remove_yum=''
if [ $DIB_RELEASE -ge 22 ]; then
# if we are on F22, we can remove yum if there, because it has
# been superseeded by dnf
_remove_yum='yum'
fi
install-packages -e kernel-debug-devel gcc fedora-logos \
rsync pykickstart \
genisoimage tcpdump \
man-db kbd-misc \
plymouth cronie ${_remove_yum}
${YUM:-yum} clean all
# Rebuilding the rpm database after removing packages will reduce
# its size
rpm --rebuilddb
fi

+ 0
- 1
diskimage_builder/elements/ironic-agent/install.d/ironic-agent-package-install/package-installs-ironic-agent View File

@ -1 +0,0 @@
ironic-python-agent

+ 0
- 49
diskimage_builder/elements/ironic-agent/install.d/ironic-agent-source-install/60-ironic-agent-install View File

@ -1,49 +0,0 @@
#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
SCRIPTDIR=$(dirname $0)
IPADIR=/usr/share/ironic-python-agent
# Generate upper-constraints
$IPADIR/imagebuild/common/generate_upper_constraints.sh $IPADIR/upper-constraints.txt
# create the virtual environment
virtualenv $IPADIR/venv
# pip might be an older version which does not support the -c option, therefore upgrade first
$IPADIR/venv/bin/pip install pip --upgrade
# install IPA inside the virtual environment
$IPADIR/venv/bin/pip install -c $IPADIR/upper-constraints.txt $IPADIR
# FIXME(lucasagomes): Figure out how we can use the "--install-option"
# parameter for pip install so we don't have to manually create a symlink
# create the launcher link so services can use it
ln -s $IPADIR/venv/bin/ironic-python-agent /usr/local/bin/ironic-python-agent
case "$DIB_INIT_SYSTEM" in
upstart)
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.conf /etc/init/ironic-python-agent.conf
;;
systemd)
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.service /usr/lib/systemd/system/ironic-python-agent.service
;;
sysv)
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.init /etc/init.d/ironic-python-agent.init
update-rc.d ironic-python-agent.init defaults
;;
*)
echo "Unsupported init system"
exit 1
;;
esac
# Copying the self signed certificate for request library
if [ -f /tmp/in_target.d/ipa-trusted-cert.pem ]; then
cat /tmp/in_target.d/ipa-trusted-cert.pem >> $($IPADIR/venv/bin/python -c "import requests; print(requests.certs.where())")
fi

+ 0
- 22
diskimage_builder/elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.conf View File

@ -1,22 +0,0 @@
# ironic-python-agent - OpenStack Ironic Python Agent
#
# The ironic-python-agent helps ironic in deploying instances.
description "Ironic Python Agnet"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
umask 022
expect stop
console output
pre-start script
echo Starting Ironic Python Agent
end script
exec /usr/local/bin/ironic-python-agent

+ 0
- 31
diskimage_builder/elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.init View File

@ -1,31 +0,0 @@
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: ironic-python-agent
# Required-Start: $local_fs networking
# Required-Stop: $local_fs
# Default-Start: S
# Default-Stop: 0 6
# X-Start-Before:
# Short-Description: Ironic Python Agent
# Description: Starts Ironic Python Agent for instance deployment
### END INIT INFO
NAME=ironic-python-agent
INIT_NAME=/etc/init.d/${NAME}
SCRIPT_NAME=/usr/local/bin/${NAME}
[ -x $SCRIPT_NAME ] || exit 0
case "$1" in
start)
$SCRIPT_NAME
;;
stop)
;;
*)
echo "Usage: $INIT_NAME {start|stop}"
exit 1
;;
esac
exit 0

+ 0
- 13
diskimage_builder/elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.service View File

@ -1,13 +0,0 @@
[Unit]
Description=Ironic Python Agent
After=network-online.target
[Service]
ExecStartPre=/sbin/modprobe vfat
ExecStart=/usr/local/bin/ironic-python-agent
Restart=always
RestartSec=30s
[Install]
WantedBy=multi-user.target

+ 0
- 25
diskimage_builder/elements/ironic-agent/package-installs.yaml View File

@ -1,25 +0,0 @@
tgt:
curl:
# dmidecode does not exist for ppc* arches so we use lshw
dmidecode:
not-arch: ppc64,ppc64el,ppc64le
iptables:
lshw:
ipmitool:
qemu-utils:
gcc:
python-dev:
parted:
hdparm:
util-linux:
genisoimage:
gdisk:
kmod:
psmisc:
dosfstools:
mdadm:
# efibootmgr and efivar do not exist for ppc*
efibootmgr:
not-arch: ppc64,ppc64el,ppc64le
efivar:
not-arch: ppc64,ppc64el,ppc64le

+ 0
- 42
diskimage_builder/elements/ironic-agent/pkg-map View File

@ -1,42 +0,0 @@
{
"release": {
"rhel": {
"8": {
"tgt": "target-restore",
"curl": "curl",
"ironic-python-agent": "openstack-ironic-python-agent",
"qemu-utils": "qemu-img",
"python-dev": "python3-devel"
}
},
"centos": {
"8": {
"tgt": "target-restore",
"curl": "curl",
"ironic-python-agent": "openstack-ironic-python-agent",
"qemu-utils": "qemu-img",
"python-dev": "python3-devel"
}
}
},
"family": {
"redhat": {
"tgt": "scsi-target-utils",
"curl": "curl",
"ironic-python-agent": "openstack-ironic-python-agent",
"qemu-utils": "qemu-img",
"python-dev": "python2-devel"
},
"debian": {
"tgt": "tgt",
"curl": "curl"
}
},
"default": {
"tgt": "tgt",
"curl": "curl",
"ironic-python-agent": "openstack-ironic-python-agent",
"qemu-utils": "qemu-utils",
"python-dev": "python-dev"
}
}

+ 0
- 36
diskimage_builder/elements/ironic-agent/post-install.d/80-ironic-agent View File

@ -1,36 +0,0 @@
#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
install-packages -e cloud-init
rm -rf /tmp/ironic-python-agent
case "$DIB_INIT_SYSTEM" in
upstart)
if [ -f /etc/init/ufw.conf ]; then
mv /etc/init/ufw.conf /etc/init/ufw.conf.disabled
fi
if [ -f /etc/init/tgt.conf ]; then
mv /etc/init/tgt.conf /etc/init/tgt.conf.disabled
fi
;;
systemd)
if [[ $(systemctl --no-pager list-unit-files iptables) =~ 'enabled' ]]; then
systemctl disable iptables.service
fi
systemctl enable $(svc-map ironic-python-agent).service
systemctl enable ironic-agent-create-rescue-user.path
;;
sysv)
update-rc.d iptables disable
;;
*)
echo "Unsupported init system"
exit 1
;;
esac

+ 0
- 1
diskimage_builder/elements/ironic-agent/source-repository-ironic-agent View File

@ -1 +0,0 @@
ironic-agent git /usr/share/ironic-python-agent https://opendev.org/openstack/ironic-python-agent

+ 0
- 8
diskimage_builder/elements/ironic-agent/static/etc/systemd/system/ironic-agent-create-rescue-user.path View File

@ -1,8 +0,0 @@
[Unit]
Description=Ironic user rescue - notify path existence
[Path]
PathExists=/etc/ipa-rescue-config/ipa-rescue-password
[Install]
WantedBy=multi-user.target

+ 0
- 10
diskimage_builder/elements/ironic-agent/static/etc/systemd/system/ironic-agent-create-rescue-user.service View File

@ -1,10 +0,0 @@
[Unit]
Description=Ironic agent rescue user creation
[Service]
ExecStart=/bin/bash /usr/local/bin/ironic-python-agent-create-rescue-user.sh
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

+ 0
- 12
diskimage_builder/elements/ironic-agent/static/usr/local/bin/ironic-python-agent-create-rescue-user.sh View File

@ -1,12 +0,0 @@
#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
echo "Adding rescue user with root privileges..."
crypted_pass=$(</etc/ipa-rescue-config/ipa-rescue-password)
useradd -m rescue -G wheel -p $crypted_pass
echo "rescue ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/rescue

+ 0
- 4
diskimage_builder/elements/ironic-agent/svc-map View File

@ -1,4 +0,0 @@
ironic-python-agent:
default: openstack-ironic-python-agent
redhat: openstack-ironic-python-agent
debian: ironic-python-agent

+ 0
- 2
diskimage_builder/elements/ironic-agent/test-elements/build-succeeds-fedora/element-deps View File

@ -1,2 +0,0 @@
fedora-minimal
openstack-ci-mirrors

+ 0
- 1
diskimage_builder/elements/ironic-agent/test-elements/build-succeeds-fedora/element-type View File

@ -1 +0,0 @@
ramdisk

+ 7
- 4
diskimage_builder/elements/iso/README.rst View File

@ -2,7 +2,8 @@
iso
===
Generates a bootable ISO image from the kernel/ramdisk generated by the
elements ``baremetal``, ``ironic-agent`` or ``ramdisk``. It uses isolinux to boot on BIOS
elements ``baremetal``, ``ironic-python-agent-ramdisk`` (from
ironic-python-agent-builder) or ``ramdisk``. It uses isolinux to boot on BIOS
machines and grub to boot on EFI machines.
This element has been tested on the following distro(s):
@ -37,9 +38,11 @@ named ``<image-name>.iso`` booting the generated kernel and ramdisk. It also
automatically appends kernel command-line argument 'boot\_method=vmedia'
which is required for Ironic drivers ``iscsi_ilo``.
ironic-agent element
--------------------
When used with ``ironic-agent`` element, this generates a bootable ISO image named ``<image-name>.iso`` which boots the agent kernel and agent ramdisk.
ironic-python-agent-ramdisk element
-----------------------------------
When used with ``ironic-python-agent-ramdisk`` element, this generates a
bootable ISO image named ``<image-name>.iso`` which boots the agent kernel and
agent ramdisk.
**REFERENCES**


+ 1
- 1
diskimage_builder/elements/iso/cleanup.d/100-build-iso View File

@ -152,7 +152,7 @@ if echo $IMAGE_ELEMENT | grep -q '\bramdisk\b'; then
DIB_DEPLOY_ISO_KERNEL_CMDLINE_ARGS=${DIB_DEPLOY_ISO_KERNEL_CMDLINE_ARGS:-}
EMITTED_KERNEL_CMDLINE_ARGS="boot_method=vmedia $DIB_DEPLOY_ISO_KERNEL_CMDLINE_ARGS"
EMITTED_ISO_FILENAME=$IMAGE_NAME.iso
elif echo $IMAGE_ELEMENT | grep -q '\bironic-agent\b'; then
elif echo $IMAGE_ELEMENT | grep -q '\bironic-python-agent\b'; then
EMITTED_KERNEL=$IMAGE_NAME.vmlinuz
EMITTED_RAMDISK=$IMAGE_NAME.initramfs
DIB_DEPLOY_ISO_KERNEL_CMDLINE_ARGS=${DIB_DEPLOY_ISO_KERNEL_CMDLINE_ARGS:-}


+ 3
- 3
diskimage_builder/elements/no-final-image/README.rst View File

@ -5,9 +5,9 @@ no-final-image
This is a noop element which can be used to indicate to diskimage-builder that
it should not bother creating a final image out of the generated filesystem.
It is useful in cases where an element handles all of the image building
itself, such as ironic-agent or Docker images. In those cases the final image
normally generated by diskimage-builder is not the desired output, so there's
no reason to spend time creating it.
itself, such as ironic-python-agent-ramdisk or Docker images. In those cases
the final image normally generated by diskimage-builder is not the desired
output, so there's no reason to spend time creating it.
Elements that wish to behave this way should include this element in their
element-deps file.

+ 5
- 5
diskimage_builder/elements/proliant-tools/README.rst View File

@ -1,12 +1,12 @@
proliant-tools
==============
* This element can be used when building ironic-agent ramdisk. It
enables ironic-agent ramdisk to do in-band cleaning operations specific
to HPE ProLiant hardware.
* This element can be used when building ironic-python-agent ramdisk. It
enables ironic-python-agent ramdisk to do in-band cleaning operations
specific to HPE ProLiant hardware.
* Works with ubuntu and fedora distributions (on which ironic-agent
element is supported).
* Works with ubuntu and fedora distributions (on which the
ironic-python-agent-ramdisk element is supported).
* Currently the following utilities are installed:


+ 1
- 3
doc/source/developer/components.rst View File

@ -22,9 +22,7 @@ Components
ramdisk-image-create -o deploy.ramdisk deploy-baremetal
To generate kernel+ramdisk pair for use with ironic, use::
ramdisk-image-create -o deploy.ramdisk ironic-agent
Ironic no longer supports images created like this.
`element-info`


+ 5
- 0
releasenotes/notes/no-ironic-agent-689e58268e1bf44f.yaml View File

@ -0,0 +1,5 @@
---
upgrade:
- |
Removes the long deprecated ironic-agent element. Use
ironic-python-agent-ramdisk from the ironic-python-agent-builder project.

Loading…
Cancel
Save