Plugins coding guide

Asked by softCloud

I'd like to know how my Python subroutines should format their output so that it is properly processed but I do not see that in the current documentation for plugins. Also, what is the recommended error-handling other than throwing exceptions? The current guide is very thin on implementation details. In this case, I'm writing code that is querying the host OS directly.

Question information

Language:
English Edit question
Status:
Solved
For:
Rally Edit question
Assignee:
No assignee Edit question
Solved by:
Alexander Maretskiy
Solved:
Last query:
Last reply:
Revision history for this message
Yair Fried (yfried) said :
#1

I'm not sure what you are asking. sorry.
What kind of plugin are you writing (scenario, sla, context, runner)? what kind of output do you wish to generate?
What's wrong with throwing exceptions?
My suggestion is that you look at the existing plugins and try to follow their example.

Also, are you trying to query the Openstack nodes OperatingSystem? You shouldn't assume Rally is running on an Openstack node. it can (should) run on a remote machine.

Revision history for this message
softCloud (snuser1) said :
#2

I'm interested in adding multiple scenarios. Consider for example launching two VMs, creating a private network, and then measuring the bandwidth between them, seeing if it meets a threshold value. I was looking for a guide on how the plugin should format and provide that data to Rally so that it can be properly handled. There are also simple yes/no test cases I want in plugins (is SR-IOV supported).

No problem with throwing exceptions, just want to understand the proper error-handling for plugins as well.

Revision history for this message
Yair Fried (yfried) said :
#3

AFAIK, scenarios only measure time using the atomic-action objects, and at the moment that's the only format that rally accepts.
Hoever, boot-runcommand-delete scenario, also runs user-given scripts on VMs and displays script output (assuming it's in JSON format)

So, IMO, you have 2 options:
Quick and dirty - measure the BW in an external script (python/bash) and return it via JSON
Smart and constructive - suggest to Rally team (via mailing list, spec, or IRC) a way to extend Rally to accept more data types other than timers.

For the details, please take a look at existing code.

Revision history for this message
Best Alexander Maretskiy (maretskiy) said :
#4

For now, the only measurement from-the-box is timings for atomic actions.
Another measurements do not have implementations - I believe they will be added in future.

As option, there is a possibility to run arbitrary script on VMs and process JSON results:

Example for input task:
https://github.com/openstack/rally/blob/master/samples/tasks/scenarios/vm/boot-runcommand-delete.json

Example for output:
http://logs.openstack.org/31/178731/2/check/gate-rally-dsvm-rally/4acd0ea/rally-plot/results.html.gz#/VMTasks.boot_runcommand_delete/output

Revision history for this message
softCloud (snuser1) said :
#5

Thanks Alexander Maretskiy, that solved my question.

Revision history for this message
softCloud (snuser1) said :
#6

Yair, also thanks for your input, which adds to what Alexander posted.