diff --git a/.gitreview b/.gitreview index 5e14c84..2ff6323 100644 --- a/.gitreview +++ b/.gitreview @@ -2,3 +2,4 @@ host=review.opendev.org port=29418 project=openstack/ironic-python-agent-builder.git +defaultbranch=stable/2025.2 diff --git a/dib/ironic-python-agent-ramdisk/environment.d/10-defaults.bash b/dib/ironic-python-agent-ramdisk/environment.d/10-defaults.bash index 1dc8c12..a107e27 100644 --- a/dib/ironic-python-agent-ramdisk/environment.d/10-defaults.bash +++ b/dib/ironic-python-agent-ramdisk/environment.d/10-defaults.bash @@ -1,4 +1,4 @@ -export IPA_REMOVE_FIRMWARE=${IPA_REMOVE_FIRMWARE:-amdgpu,netronome,qcom,ti-communication,ti-keystone,ueagle-atm,rsi,mrvl,brcm,mediatek,ath10k,rtlwifi,rtw88,rtw89,libertas,ath11k,mellanox/mlxsw_spectrum,s5p-mfc,ti/tas2781,ti-connectivity,TAS,ath3k,ath6k,ath9k,ath12k,rtl_bt,v4l,cirrus,dvb,mwl8k,mwlwifi,cypress,atmel,vicam} +export IPA_REMOVE_FIRMWARE=${IPA_REMOVE_FIRMWARE:-amdgpu,netronome,qcom,ti-communication,ti-keystone,ueagle-atm,rsi,mrvl,brcm,mediatek,ath10k,rtlwifi,rtw88,rtw89,libertas,ath11k,mellanox/mlxsw_spectrum,s5p-mfc,ti/tas2781,ti-connectivity,TAS,ath3k,ath6k,ath9k,ath12k,rtl_bt,v4l,cirrus,dvb,mwl8k,mwlwifi,cypress,atmel,vicam,iwlwifi,intel/ibt,intel/dsp} # NOTE(TheJulia): List of what each item represents for future context # amdgpu == AMD/ATI Radeon/Vega/Raven firmware for drivers @@ -35,3 +35,6 @@ export IPA_REMOVE_FIRMWARE=${IPA_REMOVE_FIRMWARE:-amdgpu,netronome,qcom,ti-commu # cypress == Broadcom Wireless # atmel == Atmel wireless # vicam == Intel wireless +# iwlwifi == Intel wireless adapters +# intel/ibt == Intel bluetooth +# intel/dsp == Intel audio dsp diff --git a/dib/ironic-python-agent-ramdisk/post-install.d/99-remove-extra-packages b/dib/ironic-python-agent-ramdisk/post-install.d/99-remove-extra-packages index 1ee3420..76f1521 100755 --- a/dib/ironic-python-agent-ramdisk/post-install.d/99-remove-extra-packages +++ b/dib/ironic-python-agent-ramdisk/post-install.d/99-remove-extra-packages @@ -12,17 +12,40 @@ rm -rf /tmp/ironic-python-agent # below will keep it from erroring. KNOWN_FIRMWARE_PATH="/lib/firmware/ /usr/lib/firmware/" for folder in $KNOWN_FIRMWARE_PATH; do + if [[ ! -d $folder ]]; then + echo "Skipping firmware removal for $folder as it is not found." + fi for item in ${IPA_REMOVE_FIRMWARE//,/ }; do - # Attempt removal of item, but don't error + # NOTE(TheJulia): The original idea here has been delete whole folders + # but the patterns have shifted and evolved, and it we need to remove + # files in the main folder as well, or subsections their of. Also, due + # to perception of risk on the build process, the code is intended + # to be *very* defensive here. + + # tl;dr Attempt removal of item, but don't error # if it is not present already. - if [[ "$item" != "" ]] && [[ "$item" =~ "/" ]]; then - # We're deleting targetted contents in a folder, - # and not an entire folder. Since we're checking for an - # an empty string, we should be fine letting it do the - # expansion. - rm -r -f $folder$item* - else - rm -rf $folder$item || true + if [[ "$item" != "" ]]; then + if [[ "$item" =~ "/" ]]; then + # We're deleting targetted contents in a folder, + # and not an entire folder. Since we're checking for an + # an empty string, we should be fine letting it do the + # expansion. + rm -r -f $folder$item* + elif [[ -d "$folder$item" ]]; then + # This was the original deletion code path where we + # are attempting to delete a folder. + # This is normally not handled with the glob expansion + # expansion even though it could be due to management + # the host's contents as it is constructed. + rm -rf $folder$item || true + elif [[ $(ls $folder$item* | wc -l) -gt 0 ]]; then + # In this case, we have to use glob expansion because we + # have objects which are only available via glob expansion. + # NOTE(TheJulia): Fun factoid, these folders can have + # subfolders as well, and recursive is thus required becuase + # otherwise rm errors and aborts the deletion. + rm -rf $folder$item* + fi fi done done diff --git a/dib/ironic-python-agent-ramdisk/static/etc/systemd/system/ironic-agent-resolve-config-drive.service b/dib/ironic-python-agent-ramdisk/static/etc/systemd/system/ironic-agent-resolve-config-drive.service index fa367eb..9ffbcba 100644 --- a/dib/ironic-python-agent-ramdisk/static/etc/systemd/system/ironic-agent-resolve-config-drive.service +++ b/dib/ironic-python-agent-ramdisk/static/etc/systemd/system/ironic-agent-resolve-config-drive.service @@ -3,6 +3,8 @@ Description=Ironic agent config drive setup Wants=network-pre.target Before=network-pre.target After=local-fs.target +Before=glean.service +Before=system-glean.slice [Service] ExecStart=/bin/bash /usr/local/bin/ironic-python-agent-resolve-configdrive.sh diff --git a/dib/ironic-python-agent-ramdisk/static/usr/local/bin/ironic-python-agent-resolve-configdrive.sh b/dib/ironic-python-agent-ramdisk/static/usr/local/bin/ironic-python-agent-resolve-configdrive.sh index 0f6cc4e..20b4f2d 100755 --- a/dib/ironic-python-agent-ramdisk/static/usr/local/bin/ironic-python-agent-resolve-configdrive.sh +++ b/dib/ironic-python-agent-ramdisk/static/usr/local/bin/ironic-python-agent-resolve-configdrive.sh @@ -10,19 +10,27 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin # Inspired by/based on glean-early.sh # https://opendev.org/opendev/glean/src/branch/master/glean/init/glean-early.sh -# NOTE(TheJulia): We care about iso images, and would expect lower case as a -# result. In the case of VFAT partitions, they would be upper case. -CONFIG_DRIVE_LABEL="config-2" - -# Identify the number of devices -device_count=$(lsblk -o PATH,LABEL | grep -c $CONFIG_DRIVE_LABEL || true) - # Identify if we have an a publisher id set publisher_id="" if grep -q "ir_pub_id" /proc/cmdline; then publisher_id=$(cat /proc/cmdline | sed -e 's/^.*ir_pub_id=//' -e 's/ .*$//') fi +# NOTE(TheJulia): We care about iso images, and would expect lower case as a +# result. In the case of VFAT partitions, they would be upper case. +CONFIG_DRIVE_LABEL="config-2" + +i=0 +while [ $i -lt 30 ] ; do + i=$((i + 1)) + + # Identify the number of devices + device_count=$(lsblk -o PATH,LABEL | grep -c $CONFIG_DRIVE_LABEL || true) + + [ $device_count -lt 1 ] || break + sleep 1 +done + if [ $device_count -lt 1 ]; then # Nothing to do here, exit! exit 0 diff --git a/releasenotes/notes/fix-firmware-cleanup-revisited-3047b3bf415bc91c.yaml b/releasenotes/notes/fix-firmware-cleanup-revisited-3047b3bf415bc91c.yaml new file mode 100644 index 0000000..d4dde9b --- /dev/null +++ b/releasenotes/notes/fix-firmware-cleanup-revisited-3047b3bf415bc91c.yaml @@ -0,0 +1,9 @@ +--- +fixes: + - | + Fixes firmware cleanup to be a bit more defensive and also be more + open to allowing for "glob expansion" as it relates to cleaning up files. + Ultimately this change fixes firmware cleanup so remnents are not left + in the image where previously some artifacts were not deleted due to + prior defensiveness in the cleanup logic. The net result is smaller + images for booting IPA. diff --git a/releasenotes/notes/wait-config-drive-30s-3c51adba5fddc8a2.yaml b/releasenotes/notes/wait-config-drive-30s-3c51adba5fddc8a2.yaml new file mode 100644 index 0000000..5220569 --- /dev/null +++ b/releasenotes/notes/wait-config-drive-30s-3c51adba5fddc8a2.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Wait config drive up to 30 seconds. This ensure that network data is available to Glean. diff --git a/tinyipa/build-tinyipa.sh b/tinyipa/build-tinyipa.sh index 5e14e80..e90c4e2 100755 --- a/tinyipa/build-tinyipa.sh +++ b/tinyipa/build-tinyipa.sh @@ -144,6 +144,9 @@ $PYTHON_COMMAND setup.py sdist --dist-dir "$BUILDDIR/tmp/localpip" --quiet ls $BUILDDIR/tmp/localpip || true cp requirements.txt $BUILDDIR/tmp/ipa-requirements.txt +# NOTE(clif): Modify ipa-requirements.txt to pin setuptools +echo "setuptools>=64.0.0,<82.0.0 # MIT" >> $BUILDDIR/tmp/ipa-requirements.txt + if [ -n "$PYTHON_EXTRA_SOURCES_DIR_LIST" ]; then IFS="," read -ra PKGDIRS <<< "$PYTHON_EXTRA_SOURCES_DIR_LIST" for PKGDIR in "${PKGDIRS[@]}"; do diff --git a/tox.ini b/tox.ini index c3e97f1..8302968 100644 --- a/tox.ini +++ b/tox.ini @@ -10,8 +10,9 @@ setenv = VIRTUAL_ENV={envdir} PYTHONWARNINGS=default::DeprecationWarning deps = - -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2025.2} -r{toxinidir}/doc/requirements.txt + setuptools>=64.0.0,<82.0.0 # MIT [testenv:pep8] deps = diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index c4717d7..ad39752 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -43,6 +43,8 @@ - publish-openstack-python-branch-tarball - ironic-python-agent-build-image-dib-centos9: branches: master + - ironic-python-agent-build-image-dib-centos10: + branches: master - ironic-python-agent-build-image-dib-debian: branches: master - ironic-python-agent-build-image-dib-debian-arm64: