Skip to content

[foreman*|pulp|candlepin] support foremanctl deployments#4330

Open
pmoravec wants to merge 8 commits into
sosreport:mainfrom
pmoravec:sos-pmoravec-foremanctl
Open

[foreman*|pulp|candlepin] support foremanctl deployments#4330
pmoravec wants to merge 8 commits into
sosreport:mainfrom
pmoravec:sos-pmoravec-foremanctl

Conversation

@pmoravec
Copy link
Copy Markdown
Contributor

@pmoravec pmoravec commented May 15, 2026

A merge-able implementation of #4189. When reviewing all stuff being collected in foreman plugin, I did remove some parts that are not further relevant (passenger, qpid).

I am kindy asking @evgeni / @adamruzicka / @ehelms for a review of the TODO questions as I dont know how (or if) to collect some stuff.

All other plugin changes (pulp, candlepin,..) included, as well as a new foremanctl plugin is implemented.


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname email@example.com?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?
  • Are all passwords or private data gathered by this PR obfuscated?

Comment thread sos/utilities.py Fixed
@packit-as-a-service
Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/sosreport-sos-4330
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

Comment thread sos/report/plugins/foreman.py Outdated
Comment thread sos/report/plugins/foreman.py Outdated
Comment thread sos/report/plugins/foreman.py Outdated
add_cmd_output / exec_cmd / .. methods newly accepts stdin
argument, to pass stdin to various commands.

Adding some unit tests to verify the feature.

Relevant: sosreport#4189

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Comment thread sos/report/plugins/foreman.py Outdated
pmoravec added a commit to pmoravec/sos that referenced this pull request May 15, 2026
foremanctl deployments are container based, so collect data from the
pods.

Also, drop collecting some abandoned stuff not further applicable even
to standalone deployments.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
@pmoravec pmoravec force-pushed the sos-pmoravec-foremanctl branch from 06c9cd0 to 186dd5e Compare May 15, 2026 12:33
Comment thread sos/report/plugins/foreman.py Outdated
Comment thread sos/report/plugins/foreman.py Outdated
Comment thread sos/report/plugins/foreman.py Outdated
Comment thread sos/report/plugins/foreman.py Outdated
Comment thread sos/utilities.py Dismissed
pmoravec added a commit to pmoravec/sos that referenced this pull request May 15, 2026
foremanctl deployments are container based, so collect data from the
pods.

Also, drop collecting some abandoned stuff not further applicable even
to standalone deployments.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
@pmoravec pmoravec force-pushed the sos-pmoravec-foremanctl branch from 186dd5e to 79122fb Compare May 15, 2026 13:10
Comment thread sos/report/plugins/foreman_proxy.py Outdated
pmoravec added a commit to pmoravec/sos that referenced this pull request May 15, 2026
foremanctl deployments are container based, so collect data from the
pods.

Also, drop collecting some abandoned stuff not further applicable even
to standalone deployments.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
@pmoravec pmoravec force-pushed the sos-pmoravec-foremanctl branch from 79122fb to 6608734 Compare May 15, 2026 16:42
pmoravec added a commit to pmoravec/sos that referenced this pull request May 15, 2026
New plugin for foreman deployments using podman and ansible.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
pmoravec added a commit to pmoravec/sos that referenced this pull request May 15, 2026
foremanctl deployments are container based, so collect data from the
pods.

Also, drop collecting some abandoned stuff not further applicable even
to standalone deployments.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
pmoravec added a commit to pmoravec/sos that referenced this pull request May 15, 2026
New plugin for foreman deployments using podman and ansible.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
@pmoravec pmoravec force-pushed the sos-pmoravec-foremanctl branch from 62f2bda to c86220b Compare May 15, 2026 17:25
pmoravec added a commit to pmoravec/sos that referenced this pull request May 17, 2026
foremanctl deployments are container based, so collect data from the
pods.

Also, drop collecting some abandoned stuff not further applicable even
to standalone deployments.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
pmoravec added a commit to pmoravec/sos that referenced this pull request May 17, 2026
New plugin for foreman deployments using podman and ansible.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
@pmoravec pmoravec force-pushed the sos-pmoravec-foremanctl branch from c86220b to a5fcbe0 Compare May 17, 2026 16:38
pmoravec added a commit to pmoravec/sos that referenced this pull request May 17, 2026
foremanctl deployments are container based, so collect data from the
pods.

Also, drop collecting some abandoned stuff not further applicable even
to standalone deployments.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
pmoravec added a commit to pmoravec/sos that referenced this pull request May 17, 2026
New plugin for foreman deployments using podman and ansible.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
@pmoravec pmoravec force-pushed the sos-pmoravec-foremanctl branch from a5fcbe0 to b8083e6 Compare May 17, 2026 20:51
Comment thread sos/report/plugins/foreman.py Outdated
'ping -c1 -W1 localhost'
])

self.add_journal(units="foreman.service", sizelimit=500)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally also all of these

# systemctl list-units | grep dynflow-sidekiq@ | awk '{ print $1 }'
dynflow-sidekiq@orchestrator.service
dynflow-sidekiq@worker-hosts-queue.service
dynflow-sidekiq@worker.service

Or maybe even better, logs of all the services forming foreman.target?

