]> scripts.mit.edu Git - wizard.git/blob - TODO
Move generic functionality out of wizard.app.mediawiki.
[wizard.git] / TODO
1 The Git Autoinstaller
2
3 TODO NOW:
4
5 - Keep my sanity when upgrading 1000 installs
6     - Custom merge algo: absolute php.ini symlinks to relative symlinks (this
7       does not seem to have been a problem in practice)
8     - Prune -7 call errors and automatically reprocess them (with a
9       strike out counter of 3)--this requires better error parsing.
10     - IOError should be aggregated, right now contains custom string
11       that makes this not possible. Partition on a colon.
12     - Replace gaierror with a more descriptive name (this is a DNS error)
13     - Stronger skips means that backup failures should also be avoided
14     - Distinguish between types of backup failures
15     - Ignore empty blacklists; they should all have reasons
16     - wizard upgrade should have different exit codes for merge failure
17       and blacklist error.
18
19 - Distinguish from logging and reporting (so we can easily send mail
20   to users)
21     - Figure out a way of collecting blacklist data from .scripts/blacklisted
22       and aggregate it together
23
24 - Let users use Wizard when ssh'ed into Scripts
25     - Make single user mass-migrate work when not logged in as root
26
27 - Make the rest of the world use Wizard
28     - Make parallel-find.pl use `sudo -u username git describe --tags`
29       to determine version.  Make parallel-find.pl have this have greater
30       precedence.  This also means, however, that we get
31       full mediawiki-1.2.3-2-abcdef names (Have patch, pending testing and commit)
32     - Make deployed installer use 'wizard install' /or/ do a migration
33       after doing a normal install (the latter makes it easier
34       for mass-rollbacks).
35
36 - Pre-emptively check if daemon/scripts-security-upd
37   is not on scripts-security-upd list (/mit/moira/bin/blanche)
38
39 - Redo Wordpress conversion, with an eye for automating everything
40   possible (such as downloading the tarball and unpacking)
41
42 - Pay back code debt
43     - Genericize callAsUser and drop_priviledges in shell
44     - Summary script should be more machine friendly, and should not
45       output summary charts when I increase specificity
46     - Summary script should do something intelligent when distinguishing
47       between old-style and new-style installs
48     - Report code in wizard/command/__init__.py is ugly as sin.  Also,
49       the Report object should operate at a higher level of abstraction
50       so we don't have to manually increment fails. (in fact, that should
51       probably be called something different).  The by-percent errors should
52       also be automated.
53     - Indents in upgrade.py are getting pretty ridiculous; more breaking
54       into functions is probably a good idea
55     - Move resolutions in mediawiki.py to a text file? (the parsing overhead
56       may not be worth it)
57     - Investigate QuotaParseErrors
58     - If a process is C-ced, it can result in a upgrade that has
59       an updated filesystem but not updated database. Make this more
60       resilient
61     - PHP end of file allows omitted semicolon, can result in parse error
62       if merge resolutions aren't careful.
63
64 - Other stuff
65     - Don't use the scripts heuristics unless we're on scripts with the
66       AFS patch.  Check with `fs sysname`
67     - Make 'wizard summary' generate nice pretty graphs of installs by date
68       (more histograms, will need to check actual .scripts-version files.)
69     - It should be able to handle installs like Django where there's a component
70       that gets installed in web_scripts and another directory that gets installed
71       in Scripts.
72     - ACLs is a starting point for sending mail to users, but it has
73       several failure modes:
74         - Old maintainers who don't care who are still on the ACL
75         - Private AFS groups that aren't mailing lists and that we
76           can't get to
77       A question is whether or not sending mail actually helps us:
78       many users will probably have to come back to us for help; many
79       other users won't care.
80
81 PULLING OUT CONFIGURATION FILES IN AN AUTOMATED MANNER
82
83 advancedpoll: Template file to fill out
84 django: Noodles of template files
85 gallery2: Multistage install process
86 joomla: Template file
87 mediawiki: One-step install process
88 phpbb: Multistage install process
89 phpical: Template file
90 trac: NFC
91 turbogears: NFC
92 wordpress: Multistage install process
93
94 PHILOSOPHY ABOUT LOGGING
95
96 Logging is most useful when performing a mass run.  This
97 includes things such as mass-migration as well as when running
98 summary reports.  An interesting property about mass-migration
99 or mass-upgrade, however, is that if they fail, they are
100 idempotent, so an individual case can be debugged simply running
101 the single-install equivalent with --debug on.  (This, indeed,
102 may be easier to do than sifting through a logfile).
103
104 It is a different story when you are running a summary report:
105 you are primarily bound by your AFS cache and how quickly you can
106 iterate through all of the autoinstalls.  Checking if a file
107 exists on a cold AFS cache may
108 take several minutes to perform; on a hot cache the same report
109 may take a mere 3 seconds.  When you get to more computationally
110 expensive calculations, however, even having a hot AFS cache
111 is not enough to cut down your runtime.
112
113 There are certain calculations that someone may want to be
114 able to perform on manipulated data.  As such, this data should
115 be cached on disk, if the process for extracting this data takes
116 a long time.  Also, for usability sake, Wizard should generate
117 the common case reports.
118
119 Ensuring that machine parseable reports are made, and then making
120 the machinery to reframe this data, increases complexity.  Therefore,
121 the recommendation is to assume that if you need to run iteratively,
122 you'll have a hot AFS cache at your fingerprints, and if that's not
123 fast enough, then cache the data.
124
125 COMMIT MESSAGE FIELDS:
126
127 Installed-by: username@hostname
128 Pre-commit-by: Real Name <username@mit.edu>
129 Upgraded-by: Real Name <username@mit.edu>
130 Migrated-by: Real Name <username@mit.edu>
131 Wizard-revision: abcdef1234567890
132 Wizard-args: /wizard/bin/wizard foo bar baz
133
134 GIT COMMIT FIELDS:
135
136 Committer: Real Name <username@mit.edu>
137 Author: lockername locker <lockername@scripts.mit.edu>
138
139 NOTES:
140
141 - It is not expected or required for update scripts to exist for all
142   intervening versions that were present pre-migration; only for it
143   to work on the most recent migration.
144
145 - Currently all repositories are initialized with --shared, which
146   means they have basically ~no space footprint.  However, it
147   also means that /mit/scripts/wizard/srv MUST NOT lose revs after
148   deployment.
149
150 - Full fledged logging options. Namely:
151   x all loggers (delay implementing this until we actually have debug stmts)
152     - default is WARNING
153     - debug     => loglevel = DEBUG
154   x stdout logger
155     - default is WARNING (see below for exception)
156     - verbose   => loglevel = INFO
157   x file logger (creates a dir and lots of little logfiles)
158     - default is OFF
159     - log-file   => loglevel = INFO
160
161 OVERALL PLAN:
162
163 * Some parts of the infrastructure will not be touched, although I plan
164   on documenting them.  Specifically, we will be keeping:
165
166     - parallel-find.pl, and the resulting
167       /mit/scripts/.htaccess/scripts/sec-tools/store/scriptslist
168
169 * The new procedure for generating an update is as follows:
170   (check out the mass-migration instructions for something in this spirit,
171   although uglier in some ways; A indicates the step /should/ be automated)
172
173     0. ssh into not-backward, temporarily give the daemon.scripts-security-upd
174        bits by blanching it on system:scripts-security-upd, and run parallel-find.pl
175
176     1. Have the Git repository and working copy for the project on hand.
177
178 /- wizard prepare-pristine --
179
180 A   2. Checkout the pristine branch
181
182 A   3. Remove all files from the working copy.  Use `wipe-working-dir`
183
184 A   4. Download the new tarball
185
186 A   5. Extract the tarball over the working copy (`cp -R a/. b` works well,
187        remember that the working copy is empty; this needs some intelligent
188        input)
189
190 A   6. Check for empty directories and add stub files as necessary.
191        Use `preserve-empty-dir`
192
193 \---
194
195     7. Git add it all, and then commit as a new pristine version (v1.2.3)
196
197     8. Checkout the master branch
198
199     9. [FOR EXISTING REPOSITORIES]
200        Merge the pristine branch in. Resolve any conflicts that our
201        patches have with new changes. Do NOT let Git auto-commit it
202        with --no-commit (otherwise, you want to git commit --amend
203        to keep our history clean
204
205        [FOR NEW REPOSITORIES]
206        Check if any patches are needed to make the application work
207        on Scripts (ideally, it shouldn't.
208
209 /- wizard prepare-new --
210
211     Currently not used for anything besides parallel-find.pl, but
212     we reserve the right to place files in here in the future.
213
214 A       mkdir .scripts
215 A       echo "Deny from all" > .scripts/.htaccess
216
217 \---
218
219    10. Check if there are any special update procedures, and update
220        the wizard.app.APPNAME module accordingly (or create it, if
221        need be).
222
223    11. Run 'wizard prepare-config' on a scripts server while in a checkout
224        of this newest version.  This will prepare a new version of the
225        configuration file based on the application's latest installer.
226        Manually merge back in any custom changes we may have made.
227        Check if any of the regular expressions need tweaking by inspecting
228        the configuration files for user-specific gunk, and modify
229        wizard.app.APPNAME accordingly.
230
231    12. Commit your changes, and tag as v1.2.3-scripts (or scripts2, if
232        you are amending an install without an upstream changes)
233
234       NOTE: These steps should be run on a scripts server
235
236    13. Test the new update procedure using our test scripts.  See integration
237        tests for more information on how to do this.
238
239         http://scripts.mit.edu/wizard/testing.html#acceptance-tests
240
241       GET APPROVAL BEFORE PROCEEDING ANY FURTHER
242
243       NOTE: The following commands are to be run on not-backward.mit.edu.
244       You'll need to add daemon.scripts-security-upd to
245       scripts-security-upd to get bits to do this.  Make sure you remove
246       these bits when you're done.
247
248 A  14. Run `wizard research appname`
249        which uses Git commands to check how many
250        working copies apply the change cleanly, and writes out a logfile
251        with the working copies that don't apply cleanly.  It also tells
252        us about "corrupt" working copies, i.e. working copies that
253        have over a certain threshold of changes.
254
255 A  15. Run `wizard mass-upgrade appname`, which applies the update to all working
256        copies possible, and sends mail to users to whom the working copy
257        did not apply cleanly.
258
259    16. Run parallel-find.pl to update our inventory
260
261 * For mass importing into the repository, there are a few extra things:
262
263     * Many applications had patches associated with them.  Be sure to
264       apply them, so later merges work better.
265
266         # the following operation might require -p1
267         patch -p0 < ../app-1.2.3/app-1.2.3.patch  # [FIDDLY BIT]
268
269     * When running updates, if the patch has changed you will have to
270       do a special procedure for your merge:
271
272         git checkout pristine
273         # NOTE: Now, the tricky part (this is different from a real update)
274         git symbolic-ref HEAD refs/heads/master
275         # NOTE: Now, we think we're on the master branch, but we have
276         # pristine copy checked out
277         # NOTE: -p0 might need to be twiddled
278         patch -p0 < ../app-1.2.3/app-1.2.3.patch
279         git add .
280         # reconstitute .scripts directory
281         git checkout v1.2.2-scripts -- .scripts
282         git add .scripts
283         # NOTE: Fake the merge
284         git rev-parse pristine > .git/MERGE_HEAD
285
286       You could also just try your luck with a manual merge using the patch
287       as your guide.
288
289 * The repository for a given application will contain the following files:
290
291     - The actual application's files, as from the official tarball
292
293     - A .scripts directory, with the intent of holding Scripts specific files
294       if they become necessary.
295
296         * .scripts/lock (generated) which locks an autoinstall during upgrade
297