Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USHIFT-3503: Properly apply greenboot timeout increase in blueprints and container files #3615

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,13 @@ runtime_root = "/run/crun"
runtime_config_path = ""
monitor_path = ""
"""

# Extend Greenboot wait timeout to 10m for MicroShift to be ready.
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update.
[[customizations.files]]
path = "/etc/greenboot/greenboot.conf"
data = """
GREENBOOT_WATCHDOG_CHECK_ENABLED=true
MICROSHIFT_WAIT_TIMEOUT_SEC=600
"""
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,13 @@ enabled = ["mdns", "ssh", "http", "https"]
[[customizations.firewall.zones]]
name = "trusted"
sources = ["10.42.0.0/16", "169.254.169.1"]

# Extend Greenboot wait timeout to 10m for MicroShift to be ready.
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update.
[[customizations.files]]
path = "/etc/greenboot/greenboot.conf"
data = """
GREENBOOT_WATCHDOG_CHECK_ENABLED=true
MICROSHIFT_WAIT_TIMEOUT_SEC=600
"""
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,13 @@ enabled = ["mdns", "ssh", "http", "https"]
[[customizations.firewall.zones]]
name = "trusted"
sources = ["10.42.0.0/16", "169.254.169.1"]

# Extend Greenboot wait timeout to 10m for MicroShift to be ready.
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update.
[[customizations.files]]
path = "/etc/greenboot/greenboot.conf"
data = """
GREENBOOT_WATCHDOG_CHECK_ENABLED=true
MICROSHIFT_WAIT_TIMEOUT_SEC=600
"""
10 changes: 10 additions & 0 deletions test/image-blueprints/layer2-presubmit/group1/rhel94-crel.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,14 @@ enabled = ["mdns", "ssh", "http", "https"]
[[customizations.firewall.zones]]
name = "trusted"
sources = ["10.42.0.0/16", "169.254.169.1"]

# Extend Greenboot wait timeout to 10m for MicroShift to be ready.
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update.
[[customizations.files]]
path = "/etc/greenboot/greenboot.conf"
data = """
GREENBOOT_WATCHDOG_CHECK_ENABLED=true
MICROSHIFT_WAIT_TIMEOUT_SEC=600
"""
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,13 @@ enabled = ["mdns", "ssh", "http", "https"]
[[customizations.firewall.zones]]
name = "trusted"
sources = ["10.42.0.0/16", "169.254.169.1"]

# Extend Greenboot wait timeout to 10m for MicroShift to be ready.
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update.
[[customizations.files]]
path = "/etc/greenboot/greenboot.conf"
data = """
GREENBOOT_WATCHDOG_CHECK_ENABLED=true
MICROSHIFT_WAIT_TIMEOUT_SEC=600
"""
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,13 @@ enabled = ["mdns", "ssh", "http", "https"]
[[customizations.firewall.zones]]
name = "trusted"
sources = ["10.42.0.0/16", "169.254.169.1"]

# Extend Greenboot wait timeout to 10m for MicroShift to be ready.
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update.
[[customizations.files]]
path = "/etc/greenboot/greenboot.conf"
data = """
GREENBOOT_WATCHDOG_CHECK_ENABLED=true
MICROSHIFT_WAIT_TIMEOUT_SEC=600
"""
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@ enabled = ["mdns", "ssh", "http", "https"]
[[customizations.firewall.zones]]
name = "trusted"
sources = ["10.42.0.0/16", "169.254.169.1"]

# Extend Greenboot wait timeout to 10m for MicroShift to be ready.
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update.
[[customizations.files]]
path = "/etc/greenboot/greenboot.conf"
data = """
GREENBOOT_WATCHDOG_CHECK_ENABLED=true
MICROSHIFT_WAIT_TIMEOUT_SEC=600
"""
10 changes: 10 additions & 0 deletions test/image-blueprints/layer2-presubmit/group1/rhel94-source.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,13 @@ enabled = ["mdns", "ssh", "http", "https"]
[[customizations.firewall.zones]]
name = "trusted"
sources = ["10.42.0.0/16", "169.254.169.1"]

# Extend Greenboot wait timeout to 10m for MicroShift to be ready.
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update.
[[customizations.files]]
path = "/etc/greenboot/greenboot.conf"
data = """
GREENBOOT_WATCHDOG_CHECK_ENABLED=true
MICROSHIFT_WAIT_TIMEOUT_SEC=600
"""
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,14 @@ enabled = ["mdns", "ssh", "http", "https"]
[[customizations.firewall.zones]]
name = "trusted"
sources = ["10.42.0.0/16", "169.254.169.1"]

# Extend Greenboot wait timeout to 10m for MicroShift to be ready.
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update.
[[customizations.files]]
path = "/etc/greenboot/greenboot.conf"
data = """
GREENBOOT_WATCHDOG_CHECK_ENABLED=true
MICROSHIFT_WAIT_TIMEOUT_SEC=600
"""
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,30 @@ enabled = ["mdns", "ssh", "http", "https"]
name = "trusted"
sources = ["10.42.0.0/16", "169.254.169.1"]

[[customizations.files]]
# Override the default qemu-ga service configuration on the guest to allow all RPCs.
# BLOCK_RPCS is a deny-list of qemu-guest-agent RPCs to block, such as file read/write, process execution, etc. By
# default, all RPCs are blocked.
# FREEZE_HOOK_PATHNAME is the dir-path containing hook scripts. This override does not change the default value.
# These scripts are executed before or after guest image snapshotting ops ("freezing" and "thawing" in libvirt speak).
# These scripts are executed before or after guest image snapshot ops ("freezing" and "thawing" in libvirt speak).
# No hooks are installed by default.
[[customizations.files]]
path = "/etc/sysconfig/qemu-ga"
data = """
# This is a systemd environment file, not a shell script.
# It provides settings for "/lib/systemd/system/qemu-guest-agent.service".
BLOCK_RPCS=
FSFREEZE_HOOK_PATHNAME=/etc/qemu-ga/fsfreeze-hook"""

# Extend Greenboot wait timeout to 10m for MicroShift to be ready.
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update.
[[customizations.files]]
path = "/etc/greenboot/greenboot.conf"
data = """
GREENBOOT_WATCHDOG_CHECK_ENABLED=true
MICROSHIFT_WAIT_TIMEOUT_SEC=600
"""

[[containers]]
source = "quay.io/microshift/busybox:1.36"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@ enabled = ["mdns", "ssh", "http", "https"]
[[customizations.firewall.zones]]
name = "trusted"
sources = ["10.42.0.0/16", "169.254.169.1"]

# Extend Greenboot wait timeout to 10m for MicroShift to be ready.
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update.
[[customizations.files]]
path = "/etc/greenboot/greenboot.conf"
data = """
GREENBOOT_WATCHDOG_CHECK_ENABLED=true
MICROSHIFT_WAIT_TIMEOUT_SEC=600
"""
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ RUN ${REPO_CONFIG_SCRIPT} -create ${USHIFT_RPM_REPO_PATH} && \
rm -rf $USHIFT_RPM_REPO_PATH && \
dnf clean all

# Extend Greenboot wait timeout to 10m for MicroShift to be ready.
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update.
RUN printf "\nMICROSHIFT_WAIT_TIMEOUT_SEC=600\n" >> /etc/greenboot/greenboot.conf

# Configure firewall
RUN firewall-offline-cmd --zone=public --add-port=22/tcp && \
firewall-offline-cmd --zone=trusted --add-source=10.42.0.0/16 && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ RUN ${REPO_CONFIG_SCRIPT} -create ${USHIFT_RPM_REPO_PATH} && \
rm -rf $USHIFT_RPM_REPO_PATH && \
dnf clean all

# Extend Greenboot wait timeout to 10m for MicroShift to be ready.
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update.
RUN printf "\nMICROSHIFT_WAIT_TIMEOUT_SEC=600\n" >> /etc/greenboot/greenboot.conf

# Configure firewall
RUN firewall-offline-cmd --zone=public --add-port=22/tcp && \
firewall-offline-cmd --zone=trusted --add-source=10.42.0.0/16 && \
Expand Down
6 changes: 6 additions & 0 deletions test/kickstart-templates/includes/post-greenboot.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Extend Greenboot wait timeout to 10m for MicroShift to be ready
if [ ! -f "/etc/greenboot/greenboot.conf" ] ; then
echo "ERROR: The /etc/greenboot/greenboot.conf file does not exist"
exit 1
fi
printf "\nMICROSHIFT_WAIT_TIMEOUT_SEC=600\n" >> /etc/greenboot/greenboot.conf
3 changes: 0 additions & 3 deletions test/kickstart-templates/includes/post-system.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ ln -sf /dev/null /etc/systemd/user/grub-boot-success.timer
echo "fs.inotify.max_user_watches = 65536" >> /etc/sysctl.conf
echo "fs.inotify.max_user_instances = 8192" >> /etc/sysctl.conf
sysctl --system

# Extend Greenboot wait timeout to 10m for MicroShift to be ready
printf "\nMICROSHIFT_WAIT_TIMEOUT_SEC=600\n" >> /etc/greenboot/greenboot.conf
3 changes: 3 additions & 0 deletions test/kickstart-templates/kickstart-centos.ks.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
%include /post-network.cfg

%include /post-cos9rpm.cfg
# Greenboot configuration must come after RPM install to avoid
# /etc/greenboot/greenboot.conf overwrite by the package update
%include /post-greenboot.cfg

%end

Expand Down
2 changes: 1 addition & 1 deletion test/resources/libostree.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def write_greenboot_microshift_wait_timeout(seconds: int) -> None:


def remove_greenboot_microshift_wait_timeout() -> None:
remote_sudo("rm /etc/greenboot/greenboot.conf")
remote_sudo("sudo sed -i '/^MICROSHIFT_WAIT_TIMEOUT_SEC=/d' /etc/greenboot/greenboot.conf")


def no_transaction_in_progress() -> None:
Expand Down