Re: [Juju] Proxy Charm examples

2015-08-26 Thread Kapil Thangavelu
i have some old ones (2013) for a few aws services, i'd say there mostly
just poc albeit with good unit tests. they internally use dynamodb to work
in ha mode with distributed lease/locks.

one for route 53 that creates dns entries for related service units
https://code.launchpad.net/~hazmat/charms/precise/aws-route53/trunk

one for rds to provision a database (this one definitely bitrotted as db
engines in aws have all rotated to newer versions)
https://code.launchpad.net/~hazmat/charms/precise/aws-route53/trunk

one for elb
http://bazaar.launchpad.net/~hazmat/charms/precise/aws-elb/trunk/files

most of the code for the charms is in a separate package awsjuju on pypi.

cheers
kapil


On Wed, Aug 19, 2015 at 10:19 AM, Samuel Cozannet <
samuel.cozan...@canonical.com> wrote:

> Hi!
>
> Still working with SpagoBI, Alberto and Ana are looking for examples of
> proxy charms, or best practices to expose external services.
>
> I think vzzualmobileapi is one of these, but are there documented best
> practices about them somewhere and/or example? I couldn't help on that one.
>
> Many thanks!
>
> Best,
> Samuel
>
> --
> Samuel Cozannet
> Cloud, Big Data and IoT Strategy Team
> Business Development - Cloud and ISV Ecosystem
> Changing the Future of Cloud
> Ubuntu   / Canonical UK LTD  /
> Juju 
> samuel.cozan...@canonical.com
> mob: +33 616 702 389
> skype: samnco
> Twitter: @SaMnCo_23
> [image: View Samuel Cozannet's profile on LinkedIn]
> 
>
> --
> Juju mailing list
> Juju@lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: [Juju] Proxy Charm examples

2015-08-21 Thread Cory Johns
Oh, I just realized that I misunderstood your point about the identical
data and that you were suggesting designing the interface to match the need
for a proxy charm.  I would argue against that, since proxy charms to
external services are the exception rather than the rule, and with a bit
more smarts in the proxy charm, it can be handled more gracefully than I
did in my example.

On Fri, Aug 21, 2015 at 10:08 AM, Cory Johns 
wrote:

> Stuart,
>
> Excellent points.
>
> Supporting separate different data for different services is exactly what
> I was thinking of when I mentioned the actions, where calling the action
> would register a service name (or pattern) and associated data.  Structured
> data for the config value is another option there, as you mention.
>
> Yes, the proxy charm could be a subordinate.  You could also simply deploy
> it as a container on the bootstrap node with --to lxc:0 or similar.  That
> would still take up some amount of resources, though, so a subordinate
> would be a bit better there, but then you'd have a dangling (subordinate)
> relation that muddies up the model a bit.  So I'm not sure which is better
> in the end.
>
> In the end, though, this was intended as a simple example of the general
> idea of proxy charms, so I didn't bother making it more robust.  Perhaps it
> would be worth filling it out, though, to show off all of these
> considerations that one is faced with when using proxy charms that may not
> be apparent at first.
>
> On Fri, Aug 21, 2015 at 2:43 AM, Stuart Bishop <
> stuart.bis...@canonical.com> wrote:
>
>>
>> On 21 August 2015 at 01:45, Cory Johns  wrote:
>>
>>
>>
>>> Even as a proxy charm, this could be improved (it could use actions to
>>> enable per-service configuration, for example), but it should give you the
>>> basic idea.
>>>
>>>
>> The main limitation is that this approach only supports proxying a single
>> unit service, or a service where each unit presents identical data. If you
>> need a proxy like this, you may need to take these limitations into account
>> when designing the relation interface (eg. present hostnames (plural - a
>> list of all hosts) the same on each unit, rather than a individual hostname
>> on each unit).
>>
>> Can the proxy be a subordinate to save spinning up the container?
>>
>> --
>> Stuart Bishop 
>>
>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: [Juju] Proxy Charm examples

2015-08-21 Thread Cory Johns
Stuart,

Excellent points.

Supporting separate different data for different services is exactly what I
was thinking of when I mentioned the actions, where calling the action
would register a service name (or pattern) and associated data.  Structured
data for the config value is another option there, as you mention.

Yes, the proxy charm could be a subordinate.  You could also simply deploy
it as a container on the bootstrap node with --to lxc:0 or similar.  That
would still take up some amount of resources, though, so a subordinate
would be a bit better there, but then you'd have a dangling (subordinate)
relation that muddies up the model a bit.  So I'm not sure which is better
in the end.

In the end, though, this was intended as a simple example of the general
idea of proxy charms, so I didn't bother making it more robust.  Perhaps it
would be worth filling it out, though, to show off all of these
considerations that one is faced with when using proxy charms that may not
be apparent at first.

On Fri, Aug 21, 2015 at 2:43 AM, Stuart Bishop 
wrote:

>
> On 21 August 2015 at 01:45, Cory Johns  wrote:
>
>
>
>> Even as a proxy charm, this could be improved (it could use actions to
>> enable per-service configuration, for example), but it should give you the
>> basic idea.
>>
>>
> The main limitation is that this approach only supports proxying a single
> unit service, or a service where each unit presents identical data. If you
> need a proxy like this, you may need to take these limitations into account
> when designing the relation interface (eg. present hostnames (plural - a
> list of all hosts) the same on each unit, rather than a individual hostname
> on each unit).
>
> Can the proxy be a subordinate to save spinning up the container?
>
> --
> Stuart Bishop 
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: [Juju] Proxy Charm examples

2015-08-20 Thread Stuart Bishop
On 21 August 2015 at 01:45, Cory Johns  wrote:



> Even as a proxy charm, this could be improved (it could use actions to
> enable per-service configuration, for example), but it should give you the
> basic idea.
>
>
The main limitation is that this approach only supports proxying a single
unit service, or a service where each unit presents identical data. If you
need a proxy like this, you may need to take these limitations into account
when designing the relation interface (eg. present hostnames (plural - a
list of all hosts) the same on each unit, rather than a individual hostname
on each unit).

Can the proxy be a subordinate to save spinning up the container?

-- 
Stuart Bishop 
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: [Juju] Proxy Charm examples

2015-08-20 Thread Cory Johns
Sam, Ana, and Alberto,

We tend not to have good examples of a proxy charm because they are much
more limited than full charms and they also tend to be specific to
particular use-cases.  Thus, they are often one-off charms that don't end
up in the store.

If you're referring to https://jujucharms.com/u/adamgreig/vzzual/, then
yes, that could be considered a type of proxy charm.  I would note that it
has an issue with not propagating changes to the API key to the related
services.  It also doesn't include the connection info  (hostname, etc)
that would presumably be needed to connect.

To provide an example that addresses those issues, I created a proxy charm
for MySQL: https://jujucharms.com/u/johnsca/mysql-external-proxy/ (if that
has not ingested into the charm store by the time you look at this, the
code is available in Launchpad:
http://bazaar.launchpad.net/~johnsca/charms/trusty/mysql-external-proxy/trunk/files
).

