<font face="verdana" size="2"><p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;">Hi all,<br /> <br />There seem to be varying ideas about the worker interface design for our blueprint <span style="line-height: 0px;"><a href="https://blueprints.launchpad.net/openstack/?searchtext=async-glance-workers">async-glance-workers</a>. Fei and Zhi already </span>have<span style="font-size: 10pt; line-height: 0px;"> posted detailed comments on </span><a style="font-size: 10pt; font-family: Arial, Helvetica, Verdana, sans-serif;" href="https://review.openstack.org/#/c/46117/21">https://review.openstack.org/#/c/46117/21</a><span style="font-size: 10pt;"> (PS 21). Venkatesh, Alex and I have worked on it at varying periods of times and brainstormed different ideas as well. I know Zhi is also, very interested in the design and making it as configurable as possible.</span></p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;"> </p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;">Recently, a patch has been uploaded to <a style="font-family: Arial, Helvetica, Verdana, sans-serif;" href="https://review.openstack.org/#/c/46117">https://review.openstack.org/#/c/46117</a> giving a direction to the interface we'r hoping to achieve. The following are some of the high level pros and cons to this approach which we would like to discuss in the upcoming sync up(s) on #openstack-glance :-</p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;"> </p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;">Pros:</p>
<ul>
<li><span style="font-family: verdana;">Establishes clear distinction between an executor and a script (or script package)</span>
<ul>
<li><span style="font-family: verdana;">eg. executor can be of type eventlet or rpc and script  (or script package) can be of type import/export/clone</span></li>
</ul>
</li>
<li><span style="font-family: verdana;">Establishes a good understanding of the contract between Glance and script packages</span></li>
<li><span style="font-family: verdana;">Gives the deployer the ability to keep their script packages as simple as possible or even add complexity to them if needed without marrying such script packages with Glance code.</span></li>
<li><span style="font-family: verdana;">A standard way of invoking asynchronous tasks via Glance.</span></li>
</ul>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;">Cons:</p>
<ul>
<li><span style="font-family: verdana;">Not all script packages would be supported by Glance.</span></li>
<li><span style="font-family: verdana;">There would be no modules which include classes like TaskImportScript, TaskExportScript within Glance domain logic- if they are needed for some sort of inheritance. However, the script packages themselves can have them and be as extensible as it gets.</span></li>
</ul>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;"><span style="font-size: 10pt;">(Trying to use the word "script packages" as I'm trying to help understand that they would even be configurable using stevedore and be something similar to the example package given </span><a style="font-size: 10pt;" href="https://github.com/dreamhost/stevedore/tree/master/stevedore/example">here</a><span style="font-size: 10pt;">. If using stevedore, they would have their own setup file and namespace defined.) </span></p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;"> </p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;">All the script_packages would be having a standard module say <span style="font-size: 10pt;">named as "main" - which Glance task executor calls and initiates the execution. ("main" <span style="text-decoration: underline;">can be</span> analogous to the python </span><a style="font-size: 10pt;" href="https://github.com/dreamhost/stevedore/blob/master/stevedore/example/load_as_extension.py">script</a><span style="font-size: 10pt;"> given in the above example or can even be a simple script which runs the task)  Glance provides access to it's code on contractual basis - viz. the params that would be passed in are defined at the executor level. For example - in case of import we seem to need db_api, store_api, notifier_api, task_id, req.context. These can be used to invoke calls from within Glance modules like sqlalchemy/api or notifier/api etc. From this point on, it's responsibility of the script to achieve the result it needs. This design seem to fit in the requirements which many people have posted in the review comments without adding too many configuration options within glance; keeping it maintainable as well.</span></p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;"> </p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;">Another idea about the interface design which Zhi layed-out is linked below. I have browsed through it however, am not completely familiar with the design's end goal. Would like to do a differential analysis sometime soon.</p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;"><a style="font-family: Arial, Helvetica, Verdana, sans-serif;" href="http://paste.openstack.org/show/48644/">http://paste.openstack.org/show/48644/</a></p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;"> </p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;"><span style="font-size: 10pt;">Your opinions are very welcome!</span></p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;"> </p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;"><span style="font-size: 10pt;">If you prefer, please try to sync up with us on the #openstack-glance channel while we try to fit the design as per the use cases.</span></p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;">Thanks,</p>
<p style="margin:0;padding:0;font-family: verdana; font-size: 10pt;">-Nikhil</p>
<!--WM_COMPOSE_SIGNATURE_END--></font>