# systemctl list-dependencies foreman.target | grep -Po '[a-zA-Z].*'
foreman.target
candlepin.service
dynflow-sidekiq@orchestrator.service
dynflow-sidekiq@worker-hosts-queue.service
dynflow-sidekiq@worker.service
foreman-proxy.service
foreman-recurring@daily.service
foreman-recurring@daily.timer
foreman-recurring@hourly.service
foreman-recurring@hourly.timer
foreman-recurring@monthly.service
foreman-recurring@monthly.timer
foreman-recurring@weekly.service
foreman-recurring@weekly.timer
foreman.service
postgresql.service
pulp-api.service
pulp-content.service
pulp-worker@1.service
pulp-worker@2.service
pulp-worker@3.service
pulp-worker@4.service
pulp-worker@5.service
pulp-worker@6.service
redis.service
pulp-worker.target
pulp-worker@1.service
pulp-worker@2.service
pulp-worker@3.service
pulp-worker@4.service
pulp-worker@5.service
pulp-worker@6.service

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We collect self.add_journal(units="dynflow-sidekiq@*") on line 179. candlepin, foreman-* and pulp-* shall be rather collected by the respective plugins (so I will extend the foreman_proxy one, candlepin and pulp is on the TODO list).

both redis and postgresql journals make sense to collect only in foremanctl, right? It makes bit more sense to collect them in foreman plugin as a special use case, since redis and postgresql plugins dont collect the journals by default.

Comment on lines +319 to +327
cmdout = self.exec_cmd(
_cmd, timeout=600, sizelimit=100,
env=self.env, container=self.dbcontainer)
self.add_cmd_output(
'podman exec -i foreman /usr/libexec/dynflow-expand',
suggest_filename=dyn,
timeout=600,
stdin=cmdout['output'],
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to pipe the two together in one go? I'm pretty sure it could be done in a hack way, this question is more about doing it cleanly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TurboTurtle some thoughts? I know there are some know issues when collecting commands with pipes, so we try to avoid that as much as we can.

Moreover, plain:

self.add_cmd_output(f'podman exec postgresql {_cmd} | podman exec -i foreman /usr/libexec/dynflow-expand', env=self.env,suggest_filename=f'piped_{dyn}', timeout=600)

does not work (psql: invalid option -- 'i'), regardless if I add - to tail of the 2nd podman command, and:

podman exec -i foreman /usr/libexec/dynflow-expand < <(podman exec postgresql {_cmd})

gets stuck.

I dont like the proposed approach, but dont see anything better (that would work).

pmoravec added a commit to pmoravec/sos that referenced this pull request May 18, 2026
foremanctl deployments are container based, so collect data from the
pods.

Also, drop collecting some abandoned stuff not further applicable even
to standalone deployments.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
pmoravec added a commit to pmoravec/sos that referenced this pull request May 18, 2026
New plugin for foreman deployments using podman and ansible.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
@pmoravec pmoravec force-pushed the sos-pmoravec-foremanctl branch from b8083e6 to 5c3cf37 Compare May 18, 2026 10:47
pmoravec added 2 commits May 26, 2026 17:12
foremanctl deployments are container based, so collect data from the
pods.

Also, drop collecting some abandoned stuff not further applicable even
to standalone deployments.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
New plugin for foreman deployments using podman and ansible.

Relevant: sosreport#4189
Closes: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
@pmoravec pmoravec force-pushed the sos-pmoravec-foremanctl branch from 5c3cf37 to 3c86d48 Compare May 26, 2026 15:13
Useful mainly for foremanctl deployments

Relevant: sosreport#4189

Signed-off by: Barbora Vassova <bvassova@redhat.com>
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
@pmoravec pmoravec force-pushed the sos-pmoravec-foremanctl branch from 3c86d48 to 4bc5689 Compare May 26, 2026 15:15
pmoravec added a commit to pmoravec/sos that referenced this pull request May 29, 2026
Plugin.add_cmd_output run with container and env args should pass the
env into container OS environ.

Relevant: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
pmoravec added a commit to pmoravec/sos that referenced this pull request May 29, 2026
Changes applied:
- uploaddir default value valid also for non-foremanctl deployments
- plugin trigger enahnced by foremanctl related pods
- foremanctl moved config from settings.py to pods config
- collect proper commands from proper pod

Related: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
pmoravec added 2 commits May 29, 2026 16:06
Plugin.add_cmd_output run with container and env args should pass the
env into container OS environ.

Relevant: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Changes applied:
- uploaddir default value valid also for non-foremanctl deployments
- plugin trigger enahnced by foremanctl related pods
- foremanctl moved config from settings.py to pods config
- collect proper commands from proper pod

Related: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
@pmoravec pmoravec force-pushed the sos-pmoravec-foremanctl branch from 7a0eab6 to ba02cbe Compare May 29, 2026 14:06
pmoravec and others added 2 commits June 1, 2026 12:49
Two issues fixed for systems with postgres in containers managed by
same-named service (like foremanctl deployments):

- Add 'postgresql' service trigger.
- Break wrong inheritance of classes, where RHELPolicy allowing
  IndependentPlugin and RedHatPlugin can cause DebianPostgreSQL is used
via common IndependentPlugin subclass. Splitting RedHatPostgreSQL is a
solution here.

Relevant: sosreport#4330

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Relevant: sosreport#4330

Signed-off-by: Barbora Vassova <bvassova@redhat.com>
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
@pmoravec pmoravec marked this pull request as ready for review June 1, 2026 14:49
@pmoravec pmoravec requested review from TurboTurtle, adamruzicka, arif-ali and evgeni and removed request for adamruzicka and evgeni June 1, 2026 14:52
@pmoravec
Copy link
Copy Markdown
Contributor Author

pmoravec commented Jun 8, 2026

Kindly asking @arif-ali and/or @TurboTurtle for a review - I would like to fix this regression till the next release scheduled for the next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants