Problems with colocated layered and non-layered Charms
Merlijn Sebrechts
merlijn.sebrechts at gmail.com
Thu Jan 28 13:01:20 UTC 2016
Hi Marco
The virtalenv flag would be really helpful and solve all my use-cases
afaik! Any eta?
For more context:
I hulk smash a few Charms to enable full lxc support in a manual
environment.
- *lxc-networking* bridges lxcbr0 to a private network
- *dhcp-server* assigns ip addresses to the containers and acts as a NAT
router
- *openvpn* allows administrators access to the private network
- and finally *juju-gui* because it's awesome
*lxc-networking* and *dhcp-server* are layered, which breaks juju-gui. I
understand this is a hacky solution but it's the best I could come up with
to support lxc containers on the manual provider. Although hulk-smashing
isn't very wise, I think there will always be use-cases where it's
needed... I could put *juju-gui* into a container and port-forward, but
*openvpn* will always have to run on a physical machine, hulk-smashed
together with the others..
Then there's the use-case of subordinate Charms. I encountered some issues
creating layered subordinate Charms for non-layered Charms.
Kind regards
Merlijn
2016-01-28 13:33 GMT+01:00 Marco Ceppi <marco.ceppi at canonical.com>:
> Is this a result of deploy --to <machine#>? If so, I expect there to be
> errors, "hulk smashing" services onto a single machine really isn't
> expected to work, it just "works" for a few combination of charms. Is there
> a reason you can't deploy to LXC or KVM containers? The isolation of a LXC
> containers on a single machine is what this was built for.
>
> If you /do/ have to hulk smash, there was talk of adding a virtualenv flag
> to the charm layer, by which it will install its deps not systemwide but
> instead in a virtual environment that all the hooks would run with.
>
> Marco
>
> On Thu, Jan 28, 2016 at 4:54 AM Merlijn Sebrechts <
> merlijn.sebrechts at gmail.com> wrote:
>
>> Hi
>>
>>
>> Layered Charms use Python 3 and install pip3 as default pip. This causes
>> great problems for colocated non-layered Charms who expect that default pip
>> is pip2.
>>
>> An example is the combination of juju-gui with any layered Charm. You get
>> the following error:
>>
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 Traceback (most recent call last):
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 File
>> "/var/lib/juju/agents/unit-juju-gui-0/charm/hooks/install", line 92, in
>> <module>
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 main()
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 File
>> "/var/lib/juju/agents/unit-juju-gui-0/charm/hooks/install", line 85, in main
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 backend.install()
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 File
>> "/var/lib/juju/agents/unit-juju-gui-0/charm/hooks/backend.py", line 181, in
>> install
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 call_methods(self.mixins, 'install', self)
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 File
>> "/var/lib/juju/agents/unit-juju-gui-0/charm/hooks/backend.py", line 134, in
>> call_methods
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 method(*args)
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 File
>> "/var/lib/juju/agents/unit-juju-gui-0/charm/hooks/backend.py", line 101, in
>> install
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 utils.install_builtin_server()
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 File
>> "/var/lib/juju/agents/unit-juju-gui-0/charm/hooks/utils.py", line 297, in
>> install_builtin_server
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 '-r', requirements
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 File
>> "/var/lib/juju/agents/unit-juju-gui-0/charm/hooks/shelltoolbox.py", line
>> 458, in run
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 raise exception
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 INFO unit.juju-gui/0.install
>> logger.go:40 subprocess.CalledProcessError: Command '['pip', 'install',
>> '--no-index', '--no-dependencies', '--find-links',
>> 'file:////var/lib/juju/agents/unit-juju-gui-0/charm/deps', '-r',
>> '/var/lib/juju/agents/unit-juju-gui-0/charm/server-requirements.pip']'
>> returned non-zero exit status 1
>> unit-juju-gui-0[8052]: 2016-01-28 09:35:53 ERROR
>> juju.worker.uniter.operation runhook.go:107 hook "install" failed: exit
>> status 1
>>
>>
>>
>> Running it manually:
>>
>> pip install --no-index --no-dependencies --find-links
>> file:////var/lib/juju/agents/unit-juju-gui-0/charm/deps -r
>> /var/lib/juju/agents/unit-juju-gui-0/charm/server-requirements.pip
>> Ignoring indexes: https://pypi.python.org/simple
>> Collecting argparse==1.2.1 (from -r
>> /var/lib/juju/agents/unit-juju-gui-0/charm/server-requirements.pip (line 1))
>> Could not find a version that satisfies the requirement argparse==1.2.1
>> (from -r /var/lib/juju/agents/unit-juju-gui-0/charm/server-requirements.pip
>> (line 1)) (from versions: )
>> No matching distribution found for argparse==1.2.1 (from -r
>> /var/lib/juju/agents/unit-juju-gui-0/charm/server-requirements.pip (line 1))
>>
>> `pip2 install ....` works..
>>
>>
>>
>> Kind regards
>> Merlijn Sebrechts
>> --
>> Juju mailing list
>> 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/20160128/07c9afa2/attachment.html>
More information about the Juju
mailing list