5 - Better error message if daemon/scripts-security-upd
6 is not on scripts-security-upd list
8 - Add repository flag so that we can specify an
9 arbitrary repository to migrate to
10 - Fix retarded logging mechanism
12 - The great initial deploy:
13 - Turn on mediawiki new autoinstaller
14 - Migrate all mediawiki installs
17 - Need a scriptable autoinstaller, which means we rewrite
18 all of the autoinstall machinery. This doesn't need
19 to be able to create pre-wizard autoinstalls, since migration
20 is easy to test+revert
22 - Build automation for generating config files; this automation
23 will be shared with the migrate script and the installer script
24 (migrate script needs to be able to pull out values from config
25 file, so will we; installer script needs to be able to run
26 the installer to generate config files, so will this)
28 - Implement proper deploy log parsing; this basically means we
29 need to be able to introspect Git Log. Consider using git-python
32 - This should all be automated:
33 - Wordpress needs to have .scripts dir in all -scripts versions
34 (also make .scripts/.htaccess)
35 - Wordpress needs to have a .scripts/update script written for
36 its latest version (do this after its migration)
37 - Wordpress needs to check for php.ini files (which it almost
38 certianly has) and commit messages
39 - Wordpress needs user config and php.ini links made
41 - Summary script should be more machine friendly, and should not
42 output summary charts when I increase specificity
43 - Summary script needs to be updated for new format
44 - Check how many autoinstalls are missing w bits for
45 daemon.scripts (this would need pyafs)
46 - Make scripts AFS patch advertise its existence so we can check for it
48 PULLING OUT CONFIGURATION FILES IN AN AUTOMATED MANNER
50 advancedpoll: Template file to fill out
51 django: Noodles of template files
52 gallery2: Multistage install process
54 mediawiki: One-step install process
55 phpbb: Multistage install process
56 phpical: Template file
59 wordpress: Multistage install process
61 PHILOSOPHY ABOUT LOGGING
63 Logging is most useful when performing a mass run. This
64 includes things such as mass-migration as well as when running
65 summary reports. An interesting property about mass-migration
66 or mass-upgrade, however, is that if they fail, they are
67 idempotent, so an individual case can be debugged simply running
68 the single-install equivalent with --debug on. (This, indeed,
69 may be easier to do than sifting through a logfile).
71 It is a different story when you are running a summary report:
72 you are primarily bound by your AFS cache and how quickly you can
73 iterate through all of the autoinstalls. Checking if a file
74 exists on a cold AFS cache may
75 take several minutes to perform; on a hot cache the same report
76 may take a mere 3 seconds. When you get to more computationally
77 expensive calculations, however, even having a hot AFS cache
78 is not enough to cut down your runtime.
80 There are certain calculations that someone may want to be
81 able to perform on manipulated data. As such, this data should
82 be cached on disk, if the process for extracting this data takes
83 a long time. Also, for usability sake, Wizard should generate
84 the common case reports.
86 Ensuring that machine parseable reports are made, and then making
87 the machinery to reframe this data, increases complexity. Therefore,
88 the recommendation is to assume that if you need to run iteratively,
89 you'll have a hot AFS cache at your fingerprints, and if that's not
90 fast enough, then cache the data.
92 COMMIT MESSAGE FIELDS:
94 Installed-by: username@hostname
95 Pre-commit-by: Real Name <username@mit.edu>
96 Upgraded-by: Real Name <username@mit.edu>
97 Migrated-by: Real Name <username@mit.edu>
98 Wizard-revision: abcdef1234567890
99 Wizard-args: /wizard/bin/wizard foo bar baz
103 Committer: Real Name <username@mit.edu>
104 Author: lockername locker <lockername@scripts.mit.edu>
108 - A perfectly formed autoinstall with upgrade paths for all of
109 the intervening versions is not really feasible to implement.
110 As such, we want to migrate everything to -scripts, and then
111 generate a -scripts2 with the correct .scripts directory.
112 We will then nop update some installs, but this will prevent
113 us from having to migrate and update concurrently. Treat
114 a scripts2 upgrade from migration the same way you would treat
115 a botched scripts upgrade.
116 ADDENDUM: You MUST NOT migrate to a -scripts2 version; the
117 machinery can't actually handle this.
119 - Currently all repositories are initialized with --shared, which
120 means they have basically ~no space footprint. However, it
121 also means that /mit/scripts/wizard/srv MUST NOT lose revs.
123 - Full fledged logging options. Namely:
124 x all loggers (delay implementing this until we actually have debug stmts)
126 - debug => loglevel = DEBUG
128 - default is WARNING (see below for exception)
129 - verbose => loglevel = INFO
130 x file logger (only allowed for serial processing)
132 - log-file => loglevel = INFO
133 x database logger (necessary for parallel processing, not implemented)
135 - log-db => loglevel = INFO
137 - More on the database logger: it will be very simple with one
138 table named `logs` in SQLite, with columns: `job`, `level`,
139 `message`. Job identifies the subprocess/thread that emitted
140 the log, so things can be correlated together. We will then
141 have `wizard dump` which takes a database like this and dumps
142 it into a file logger type file. The database may also store
143 a queue like structure which can be used to coordinate jobs.
147 * Some parts of the infrastructure will not be touched, although I plan
148 on documenting them. Specifically, we will be keeping:
150 - parallel-find.pl, and the resulting
151 /mit/scripts/.htaccess/scripts/sec-tools/store/scriptslist
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)
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
160 A 1. Have the Git repository and working copy for the project on hand.
162 A 2. Checkout the pristine branch
164 A 3. Remove all files from the working copy. Use `wipe-working-dir`
166 A 4. Download the new tarball
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
172 A 6. Check for empty directories and add stub files as necessary.
173 Use `preserve-empty-dir`
175 A 7. Git add it all, and then commit as a new pristine version (v1.2.3)
177 A 8. Checkout the master branch
179 9. [FOR EXISTING REPOSITORIES]
180 Merge the pristine branch in. Resolve any conflicts that our
181 patches have with new changes. Do NOT let Git auto-commit it
182 with --no-commit (otherwise, you want to git commit --amend
183 to keep our history clean
185 [FOR NEW REPOSITORIES]
186 See if any patches are needed to make this run smoothly on
189 [FOR NEW REPOSITORIES]
191 A echo "Deny from all" > .scripts/.htaccess
192 touch .scripts/update
193 chmod a+x .scripts/update
195 10. Check if there are any special update procedures, and update/create the
196 .scripts/update shell script as necessary (this means that any
197 application specific update logic will be kept with the actual
198 source code. The language of this update script will vary
199 depending on context.)
201 11. Commit your changes, and tag as v1.2.3-scripts (or scripts2, if
202 you are amending an install without an upstream changes)
204 NOTE: These steps should be run on a scripts server
206 12. Test the new update procedure using
207 `wizard upgrade --with=/path/to/repo /your/autoinstall` (this will
208 read out master as your "latest" version).
209 Use git commit --amend to fix any bugs (alternatively, squash them
212 13. You can also do a "mass" version of this using:
213 `wizard -d testbed.txt massupgrade --with=/path/to/repo app`
214 You'll need perms for any testbed stuff you want. (not implemented)
216 GET APPROVAL BEFORE PROCEEDING ANY FURTHER
218 NOTE: The following commands are to be run on not-backward.mit.edu.
219 You'll need to add daemon.scripts-security-upd to
220 scripts-security-upd to get bits to do this. Make sure you remove
221 these bits when you're done.
223 14. Run `wizard research appname`
224 which uses Git commands to check how many
225 working copies apply the change cleanly, and writes out a logfile
226 with the working copies that don't apply cleanly. It also tells
227 us about "corrupt" working copies, i.e. working copies that
228 have over a certain threshold of changes.
230 15. Run `wizard massupgrade appname`, which applies the update to all working
231 copies possible, and sends mail to users to whom the working copy
232 did not apply cleanly.
234 16. Run parallel-find.pl to update our inventory
236 * For mass importing into the repository, the steps are:
237 (this probably won't ever be automated, becuase there are fiddly bits)
240 # let app-1.2.3 be the scripts folder originally in deploydev
241 # let this folder be srv/
242 # you can also do a git clone
247 unfurl app-1.2.3 app # [FIDDLY BIT]
248 # NOTE: contents of application are now in app directory
251 git commit -s -m "App 1.2.3"
254 # NOTE: you're still on master branch
255 # WARNING: the following operation might require -p1
256 patch -p0 < ../app-1.2.3/app-1.2.3.patch # [FIDDLY BIT]
257 # NOTE: please sanity check the patch!
259 # NOTE: -a flag is to handle if the patch deleted something
260 git commit -as -m "App 1.2.3-scripts"
261 git tag v1.2.3-scripts
264 # let this folder be srv/app.git
265 git checkout pristine
266 # NOTE: this preserves your .git folder, but removes everything
269 unfurl app-1.2.3 app # [FIDDLY BIT]
271 # NOTE: please sanity check app directory
273 # NOTE: -a is to take care of deletions
274 git commit -as -m "App 1.2.3"
276 [FIDDLE AROUND. FIDDLE AROUND]
277 [IF THE PATCH HAS CHANGED]
278 # You are on the pristine branch
279 # NOTE: Now, the tricky part (this is different from a real update)
280 git symbolic-ref HEAD refs/heads/master
281 # NOTE: Now, we think we're on the master branch, but we have
282 # pristine copy checked out
283 # NOTE: -p0 might need to be twiddled
284 patch -p0 < ../app-1.2.3/app-1.2.3.patch
286 # COMMENT: used to git checkout .scripts here
287 # then check if the directory needs an updated update script
288 # NOTE: Fake the merge
289 git rev-parse pristine > .git/MERGE_HEAD
290 [IF THE PATCH HASN'T CHANGED]
292 git merge --no-commit pristine
293 git commit -as -m "App 1.2.3-scripts"
294 git tag v1.2.3-scripts
296 * The repository for a given application will contain the following files:
298 - The actual application's files, as from the official tarball
300 - A .scripts directory, which contains the following information:
302 * .scripts/update shell script (with the +x bit set appropriately),
303 which performs the commands necessary to update a script. This can
306 * .scripts/.htaccess to prevent this directory from being accessed
309 * .scripts/database (generated) contains the database the
310 user installed the script to, so scripts-remove can clean it
312 XXX: Could cause problems if a user copies the autoinstall,
313 fiddles with the DB credentials, and then scripts-remove's
314 the autoinstall. Possible fix is to add the original
315 directory as a sanity check. Additionally, we could have
316 the application read out of this file.
318 * .scripts/old-version (optional) the old value of .scripts-version
320 * .scripts/version something like "app-1.2.3-scripts"
322 * .scripts/install (eventually) interactively installs the
323 application from command line. (This might go into wizard.app
326 * .scripts/lock which locks the autoinstall during an upgrade
328 * Make 'wizard summary' generate nice pretty graphs of installs by date
329 (more histograms, will need to check actual .scripts-version files.)