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