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