interfaces: add lxd-support interface #1720

Merged
merged 4 commits into from Aug 24, 2016

Conversation

Projects
None yet
5 participants
Contributor

jdstrand commented Aug 22, 2016

As discussed in #1699, implement a transitional (essentially unconfined) lxd-support interface such that the plugging snap must be named 'lxd' and be from the 'canonical' developer. This also means that the interface will not connect if the snap is sideloaded. LXD developers should add 'plugs: [ lxd-support ]' to the snap and test by uploading to the store in a non-stable channel and 'snap install lxd --channel=...'. When assertions are fully in place for interface connections, we may consider changing this.

The check is implemented in SanitizePlug and it does not panic(). Instead the error is logged in syslog like so:

/usr/lib/snapd/snapd[3313]: handlers.go:98: snap "lxd" has bad plugs or slots: lxd-support (lxd-support plug reserved (developer name '' != 'canonical')
/usr/lib/snapd/snapd[3313]: handlers.go:98: snap "snap-lxd-test" has bad plugs or slots: lxd-support (lxd-support plug reserved (snap name 'snap-lxd-test' != 'lxd'))

jdstrand added some commits Aug 22, 2016

Contributor

zyga commented Aug 22, 2016

Looks good to me, LGTM

Contributor

stgraber commented Aug 23, 2016

Ok, so as part of this, can someone from the snappy team do the initial upload of lxd on the canonical account and request for the lxd and lxc snap names to be moved to the canonical account too?

My understanding is that I can't really do any of those myself but once that's done, I can get the store team to set things up so we can manage that snap with our normal SSO accounts (we'll need @tych0, myself and a bot account for automatic uploads).

Collaborator

mvo5 commented Aug 23, 2016

I can upload a lxd snap and give you access to it.

Contributor

stgraber commented Aug 23, 2016

@mvo5 Cool, that'd be nice. Lets just upload whatever we currently have in the edge channel under my account for now, I'll upload something a bit more up to date later :)

I pushed a copy from the store to https://dl.stgraber.org/J60k4JY0HppjwOjW8dZdYc8obXKxujRu_21.snap if that helps you.

Also it'd be great if you could add:

To the uploaders, that'd be great. That way we can have Tycho iterate his packaging there in the edge channel and once that's done, we can have our existing bot account (managing PPAs and backports) to deal with the uploads whenever upstream changes (for edge, the rest will be manual).

Contributor

stgraber commented Aug 23, 2016

I've just logged into myapps from that bot account (ubuntu-lxc-bot@stgraber.org) so it should have a myapps account now. I'll have Tycho do the same.

Contributor

niemeyer commented Aug 23, 2016

Please send a mail to canonical-snapcraft with detailed coverage of how this bot account is used. This shared account will be able to upload not only lxd, which holds an interface that can do absolutely anything on the system, but also replace ubuntu-core itself, so an arbitrary bot owning credentials there is not okay.

+func (iface *LxdSupportInterface) SanitizePlug(plug *interfaces.Plug) error {
+ snapName := plug.Snap.Name()
+ devName := plug.Snap.Developer
+ if snapName != "lxd" {
@niemeyer

niemeyer Aug 24, 2016

Contributor

Can we please merge both of those errors on a single message:

"lxd-support interface is reserved for the upstream LXD project"

@@ -296,6 +296,14 @@ Can read system logs and set kernel log rate-limiting.
* Auto-Connect: no
+### lxd-support
+Can access all resources and syscalls on the device for LXD to mediate access
+for its containers. This interface currently may only be used by the lxd snap
@niemeyer

niemeyer Aug 24, 2016

Contributor

This interface currently may only be established with the upstream LXD project.

Contributor

niemeyer commented Aug 24, 2016

Code LGTM assuming the suggested messaging changes go in.

Collaborator

mvo5 commented Aug 24, 2016

This looks good to me! I applied the review feedback into #1733 and merged that so that it can be part of the SRU of today.

@stgraber Unfortunately if the snap is already in the store I can not help. I can only upload new snaps. To transfer snaps from one account to the other you will have to talk to the store team, Nessita is the best person probably.

@mvo5 mvo5 merged commit 6a2bf7d into snapcore:master Aug 24, 2016

2 of 3 checks passed

Integration tests
Details
autopkgtest Success
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jdstrand jdstrand deleted the jdstrand:lxd-support branch Aug 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment