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