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