Skip to content

Conversation

@jmencak
Copy link
Contributor

@jmencak jmencak commented Apr 12, 2022

TuneD profiles are extracted into all operands on every Tuned CR change. After their deletion in the CR, they were not removed from the operand's filesystems. In the past, it was not necessary to remove these profiles. This changed with the introduction of conditional profile loading into TuneD.

As NTO's Cloud-specific profiles rely on conditional profile loading, this change makes sure all TuneD profiles the current recommended profile depends on are removed from /etc/tuned/<profile>/ once the same TuneD is no longer defined in any of Tuned CRs.

Resolves rhbz#2074062.

@openshift-ci openshift-ci bot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Apr 12, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 12, 2022

@jmencak: This pull request references Bugzilla bug 2074062, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.11.0) matches configured target release for branch (4.11.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (liqcui@redhat.com), skipping review request.

In response to this:

Bug 2074062: Remove TuneD profiles no longer used

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/test-infra repository.

@jmencak
Copy link
Contributor Author

jmencak commented Apr 12, 2022

/assign @dagrayvid

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 12, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jmencak

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 Apr 12, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 12, 2022

@jmencak: This pull request references Bugzilla bug 2074062, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.11.0) matches configured target release for branch (4.11.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (liqcui@redhat.com), skipping review request.

In response to this:

Bug 2074062: Remove TuneD profiles no longer used

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/test-infra repository.

1 similar comment
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 12, 2022

@jmencak: This pull request references Bugzilla bug 2074062, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.11.0) matches configured target release for branch (4.11.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (liqcui@redhat.com), skipping review request.

In response to this:

Bug 2074062: Remove TuneD profiles no longer used

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/test-infra repository.

@dagrayvid
Copy link
Contributor

/retest

Comment on lines 441 to 448
change, extracted, recommendedProfileDeps, err := profilesExtract(profiles)
if err != nil {
return change, err
}

// Deal with TuneD profiles absent from Tuned CRs, but still present in /etc/tuned/<profile>/ the recommended profile depends on.
for profile := range recommendedProfileDeps {
if !extracted[profile] {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @jmencak. Overall the code makes sense, just one idea for improvement:

I find the name of extracted a bit confusing here because the "problem" is that the profile IS extracted (or was), and because it was extracted, we need to delete it. However, we are checking if it is !extracted and if !extracted, we delete the corresponding profile dir.

I think renaming the variable to something like newlyExtracted or extractedNew might clarify things.

Similarly the name recommendedProfileDeps sounds like the list of profiles that we would need to keep in /etc/tuned/, but it refers to the current (soon to be previous?) recommended-profile-dependencies. Maybe there is a better name we can come up with? I'm probably okay with keeping this as-is, if we make it clear that extracted is referring to the latest (future) needed dependencies.

Hope that makes sense, open to discussing further.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the suggestions, David. I've replaced s/extracted/extractedNew/ . As for recommendedProfileDeps I do not have a better name. :/ It is one of the hardest problems in computer science. :)

TuneD profiles are extracted into all operands on every Tuned CR change.
After their deletion in the CR, they were not removed from the operand's
filesystems.  In the past, it was not necessary to remove these
profiles.  This changed with the introduction of conditional profile
loading into TuneD.

As NTO's Cloud-specific profiles rely on conditional profile loading,
this change makes sure all TuneD profiles the current recommended
profile depends on are removed from /etc/tuned/<profile>/ once the same
TuneD <profile> is no longer defined in any of Tuned CRs.

Resolves rhbz#2074062.
@dagrayvid
Copy link
Contributor

Thanks for the change.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 13, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 13, 2022

@jmencak: 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/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 5065565 into openshift:master Apr 13, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 13, 2022

@jmencak: All pull requests linked via external trackers have merged:

Bugzilla bug 2074062 has been moved to the MODIFIED state.

In response to this:

Bug 2074062: Remove TuneD profiles no longer used

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/test-infra repository.

@jmencak jmencak deleted the 4.11-bz2074062 branch April 13, 2022 16:49
IlyaTyomkin pushed a commit to IlyaTyomkin/cluster-node-tuning-operator that referenced this pull request May 23, 2023
TuneD profiles are extracted into all operands on every Tuned CR change.
After their deletion in the CR, they were not removed from the operand's
filesystems.  In the past, it was not necessary to remove these
profiles.  This changed with the introduction of conditional profile
loading into TuneD.

As NTO's Cloud-specific profiles rely on conditional profile loading,
this change makes sure all TuneD profiles the current recommended
profile depends on are removed from /etc/tuned/<profile>/ once the same
TuneD <profile> is no longer defined in any of Tuned CRs.

Resolves rhbz#2074062.

Co-authored-by: Jiri Mencak <jmencak@users.noreply.github.com>
IlyaTyomkin pushed a commit to IlyaTyomkin/cluster-node-tuning-operator that referenced this pull request Jun 13, 2023
TuneD profiles are extracted into all operands on every Tuned CR change.
After their deletion in the CR, they were not removed from the operand's
filesystems.  In the past, it was not necessary to remove these
profiles.  This changed with the introduction of conditional profile
loading into TuneD.

As NTO's Cloud-specific profiles rely on conditional profile loading,
this change makes sure all TuneD profiles the current recommended
profile depends on are removed from /etc/tuned/<profile>/ once the same
TuneD <profile> is no longer defined in any of Tuned CRs.

Resolves rhbz#2074062.

Co-authored-by: Jiri Mencak <jmencak@users.noreply.github.com>
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. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants