<div dir="ltr"><div><div><div>Juju run is currently a way to execute arbitrary shell code on machines inside of a hook context. Actions are running charm-defined shell code inside a hook context. There is a certain amount of overlap between the two.<br>
<br></div>As I understand it, juju-run actually works by having the juju client talk to the API server and request some actions, which the API server then spawns an SSH connection to each machine and runs those commands synchronously. (I'm not sure if it runs them all in parallel, but the client sits waiting for the API server to return from the original request with the results of the SSH sessions.)<br>
<br></div>I'm personally a bigger fan of modeling Actions as being run directly by the Uniter agent (instead of as spawned from SSH from the API server).<br><br></div>I think Gustavo's outline fits well with that, and is a reason to *not* use the juju-run mechanism.<br>
<br>John<br>=:-><br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 27, 2014 at 6:40 AM, Gustavo Niemeyer <span dir="ltr"><<a href="mailto:gustavo.niemeyer@canonical.com" target="_blank">gustavo.niemeyer@canonical.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey Bodie,<br>
<div class=""><br>
On Wed, Mar 26, 2014 at 9:22 PM, James Solomon <<a href="mailto:binary132@gmail.com">binary132@gmail.com</a>> wrote:<br>
> Gustavo said we should start with charm/config.go, but as I'm looking<br>
> through /cmd/juju/run.go, it looks almost like Actions should be implemented<br>
> there.  I asked about this in freenode #juju-dev and dimitern confirmed what<br>
> I was thinking (but again, I'm new to the project) -- this almost seems like<br>
> it should be an API feature.<br>
</div>(...)<br>
<div class="">> Gustavo's indication was that we should be implementing this through hooks,<br>
> so I'm at a loss here.  I agree with him that this is probably the best<br>
> place to start.  Any input is welcome.  :)<br>
<br>
</div>From a high-level perspective, the plan we discussed is:<br>
<br>
1) Charm is designed with support for actions schema<br>
2) Command is run: juju do <action> <parameters><br>
3) Client talks to the server, and enqueues actions<br>
4) Unit agent take notice, pulls the first action from the queue<br>
5) Unit agent runs hook, reports back<br>
6) Client gets told outcome<br>
<br>
I honestly don't even know what "using juju run" would mean in this<br>
context, let alone why it would make more sense.<br>
<br>
Can someone that understands the alternative please provide some<br>
insight and reasoning comparing them?<br>
<br>
<br>
gustavo @ <a href="http://niemeyer.net" target="_blank">http://niemeyer.net</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
</font></span></blockquote></div><br></div>