Local provider home dir binding
Wavy Davy
bloodearnest at gmail.com
Wed Dec 5 14:24:27 UTC 2012
Hi all
I've been trying to get juju to expose the ubuntu lxc template's
binduser option, which creates the host user on the container and bind
mounts the host user's home directory. I use this feature for
development a lot - it makes developing in a container really nice.
Clint mentioned in IRC that this was desirable, so I had a go.
The first problem I hit was that juju uses the 'ubuntu-cloud' lxc
template, which doesn't support this option (unsurprisingly). So I
though I could try using the 'ubuntu' template - but that doesn't
support cloud-init. So I was thinking I could try to:
1) Add support for cloud-init to 'ubuntu' template (and maybe push
upstream if appropriate), and have juju use that. Maybe there are
other reasons beyond cloud-init support that juju uses the
ubuntu-cloud template? The only other ubuntu-cloud template option
that seems to be used is release_stream, which is always set to
"released" AFAICS.
2) Write a utility to add a host user to a juju unit after the unit is
up and running. This would create the user in the container, and add
the bind mount to the container's fstab (which has to be done from the
host).
I envision the workflow using 2) to be like:
juju deploy myservice
juju-mount-user $USER myservice/0
juju set myservice dev=true src=/home/$USER/dev/branch
which is obviously not as nice as
juju deploy myservice --config mysevice-dev.yaml
(To be clear, the benefits of using --binduser extend beyond
convenient path sharing between host/container. The container also has
the user's ssh/bzr config, which means they can dance with bzr from
either host or container, and full ssh directly into container (useful
with fabric, for example). IMO, anyway :)
The second problem I encountered was how to access the environment
config when creating a container. I added a 'dev_user' config value,
but I can't figure out how to access it from UnitContainerDeployment
(juju/machine/unit.py), which creates the container.
Anyway, if anyone has any guidance as to how best to proceed, or
whether my current thinking makes any sense, I'd be grateful.
Thanks
--
Simon
More information about the Juju
mailing list