feat: Support this role in container builds#243
feat: Support this role in container builds#243martinpitt merged 1 commit intolinux-system-roles:mainfrom
Conversation
Reviewer's GuideThis PR enables container build support by detecting if the system is booted under systemd and gating all runtime tasks and tests behind a new __metrics_is_booted flag, switches firewall commands to offline mode, adapts PCP invocation, extends CI full-stack tests with a Buildah QEMU scenario, and updates metadata to reflect containerbuild support. Sequence diagram for role execution in container build environmentssequenceDiagram
actor CI as CI Pipeline
participant Buildah as Buildah Container
participant Role as Cockpit Role
CI->>Buildah: Start container build
Buildah->>Role: Execute role tasks
Role->>Role: detect_systemd_boot()
alt System is booted (systemd present)
Role->>Role: run runtime operations
else System is not booted (container build)
Role->>Role: skip runtime operations
end
ER diagram for new __metrics_is_booted flag in role data modelerDiagram
METRICS_ROLE {
bool __metrics_is_booted
}
METRICS_ROLE ||--o{ TASKS : guards
TASKS {
string name
bool runtime_only
}
Class diagram for booted system detection and runtime gatingclassDiagram
class MetricsRole {
+__metrics_is_booted : bool
+detect_systemd_boot()
+run_runtime_tasks()
}
MetricsRole : +detect_systemd_boot() sets __metrics_is_booted
MetricsRole : +run_runtime_tasks() only if __metrics_is_booted == true
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Ah, our new favourite "unique name:" warning. Sent to performancecopilot/ansible-pcp#85 and included here. |
5ae916a to
a4d6e51
Compare
|
[citest] |
|
Both CentOS 7 and CentOS 8 fail in TF with This also reproduces locally with (note: search for "ERROR!", not "fatal:" -- that's just the follow-up "ansible_failed_result is undefined" error, but that's not interesting). The failure also happens on main, and on c8c8fd4 (rewound main to the state from a few days ago). @spetrosi @richm does that ring a bell? Did something go wrong with yesterday's release? |
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey @martinpitt - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This comment was marked as outdated.
This comment was marked as outdated.
|
Back to metrics, locally However, even after that, At least after This seems to be specific to Ansible 2.9. It works with 2.16: |
Feature: Support running the cockpit role during container builds. Reason: This is particularly useful for building bootc derivative OSes. Result: The role now works during container builds. The bootc container scenarios run in CI, which ensures that the role works in buildah build environment. This allows us to officially support this role for image mode builds. Detect if the system is booted (with systemd), and skip all runtime operations and checks if not. Also use `firewall-offline-cmd` which works also in non-booted environments -- we are only/primarily interested in the persistent firewall config anyway. Make tests_verify_fullstack.yml a full bootc end-to-end test, as that covers the most code paths. https://issues.redhat.com/browse/RHEL-98911
|
[citest] |
There was a problem hiding this comment.
Hey @martinpitt - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
WTH -- it's now doing this role dep failure thing on C10 as well 😢 What is happening here? |
|
[citest] |
|
[citest] |
|
phew, the mysterious collection dependency failure from yesterday magically resolved itself again. All green except for the F42 spark SELinux failure which isn't new (see #173). |
Feature: Support running the cockpit role during container builds.
Reason: This is particularly useful for building bootc derivative OSes.
Result: The role now works during container builds. The bootc container scenarios run in CI, which ensures that the role works in buildah build environment. This allows us to officially support this role for image mode builds.
Detect if the system is booted (with systemd), and skip all runtime operations and checks if not. Also use
firewall-offline-cmdwhich works also in non-booted environments -- we are only/primarily interested in the persistent firewall config anyway.Make tests_verify_fullstack.yml a full bootc end-to-end test, as that covers the most code paths.
https://issues.redhat.com/browse/RHEL-98911
Requirements:
Summary by Sourcery
Enable the cockpit role to be executed during container (Buildah) image builds by detecting systemd boot status, skipping unsupported runtime operations, using persistent firewall tooling, and extending CI tests to cover buildah QEMU scenarios.
New Features:
Enhancements:
Summary by Sourcery
Enable the metrics Ansible role to run in container (Buildah) image builds by detecting when systemd isn’t running, skipping unsupported runtime tasks, and anchoring firewall changes to persistent configuration.
New Features:
Enhancements:
Build:
CI: