1 |
On Thu, Mar 8, 2018 at 11:44 AM, R0b0t1 <r030t1@×××××.com> wrote: |
2 |
|
3 |
> On Wed, Mar 7, 2018 at 3:06 PM, Rich Freeman <rich0@g.o> wrote: |
4 |
> > On Wed, Mar 7, 2018 at 3:55 PM, R0b0t1 <r030t1@×××××.com> wrote: |
5 |
> >> On Wed, Mar 7, 2018 at 1:15 PM, Alec Warner <antarus@g.o> wrote: |
6 |
> >>> |
7 |
> >>> Because containers are awesome and are way easier to use. |
8 |
> >>> |
9 |
> >> |
10 |
> >> I think you missed my point: Why are they easier to use? |
11 |
> >> |
12 |
> > |
13 |
> > I suspect that he was equating "containers" with "Docker," which both |
14 |
> > runs containers and also is an image management solution (one that I |
15 |
> > don't particularly like, but probably because I don't have heavy needs |
16 |
> > so I find myself fighting it more than anything else - it doesn't hurt |
17 |
> > that for the life of me I can't get it to connect containers to my |
18 |
> > bridge, and it seems like it is completely opposed to just using DHCP |
19 |
> > to obtain IPs). |
20 |
> > |
21 |
> > But, if you're using Docker, sure, you can run whatever the command is |
22 |
> > to download an image of a container with some software pre-installed |
23 |
> > and run it. |
24 |
> > |
25 |
> > If you're using something other than Docker to manage your containers |
26 |
> > then you still have to get the software you want to use installed in |
27 |
> > your container image. |
28 |
> > |
29 |
> |
30 |
> I think I was equating containers to Docker as well. My point was |
31 |
> instead of trying to manage dependencies, containers allow people to |
32 |
> shove everything into an empty root with no conflicts. The |
33 |
> enthusiastic blog post seems to restate this. |
34 |
> |
35 |
> |
36 |
I think the premise on which I disagree is that somehow portage (and |
37 |
package managers in general) |
38 |
somehow allow you to keep a system 'clean'. Clean being a generic sort of |
39 |
idea like: |
40 |
|
41 |
1) All system files are owned by a package. |
42 |
2) Only the packages that need to be installed are installed. |
43 |
3) As the administrator, I fully understand the state of the system at all |
44 |
times. |
45 |
|
46 |
This is a useful abstraction (because its how many people do systems |
47 |
administration) but I don't like it for a few reasons. |
48 |
|
49 |
1) People log in and run stuff as root. Stuff running as root doesn't have |
50 |
to follow the rules of the PM, and so the system state can diverge (even by |
51 |
accident.) |
52 |
a) (Note that 'People' is often 'me'; I'm not immune! |
53 |
2) The PM itself (or the code it runs, such as pre / post installs) can |
54 |
have bugs, and so those bugs also can cause stage to diverge. |
55 |
3) In general, the state of the machine evolves organically over time. |
56 |
a) Start with a clean stage3. |
57 |
b) You install your configuration management software (puppet / cfengine |
58 |
/ chef / whatever your CM is) |
59 |
c) You commit some code into your CM, but it has a bug, so you |
60 |
accidentally mutate some unexpected state) |
61 |
d) Your CM is really great at doing things like "deploying a web node" |
62 |
but its bad at "undeploying the web node" (perhaps you never implemented |
63 |
this recipe.) |
64 |
1) You deploy a web node CM recipe on your server. It works great and |
65 |
runs as a web node for six months. |
66 |
2) The web node is getting busy, so you decide to move servers. You run |
67 |
your web node recipe on another server and decide to repurpose the server |
68 |
in 1. |
69 |
3) You deploy an LDAP node CM recipe on the server in 1. Maybe its also |
70 |
still running the web node; maybe it has the web node files but not apache |
71 |
(because you uninstalled it.) |
72 |
|
73 |
To me this was systems administration in the 90s / 2000s. The case of 3 |
74 |
(organic machine growth over N years) was rampant. On physical machines and |
75 |
VMs we commonly addressed this problem by having a machine + service |
76 |
lifecycle, making reinstalls automated, and reinstalling machines when they |
77 |
switched roles. Reinstalls were 'clean' and we built new installer images |
78 |
weekly. It also means I can test my procedures and be sure that I can say, |
79 |
deploy a new webnode or slave and not worry about never doing deploys; its |
80 |
common for automation to go stale if unused. |
81 |
|
82 |
I am reminded a bit of a security mindset; once the machine is compromised |
83 |
its really hard to prove that its no longer compromised (which is why |
84 |
backup + re-image is a common remediation in security-land.) |
85 |
I tend to use this as well in machines. If I logged in and did stuff as |
86 |
root, its probable its not in configuration management, the package manager |
87 |
may not know, and its now 'unclean.' |
88 |
|
89 |
Its also possible that you write CM recipes really well (or distribute all |
90 |
software in packages maybe.) You don't have bugs very often, or you just |
91 |
don't care about this idiom of "clean" machines. The intent of this text |
92 |
was merely to provide context for my experience. |
93 |
|
94 |
In contrast with disposable containers: |
95 |
|
96 |
1. Automated build process for my containers. |
97 |
1. If there is a bug in the build, I can throw my buggy containers |
98 |
away and build new ones. |
99 |
2. Containers are encouraged to be stateless, so logging in to the |
100 |
container as root is unlikely to scale well; the containers are likely to |
101 |
remain 'clean.' |
102 |
1. If my containers are dirty, I can just throw them away and build |
103 |
new ones. |
104 |
3. If I need to change roles, I can just destroy the webnode container |
105 |
and deploy a LDAP node container. |
106 |
|
107 |
The containers are nominally stateless, so there is less chance of 'gunk' |
108 |
building up and surprising me later. It also makes the lifecycle simpler. |
109 |
|
110 |
Obviously its somewhat harder for stateful services (databases, etc.) but I |
111 |
suspect things like SANs (or Ceph) can really provide the storage backing |
112 |
for the database. |
113 |
(database "schema" cleanliness is perhaps a separate issue that I'll defer |
114 |
for another time ;p) |
115 |
|
116 |
-A |