Triggering a fixed hook as part of upgrade-charm

Kapil Thangavelu kapil.thangavelu at canonical.com
Thu Apr 4 14:58:32 UTC 2013


On Thu, Apr 4, 2013 at 10:40 AM, Tom Haddon <tom.haddon at canonical.com>wrote:

> On 04/04/13 15:27, Kapil Thangavelu wrote:
> >
> > fwiw in the python version this goes..
> >
> > If you want to distribute the new charm to the units, the following will
> > put the new charm in place regardless of current unit error state. It
> > this just drops the new charm on to disk.  it does not run upgrade-charm
> > hook with the --force flag.
> >
> > $ juju upgrade-charm --force service
> >
> > Even without the upgrade you have two options, either a) retry the
> > failed op with the new hook, specifying relation name if its a relation
> > error and you want the relation hook to re-executed. The execution
> > environment is the same as the original execution environment in terms
> > of the units seen  of the remote side, although current relation
> > settings for those may have changed from the original execution env.
> >
> > $ juju resolved --retry unit_name [relation_name]
> >
> > Alternatively manually mark the error as resolved, typically as a result
> > of manual intervention.
> >
> >  $ juju resolved  unit_name [relation_name]
>
> The particular case here is that we don't actually have a relation
> error, we just want to change the implementation of the hook. Can you
> run "juju resolved --retry unit_name [relation_name]" even if there's no
> error?
>

Resolved --retry against a unit in a good state is no-op.

The underlying capability to run a hook out of band of orchestration, has
been ruminated on a few times but it doesn't exist. Its effectively a
juju-cli api form of juju-run-hook whereby an adminstrator or cron job can
run a hook. Its an important conceptual piece as well as it allows external
feedback into juju. The closest thing we have is a jitsu tool to
run-as-hook but its broken by design imo, in that its runs something on the
client with the hook environment which is not what users generally expect.


cheers,

Kapil

>
> > On Thu, Apr 4, 2013 at 10:07 AM, Tom Haddon <tom.haddon at canonical.com
> > <mailto:tom.haddon at canonical.com>> wrote:
> >
> >     Hi Folks,
> >
> >     If we have a problem with a particular hook, and fix that, we can
> >     upgrade-charm to rollout the fixed version of the charm. However,
> how do
> >     we actually fire the hook in question? I'm looking for this in terms
> of
> >     the "right way"™ as there are a few manual ways of doing this I can
> >     think of. Should we include the hook we want to run in the
> upgrade-charm
> >     hook? If the hook is a relation-changed, we don't necessarily want
> to do
> >     anything invasive to trigger that hook from being fired (such as
> >     changing the environment) we just want the hook to be rerun.
> >
> >     Thanks, Tom
> >
> >     --
> >     Juju mailing list
> >     Juju at lists.ubuntu.com <mailto:Juju at lists.ubuntu.com>
> >     Modify settings or unsubscribe at:
> >     https://lists.ubuntu.com/mailman/listinfo/juju
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20130404/61e36887/attachment-0001.html>


More information about the Juju mailing list