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