<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 10/30/10 5:44 PM, Dan Tenenbaum wrote:
<blockquote
cite="mid:AANLkTinbh_x+AqeW_WF6116SOM_=av0mczJbwmJ+zWoT@mail.gmail.com"
type="cite">OK,
<div><br>
</div>
<div>Farther along.</div>
<div>I made an additional patch to cluster.py, in load_plugins():</div>
<div><br>
</div>
<div>old code:</div>
<div>
<div> for plugin in plugins:</div>
<div><br>
</div>
<div>new code:</div>
<div>
<div> for key in plugins:</div>
<div> plugin = plugins[key]</div>
</div>
<div><br>
</div>
<div>That gets me past that trouble spot.</div>
<div><br>
</div>
<div>Then, though, when I try and run my plugin from the shell,
I get this:</div>
</div>
</blockquote>
<br>
You can also use the following approach to run your plugin: <br>
<br>
$ starcluster shell<br>
$ from shortread import ShortReadPlugin<br>
$ plugin = ShortReadPlugin(your, args, here)<br>
$ cl = cluster.get_cluster("mycluster", cfg)<br>
$ cl.load_receipt()<br>
$ plugin.run(cl.nodes, cl.master_node, cl.cluster_user,
cl.cluster_shell, cl.volumes)<br>
<br>
Alternatively this patch to run_plugin in cluster.py should work:<br>
<br>
<span class="Apple-style-span" style="border-collapse: separate;
color: rgb(0, 0, 0); font-family: Times; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
font-size: medium;"><span class="Apple-style-span"
style="font-family: helvetica,arial,freesans,clean,sans-serif;
font-size: 11px; line-height: 14px;">
<pre style="margin: 0px; padding: 0px; font: 12px/1.4em 'Bitstream Vera Sans Mono',Courier,monospace;"><div class="line" id="LC170" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"><span class="k" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">def</span> <span class="nf" style="margin: 0px; padding: 0px; line-height: 1.4em; color: rgb(153, 0, 0); font-weight: bold;">run_plugin</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">(</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">plugin_name</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">,</span> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cluster_tag</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">,</span> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cfg</span><span class="p" style="margin: 0px; padding: 0px; lin
e-height: 1.4em;">):</span></div><div class="line" id="LC171" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">ec2</span> <span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">=</span> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cfg</span><span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">.</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">get_easy_ec2</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">()</span></div><div class="line" id="LC172" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cl</span> <span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">=</span> <
span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">get_cluster</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">(</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cluster_tag</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">, cfg)</span></div><div class="line" id="LC173" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cl</span><span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">.</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">load_receipt</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">()</span></div><div class="line" id="LC174" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> <span class="n" style="margin: 0px; padding: 0px;
line-height: 1.4em;">plug</span> <span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">=</span> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cfg</span><span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">.</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">get_plugin</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">(</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">plugin_name</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">)</span></div><div class="line" id="LC175" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">plugins</span> <span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">=</span> <span class="p" style="margin: 0p
x; padding: 0px; line-height: 1.4em;">{}</span></div><div class="line" id="LC176" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">plugins</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">[</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">plugin_name</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">]</span> <span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">=</span> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">plug</span></div><div class="line" id="LC177" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">plugins</span> <span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">=
</span> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cl</span><span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">.</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">load_plugins</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">(</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">plugins</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">)</span></div><div class="line" id="LC178" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">master</span> <span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">=</span> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cl</span><span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight
: bold;">.</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">master_node</span></div><div class="line" id="LC179" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> <span class="k" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">for</span> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">p</span> <span class="ow" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">in</span> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">plugins</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">:</span></div><div class="line" id="LC181" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">plugins</span><span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-we
ight: bold;">.</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">get(p).run</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">(</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cl</span><span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">.</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">nodes</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">,</span> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cl</span><span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">.</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">master_node</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">,</span> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">
cl</span><span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">.</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cluster_user</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">,</span> <span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cl</span><span class="o" style="margin: 0px; padding: 0px; line-height: 1.4em; font-weight: bold;">.</span><span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">cluster_shell</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">,</span> cl.<span class="n" style="margin: 0px; padding: 0px; line-height: 1.4em;">volumes</span><span class="p" style="margin: 0px; padding: 0px; line-height: 1.4em;">)</span></div></pre>
</span></span><br>
<br>
~Justin<br>
</body>
</html>