Even as a proxy charm, this could be improved (it could use actions to
enable per-service configuration, for example), but it should give you the
basic idea.

On Wed, Aug 19, 2015 at 10:19 AM, Samuel Cozannet <
samuel.cozan...@canonical.com> wrote:

> Hi!
>
> Still working with SpagoBI, Alberto and Ana are looking for examples of
> proxy charms, or best practices to expose external services.
>
> I think vzzualmobileapi is one of these, but are there documented best
> practices about them somewhere and/or example? I couldn't help on that one.
>
> Many thanks!
>
> Best,
> Samuel
>
> --
> Samuel Cozannet
> Cloud, Big Data and IoT Strategy Team
> Business Development - Cloud and ISV Ecosystem
> Changing the Future of Cloud
> Ubuntu   / Canonical UK LTD  /
> Juju 
> samuel.cozan...@canonical.com
> mob: +33 616 702 389
> skype: samnco
> Twitter: @SaMnCo_23
> [image: View Samuel Cozannet's profile on LinkedIn]
> 
>
> --
> Juju mailing list
> Juju@lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


[Juju] Proxy Charm examples

2015-08-19 Thread Samuel Cozannet
Hi!

Still working with SpagoBI, Alberto and Ana are looking for examples of
proxy charms, or best practices to expose external services.

I think vzzualmobileapi is one of these, but are there documented best
practices about them somewhere and/or example? I couldn't help on that one.

Many thanks!

Best,
Samuel

--
Samuel Cozannet
Cloud, Big Data and IoT Strategy Team
Business Development - Cloud and ISV Ecosystem
Changing the Future of Cloud
Ubuntu   / Canonical UK LTD  / Juju

samuel.cozan...@canonical.com
mob: +33 616 702 389
skype: samnco
Twitter: @SaMnCo_23
[image: View Samuel Cozannet's profile on LinkedIn]

-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju