Skip to content

Add switch for running Sonobuoy tests in parallel#1117

Open
mbuechse wants to merge 1 commit intomainfrom
feat/sonobuoy-parallel
Open

Add switch for running Sonobuoy tests in parallel#1117
mbuechse wants to merge 1 commit intomainfrom
feat/sonobuoy-parallel

Conversation

@mbuechse
Copy link
Contributor

No description provided.

Signed-off-by: Matthias Büchse <matthias.buechse@alasca.cloud>
@click.option("-r", "--result_dir_name", "result_dir_name", type=str, default="sonobuoy_results", help="directory name to store results at",)
@click.option("-c", "--check", "check_name", type=str, default="sonobuoy_executor", help="this MUST be the same name as the id in 'scs-compatible-kaas.yaml'",)
@click.option("--scs-sonobuoy-config", "scs_sonobuoy_config_yaml", type=click.Path(exists=True), default="kaas/sonobuoy-config.yaml", help="Configuration for Sonobuoy (yaml format)")
@click.option('--execution-mode', 'mode', type=click.Choice(('serial', 'parallel')), default='serial')
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@click.option('--execution-mode', 'mode', type=click.Choice(('serial', 'parallel')), default='serial')
@click.option('--execution-mode', 'mode', type=click.Choice(('serial', 'parallel')), default='parallel')

Copy link
Contributor

Choose a reason for hiding this comment

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

I would like to see the default being parallel. This is what I would expect to be working from services like K8s.

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 think we should vote on that in the SIG because it's a clear deviation from the status quo. If we decide to change the default, we need to do at the top of the file scs-compatible-kaas.yaml, because the default of the CLI tool is overriden by that.

Replace `SUBJECT` with an arbitrary, but meaningful subject name. Also, please note that the check
will always use the `current-context` of the kubeconfig and will fail if it isn't set.

Note: Sonobuoy checks (such as CNCF k8s conformance) are known to run for multiple hours (during which
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated to this line, but there is no PR description

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 do write a description if I find the heading isn't sufficient. What info would you say is missing specifically?

if mode == 'parallel':
# This is merely a shortcut to simplify commandline in scs-compatible-kaas.yaml
# For more on parallel execution, see https://github.com/vmware-tanzu/sonobuoy/issues/1435
args.append('--e2e-parallel=true')
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't quite understand how to variable replacement/insertion functions. I would have thought that if I enabled parallel execution with -a execution_mode=parallel then I would see --e2e-parallel=true in the debug log, but I only see --execution-mode parallel

DEBUG: running './kaas/sonobuoy_handler/run_sonobuoy.py run -k /home/ubuntu/aurora/admin.conf --scs-sonobuoy-config kaas/scs-sonobuoy-config.yaml -r ./sono-results-0219 -c \'kaas-networking-check\' -a \'--e2e-focus "NetworkPolicy"\' --execution-mode parallel'...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For run_sonobuoy.py we have a dedicated switch for the execution mode now so we don't need to use parameter passthrough to Sonobuoy any more. What you see in your quote is the command-line for run_sonobuoy.py, not the commandline for sonobuoy -- the latter would show --e2e-parallel=true (not sure if it's ever logged though).

spec['var_defaults'] = defaults


def load_spec(document: dict) -> dict:
Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I can tell, there are no tests yet for this tool. I would at least add some tests to make sure that the configured call, e.g.

./scs-compliance-check.py --debug -v -a kubeconfig=/home/ubuntu/aurora/admin.conf -a subject_root=. -s SUBJECT -o report.yaml -a execution_mode=parallel scs-compatible-kaas.yaml

results in the appropriate cmd call.

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 am not going to write tests for this tool at the current state.

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.

2 participants