Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8b246c2316 | ||
![]() |
a9964026d5 | ||
![]() |
aebdf6082d | ||
![]() |
9b2277302d | ||
334fd79f97 | |||
![]() |
72a02b7b68 | ||
![]() |
4dba6f4ef2 | ||
![]() |
4a9f329f69 | ||
![]() |
0b3f3dc110 | ||
![]() |
36b5e11de6 | ||
![]() |
f340ae3100 | ||
![]() |
142834e41b | ||
![]() |
46a8e0104e | ||
![]() |
2cab2e4143 | ||
![]() |
ef33cc89e7 | ||
d6008a941d | |||
![]() |
8a27cf7167 | ||
![]() |
ac07c360a5 | ||
a23d3d0328 |
dib
element/ironic-python-agent-podman
extra-hardware
ironic-python-agent-ramdisk
environment.d
install.d/ironic-python-agent-ramdisk-source-install
package-installs.yamlpost-install.d
source-repository-ironic-libstatic/usr/local/bin
doc/source
ironic_python_agent_builder
playbooks/ironic-python-agent-build-image
releasenotes
tinyipa
zuul.d
191
dib/element/ironic-python-agent-podman/README.rst
Normal file
191
dib/element/ironic-python-agent-podman/README.rst
Normal file
@ -0,0 +1,191 @@
|
||||
ironic-python-agent-podman
|
||||
===========================
|
||||
|
||||
Adds Podman support and configuration files to ironic-python-agent-ramdisk.
|
||||
|
||||
Compatibility
|
||||
-------------
|
||||
This DIB element currently supports Debian-based images only. Additional
|
||||
distribution support may be added in the future.
|
||||
|
||||
ironic-python-agent-config
|
||||
--------------------------
|
||||
|
||||
**allow_arbitrary_containers**
|
||||
- **Description:** Defines whether arbitrary containers are allowed. Set to true or false.
|
||||
- **Environment Variable:** ``DIB_ALLOW_ARBITRARY_CONTAINERS``
|
||||
- **Default:** ``false``
|
||||
|
||||
**allowed_containers**
|
||||
- **Description:** Specifies a list of allowed container image URLs (ex "image1-url,image2-url").
|
||||
- **Environment Variable:** ``DIB_ALLOWED_CONTAINERS``
|
||||
- **Default:** Empty string (``""``)
|
||||
|
||||
**container_steps_file**
|
||||
- **Description:** Specifies the path in the RAM to the YAML file containing container steps to be executed.
|
||||
- **Environment Variable:** ``DIB_CONTAINER_STEPS_FILE``
|
||||
- **Default:** ``/etc/ironic-python-agent.d/mysteps.yaml``
|
||||
|
||||
**runner**
|
||||
- **Description:** Defines the container runtime to use, such as podman or docker.
|
||||
- **Environment Variable:** ``DIB_RUNNER``
|
||||
- **Default:** ``podman``
|
||||
|
||||
**pull_options**
|
||||
- **Description:** Container pull options (e.g., --tls-verify=false).
|
||||
- **Environment Variable:** ``DIB_PULL_OPTIONS``
|
||||
- **Default:** ``--tls-verify=false``
|
||||
|
||||
**run_options**
|
||||
- **Description:** Options passed when running the container (e.g., --rm --network=host).
|
||||
- **Environment Variable:** ``DIB_RUN_OPTIONS``
|
||||
- **Default:** ``--rm --network=host --tls-verify=false``
|
||||
|
||||
ironic-python-agent-podman
|
||||
--------------------------
|
||||
|
||||
**podman_conf_file**
|
||||
- **Description:** The path to the configuration file created in the RAM.
|
||||
- **Environment Variable:** ``DIB_PODMAN_CONF_FILE``
|
||||
- **Default:** ``/etc/containers/containers.conf``
|
||||
|
||||
ironic-python-agent-steps
|
||||
--------------------------
|
||||
|
||||
**steps_file_path**
|
||||
- **Description:** Path to the local step file to be copied to the RAM.
|
||||
- **Environment Variable:** ``DIB_STEPS_FILE_PATH``
|
||||
- **Default:** ``/etc/mysteps.yaml``
|
||||
|
||||
Example mysteps.yaml
|
||||
--------------------
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
steps:
|
||||
- name: manage_container_cleanup
|
||||
image: docker://172.24.4.1:5000/cleaning-image:latest
|
||||
interface: deploy
|
||||
reboot_requested: true
|
||||
pull_options:
|
||||
- --tls-verify=false
|
||||
run_options:
|
||||
- --rm
|
||||
- --network=host
|
||||
- --tls-verify=false
|
||||
abortable: true
|
||||
priority: 20
|
||||
- name: manage_container_cleanup2
|
||||
image: docker://172.24.4.1:5000/cleaning-image2:latest
|
||||
interface: deploy
|
||||
reboot_requested: true
|
||||
pull_options:
|
||||
- --tls-verify=false
|
||||
run_options:
|
||||
- --rm
|
||||
- --network=host
|
||||
- --tls-verify=false
|
||||
abortable: true
|
||||
priority: 10
|
||||
|
||||
Customization
|
||||
-------------
|
||||
You can override any of the default values by setting the corresponding
|
||||
environment variables during the build process. This allows the configuration
|
||||
to be dynamically adapted without modifying the script.
|
||||
|
||||
ironic-python-agent-podman
|
||||
===========================
|
||||
|
||||
Adds Podman support and configuration files to ironic-python-agent-ramdisk.
|
||||
|
||||
Compatibility
|
||||
-------------
|
||||
This DIB element currently supports Debian-based images only. Additional
|
||||
distribution support may be added in the future.
|
||||
|
||||
ironic-python-agent-config
|
||||
--------------------------
|
||||
|
||||
**allow_arbitrary_containers**
|
||||
- **Description:** Defines whether arbitrary containers are allowed. Set to true or false.
|
||||
- **Environment Variable:** ``DIB_ALLOW_ARBITRARY_CONTAINERS``
|
||||
- **Default:** ``false``
|
||||
|
||||
**allowed_containers**
|
||||
- **Description:** Specifies a list of allowed container image URLs (ex "image1-url,image2-url").
|
||||
- **Environment Variable:** ``DIB_ALLOWED_CONTAINERS``
|
||||
- **Default:** Empty string (``""``)
|
||||
|
||||
**container_steps_file**
|
||||
- **Description:** Specifies the path in the RAM to the YAML file containing container steps to be executed.
|
||||
- **Environment Variable:** ``DIB_CONTAINER_STEPS_FILE``
|
||||
- **Default:** ``/etc/ironic-python-agent.d/mysteps.yaml``
|
||||
|
||||
**runner**
|
||||
- **Description:** Defines the container runtime to use, such as podman or docker.
|
||||
- **Environment Variable:** ``DIB_RUNNER``
|
||||
- **Default:** ``podman``
|
||||
|
||||
**pull_options**
|
||||
- **Description:** Container pull options (e.g., --tls-verify=false).
|
||||
- **Environment Variable:** ``DIB_PULL_OPTIONS``
|
||||
- **Default:** ``--tls-verify=false``
|
||||
|
||||
**run_options**
|
||||
- **Description:** Options passed when running the container (e.g., --rm --network=host).
|
||||
- **Environment Variable:** ``DIB_RUN_OPTIONS``
|
||||
- **Default:** ``--rm --network=host --tls-verify=false``
|
||||
|
||||
ironic-python-agent-podman
|
||||
--------------------------
|
||||
|
||||
**podman_conf_file**
|
||||
- **Description:** The path to the configuration file created in the RAM.
|
||||
- **Environment Variable:** ``DIB_PODMAN_CONF_FILE``
|
||||
- **Default:** ``/etc/containers/containers.conf``
|
||||
|
||||
ironic-python-agent-steps
|
||||
--------------------------
|
||||
|
||||
**steps_file_path**
|
||||
- **Description:** Path to the local step file to be copied to the RAM.
|
||||
- **Environment Variable:** ``DIB_STEPS_FILE_PATH``
|
||||
- **Default:** ``/etc/mysteps.yaml``
|
||||
|
||||
Example mysteps.yaml
|
||||
--------------------
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
steps:
|
||||
- name: manage_container_cleanup
|
||||
image: docker://172.24.4.1:5000/cleaning-image:latest
|
||||
interface: deploy
|
||||
reboot_requested: true
|
||||
pull_options:
|
||||
- --tls-verify=false
|
||||
run_options:
|
||||
- --rm
|
||||
- --network=host
|
||||
- --tls-verify=false
|
||||
abortable: true
|
||||
priority: 20
|
||||
- name: manage_container_cleanup2
|
||||
image: docker://172.24.4.1:5000/cleaning-image2:latest
|
||||
interface: deploy
|
||||
reboot_requested: true
|
||||
pull_options:
|
||||
- --tls-verify=false
|
||||
run_options:
|
||||
- --rm
|
||||
- --network=host
|
||||
- --tls-verify=false
|
||||
abortable: true
|
||||
priority: 10
|
||||
|
||||
Customization
|
||||
-------------
|
||||
You can override any of the default values by setting the corresponding
|
||||
environment variables during the build process. This allows the configuration
|
||||
to be dynamically adapted without modifying the script.
|
2
dib/element/ironic-python-agent-podman/element-deps
Normal file
2
dib/element/ironic-python-agent-podman/element-deps
Normal file
@ -0,0 +1,2 @@
|
||||
ironic-python-agent-ramdisk
|
||||
package-installs
|
@ -0,0 +1,21 @@
|
||||
# Podman Config
|
||||
PODMAN_CONF_INSIDEDIR=/etc/containers
|
||||
|
||||
export PODMAN_CONF_FILE=${DIB_IPA_PODMAN_CONF_FILE:-$TMP_BUILD_DIR/mnt/$PODMAN_CONF_INSIDEDIR/containers.conf}
|
||||
|
||||
# Ipa Config
|
||||
IPA_CONF_INSIDEDIR=/etc/ironic-python-agent.d
|
||||
export IPA_CONFFILE=$TMP_BUILD_DIR/mnt/$IPA_CONF_INSIDEDIR/ironic_python_agent.conf
|
||||
|
||||
export ALLOW_ARBITRARY_CONTAINERS="${DIB_ALLOW_ARBITRARY_CONTAINERS:-false}"
|
||||
export ALLOWED_CONTAINERS="${DIB_ALLOWED_CONTAINERS:-""}"
|
||||
export CONTAINER_STEPS_FILE="${DIB_CONTAINER_STEPS_FILE:-/etc/ironic-python-agent.d/mysteps.yaml}"
|
||||
export RUNNER="${DIB_RUNNER:-podman}"
|
||||
export PULL_OPTIONS="${DIB_PULL_OPTIONS:---tls-verify=false}"
|
||||
export RUN_OPTIONS="${DIB_RUN_OPTIONS:---rm --network=host --tls-verify=false}"
|
||||
|
||||
# Steps Config
|
||||
STEPS_INSIDEDIR=/etc/ironic-python-agent.d
|
||||
export STEPS_FILE=$TMP_BUILD_DIR/mnt/$STEPS_INSIDEDIR/mysteps.yaml
|
||||
|
||||
export STEPS_FILE_PATH="${DIB_STEPS_FILE_PATH:-/etc/mysteps.yaml}"
|
@ -0,0 +1,2 @@
|
||||
podman:
|
||||
phase: install.d
|
10
dib/element/ironic-python-agent-podman/pre-finalise.d/10-ipa-podman-config
Executable file
10
dib/element/ironic-python-agent-podman/pre-finalise.d/10-ipa-podman-config
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ensure the directory exists
|
||||
sudo mkdir -p $(dirname $PODMAN_CONF_FILE)
|
||||
|
||||
# Create Podman configuration file inside the ramdisk with sudo tee
|
||||
echo "[engine]
|
||||
no_pivot_root = true" | sudo tee $PODMAN_CONF_FILE > /dev/null
|
||||
|
||||
echo "Podman configuration written to $PODMAN_CONF_FILE"
|
17
dib/element/ironic-python-agent-podman/pre-finalise.d/20-ipa-config
Executable file
17
dib/element/ironic-python-agent-podman/pre-finalise.d/20-ipa-config
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ensure the directory exists
|
||||
sudo mkdir -p $(dirname $IPA_CONFFILE)
|
||||
|
||||
# Write the configuration inside the ramdisk
|
||||
cat <<EOF | sudo tee $IPA_CONFFILE
|
||||
[container]
|
||||
allow_arbitrary_containers="$ALLOW_ARBITRARY_CONTAINERS"
|
||||
allowed_containers="$ALLOWED_CONTAINERS"
|
||||
container_steps_file="$CONTAINER_STEPS_FILE"
|
||||
runner="$RUNNER"
|
||||
pull_options="$PULL_OPTIONS"
|
||||
run_options="$RUN_OPTIONS"
|
||||
EOF
|
||||
|
||||
echo "Ironic Python Agent config written to $IPA_CONFFILE"
|
10
dib/element/ironic-python-agent-podman/pre-finalise.d/30-ipa-steps
Executable file
10
dib/element/ironic-python-agent-podman/pre-finalise.d/30-ipa-steps
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copy the YAML file to the ramdisk location
|
||||
if [[ -f $STEPS_FILE_PATH ]]; then
|
||||
sudo cp $STEPS_FILE_PATH $STEPS_FILE
|
||||
echo "Local mysteps.yaml copied to ramdisk: $STEPS_FILE"
|
||||
else
|
||||
echo "No valid mysteps.yaml file found at $STEPS_FILE_PATH. Please provide a valid file or check the default path."
|
||||
exit 1
|
||||
fi
|
@ -13,5 +13,5 @@ smartmontools:
|
||||
sysbench:
|
||||
|
||||
biosdevname:
|
||||
not-arch: ppc64,ppc64el,ppc64le
|
||||
not-arch: aarch64,arm64,ppc64,ppc64el,ppc64le
|
||||
when: IPA_DISTRO_FAMILY = rh
|
||||
|
@ -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}
|
||||
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}
|
||||
|
||||
# NOTE(TheJulia): List of what each item represents for future context
|
||||
# amdgpu == AMD/ATI Radeon/Vega/Raven firmware for drivers
|
||||
@ -13,3 +13,7 @@ export IPA_REMOVE_FIRMWARE=${IPA_REMOVE_FIRMWARE:-amdgpu,netronome,qcom,ti-commu
|
||||
# mediatek == Mediatek wifi and SoC (think chromebook) firmware
|
||||
# ath10k == Qualcom Atheros 10k firmware
|
||||
# rtlwifi == Realtek Wifi firmware
|
||||
# rtw88 == Realtek wireless
|
||||
# rtw89 == Realtek wireless
|
||||
# libertas == Marvell libertas wifi
|
||||
# auth11k == Qualcomm atheros WLAN
|
||||
|
@ -10,7 +10,6 @@ export LC_ALL=C.UTF-8
|
||||
|
||||
SCRIPTDIR=$(dirname $0)
|
||||
IPADIR=/tmp/ironic-python-agent
|
||||
IRLIBDIR=/tmp/ironic-lib
|
||||
UPPER_CONSTRAINTS=/tmp/requirements/upper-constraints.txt
|
||||
VENVDIR=/opt/ironic-python-agent
|
||||
|
||||
@ -46,12 +45,6 @@ $VENVDIR/bin/pip install -c $UPPER_CONSTRAINTS $IPADIR
|
||||
ln -s $VENVDIR/bin/ironic-python-agent /usr/local/bin/
|
||||
ln -s $VENVDIR/bin/ironic-collect-introspection-data /usr/local/bin/
|
||||
|
||||
# install ironic-lib from source if requested
|
||||
if [ ${IRONIC_LIB_FROM_SOURCE:-false} == "true" ]; then
|
||||
$VENVDIR/bin/pip install -c $UPPER_CONSTRAINTS -r $IRLIBDIR/requirements.txt
|
||||
$VENVDIR/bin/pip install $IRLIBDIR
|
||||
fi
|
||||
|
||||
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
|
||||
|
@ -3,6 +3,7 @@ Description=Ironic Python Agent
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
ConditionPathExists=!/etc/.rescued
|
||||
ExecStartPre=/sbin/modprobe vfat
|
||||
ExecStart=/usr/local/bin/ironic-python-agent --config-dir /etc/ironic-python-agent.d/
|
||||
Restart=always
|
||||
|
@ -59,6 +59,11 @@ amd64-microcode:
|
||||
- DISTRO_NAME = debian
|
||||
- IPA_DEBIAN_NONFREE = true
|
||||
|
||||
# Packages needed by Debian
|
||||
# bsdextrautils provides the 'hexdump' command used by IPA.
|
||||
bsdextrautils:
|
||||
when: DISTRO_NAME = debian
|
||||
|
||||
# Packages that should not normally be present on IPA images
|
||||
cloud-init:
|
||||
phase: post-install.d
|
||||
|
@ -64,7 +64,7 @@ DHCP=yes" > /etc/systemd/network/99-dhcp.network
|
||||
fi
|
||||
if [ -e /usr/lib/systemd/system/glean-early.service ]; then
|
||||
# Disable Glean-early start
|
||||
# Under normal cirumstances, glean-early attempts to mount a config
|
||||
# Under normal circumstances, glean-early attempts to mount a config
|
||||
# drive, configure ssh and a hostname. We only need the mount, and we
|
||||
# trigger that in ironic-agent-resolve-config-drive.service.
|
||||
# This is largely because glean uses /mnt/config by default,
|
||||
|
@ -1 +0,0 @@
|
||||
ironic-lib git /tmp/ironic-lib https://opendev.org/openstack/ironic-lib
|
@ -33,7 +33,7 @@ else
|
||||
# We need to enumerate through the devices, and obtain the
|
||||
for device in $(lsblk -o PATH,LABEL|grep config-2|cut -f1 -d" "); do
|
||||
device_id=$(udevadm info --query=property --property=ID_FS_PUBLISHER_ID $device | sed s/ID_FS_PUBLISHER_ID=//)
|
||||
if [[ "${publisher_id}" == "${device_id}" ]]; then
|
||||
if [[ "${publisher_id,,}" == "${device_id,,}" ]]; then
|
||||
# SUCCESS! Valid device! Do it!
|
||||
echo "Device ${device} matches the ${publisher_id}. Mounting..."
|
||||
mount -t iso9660 -o ro,mode=0700 "${device}" /mnt/config || true
|
||||
|
@ -84,14 +84,6 @@ To use a specific branch of ironic-python-agent, use:
|
||||
export DIB_REPOREF_ironic_python_agent=origin/stable/queens
|
||||
export DIB_REPOREF_requirements=origin/stable/queens
|
||||
|
||||
To build ironic-lib from source, do:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
export IRONIC_LIB_FROM_SOURCE=true
|
||||
# Optionally:
|
||||
#export DIB_REPOREF_ironic_lib=<branch>
|
||||
|
||||
To build image for architectures other than amd64, you can either set the
|
||||
``ARCH`` environment variable or use ``-a`` to specify the target
|
||||
architecture:
|
||||
|
@ -154,18 +154,6 @@ If you want to collect BIOS given names of NICs in the inventory, set
|
||||
|
||||
export TINYIPA_REQUIRE_BIOSDEVNAME=true
|
||||
|
||||
Using ironic-lib from source
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
ironic-lib_ contains important parts of the provisioning logic. If you would
|
||||
like to build an IPA image with your local checkout of ironic-lib_, export
|
||||
the following variable:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
export IRONIC_LIB_SOURCE=/absolute/path/to/ironic-lib/checkout
|
||||
|
||||
|
||||
.. _Ironic Python Agent: https://docs.openstack.org/ironic-python-agent
|
||||
.. _TinyCoreLinux: http://tinycorelinux.net
|
||||
.. _ironic-lib: https://opendev.org/openstack/ironic-lib
|
||||
|
0
doc/source/conf.py
Executable file → Normal file
0
doc/source/conf.py
Executable file → Normal file
@ -22,12 +22,3 @@ rebuilding an image with the following procedure.
|
||||
DIB_REPOREF_ironic_python_agent=my-test-branch \
|
||||
ironic-python-agent-builder -o my-ipa --release 9-stream centos
|
||||
|
||||
#. A similar process (with one additional variable) can be used for ironic-lib
|
||||
changes:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
DIB_REPOLOCATION_ironic_lib=/home/user/path/to/repo \
|
||||
DIB_REPOREF_ironic_lib=my-test-branch \
|
||||
IRONIC_LIB_FROM_SOURCE=true \
|
||||
ironic-python-agent-builder -o my-ipa --release 9-stream centos
|
||||
|
@ -80,7 +80,7 @@ def main():
|
||||
os.environ['DIB_REPOREF_requirements'] = args.branch
|
||||
if args.lzma:
|
||||
os.environ['DIB_IPA_COMPRESS_CMD'] = \
|
||||
'xz --format=lzma --compress --stdout'
|
||||
'xz --format=lzma --compress --stdout -9'
|
||||
# Enable checksum generation by default
|
||||
if 'DIB_CHECKSUM' not in os.environ:
|
||||
os.environ['DIB_CHECKSUM'] = 'sha256'
|
||||
|
@ -1,4 +1,8 @@
|
||||
- hosts: all
|
||||
|
||||
environment:
|
||||
PIP_BREAK_SYSTEM_PACKAGES: 1
|
||||
|
||||
roles:
|
||||
- ensure-pip
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
- hosts: all
|
||||
|
||||
environment:
|
||||
PIP_BREAK_SYSTEM_PACKAGES: 1
|
||||
|
||||
tasks:
|
||||
|
||||
- name: Create a target directory for raw images
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Changes lzma compression level to 9 for smaller images.
|
@ -3,4 +3,4 @@
|
||||
===========================
|
||||
|
||||
.. release-notes::
|
||||
:branch: stable/2023.1
|
||||
:branch: unmaintained/2023.1
|
||||
|
6
releasenotes/source/2024.2.rst
Normal file
6
releasenotes/source/2024.2.rst
Normal file
@ -0,0 +1,6 @@
|
||||
===========================
|
||||
2024.2 Series Release Notes
|
||||
===========================
|
||||
|
||||
.. release-notes::
|
||||
:branch: stable/2024.2
|
6
releasenotes/source/2025.1.rst
Normal file
6
releasenotes/source/2025.1.rst
Normal file
@ -0,0 +1,6 @@
|
||||
===========================
|
||||
2025.1 Series Release Notes
|
||||
===========================
|
||||
|
||||
.. release-notes::
|
||||
:branch: stable/2025.1
|
@ -6,6 +6,8 @@ Ironic Python Agent Builder Release Notes
|
||||
:maxdepth: 1
|
||||
|
||||
unreleased
|
||||
2025.1
|
||||
2024.2
|
||||
2024.1
|
||||
2023.2
|
||||
2023.1
|
||||
|
@ -7,15 +7,77 @@ source ${WORKDIR}/common.sh
|
||||
IRONIC_LIB_SOURCE=${IRONIC_LIB_SOURCE:-}
|
||||
|
||||
TC_RELEASE="15.x"
|
||||
QEMU_RELEASE="v5.2.0"
|
||||
QEMU_RELEASE="5.2.0"
|
||||
LSHW_RELEASE="B.02.18"
|
||||
BIOSDEVNAME_RELEASE="0.7.2"
|
||||
IPMITOOL_GIT_HASH="19d78782d795d0cf4ceefe655f616210c9143e62"
|
||||
|
||||
CHROOT_CMD="sudo chroot $BUILDDIR /usr/bin/env -i PATH=$CHROOT_PATH http_proxy=$http_proxy https_proxy=$https_proxy no_proxy=$no_proxy"
|
||||
|
||||
function clone_single_branch {
|
||||
git clone --branch $3 --depth=1 $1 $2
|
||||
DOWNLOAD_RETRY_MAX=${DOWNLOAD_RETRY_MAX:-5}
|
||||
DOWNLOAD_RETRY_DELAY=${DOWNLOAD_RETRY_DELAY:-10}
|
||||
|
||||
function download_with_retry() {
|
||||
local source_url=$1
|
||||
local destination_path=$2
|
||||
local attempts=1
|
||||
|
||||
declare -A tar_flags=(
|
||||
["tar.gz"]="z"
|
||||
["tgz"]="z"
|
||||
["tar.bz2"]="j"
|
||||
["tbz2"]="j"
|
||||
["tar.xz"]="J"
|
||||
["txz"]="J"
|
||||
)
|
||||
|
||||
echo "Downloading $source_url to $destination_path"
|
||||
while [ $attempts -le $DOWNLOAD_RETRY_MAX ]; do
|
||||
for ext in "${!tar_flags[@]}"; do
|
||||
if [[ "$source_url" =~ \.${ext}$ ]]; then
|
||||
mkdir -p "$destination_path"
|
||||
if wget --timeout=30 --tries=3 -O - "$source_url" | tar -x${tar_flags[$ext]} -C "$destination_path" --strip-components=1 -f -; then
|
||||
echo "Successfully downloaded $source_url on attempt $attempts"
|
||||
return 0
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ! "$source_url" =~ \.tar\.[a-z]+$ ]]; then
|
||||
if wget --timeout=30 --tries=3 "$source_url" -O "${destination_path}"; then
|
||||
echo "Successfully downloaded $source_url on attempt $attempts"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Download attempt $attempts failed for $source_url, retrying in $DOWNLOAD_RETRY_DELAY seconds..."
|
||||
sleep $DOWNLOAD_RETRY_DELAY
|
||||
attempts=$((attempts + 1))
|
||||
done
|
||||
|
||||
echo "Failed to download $source_url after $DOWNLOAD_RETRY_MAX attempts"
|
||||
return 1
|
||||
}
|
||||
|
||||
function tce_load_with_retry() {
|
||||
local package=$1
|
||||
local attempts=1
|
||||
|
||||
echo "Loading package $package with tce-load"
|
||||
while [ $attempts -le $DOWNLOAD_RETRY_MAX ]; do
|
||||
if sudo chroot --userspec=$TC:$STAFF $BUILDDIR /usr/bin/env -i PATH=$CHROOT_PATH http_proxy=$http_proxy https_proxy=$https_proxy no_proxy=$no_proxy tce-load -wci $package; then
|
||||
echo "Successfully loaded $package on attempt $attempts"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "tce-load attempt $attempts failed for $package, retrying in $DOWNLOAD_RETRY_DELAY seconds..."
|
||||
sleep $DOWNLOAD_RETRY_DELAY
|
||||
attempts=$((attempts + 1))
|
||||
done
|
||||
|
||||
echo "Failed to load $package with tce-load after $DOWNLOAD_RETRY_MAX attempts"
|
||||
return 1
|
||||
}
|
||||
|
||||
echo "Building tinyipa:"
|
||||
@ -37,8 +99,8 @@ fi
|
||||
choose_tc_mirror
|
||||
|
||||
cd $WORKDIR/build_files
|
||||
wget -N $TINYCORE_MIRROR_URL/$TC_RELEASE/x86_64/release/distribution_files/corepure64.gz
|
||||
wget -N $TINYCORE_MIRROR_URL/$TC_RELEASE/x86_64/release/distribution_files/vmlinuz64
|
||||
download_with_retry "$TINYCORE_MIRROR_URL/$TC_RELEASE/x86_64/release/distribution_files/corepure64.gz" "corepure64.gz"
|
||||
download_with_retry "$TINYCORE_MIRROR_URL/$TC_RELEASE/x86_64/release/distribution_files/vmlinuz64" "vmlinuz64"
|
||||
cd $WORKDIR
|
||||
|
||||
########################################################
|
||||
@ -55,10 +117,10 @@ mkdir "$BUILDDIR"
|
||||
sudo sh -c "echo $TINYCORE_MIRROR_URL > $BUILDDIR/opt/tcemirror"
|
||||
|
||||
# Download Qemu-utils, Biosdevname and IPMItool source
|
||||
clone_single_branch "https://github.com/qemu/qemu.git" "${BUILDDIR}/tmp/qemu" "$QEMU_RELEASE"
|
||||
clone_single_branch "https://github.com/lyonel/lshw.git" "${BUILDDIR}/tmp/lshw" "$LSHW_RELEASE"
|
||||
download_with_retry "https://download.qemu.org/qemu-${QEMU_RELEASE}.tar.xz" "${BUILDDIR}/tmp/qemu"
|
||||
download_with_retry "https://github.com/lyonel/lshw/archive/refs/tags/${LSHW_RELEASE}.tar.gz" "${BUILDDIR}/tmp/lshw"
|
||||
if $TINYIPA_REQUIRE_BIOSDEVNAME; then
|
||||
wget -N -O - https://linux.dell.com/biosdevname/biosdevname-${BIOSDEVNAME_RELEASE}/biosdevname-${BIOSDEVNAME_RELEASE}.tar.gz | tar -xz -C "${BUILDDIR}/tmp" -f -
|
||||
download_with_retry "https://linux.dell.com/biosdevname/biosdevname-${BIOSDEVNAME_RELEASE}/biosdevname-${BIOSDEVNAME_RELEASE}.tar.gz" "${BUILDDIR}/tmp/biosdevname"
|
||||
fi
|
||||
if $TINYIPA_REQUIRE_IPMITOOL; then
|
||||
git clone https://codeberg.org/IPMITool/ipmitool.git "${BUILDDIR}/tmp/ipmitool-src"
|
||||
@ -82,14 +144,6 @@ $PYTHON_COMMAND setup.py sdist --dist-dir "$BUILDDIR/tmp/localpip" --quiet
|
||||
ls $BUILDDIR/tmp/localpip || true
|
||||
cp requirements.txt $BUILDDIR/tmp/ipa-requirements.txt
|
||||
|
||||
if [ -n "$IRONIC_LIB_SOURCE" ]; then
|
||||
pushd $IRONIC_LIB_SOURCE
|
||||
rm -rf *.egg-info
|
||||
$PYTHON_COMMAND setup.py sdist --dist-dir "$BUILDDIR/tmp/localpip" --quiet
|
||||
cp requirements.txt $BUILDDIR/tmp/ironic-lib-requirements.txt
|
||||
popd
|
||||
fi
|
||||
|
||||
if [ -n "$PYTHON_EXTRA_SOURCES_DIR_LIST" ]; then
|
||||
IFS="," read -ra PKGDIRS <<< "$PYTHON_EXTRA_SOURCES_DIR_LIST"
|
||||
for PKGDIR in "${PKGDIRS[@]}"; do
|
||||
@ -105,9 +159,6 @@ if [ -n "$PYTHON_EXTRA_SOURCES_DIR_LIST" ]; then
|
||||
fi
|
||||
|
||||
$WORKDIR/generate_tox_constraints.sh upper-constraints.txt
|
||||
if [ -n "$IRONIC_LIB_SOURCE" ]; then
|
||||
sed -i '/ironic-lib/d' upper-constraints.txt $BUILDDIR/tmp/ipa-requirements.txt
|
||||
fi
|
||||
cp upper-constraints.txt $BUILDDIR/tmp/upper-constraints.txt
|
||||
echo Using upper-constraints:
|
||||
cat upper-constraints.txt
|
||||
@ -153,7 +204,7 @@ PY_REQS="buildreqs_python3.lst"
|
||||
sudo chown $TC:$STAFF $BUILDDIR/usr/local/tce.installed
|
||||
|
||||
while read line; do
|
||||
sudo chroot --userspec=$TC:$STAFF $BUILDDIR /usr/bin/env -i PATH=$CHROOT_PATH http_proxy=$http_proxy https_proxy=$https_proxy no_proxy=$no_proxy tce-load -wci $line
|
||||
tce_load_with_retry "$line"
|
||||
done < <(paste $WORKDIR/build_files/$PY_REQS $WORKDIR/build_files/buildreqs.lst)
|
||||
|
||||
TINYIPA_PYTHON_EXE="python3.9"
|
||||
@ -165,10 +216,6 @@ $CHROOT_CMD ${TINYIPA_PYTHON_EXE} -m ensurepip
|
||||
$CHROOT_CMD ${PIP_COMMAND} install --upgrade pip==${PIP_VERSION} wheel
|
||||
$CHROOT_CMD ${PIP_COMMAND} install pbr
|
||||
$CHROOT_CMD ${PIP_COMMAND} wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels -r /tmp/ipa-requirements.txt
|
||||
if [ -n "$IRONIC_LIB_SOURCE" ]; then
|
||||
$CHROOT_CMD ${PIP_COMMAND} wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels -r /tmp/ironic-lib-requirements.txt
|
||||
$CHROOT_CMD ${PIP_COMMAND} wheel -c /tmp/upper-constraints.txt --no-index --pre --wheel-dir /tmp/wheels --find-links=/tmp/localpip --find-links=/tmp/wheels ironic-lib
|
||||
fi
|
||||
|
||||
if [ -n "$PYTHON_EXTRA_SOURCES_DIR_LIST" ]; then
|
||||
IFS="," read -ra PKGDIRS <<< "$PYTHON_EXTRA_SOURCES_DIR_LIST"
|
||||
|
@ -1,7 +1,7 @@
|
||||
- job:
|
||||
name: ironic-python-agent-build-image-base
|
||||
parent: publish-openstack-artifacts
|
||||
nodeset: ubuntu-jammy
|
||||
nodeset: ubuntu-noble
|
||||
pre-run: playbooks/ironic-python-agent-build-image/pre.yaml
|
||||
run: playbooks/ironic-python-agent-build-image/run.yaml
|
||||
post-run:
|
||||
@ -46,7 +46,7 @@
|
||||
- job:
|
||||
name: ironic-python-agent-check-image-base
|
||||
parent: base
|
||||
nodeset: ubuntu-jammy
|
||||
nodeset: ubuntu-noble
|
||||
pre-run: playbooks/ironic-python-agent-build-image/pre.yaml
|
||||
run: playbooks/ironic-python-agent-build-image/run.yaml
|
||||
post-run: playbooks/ironic-python-agent-build-image/extra-logs.yaml
|
||||
@ -133,13 +133,13 @@
|
||||
vars:
|
||||
image_type: 'dib'
|
||||
image_distro: 'ubuntu'
|
||||
image_release: 'jammy'
|
||||
image_release: 'noble'
|
||||
dib_no_tmpfs: '1'
|
||||
|
||||
- job:
|
||||
name: ironic-python-agent-check-image-dib-ubuntu-arm64
|
||||
parent: ironic-python-agent-check-image-dib-ubuntu
|
||||
nodeset: ubuntu-jammy-arm64
|
||||
nodeset: ubuntu-noble-arm64
|
||||
vars:
|
||||
image_target_name: ubuntu-arm64
|
||||
|
||||
@ -149,4 +149,4 @@
|
||||
parent: openstack-tox
|
||||
timeout: 7200
|
||||
vars:
|
||||
tox_envlist: codespell
|
||||
tox_envlist: codespell
|
||||
|
Loading…
x
Reference in New Issue
Block a user