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