5 - Consider adding user config to repository
6 - Put php.ini links in repos (probably will need another
8 - Version configuration
10 - Consider making usermode wizard operation a support mode
11 (mostly for letting users upgrade things themself)
13 - Add repository flag to migrate so that we can specify an
14 arbitrary repository to migrate to
16 - The great initial deploy:
17 - Turn on mediawiki new autoinstaller
18 - Migrate all mediawik installs
20 - Implement proper deploy log parsing; this basically means we
21 need to be able to introspect Git Log. Consider using git-python
22 for this. There's also missing functionality, bad error handling
23 and hacks in the prototype implementation of upgrade
25 - Wordpress needs to have .scripts dir in all -scripts versions
26 (remember --no-walk!) (also make .scripts/.htaccess)
27 - Wordpress needs to have a .scripts/update script written for
28 its latest version (do this after its migration)
29 - Wordpress needs to check for php.ini files (which it almost
30 certianly has) and commit messages
32 - Summary script should be more machine friendly, and should not
33 output summary charts when I increase specificity
34 - Check how many autoinstalls are missing w bits for
35 daemon.scripts (this would need pyafs)
36 - Consider fixing Wizard's commit messages
38 PULLING OUT CONFIGURATION FILES IN AN AUTOMATED MANNER
40 advancedpoll: Template file to fill out
41 django: Noodles of template files
42 gallery2: Multistage install process
44 mediawiki: One-step install process
45 phpbb: Multistage install process
46 phpical: Template file
49 wordpress: Multistage install process
51 PHILOSOPHY ABOUT LOGGING
53 Logging is most useful when performing a mass run. This
54 includes things such as mass-migration as well as when running
55 summary reports. An interesting property about mass-migration
56 or mass-upgrade, however, is that if they fail, they are
57 idempotent, so an individual case can be debugged simply running
58 the single-install equivalent with --debug on. (This, indeed,
59 may be easier to do than sifting through a logfile).
61 It is a different story when you are running a summary report:
62 you are primarily bound by your AFS cache and how quickly you can
63 iterate through all of the autoinstalls. Checking if a file
64 exists on a cold AFS cache may
65 take several minutes to perform; on a hot cache the same report
66 may take a mere 3 seconds. When you get to more computationally
67 expensive calculations, however, even having a hot AFS cache
68 is not enough to cut down your runtime.
70 There are certain calculations that someone may want to be
71 able to perform on manipulated data. As such, this data should
72 be cached on disk, if the process for extracting this data takes
73 a long time. Also, for usability sake, Wizard should generate
74 the common case reports.
76 Ensuring that machine parseable reports are made, and then making
77 the machinery to reframe this data, increases complexity. Therefore,
78 the recommendation is to assume that if you need to run iteratively,
79 you'll have a hot AFS cache at your fingerprints, and if that's not
80 fast enough, then cache the data.
82 COMMIT MESSAGE FIELDS:
84 Installed-by: username@hostname
85 Pre-commit-by: Real Name <username@mit.edu>
86 Upgraded-by: Real Name <username@mit.edu>
87 Migrated-by: Real Name <username@mit.edu>
88 Wizard-revision: abcdef1234567890
89 Wizard-args: /wizard/bin/wizard foo bar baz
93 Committer: Real Name <username@mit.edu>
94 Author: lockername locker <lockername@scripts.mit.edu>
98 - A perfectly formed autoinstall with upgrade paths for all of
99 the intervening versions is not really feasible to implement.
100 As such, we want to migrate everything to -scripts, and then
101 generate a -scripts2 with the correct .scripts directory.
102 We will then nop update some installs, but this will prevent
103 us from having to migrate and update concurrently. Treat
104 a scripts2 upgrade from migration the same way you would treat
105 a botched scripts upgrade.
107 - Currently all repositories are initialized with --shared, which
108 means they have basically ~no space footprint. However, it
109 also means that /mit/scripts/wizard/srv MUST NOT lose revs.
111 - Full fledged logging options. Namely:
112 x all loggers (delay implementing this until we actually have debug stmts)
114 - debug => loglevel = DEBUG
116 - default is WARNING (see below for exception)
117 - verbose => loglevel = INFO
118 x file logger (only allowed for serial processing)
120 - log-file => loglevel = INFO
121 x database logger (necessary for parallel processing, not implemented)
123 - log-db => loglevel = INFO
125 - More on the database logger: it will be very simple with one
126 table named `logs` in SQLite, with columns: `job`, `level`,
127 `message`. Job identifies the subprocess/thread that emitted
128 the log, so things can be correlated together. We will then
129 have `wizard dump` which takes a database like this and dumps
130 it into a file logger type file. The database may also store
131 a queue like structure which can be used to coordinate jobs.
135 * Some parts of the infrastructure will not be touched, although I plan
136 on documenting them. Specifically, we will be keeping:
138 - parallel-find.pl, and the resulting
139 /mitalso make .scripts/.htaccess/scripts/sec-tools/store/scriptslist
140 This script might need to be adapted if we decide to nuke
141 .scripts-version files.
143 - The current install scripts will be kept in place, sans changes
144 necessary to make them use Git install of copying the script over.
145 Porting these scripts to Python and making them modular would be
146 nice, but is priority. For the long term, seeing this scripts
147 be packaged with rest of our code would be optimal.
149 * The new procedure for generating an update is as follows:
150 (check out the mass-migration instructions for something in this spirit,
151 although uglier in some ways)
153 0. ssh into not-backward, temporarily give the daemon.scripts-security-upd
154 bits by blanching it on system:scripts-security-upd, and run parallel-find.pl
156 1. Have the Git repository and working copy for the project on hand.
158 2. Checkout the pristine branch
160 3. Remove all files from the working copy. Use `wipe-working-dir`
162 4. Download the new tarball
164 5. Extract the tarball over the working copy (`cp -R a/. b` works well,
165 remember that the working copy is empty)
167 6. Check for empty directories and add stub files as necessary.
168 Use `preserve-empty-dir`
170 7. Git add it all, and then commit as a new pristine version (v1.2.3)
172 8. Checkout the master branch
174 9. [FOR EXISTING REPOSITORIES]
175 Merge the pristine branch in. Resolve any conflicts that our
176 patches have with new changes. Do NOT let Git auto-commit it
177 with --no-commit (otherwise, you want to git commit --amend
178 to keep our history clean
180 [FOR NEW REPOSITORIES]
181 See if any patches are needed to make this run smoothly on
184 [FOR NEW REPOSITORIES]
186 echo "Deny from all" > .scripts/.htaccess
187 touch .scripts/update
188 chmod a+x .scripts/update
190 10. Check if there are any special update procedures, and update/create the
191 .scripts/update shell script as necessary (this means that any
192 application specific update logic will be kept with the actual
193 source code. The language of this update script will vary
194 depending on context.)
196 11. Commit your changes, and tag as v1.2.3-scripts (or scripts2, if
197 you are amending an install without an upstream changes)
199 12. Test the new update procedure using
200 `wizard upgrade --with=/path/to/repo /your/autoinstall` (this will
201 read out master as your "latest" version).
202 Use git commit --amend to fix any bugs (alternatively, squash them
205 13. You can also do a "mass" version of this using:
206 `wizard -d testbed.txt massupgrade --with=/path/to/repo app`
207 You'll need perms for any testbed stuff you want.
209 GET APPROVAL BEFORE PROCEEDING ANY FURTHER
211 NOTE: The following commands are to be run on not-backward.mit.edu.
212 You'll need to add daemon.scripts-security-upd to
213 scripts-security-upd to get bits to do this. Make sure you remove
214 these bits when you're done.
216 14. Run `wizard research appname`
217 which uses Git commands to check how many
218 working copies apply the change cleanly, and writes out a logfile
219 with the working copies that don't apply cleanly. It also tells
220 us about "corrupt" working copies.
222 15. Run `wizard massupgrade appname`, which applies the update to all working
223 copies possible, and sends mail to users to whom the working copy
224 did not apply cleanly. It also frobs .scripts-version for successful
225 upgrades (maybe not, depending on our plans).
227 16. Run parallel-find.pl to update our inventory
229 * For mass importing into the repository, the steps are:
230 (this probably won't ever be automated, becuase there are fiddly bits)
233 # let app-1.2.3 be the scripts folder originally in deploydev
234 # let this folder be srv/
235 # you can also do a git clone
240 unfurl app-1.2.3 app # [FIDDLY BIT]
241 # NOTE: contents of application are now in app directory
244 git commit -s -m "App 1.2.3"
247 # NOTE: you're still on master branch
248 # WARNING: the following operation might require -p1
249 patch -p0 < ../app-1.2.3/app-1.2.3.patch # [FIDDLY BIT]
250 # NOTE: please sanity check the patch!
252 # NOTE: -a flag is to handle if the patch deleted something
253 git commit -as -m "App 1.2.3-scripts"
254 git tag v1.2.3-scripts
257 # let this folder be srv/app.git
258 git checkout pristine
259 # NOTE: this preserves your .git folder, but removes everything
262 unfurl app-1.2.3 app # [FIDDLY BIT]
264 # NOTE: please sanity check app directory
266 # NOTE: -a is to take care of deletions
267 git commit -as -m "App 1.2.3"
269 [FIDDLE AROUND. FIDDLE AROUND]
270 [IF THE PATCH HAS CHANGED]
271 # You are on the pristine branch
272 # NOTE: Now, the tricky part (this is different from a real update)
273 git symbolic-ref HEAD refs/heads/master
274 # NOTE: Now, we think we're on the master branch, but we have
275 # pristine copy checked out
276 # NOTE: -p0 might need to be twiddled
277 patch -p0 < ../app-1.2.3/app-1.2.3.patch
279 # COMMENT: used to git checkout .scripts here
280 # then check if the directory needs an updated update script
281 # NOTE: Fake the merge
282 git rev-parse pristine > .git/MERGE_HEAD
283 [IF THE PATCH HASN'T CHANGED]
285 git merge --no-commit pristine
286 git commit -as -m "App 1.2.3-scripts"
287 git tag v1.2.3-scripts
289 * The repository for a given application will contain the following files:
291 - The actual application's files, as from the official tarball
293 - A .scripts directory, which contains the following information:
295 * .scripts/update shell script (with the +x bit set appropriately),
296 which performs the commands necessary to update a script. This can
299 * .scripts/.htaccess to prevent this directory from being accessed
302 * .scripts/database (generated) contains the database the
303 user installed the script to, so scripts-remove can clean it
305 XXX: Could cause problems if a user copies the autoinstall,
306 fiddles with the DB credentials, and then scripts-remove's
307 the autoinstall. Possible fix is to add the original
308 directory as a sanity check. Additionally, we could have
309 the application read out of this file.
311 * .scripts/old-version (optional) the old value of .scripts-versoin
313 * .scripts/install (eventually) interactively installs the
314 applicatoin from command line.
316 * The autoupgrade shall be the process of:
318 # Make the directory not accessible by the outside world (htaccess, but be careful!)
320 git commit -m 'automatically generated backup'
321 git pull origin master
322 if [ $? ne 0 ]; then git reset --hard; echo 'conflicts during upgrade'; fi
326 (with some more robust error checking, a proper dry run mechanism to, and
329 * Make 'wizard summary' generate nice pretty graphs of installs by date
330 (more histograms, will need to check actual .scripts-version files.)
332 * Update AFS patch to advertise its existence, so we can check for it