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