Gentoo Archives: gentoo-dev

From: Stuart Herbert <stuart@g.o>
To: Max Kalika <max@g.o>, Troy Dack <tad@g.o>, gentoo-dev@g.o
Subject: Re: [gentoo-dev] [GLEP] Web Application Installation
Date: Mon, 04 Aug 2003 10:45:55
Message-Id: 200308041143.51723.stuart@gentoo.org
In Reply to: Re: [gentoo-dev] [GLEP] Web Application Installation by Max Kalika
1 Morning, Max,
2
3 On Monday 04 August 2003 5:29 am, Max Kalika wrote:
4 > I don't know if I'm being overly abrasive -- the weather is really hot, and
5 > I think I ate something that didn't agree with me. Please don't take
6 > offense at anything I say. :-)
7
8 Don't worry - I only take offense at offensive people, not offensive words.
9 And I hope nothing in my replies offends you either.
10
11 As you can tell ;-) I believe that a good debate is healthy, as it improves
12 everyone's understanding of situations beyond their normal experience, and
13 helps to identify the common ground. It's just a shame that so many people
14 today seem to have closed, narrow minds, and find discussion more of a threat
15 than of value :(
16
17 > Quoting Stuart Herbert <stuart@g.o>:
18 > > True. But most webapps will rely on the webserver to handle the virtual
19 > > hosting side of things - and that's something we *can* support through
20 > > user-space tools.
21 >
22 > Eh? Elaborate please.
23
24 Apache supports virtual hosting already. Tools such as phpBB and tikiwiki and
25 phpMyAdmin (to give but three examples) don't need explicit virtual host
26 support, because Apache handles that. To run a copy of phpBB under two
27 different domains hosted on the same box, you install two copies of phpBB -
28 or at least simulate that situation using symlinks or whatever.
29
30 I've no experience with Horde, I confess.
31
32 > > Problem with that is that it prevents 'emerge -u world' from being
33 > > something that you can safely put in cron.
34 >
35 > How is that? Aside from the fact that no sysadmin who values his/her job
36 > would do this on a production system, I don't see why this would be a
37 > problem/impediment?
38
39 Scary as I find it, one reason why many of my clients run Debian rather than
40 Gentoo on their production hardware is because they do that from a cron
41 script, and trust the results. Personally, I've always introduced staging
42 platforms in environments where I've been wearing the Release Manager hat.
43
44 > Correct, which is what eclasses are for.
45
46 Agreed ;-) And that's what I did ;-)
47
48 > Ugh! Won't this get in the way when we actually try to implement this GLEP
49
50 Possibly. But I really wanted to clear out some outstanding bugs from
51 Bugzilla, and adding the eclass made it easy to do.
52
53 > (most of which is already done by my eclass).
54
55 Okay, here's my personal look at your eclass. None of my comments are meant
56 to be personal, or disrespectful!
57
58 1) Your eclass doesn't correctly (as I understand correct usage to be!)
59 support the apache2 USE flag. Easy enough to do - see my webapp-apache
60 eclass for an example.
61 2) Your eclass doesn't specify the permissions that the source files should be
62 installed under. Again, easy enough to fix.
63 3) Your eclass doesn't provide support for running multiple copies of the same
64 app on the same machine. This is a showstopper.
65 4) Your eclass requires the admin to stop and start Apache as part of the
66 install. This is a showstopper. Not every site will want to stop and start
67 their web server just because they've installed a new app. Imagine a site
68 hosting hundreds of domains, and having to take them *all* offline at the
69 same time just because phpBB's been upgraded (for example!). Robin's idea of
70 creating .htaccess files under the document root deals with this much more
71 managably - although I think we're gonna end up using symlinks, as that'll
72 make it easy to support multiple web servers.
73 5) I'm against users having to run 'ebuild /var/.../something.ebuild' after
74 installation to then complete the install. If you're emerging enough
75 packages, it's easy to miss the notification that you need to do this. It's
76 personal preference, I guess, but I've been caught out by this in the past.
77 6) I *like* the idea that check_php() is in this eclass, because that check is
78 specific to mod_php under Apache. I'm gonna steal that and add it to my
79 webapp-apache eclass ;-)
80 7) Your variable names are not generic enough for my liking ;-) AWEB_CFG, for
81 example, might be better off being WEBAPP_CFG.
82 8) Instead of trying to supply an all-encompasing apache-webapp_src_install(),
83 relying as it does on defining global variables, I'd have supplied a number
84 of individual functions to do each bit. Say, a webapp-install-appconfig,
85 webapp-install-serverconfig each taking parameters (this is off the top of my
86 head here ;-) This is a personal preference thing.
87 9) If I'm not mistaken, your eclass does nothing to ensure that the webapp can
88 find the configuration files you've moved into /etc/webapps/$PN/.
89 Personally, I'm coming to the conclusion that /etc/webapps/$PN/ isn't a good
90 idea, because again it doesn't support the idea of running multiple copies of
91 the same app on the same machine.
92 10) I'm coming to the conclusion that 'emerge -u <webapp>' shouldn't overwrite
93 the older version, but should always install alongside, in a different slot,
94 so that sites can easily run different versions of apps as required. Perhaps
95 this should be configurable somehow? Your eclass doesn't make this possible.
96
97 I'm not saying that my eclass is better. My eclass isn't trying to address
98 this GLEP - it's just trying to make maintenance easier for now. The show
99 must go on. Especially as this GLEP isn't even showing up on the GLEP list
100 yet.
101
102 > The way you did it has already been tried and shot down:
103 >
104 > <http://www.gentoo.org/cgi-bin/viewcvs.cgi/eclass/Attic/apache.eclass?hidea
105 > ttic=0>
106
107 That eclass, and the one that I added, are different in important ways.
108
109 > Double Ugh!
110
111 Lots of laughter. I'm gonna copyright that phrase, I think ;-)
112
113 > See these please:
114 >
115 > <http://marc.theaimsgroup.com/?l=gentoo-dev&w=2&r=1&s=apache.eclass&q=b>
116
117 Okay, let's knock down those ninepins. Here's the list of objections from the
118 posts in the archive, and here's my responses:
119
120 1) Apache1/Apache2 conundrum
121
122 My eclass uses the detection technique adopted for mod_php, and no-one has
123 complained about that. If this eclass is invalid, then so's the ebuild for
124 mod_php. And I don't think it is.
125
126 2) Support for multiple DocumentRoot configurations, and also
127 3) Binary packages installing on machines with different DocumentRoot values
128
129 Until the GLEP is firmed up and approved, we don't have an agreed solution to
130 implement.
131
132 For now, what I've done is backwards-compatible with the situation today,
133 while we wait for the GLEP to mature. Let me say that again. The *existing
134 ebuilds* in Portage already did things this way. I haven't introduced new
135 behaviour - I've just hovered up the duplication. And that's a worthy thing
136 to do.
137
138 Please excuse me, but I don't want to put support for existing ebuilds on hold
139 while we debate the GLEP. I believe that we *have* to continue support until
140 we're ready and able to switch. Stopping maintenance activities is *not* an
141 option.
142
143 4) Which user/group to use
144
145 My class uses Robin's suggestion, and assumes that Apache is running with the
146 default settings of apache.apache.
147
148 5) DocumentRoot pointing to a read-only mount
149
150 As far as I'm concerned, that's like trying to do 'make bzlilo' with /boot not
151 mounted, or run an 'emerge' with /usr mounted read-only. It's the sysadmin's
152 job to make sure that any necessary filesystems are mounted read/write before
153 an installation is attempted. This is not a problem unique to web
154 applications.
155
156 6) "it's weak"
157
158 That's not an argument, it's an opinion ;-) Anyway, I've taken 5-10 lines of
159 broken and incorrectly duplicated code from a number of ebuilds, and moved
160 them all into one place where they can be re-used and maintained for now.
161 Reduced defects is a strong argument, not a weak one.
162
163 After that, the discussion is more about the Apache 1 / Apache 2 slotting than
164 about web apps itself, except for continued discussion about an equivalent of
165 /usr/share/webapps/ that made its way into the GLEP.
166
167 > See, this GLEP was more about where/how to install these ebuilds and not
168 > about their place in the tree.
169
170 Then I'd argue that the GLEP is incomplete in its scope, and needs expanding.
171 Unless you think that we can create the 'web-xxx' categories without a GLEP?
172 If so, then fair enough ;-)
173
174 Actually, I'd like to see a redrafting of the GLEP, with a clearly defined
175 list of requirements for supporting webapps. We're debating implementation
176 issues without a clear list of requirements to address. This is not the
177 right way to go about it ;-)
178
179 > I held off including at least 10 ebuilds
180 > waiting for the outcome of this discussion, but now you jumped the gun.
181
182 Not really. All I've done is moved some duplicated (and broken) code out of
183 some ebuilds, and put it into one eclass, so that I could address a number of
184 open bugs. It *was* fix-a-bug weekend ;-)
185
186 I am going to be adding a webapp or two that use the new eclass, but the
187 situation's no different to before the eclass existed. The code in the
188 eclass would have had to have been duplicated in the new ebuilds.
189
190 > Hopefully the transition can be painless.
191
192 Agreed that'd be nice ;-)
193
194 > Well, perhaps a question in the original GLEP should be readdressed. I'm
195 > beginning to strongly agree with:
196 >
197 > [snip]
198 >
199 > Flexibility is one thing, maintainability with a limited developer time is
200 > quite another. The balance between the two is critical.
201
202 That's why you get the framework - the eclasses - in place to handle all of
203 this. If it's done right, then maintaining individual packages becomes
204 *easier*, and takes *less* time.
205
206 Think about it. Think about having to manually install a package under a
207 different web server (a manual process, and therefore error-prone) to
208 investigate a bug posted to Bugzilla. Once you've had to do this a few
209 times, it would already have been quicker to code up and test the eclasses
210 and tools that we need.
211
212 If we *don't* do this, I reckon that the bugs about webapps running under
213 Apache'll get addressed, and many of the other bugs won't - because it's too
214 much effort.
215
216 I agree that most people will just the webapps under Apache, and never care
217 about other web servers. But either we just support webapps under Apache, or
218 we do it properly, I'd argue. And I reckon that doing it properly is
219 actually very easy to do.
220
221 > I did. It looks like a trimmed version of the original proposed by Ned
222 > Ludd.
223
224 I'll go back and re-read the posts then.
225
226 > But you completely ignored all my work and the GLEP which we're discussing.
227
228 See above. My eclass isn't attempting to solve the GLEP. It's there to help
229 with existing packages for now, until the GLEP moves forward.
230
231 > My eclass follows your proposed philosophy, but you basically threw it out
232 > the window. I'm confused.
233
234 > How is mod_php related to the way applications are installed?
235
236 Erm, how about the whole 'do I use Apache 1 or Apache 2' conumdrum? See the
237 mod_php ebuild for details.
238
239 Take care,
240 Stu
241 --
242 Stuart Herbert stuart@g.o
243 Gentoo Developer http://www.gentoo.org/
244 Beta packages for download http://dev.gentoo.org/~stuart/packages/
245
246 GnuGP key id# F9AFC57C available from http://pgp.mit.edu
247 Key fingerprint = 31FB 50D4 1F88 E227 F319 C549 0C2F 80BA F9AF C57C
248 --