<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi Kapil,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I agree that not having juju-deployer handle the Git side of things, and just working locally from a Git checkout, would be simpler
 – but I don’t think that sort of bundle would work in the Juju GUI, because the extra steps needed mean that you can’t drag-and-drop it. Have I understood correctly?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">On the syntax for bundle files, one thing I might want to do is take my five charms (all hosted in one Git repository) and bundle them
 together with several charms from someone else (which might all be hosted in the same repository). I can’t quite see how the syntax you suggest (one Git repository per bundle) would allow that. Something like:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">> clearwater:<br>
>  services:<br>
>    "clearwater-bono":<br>
>      charm: "clearwater-bono"<br>
>      branch: "<a href="https://github.com/Metaswitch/clearwater-juju@46785ea8368a47c4351a516bb9a76763f6d4a952" target="_blank">https://github.com/Metaswitch/clearwater-juju@46785ea8368a47c4351a516bb9a76763f6d4a952</a>"<br>
>      charms_subdirectory: "charms/precise/clearwater-bono"<br>
>    "clearwater-sprout":<br>
>      charm: "clearwater-sprout"<br>
>      branch: "<a href="https://github.com/Metaswitch/clearwater-juju@46785ea8368a47c4351a516bb9a76763f6d4a952" target="_blank">https://github.com/Metaswitch/clearwater-juju@46785ea8368a47c4351a516bb9a76763f6d4a952</a>"<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">>      charms_subdirectory: "charms/precise/clearwater-sprout"<br>
>    "somethingElse":<br>
>      charm: "somethingElse"<br>
>      branch: "<a href="https://github.com/someoneElse/somethingElse@abcde">https://github.com/someoneElse/somethingElse@abcde</a>"<br>
>      charms_subdirectory: "contrib/juju-charms"<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Does that seem OK to you, or do you still prefer the single charm_repository option?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Rob<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Kapil Thangavelu [mailto:kapilt@gmail.com]
<br>
<b>Sent:</b> 14 April 2015 13:26<br>
<b>To:</b> Robert Day<br>
<b>Cc:</b> juju@lists.ubuntu.com<br>
<b>Subject:</b> Re: Deploying Juju charms from Github<o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Tue, Apr 14, 2015 at 6:09 AM, Robert Day <<a href="mailto:Robert.Day@metaswitch.com" target="_blank">Robert.Day@metaswitch.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Thanks for the response! I’ve:<br>
* found <a href="https://code.launchpad.net/~whitmo/juju-deployer/git-clone-fix" target="_blank">
https://code.launchpad.net/~whitmo/juju-deployer/git-clone-fix</a> and applied those changes to my local copy of juju-deployer<br>
* removed the “--depth 1” from vcs.py<br>
* corrected my bundle to the below<br>
<br>
>  services:<br>
>    "clearwater-bono":<br>
>      charm: "clearwater-bono"<br>
>      branch: "<a href="https://github.com/Metaswitch/clearwater-juju@46785ea8368a47c4351a516bb9a76763f6d4a952" target="_blank">https://github.com/Metaswitch/clearwater-juju@46785ea8368a47c4351a516bb9a76763f6d4a952</a>"<br>
<br>
I then get this error:<br>
<br>
2015-04-14 09:33:21 Using deployment clearwater<br>
2015-04-14 09:33:21 Starting deployment of clearwater<br>
2015-04-14 09:33:21 Invalid config charm clearwater-bono zone=clearwater.local<br>
2015-04-14 09:33:21 Deployment stopped. run time: 0.52<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal"><br>
I’m pretty sure that this is because juju-deployer expects the charm’s metadata.yaml file (or config.yaml, etc.) to be in precise/clearwater-bono/metadata.yaml, whereas due to the way my Git repository is laid out, it’s actually in precise/clearwater-bono/charms/precise/clearwater-bono/metadata.yaml
 (the Git repository is checked out correctly to precise/clearwater-bono, but my charms are all in the charms/precise subdirectory of that repository – it’s at
<a href="https://github.com/Metaswitch/clearwater-juju" target="_blank">https://github.com/Metaswitch/clearwater-juju</a> if you want to see what I mean).<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">specifically the error is referencing the key 'zone' is not found in the charms's config.yaml. if you have a single directory of charms in vcs, its a bit easier to not have deployer do vcs, ie. checkout, set JUJU_REPOSITORY env var to root
 of checkout dir, omit vcs info from the bundle config, and then just juju-deployer. Granted that has the downside of requiring additional instructions when sharing.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal"><br>
I think I could correct this by having one repository per charm, but I’d like to keep all my charms in the same repository if possible – there are six or seven of them and they’re quite closely related. It feels like having an option in the bundle to say “the
 charm files are in this subdirectory of the Git repository” would be useful – I might try and put that patch together, unless there are reasons why that wouldn’t be a good idea (or unless something similar already exists). Something like: <o:p></o:p></p>
</blockquote>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
> clearwater:<br>
>  services:<br>
>    "clearwater-bono":<br>
>      charm: "clearwater-bono"<br>
>      branch: "<a href="https://github.com/Metaswitch/clearwater-juju@46785ea8368a47c4351a516bb9a76763f6d4a952" target="_blank">https://github.com/Metaswitch/clearwater-juju@46785ea8368a47c4351a516bb9a76763f6d4a952</a>"<br>
>      charms_subdirectory: "charms/precise/clearwater-bono"<br>
>    "clearwater-sprout":<br>
>      charm: "clearwater-sprout"<br>
>      branch: "<a href="https://github.com/Metaswitch/clearwater-juju@46785ea8368a47c4351a516bb9a76763f6d4a952" target="_blank">https://github.com/Metaswitch/clearwater-juju@46785ea8368a47c4351a516bb9a76763f6d4a952</a>"<br>
>      charms_subdirectory: "charms/precise/clearwater-sprout"<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">actually i think a different syntax would be nice.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">clearwater:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">   charm_repository: <a href="https://github.com/Metaswitch/clearwater@987132asdf">
https://github.com/Metaswitch/clearwater@987132asdf</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">   services:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">      charm: clearwater-bono<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">      <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">that repo directory would get checked out, and set as the JUJU_REPOSITORY for the rest of the services, ie. propagate for all local charms automatically, but they could override as needed.  patches welcome.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">cheers,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Kapil<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Thanks,<br>
Rob<br>
<br>
<br>
From: Kapil Thangavelu [mailto:<a href="mailto:kapilt@gmail.com">kapilt@gmail.com</a>]<br>
Sent: 14 April 2015 05:57<br>
To: Robert Day<br>
Cc: <a href="mailto:juju@lists.ubuntu.com">juju@lists.ubuntu.com</a><br>
Subject: Re: Deploying Juju charms from Github<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
There's a few things going on. The charm key in the bundle should just be the charm name. The git support has a bug (there's a pending merge proposal for this) re parent dir/checkout dir which is the cause of those tracebacks. The @ syntax works for revision
 and tags but not branches. Given its common for branch co-location with git unlike bzr that seems reasonable, the @rev specification will likely need some additional syntax to support branches. Another issue is deployer is optimizing for the deployment case
 so its taking shallow copies of repos (--depth 1 on git clone). With git that seems to preclude fetching remote branch info. The shallow clone is probably of marginal utility given git's speed, with bzr its a significant speed up. Its going to take a few days
 to sort out changes to support this.<br>
