Skip to content

NO-JIRA: performance profile: internal cleanup #1359

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

Merged

Conversation

ffromani
Copy link
Contributor

@ffromani ffromani commented Jul 7, 2025

internal cleanups, code movement and minimal refactoring in preparation for the autosizing feature (#1349)

No intended changes in behavior.

The switch to the Alert mechanism is mostly meant to remove our remaining dependency from logrus.

@openshift-ci openshift-ci bot requested review from jmencak and swatisehgal July 7, 2025 13:52
Copy link
Contributor

openshift-ci bot commented Jul 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ffromani

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 7, 2025
@ffromani
Copy link
Contributor Author

ffromani commented Jul 7, 2025

/cc @Tal-or
/cc @shajmakh

@openshift-ci openshift-ci bot requested review from shajmakh and Tal-or July 7, 2025 13:58
@ffromani
Copy link
Contributor Author

ffromani commented Jul 7, 2025

/retest-required

1 similar comment
@ffromani
Copy link
Contributor Author

ffromani commented Jul 7, 2025

/retest-required

ffromani added 5 commits July 8, 2025 10:27
reorganize the current helper.go dissolving it into
specific subpackages. The goal is tstreamline the
code layout without changes in behavior.

Signed-off-by: Francesco Romani <[email protected]>
the `cmd/pkg` layout is awkward. Canonically:
- code used only by a tool should sit in `internal/`
- code which is/can be exported should sit in `pkg`.

However, in case of nontrivial command line utilities,
it's a widespread practice to have `pkg/cmd` (or `pkg/commands`) trees.
This enable third party utilities to easily embed other utilities
maximizing code reuse.

We streamline the code layout with trivial code
movements - no intended changes of behavior.

The net result is now `cmd/performance-profile-creator` is now
minified, and holds only the entry point source code file.

Signed-off-by: Francesco Romani <[email protected]>
extract code which deals with mustgather or ghw in their
own source files. Trivial code movement with no changes in behavior.

Signed-off-by: Francesco Romani <[email protected]>
- add pure text output command. By default (and it's very hard to
  change, if we ever should) log messages go on stderr. We want the
  output on stdout. Added flag `--text` to enable it
- internal cleanup and code reorganization. In log mode, log all the
  message in one go, which is easier to manage.

No intended change in behavior.

Signed-off-by: Francesco Romani <[email protected]>
We used the `logrus` package internally, but minimally
and pretty much only to notify processing status to the user.
This code was thus the only remaining consumer of that package,
which we don't really need.

Add a neutral (nor log, nor warning) minimal abstraction `Alert`,
similar in spirit to `ghw`, to be used when we need to notify the
user about processing status.

Make the backend easy to replace to make integration of this code
easier. We don't see this happening, but the extra cost is negligible.

Remove the direct dependency to `logrus`.
Note we still have quite many indirect dependencies pulling it in.

Signed-off-by: Francesco Romani <[email protected]>
@ffromani ffromani force-pushed the perfprof-creator-cleanup branch from 310c413 to 405c966 Compare July 8, 2025 08:32
@ffromani
Copy link
Contributor Author

ffromani commented Jul 8, 2025

/retest-required

@ffromani
Copy link
Contributor Author

ffromani commented Jul 8, 2025

/test okd-scos-e2e-aws-ovn

Copy link
Contributor

openshift-ci bot commented Jul 8, 2025

@ffromani: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@jmencak
Copy link
Contributor

jmencak commented Jul 9, 2025

Thank you for the PR. Any vendored dependency removal is welcome. The changes look fine to me, even at the expense of issuing an extra "\n" in dumpClusterInfo().

/lgtm
from my perspective, not adding hold for other reviewers to comment -- using the (in)valid Jira reference for that.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 9, 2025
@ffromani
Copy link
Contributor Author

ffromani commented Jul 9, 2025

Thank you for the PR. Any vendored dependency removal is welcome. The changes look fine to me, even at the expense of issuing an extra "\n" in dumpClusterInfo().

/lgtm from my perspective, not adding hold for other reviewers to comment -- using the (in)valid Jira reference for that.

Thanks Jiri! Be aware that my #1349 wants to add back another dependency though. But the balance should still be positive.

@ffromani
Copy link
Contributor Author

ffromani commented Jul 9, 2025

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 9, 2025
@ffromani ffromani changed the title performance profile: internal cleanup No-JIRA: performance profile: internal cleanup Jul 9, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 9, 2025
@openshift-ci-robot
Copy link
Contributor

@ffromani: This pull request explicitly references no jira issue.

In response to this:

internal cleanups, code movement and minimal refactoring in preparation for the autosizing feature (#1349)

No intended changes in behavior.

The switch to the Alert mechanism is mostly meant to remove our remaining dependency from logrus.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@ffromani ffromani changed the title No-JIRA: performance profile: internal cleanup NO-JIRA: performance profile: internal cleanup Jul 9, 2025
@ffromani
Copy link
Contributor Author

ffromani commented Jul 9, 2025

/hold cancel

I'll own and fix any regression. I asked previously and the output text format is not part of the API/stability guarantee, so we should be good

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 9, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 4bee682 into openshift:main Jul 9, 2025
18 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: cluster-node-tuning-operator
This PR has been included in build cluster-node-tuning-operator-container-v4.20.0-202507091614.p0.g4bee682.assembly.stream.el9.
All builds following this will include this PR.

@ffromani ffromani deleted the perfprof-creator-cleanup branch July 14, 2025 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants