Deploying Juju charms from Github
Robert Day
Robert.Day at metaswitch.com
Mon Apr 13 15:11:44 UTC 2015
Hi all,
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.
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 https://raw.githubusercontent.com/Metaswitch/clearwater-juju/github_everywhere/charms/bundles/clearwater/bundle/bundles.yaml. The Github repository/branch is https://github.com/Metaswitch/clearwater-juju/, which contains several charms and the bundle.
What I want is:
- to check out the dnsaas branch of https://github.com/Metaswitch/clearwater-juju.git
- to deploy the charm in the subdirectory 'charms/precise/clearwater-bono'
so I have the following in my bundle:
> services:
> "clearwater-bono":
> charm: "charms/precise/clearwater-bono"
> branch: "https://github.com/Metaswitch/clearwater-juju@dnsaas"
When I run juju-deployer, it fails with "No such file or directory" when trying to deploy the charm at https://github.com/Metaswitch/clearwater-juju/tree/dnsaas/charms/precise/clearwater-bono (though there's nothing special about this charm, it's just the first one in the bundle):
> $ juju-deployer -c https://raw.githubusercontent.com/Metaswitch/clearwater-juju/github_everywhere/charms/bundles/clearwater/bundle/bundles.yaml
> 2015-04-13 13:50:20 Using deployment clearwater
> 2015-04-13 13:50:20 Starting deployment of clearwater
> Traceback (most recent call last):
> File "/usr/bin/juju-deployer", line 9, in <module>
> load_entry_point('juju-deployer==0.4.3', 'console_scripts', 'juju-deployer')()
> File "/usr/local/lib/python2.7/dist-packages/deployer/cli.py", line 130, in main
> run()
> File "/usr/local/lib/python2.7/dist-packages/deployer/cli.py", line 228, in run
> importer.Importer(env, deployment, options).run()
> File "/usr/local/lib/python2.7/dist-packages/deployer/action/importer.py", line 188, in run
> self.get_charms()
> File "/usr/local/lib/python2.7/dist-packages/deployer/action/importer.py", line 63, in get_charms
> no_local_mods=self.options.no_local_mods)
> File "/usr/local/lib/python2.7/dist-packages/deployer/deployment.py", line 139, in fetch_charms
> os.mkdir(charm.series_path)
> OSError: [Errno 2] No such file or directory: 'precise/charms/precise'
If I create that directory (with mkdir -p precise/charms/precise) I get a different error:
> $ juju-deployer -c https://raw.githubusercontent.com/Metaswitch/clearwater-juju/github_everywhere/charms/bundles/clearwater/bundle/bundles.yaml
> 2015-04-13 13:50:58 Using deployment clearwater
> 2015-04-13 13:50:58 Starting deployment of clearwater
> Traceback (most recent call last):
> File "/usr/bin/juju-deployer", line 9, in <module>
> load_entry_point('juju-deployer==0.4.3', 'console_scripts', 'juju-deployer')()
> File "/usr/local/lib/python2.7/dist-packages/deployer/cli.py", line 130, in main
> run()
> File "/usr/local/lib/python2.7/dist-packages/deployer/cli.py", line 228, in run
> importer.Importer(env, deployment, options).run()
> File "/usr/local/lib/python2.7/dist-packages/deployer/action/importer.py", line 188, in run
> self.get_charms()
> File "/usr/local/lib/python2.7/dist-packages/deployer/action/importer.py", line 63, in get_charms
> no_local_mods=self.options.no_local_mods)
> File "/usr/local/lib/python2.7/dist-packages/deployer/deployment.py", line 140, in fetch_charms
> charm.fetch()
> File "/usr/local/lib/python2.7/dist-packages/deployer/charm.py", line 132, in fetch
> self.vcs.update(self.rev)
> File "/usr/local/lib/python2.7/dist-packages/deployer/vcs.py", line 99, in update
> self._call(params, self.err_update)
> File "/usr/local/lib/python2.7/dist-packages/deployer/vcs.py", line 30, in _call
> args, cwd=cwd or self.path, stderr=stderr)
> File "/usr/lib/python2.7/subprocess.py", line 537, in check_output
> process = Popen(stdout=PIPE, *popenargs, **kwargs)
> File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
> errread, errwrite)
> File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
> raise child_exception
> OSError: [Errno 2] No such file or directory: 'precise/charms/precise/clearwater-bono'
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/'.
> $ ls precise/charms/precise/precise/charms/precise/clearwater-bono/charms/precise/clearwater-bono/
> config.yaml copyright hooks icon.svg lib metadata.yaml README.md revision
I get the same error with juju-quickstart - a notification in the juju-gui tells me:
> Updated status for deployment id: 0
>
> An error occurred while deploying the bundle: [Errno 2] No such file or directory: 'precise/charms/precise'
> less than a minute ago
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.
Thanks,
Rob
More information about the Juju
mailing list