<br>
-kapil<br>
<br>
<br>
On Mon, Apr 13, 2015 at 11:11 AM, Robert Day <<a href="mailto:Robert.Day@metaswitch.com">Robert.Day@metaswitch.com</a>> wrote:<br>
Hi all,<br>
<br>
I'm trying to deploy a Juju bundle and set of charms hosted on Github rather than Launchpad, but I'm running into some problems. Although juju-deployer does appear to support this, I haven't found many examples, so I'm not certain I'm doing the right thing
 - if anyone has this working, and could point me at their Github repository, that'd be great.<br>
.  <br>
<br>
I'm using juju-deployer version 0.4.3-0ubuntu1~ubuntu12.04.1~ppa1, juju-core version 1.22.0-0ubuntu1~12.04.2~juju1 and Git version 2.3.3. The bundle I'm using is at
<a href="https://raw.githubusercontent.com/Metaswitch/clearwater-juju/github_everywhere/charms/bundles/clearwater/bundle/bundles.yaml" target="_blank">
https://raw.githubusercontent.com/Metaswitch/clearwater-juju/github_everywhere/charms/bundles/clearwater/bundle/bundles.yaml</a>. The Github repository/branch is
<a href="https://github.com/Metaswitch/clearwater-juju/" target="_blank">https://github.com/Metaswitch/clearwater-juju/</a>, which contains several charms and the bundle.<br>
<br>
What I want is:<br>
- to check out the dnsaas branch of <a href="https://github.com/Metaswitch/clearwater-juju.git" target="_blank">
https://github.com/Metaswitch/clearwater-juju.git</a><br>
- to deploy the charm in the subdirectory 'charms/precise/clearwater-bono'<br>
<br>
so I have the following in my bundle:<br>
<br>
>   services:<br>
>     "clearwater-bono":<br>
>       charm: "charms/precise/clearwater-bono"<br>
>       branch: "<a href="https://github.com/Metaswitch/clearwater-juju@dnsaas" target="_blank">https://github.com/Metaswitch/clearwater-juju@dnsaas</a>"<br>
<br>
When I run juju-deployer, it fails with "No such file or directory" when trying to deploy the charm at
<a href="https://github.com/Metaswitch/clearwater-juju/tree/dnsaas/charms/precise/clearwater-bono" target="_blank">
https://github.com/Metaswitch/clearwater-juju/tree/dnsaas/charms/precise/clearwater-bono</a> (though there's nothing special about this charm, it's just the first one in the bundle):<br>
<br>
> $ juju-deployer -c <a href="https://raw.githubusercontent.com/Metaswitch/clearwater-juju/github_everywhere/charms/bundles/clearwater/bundle/bundles.yaml" target="_blank">
https://raw.githubusercontent.com/Metaswitch/clearwater-juju/github_everywhere/charms/bundles/clearwater/bundle/bundles.yaml</a><br>
> 2015-04-13 13:50:20 Using deployment clearwater<br>
> 2015-04-13 13:50:20 Starting deployment of clearwater<br>
> Traceback (most recent call last):<br>
>   File "/usr/bin/juju-deployer", line 9, in <module><br>
>     load_entry_point('juju-deployer==0.4.3', 'console_scripts', 'juju-deployer')()<br>
>   File "/usr/local/lib/python2.7/dist-packages/deployer/cli.py", line 130, in main<br>
>     run()<br>
>   File "/usr/local/lib/python2.7/dist-packages/deployer/cli.py", line 228, in run<br>
>     importer.Importer(env, deployment, options).run()<br>
>   File "/usr/local/lib/python2.7/dist-packages/deployer/action/importer.py", line 188, in run<br>
>     self.get_charms()<br>
>   File "/usr/local/lib/python2.7/dist-packages/deployer/action/importer.py", line 63, in get_charms<br>
>     no_local_mods=self.options.no_local_mods)<br>
>   File "/usr/local/lib/python2.7/dist-packages/deployer/deployment.py", line 139, in fetch_charms<br>
>     os.mkdir(charm.series_path)<br>
> OSError: [Errno 2] No such file or directory: 'precise/charms/precise'<br>
<br>
If I create that directory (with mkdir -p precise/charms/precise) I get a different error:<br>
<br>
> $ juju-deployer -c <a href="https://raw.githubusercontent.com/Metaswitch/clearwater-juju/github_everywhere/charms/bundles/clearwater/bundle/bundles.yaml" target="_blank">
https://raw.githubusercontent.com/Metaswitch/clearwater-juju/github_everywhere/charms/bundles/clearwater/bundle/bundles.yaml</a><br>
> 2015-04-13 13:50:58 Using deployment clearwater<br>
> 2015-04-13 13:50:58 Starting deployment of clearwater<br>
> Traceback (most recent call last):<br>
>   File "/usr/bin/juju-deployer", line 9, in <module><br>
>     load_entry_point('juju-deployer==0.4.3', 'console_scripts', 'juju-deployer')()<br>
>   File "/usr/local/lib/python2.7/dist-packages/deployer/cli.py", line 130, in main<br>
>     run()<br>
>   File "/usr/local/lib/python2.7/dist-packages/deployer/cli.py", line 228, in run<br>
>     importer.Importer(env, deployment, options).run()<br>
>   File "/usr/local/lib/python2.7/dist-packages/deployer/action/importer.py", line 188, in run<br>
>     self.get_charms()<br>
>   File "/usr/local/lib/python2.7/dist-packages/deployer/action/importer.py", line 63, in get_charms<br>
>     no_local_mods=self.options.no_local_mods)<br>
>   File "/usr/local/lib/python2.7/dist-packages/deployer/deployment.py", line 140, in fetch_charms<br>
>     charm.fetch()<br>
>   File "/usr/local/lib/python2.7/dist-packages/deployer/charm.py", line 132, in fetch<br>
>     self.vcs.update(self.rev)<br>
>   File "/usr/local/lib/python2.7/dist-packages/deployer/vcs.py", line 99, in update<br>
>     self._call(params, self.err_update)<br>
>   File "/usr/local/lib/python2.7/dist-packages/deployer/vcs.py", line 30, in _call<br>
>     args, cwd=cwd or self.path, stderr=stderr)<br>
>   File "/usr/lib/python2.7/subprocess.py", line 537, in check_output<br>
>     process = Popen(stdout=PIPE, *popenargs, **kwargs)<br>
>   File "/usr/lib/python2.7/subprocess.py", line 679, in __init__<br>
>     errread, errwrite)<br>
>   File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child<br>
>     raise child_exception<br>
> OSError: [Errno 2] No such file or directory: 'precise/charms/precise/clearwater-bono'<br>
<br>
It looks like something odd has happened with the paths - juju-deployer is looking in 'precise/charms/precise/clearwater-bono' but my charm actually seems to have been checked out to 'precise/charms/precise/precise/charms/precise/clearwater-bono/charms/precise/clearwater-bono/'.<br>
<br>
> $ ls precise/charms/precise/precise/charms/precise/clearwater-bono/charms/precise/clearwater-bono/<br>
> config.yaml  copyright  hooks  icon.svg  lib  metadata.yaml  README.md  revision<br>
<br>
I get the same error with juju-quickstart - a notification in the juju-gui tells me:<br>
<br>
> Updated status for deployment id: 0<br>
><br>
> An error occurred while deploying the bundle: [Errno 2] No such file or directory: 'precise/charms/precise'<br>
> less than a minute ago<br>
<br>
I tried creating a new charm repository holding only a single charm (as opposed to my current model, where six or seven closely related charms are all in the same repository), but hit similar errors - I didn't pursue this any further, because it's much easier
 for me to keep all these charms in the same repository.<br>
<br>
Thanks,<br>
Rob<br>
<br>
--<br>
Juju mailing list<br>
<a href="mailto:Juju@lists.ubuntu.com">Juju@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju" target="_blank">
https://lists.ubuntu.com/mailman/listinfo/juju</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>