Skip to content

Comments

Performance profile render command integration#324

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
MarSik:pao-render
Apr 13, 2022
Merged

Performance profile render command integration#324
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
MarSik:pao-render

Conversation

@MarSik
Copy link
Contributor

@MarSik MarSik commented Mar 24, 2022

The original PAO code supports an offline render mode where it reads the PerformanceProfile manifest from a file and generates all the outputs as files. This is useful for Day 0 and GitOps based installations.

This PR is work in progress and depends on #322

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 24, 2022
@MarSik
Copy link
Contributor Author

MarSik commented Mar 24, 2022

@jmencak Hi, this PR introduces cobra to the main.go file. PAO has the dependency anyway, but I changed the way flags are parsed. Would this approach be acceptable?

The render command is then executed as

podman run -it cluster-node-tuning-operator:4.11 render --help

When no subcommand is used, NTO starts as usual.

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 28, 2022
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 28, 2022
Copy link
Contributor

@jmencak jmencak left a comment

Choose a reason for hiding this comment

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

Thank you for the PR. I think this approach is acceptable even though I'm far from thrilled by the cobra usage. But as you say, we already have the dependency. The PR needs cleaning though:

  • Can we have back the help for both cluster-node-tuning-operator and openshift-tuned that would show it can be used with the -v options?
  • -v options should work!
  • Also, some comments about the usage for openshift-tuned would be welcome as you already added them for cluster-node-tuning-operator

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 30, 2022
@MarSik
Copy link
Contributor Author

MarSik commented Mar 31, 2022

/retest

@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 7, 2022
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 7, 2022
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 7, 2022
@MarSik
Copy link
Contributor Author

MarSik commented Apr 7, 2022

/retest

@MarSik MarSik changed the title WIP Performance profile render command integration Performance profile render command integration Apr 7, 2022
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 7, 2022
Copy link
Contributor

@jmencak jmencak left a comment

Choose a reason for hiding this comment

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

Thank you for the PR and the changes. While the e2e tests pass, the -v=<number> option for the operator itself doesn't work. This needs to be fixed prior the merge.

$ ./cluster-node-tuning-operator -v=2
Error: invalid argument "2" for "-v, --version" flag: strconv.ParseBool: parsing "2": invalid syntax
Usage:
  cluster-node-tuning-operator [flags]
  cluster-node-tuning-operator [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  help        Help about any command
  render      Render performance-addon-operator manifests

Flags:
      --enable-leader-election   Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager. (default true)
  -h, --help                     help for cluster-node-tuning-operator
  -v, --version                  Show program version and exit.

Use "cluster-node-tuning-operator [command] --help" for more information about a command.

operand:
debug: false
tunedConfig:
reapply_sysctl: null
Copy link
Contributor

Choose a reason for hiding this comment

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

reapply_sysctl is a Boolean, why does it have null value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You tell me :) This is the value the test is seeing, I only updated the expected value for it to pass as PAO does not care about this part.

Copy link
Contributor

Choose a reason for hiding this comment

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

I might tell you, but I have no idea about the test you're talking about. :) I guess it is null because tunedConfig was not specified at all? Good to know it was manually updated by you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the expected value of Tuned when PerfProfile is processed by the render stage. If you check couple of lines above this, we mostly care about the generated tuned profile. The rest is just what NTO structures serialize to by default.

done

.PHONY: test-e2e-local
test-e2e-local:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make the make target more specific as in

performance-profile-creator-tests: build-performance-profile-creator
?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was wondering if we can have more tests that are e2e in nature, but do not require a running cluster.. but the name is not important obviously.

Copy link
Contributor

Choose a reason for hiding this comment

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

if we are planing to add a render lane in openshift/release then it should correspond to the make target

Copy link
Contributor

Choose a reason for hiding this comment

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

@MarSik we currently have https://github.com/openshift/cluster-node-tuning-operator/blob/master/hack/run-render-command-functests.sh under this repo. If this target comes to replace the invocation of this script like we did in PAO then we can remove the script (although the script contains some additional decorations)

@yanirq
Copy link
Contributor

yanirq commented Apr 11, 2022

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 11, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MarSik

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

The pull request process is described here

Details 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 11, 2022
Build and invoke the binary
```
build/_output/bin/performance-addon-operators render (FIXME)
_output/cluster-node-tuning-operator render (FIXME)
Copy link
Contributor

Choose a reason for hiding this comment

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

we can remove the (FIXME) part, I placed it specifically for this PR

Copy link
Contributor

@jmencak jmencak left a comment

Choose a reason for hiding this comment

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

The -v options seem to work now. Once the nits:

  • (FIXME)
  • s/tuned/TuneD/

are addressed and the commits squashed, this is good to go from my side.

This integrates the render mode for offline processing of
the PerformanceProfile. Part of this change is the move
of command line processing code to the cobra library.
@MarSik
Copy link
Contributor Author

MarSik commented Apr 12, 2022

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 12, 2022

@MarSik: all tests passed!

Full PR test history. Your PR dashboard.

Details

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.

@MarSik
Copy link
Contributor Author

MarSik commented Apr 13, 2022

@yanirq @jmencak It seems all is ready for the final check now.

@yanirq
Copy link
Contributor

yanirq commented Apr 13, 2022

looks good to me.
I will add a CI lane for "e2e-no-cluster" under openshift/release.
@jmencak feel free to give the final ack

@jmencak
Copy link
Contributor

jmencak commented Apr 13, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 13, 2022
@openshift-merge-robot openshift-merge-robot merged commit 0352d62 into openshift:master Apr 13, 2022
IlyaTyomkin pushed a commit to IlyaTyomkin/cluster-node-tuning-operator that referenced this pull request May 23, 2023
This integrates the render mode for offline processing of
the PerformanceProfile. Part of this change is the move
of command line processing code to the cobra library.
IlyaTyomkin pushed a commit to IlyaTyomkin/cluster-node-tuning-operator that referenced this pull request Jun 13, 2023
This integrates the render mode for offline processing of
the PerformanceProfile. Part of this change is the move
of command line processing code to the cobra library.
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. 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