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

Cockpit pcp python follow up #21056

Merged
merged 4 commits into from
Oct 2, 2024

Conversation

jelly
Copy link
Member

@jelly jelly commented Sep 30, 2024

Throwing this at CI, this still needs:

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Thanks! I'm really excited about this, it'll solve some long-standing downstream packaging trouble.

tools/debian/rules Show resolved Hide resolved
tools/debian/control Show resolved Hide resolved
tools/cockpit.spec Show resolved Hide resolved
pkg/metrics/metrics.jsx Outdated Show resolved Hide resolved
pkg/metrics/metrics.jsx Outdated Show resolved Hide resolved
test/verify/check-client Outdated Show resolved Hide resolved
@jelly jelly force-pushed the cockpit-pcp-python-follow-up branch 3 times, most recently from 8fbc4a0 to e6d0ca9 Compare September 30, 2024 16:06
tools/arch/PKGBUILD Outdated Show resolved Hide resolved
test/verify/check-client Outdated Show resolved Hide resolved
The PCP functionality is now part of the Python bridge which replaces
the C cockpit-pcp binary.
We no longer run the PCP bridge.
@jelly jelly force-pushed the cockpit-pcp-python-follow-up branch 2 times, most recently from e1f5a57 to 4447e3f Compare October 1, 2024 11:41
@jelly jelly marked this pull request as ready for review October 1, 2024 11:48
@jelly jelly force-pushed the cockpit-pcp-python-follow-up branch from 4447e3f to 338882d Compare October 1, 2024 12:35
@jelly jelly requested a review from martinpitt October 1, 2024 13:05
pkg/metrics/metrics.jsx Outdated Show resolved Hide resolved
tools/arch/PKGBUILD Outdated Show resolved Hide resolved
test/verify/check-metrics Show resolved Hide resolved
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Thanks! At least to me, the python3-pcp vs. pcp handling is still rather muddy -- I think if you do this deliberately, I'd need a high-level write-up which parts look at pcp and the service, and which parts look at the py module, and why they have to disagree.

tools/cockpit.spec Show resolved Hide resolved
tools/debian/control Show resolved Hide resolved
pkg/metrics/metrics.jsx Show resolved Hide resolved
pkg/metrics/metrics.jsx Outdated Show resolved Hide resolved
pkg/metrics/metrics.jsx Show resolved Hide resolved
pkg/metrics/metrics.jsx Outdated Show resolved Hide resolved
src/cockpit/channels/pcp.py Show resolved Hide resolved
test/verify/check-client Show resolved Hide resolved
test/verify/check-client Show resolved Hide resolved
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

I re-reviewed this from scratch after the previous discussions about the weird dependency direction in Fedora.

pkg/metrics/metrics.jsx Show resolved Hide resolved
const os_release = await read_os_release();
const pcp_packages = ["pcp"];

// PCP contains the Python module on Arch Linux, for all other distro's it is split up.
Copy link
Member

Choose a reason for hiding this comment

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

For our future selves: Please document why we have to explicitly install both: That on Fedora, python3-pcp depends on pcp, and on Debian pcp depends on python3-pcp.

pkg/metrics/metrics.jsx Outdated Show resolved Hide resolved
@@ -1789,8 +1805,10 @@ class MetricsHistory extends React.Component {
this.setState({
loading: false,
metricsAvailable: false,
isPythonPCPInstalled: message?.message !== "python3-pcp not installed",
Copy link
Member

Choose a reason for hiding this comment

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

Please do message.problem === "not-supported" ? That's much better than this human string comparison. Also, your mock hack just does raise ChannelError('not-supported') without a message.

(The ? here is unnecessary -- you already asserted that message.problem exists)

Copy link
Member Author

Choose a reason for hiding this comment

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

No, the mock is for a different scenario.

pkg/metrics/metrics.jsx Outdated Show resolved Hide resolved
pkg/metrics/metrics.jsx Outdated Show resolved Hide resolved
test/verify/check-client Outdated Show resolved Hide resolved
The python PCP bridge implementation is now the default in Cockpit and
also supports the beiboot scenario as we can install pcp (and
python3-pcp if required) as it does not pull in any cockpit* package)

We depend on python3-pcp explicitly as Fedora's pcp package does not
pull it in while Debian does.
This could likely already work fine on Arch as cockpit-pcp was split but
our tests weren't adjusted.
@jelly jelly force-pushed the cockpit-pcp-python-follow-up branch from 338882d to c225f9d Compare October 2, 2024 09:23
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

I really dislike the human error string comparison instead of the problem code, but I'm ok with that being a follow-up. Thanks!

@martinpitt martinpitt mentioned this pull request Oct 2, 2024
1 task
@jelly jelly merged commit d2e1f5d into cockpit-project:main Oct 2, 2024
88 checks passed
@jelly jelly deleted the cockpit-pcp-python-follow-up branch October 2, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants