<br><br><div class="gmail_quote">On Sat, Oct 30, 2010 at 3:45 PM, Justin Riley <span dir="ltr">&lt;<a href="mailto:jtriley@mit.edu">jtriley@mit.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


  
    
  
  <div bgcolor="#ffffff" text="#000000"><div class="im">
    On 10/30/10 5:44 PM, Dan Tenenbaum wrote:
    <blockquote 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></div>
    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(&quot;mycluster&quot;, 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 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;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="font-family:helvetica,arial,freesans,clean,sans-serif;font-size:11px;line-height:14px">
        <pre style="margin:0px;padding:0px"><div class="im"><div style="margin:0px;padding:0px 0px 0px 1em;line-height:1.4em"><span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">def</span> <span style="margin:0px;padding:0px;line-height:1.4em;color:rgb(153, 0, 0);font-weight:bold">run_plugin</span><span style="margin:0px;padding:0px;line-height:1.4em">(</span><span style="margin:0px;padding:0px;line-height:1.4em">plugin_name</span><span style="margin:0px;padding:0px;line-height:1.4em">,</span> <span style="margin:0px;padding:0px;line-height:1.4em">cluster_tag</span><span style="margin:0px;padding:0px;line-height:1.4em">,</span> <span style="margin:0px;padding:0px;line-height:1.4em">cfg</span><span style="margin:0px;padding:0px">):</span></div>
</div><div class="im"><div style="margin:0px;padding:0px 0px 0px 1em;line-height:1.4em">    <span style="margin:0px;padding:0px;line-height:1.4em">ec2</span> <span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">=</span> <span style="margin:0px;padding:0px;line-height:1.4em">cfg</span><span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">.</span><span style="margin:0px;padding:0px;line-height:1.4em">get_easy_ec2</span><span style="margin:0px;padding:0px;line-height:1.4em">()</span></div>
</div><div style="margin:0px;padding:0px 0px 0px 1em;line-height:1.4em">    <span style="margin:0px;padding:0px;line-height:1.4em">cl</span> <span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">=</span> &lt;
span class=&quot;n&quot; style=&quot;margin: 0px; padding: 0px; line-height: 1.4em;&quot;&gt;get_cluster</div></pre></span><span style="margin:0px;padding:0px;line-height:1.4em">(</span><span style="margin:0px;padding:0px;line-height:1.4em">cluster_tag</span><span style="margin:0px;padding:0px;line-height:1.4em">, cfg)</span></span></div>
<div style="margin:0px;padding:0px 0px 0px 1em;line-height:1.4em">    <span style="margin:0px;padding:0px;line-height:1.4em">cl</span><span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">.</span><span style="margin:0px;padding:0px;line-height:1.4em">load_receipt</span><span style="margin:0px;padding:0px;line-height:1.4em">()</span></div>
<div class="im"><div style="margin:0px;padding:0px 0px 0px 1em;line-height:1.4em">    <span style="margin:0px;padding:0px;line-height:1.4em">plug</span> <span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">=</span> <span style="margin:0px;padding:0px;line-height:1.4em">cfg</span><span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">.</span><span style="margin:0px;padding:0px;line-height:1.4em">get_plugin</span><span style="margin:0px;padding:0px;line-height:1.4em">(</span><span style="margin:0px;padding:0px;line-height:1.4em">plugin_name</span><span style="margin:0px;padding:0px;line-height:1.4em">)</span></div>
</div><div style="margin:0px;padding:0px 0px 0px 1em;line-height:1.4em">    <span style="margin:0px;padding:0px;line-height:1.4em">plugins</span> <span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">=</span> <span style="margin:0p x;padding:0px;line-height:1.4em">{}</span></div>
<div style="margin:0px;padding:0px 0px 0px 1em;line-height:1.4em">    <span style="margin:0px;padding:0px;line-height:1.4em">plugins</span><span style="margin:0px;padding:0px;line-height:1.4em">[</span><span style="margin:0px;padding:0px;line-height:1.4em">plugin_name</span><span style="margin:0px;padding:0px;line-height:1.4em">]</span> <span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">=</span> <span style="margin:0px;padding:0px;line-height:1.4em">plug</span></div>
<div class="im"><div style="margin:0px;padding:0px 0px 0px 1em;line-height:1.4em">    <span style="margin:0px;padding:0px;line-height:1.4em">plugins</span> <span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">=
</span> <span style="margin:0px;padding:0px;line-height:1.4em">cl</span><span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">.</span><span style="margin:0px;padding:0px;line-height:1.4em">load_plugins</span><span style="margin:0px;padding:0px;line-height:1.4em">(</span><span style="margin:0px;padding:0px;line-height:1.4em">plugins</span><span style="margin:0px;padding:0px;line-height:1.4em">)</span></div>
</div><div style="margin:0px;padding:0px 0px 0px 1em;line-height:1.4em">    <span style="margin:0px;padding:0px;line-height:1.4em">master</span> <span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">=</span> <span style="margin:0px;padding:0px;line-height:1.4em">cl</span><span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">.</span><span style="margin:0px;padding:0px;line-height:1.4em">master_node</span></div>
<div style="margin:0px;padding:0px 0px 0px 1em;line-height:1.4em">    <span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">for</span> <span style="margin:0px;padding:0px;line-height:1.4em">p</span> <span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">in</span> <span style="margin:0px;padding:0px;line-height:1.4em">plugins</span><span style="margin:0px;padding:0px;line-height:1.4em">:</span></div>
<div style="margin:0px;padding:0px 0px 0px 1em;line-height:1.4em">        <span style="margin:0px;padding:0px;line-height:1.4em">plugins</span><span style="margin:0px;padding:0px;line-height:1.4em">.</span><span style="margin:0px;padding:0px;line-height:1.4em">get(p).run</span><span style="margin:0px;padding:0px;line-height:1.4em">(</span><span style="margin:0px;padding:0px;line-height:1.4em">cl</span><span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">.</span><span style="margin:0px;padding:0px;line-height:1.4em">nodes</span><span style="margin:0px;padding:0px;line-height:1.4em">,</span> <span style="margin:0px;padding:0px;line-height:1.4em">cl</span><span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">.</span><span style="margin:0px;padding:0px;line-height:1.4em">master_node</span><span style="margin:0px;padding:0px;line-height:1.4em">,</span> <span style="margin:0px;padding:0px;line-height:1.4em">
                           cl</span><span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">.</span><span style="margin:0px;padding:0px;line-height:1.4em">cluster_user</span><span style="margin:0px;padding:0px;line-height:1.4em">,</span> <span style="margin:0px;padding:0px;line-height:1.4em">cl</span><span style="margin:0px;padding:0px;line-height:1.4em;font-weight:bold">.</span><span style="margin:0px;padding:0px;line-height:1.4em">cluster_shell</span><span style="margin:0px;padding:0px;line-height:1.4em">,</span> cl.<span style="margin:0px;padding:0px;line-height:1.4em">volumes</span><span style="margin:0px;padding:0px;line-height:1.4em">)</span></div>

      <br><font class="Apple-style-span" color="#888888"><br></font></blockquote><div><br></div><div>Great minds think alike. ;)</div><div>Dan</div><div> </div></div>