Gentoo Archives: gentoo-dev

From: William Hubbs <williamh@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] rfc: generic "container" keyword for init scripts
Date: Wed, 02 Dec 2015 23:50:01
Message-Id: 20151202234932.GA28393@whubbs1.gaikai.biz
In Reply to: Re: [gentoo-dev] rfc: generic "container" keyword for init scripts by William Hubbs
1 On Tue, Dec 01, 2015 at 03:28:44PM -0600, William Hubbs wrote:
2 > On Tue, Dec 01, 2015 at 11:21:49AM -0800, Zac Medico wrote:
3 > > On 12/01/2015 10:19 AM, William Hubbs wrote:
4 > > > On Tue, Dec 01, 2015 at 11:26:19AM -0600, William Hubbs wrote:
5 > > >> On Tue, Dec 01, 2015 at 09:00:55AM -0800, Zac Medico wrote:
6 > > >>> On 12/01/2015 08:50 AM, William Hubbs wrote:
7 > > >>>> The "container" keyword, being generic, would have its meaning expanded
8 > > >>>> to cover new container systems as they come along. This means if a
9 > > >>>> service script has the keyword "-container" it will not work under any
10 > > >>>> current or future container systems. On the other hand, adding
11 > > >>>> "container" means it will work under all of them.
12 > > >>>
13 > > >>> If it's similar to how license groups work, then there is room for doing
14 > > >>> things like "-@container docker" which means no containers except
15 > > >>> docker, or "@container -docker" which means all containers except
16 > > >>> docker. Keyword groups can be implemented using a simple expansion
17 > > >>> mechanism, just like license groups.
18 > > >>
19 > > >> Keyword groups are an interesting idea; I'll think about this approach.
20 > > >
21 > > > One question that comes to mind is,, who defines which keywords go in
22 > > > each group?
23 > > >
24 > > > The containers or virtualization systems themselves can be autodetected
25 > > > so they are the same everywhere, but keyword groups are not able to be
26 > > > detected.
27 > >
28 > > The groups should go in a configuration file somewhere. For example,
29 > > they could be defined in rc.conf with a variable setting like this:
30 > >
31 > > rc_keyword_group_container="docker lxc openvz vserver"
32 >
33 > If we keep the keywords as they are, I am starting to think we can just
34 > add a container keyword that would be valid for all of the containers;
35 > that way a script could be set up to work for no containers or for
36 > specific ones like we are talking about.
37
38 Here is where my thoughts are on this now. There will be a
39 "-containers" keyword, which will expand to list all of the containers
40 we can detect on the operating system OpenRC is running on -- for
41 example, on Linux it might be:
42
43 "-docker -lxc -openvz -rkt -systemd-nspawn -vserver"
44
45 So any time you list -containers as a keyword it would expand
46 appropriately.
47
48 > OpenRC currently doesn't do any detection of virtual machines, so maybe
49 > that could be another expansion of this -- add a keyword "vm" and
50 > keywords for the virtual machines.
51
52 VM's will be a separate project that I will look at later.
53
54 Thoughts?
55
56 William

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies