5 - Consider making the history git-svn
6 - Consider adding user config to repository
7 - Put php.ini links in repos (probably will need another
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 COMMIT MESSAGE FIELDS:
40 Installed-by: username@hostname
41 Pre-commit-by: Real Name <username@mit.edu>
42 Upgraded-by: Real Name <username@mit.edu>
43 Migrated-by: Real Name <username@mit.edu>
44 Wizard-revision: abcdef1234567890
45 Wizard-args: /wizard/bin/wizard foo bar baz
49 Committer: Real Name <username@mit.edu>
50 Author: lockername locker <lockername@scripts.mit.edu>
54 - A perfectly formed autoinstall with upgrade paths for all of
55 the intervening versions is not really feasible to implement.
56 As such, we want to migrate everything to -scripts, and then
57 generate a -scripts2 with the correct .scripts directory.
58 We will then nop update some installs, but this will prevent
59 us from having to migrate and update concurrently. Treat
60 a scripts2 upgrade from migration the same way you would treat
61 a botched scripts upgrade.
63 - Currently all repositories are initialized with --shared, which
64 means they have basically ~no space footprint. However, it
65 also means that /mit/scripts/wizard/srv MUST NOT lose revs.
67 - Full fledged logging options. Namely:
68 x all loggers (delay implementing this until we actually have debug stmts)
70 - debug => loglevel = DEBUG
72 - default is WARNING (see below for exception)
73 - verbose => loglevel = INFO
74 x file logger (only allowed for serial processing)
76 - log-file => loglevel = INFO
77 x database logger (necessary for parallel processing, not implemented)
79 - log-db => loglevel = INFO
81 - More on the database logger: it will be very simple with one
82 table named `logs` in SQLite, with columns: `job`, `level`,
83 `message`. Job identifies the subprocess/thread that emitted
84 the log, so things can be correlated together. We will then
85 have `wizard dump` which takes a database like this and dumps
86 it into a file logger type file. The database may also store
87 a queue like structure which can be used to coordinate jobs.
91 * Some parts of the infrastructure will not be touched, although I plan
92 on documenting them. Specifically, we will be keeping:
94 - parallel-find.pl, and the resulting
95 /mitalso make .scripts/.htaccess/scripts/sec-tools/store/scriptslist
96 This script might need to be adapted if we decide to nuke
97 .scripts-version files.
99 - The current install scripts will be kept in place, sans changes
100 necessary to make them use Git install of copying the script over.
101 Porting these scripts to Python and making them modular would be
102 nice, but is priority. For the long term, seeing this scripts
103 be packaged with rest of our code would be optimal.
105 * The new procedure for generating an update is as follows:
106 (check out the mass-migration instructions for something in this spirit,
107 although uglier in some ways)
109 0. ssh into not-backward, temporarily give the daemon.scripts-security-upd
110 bits by blanching it on system:scripts-security-upd, and run parallel-find.pl
112 1. Have the Git repository and working copy for the project on hand.
114 2. Checkout the pristine branch
116 3. Remove all files from the working copy. Use `wipe-working-dir`
118 4. Download the new tarball
120 5. Extract the tarball over the working copy (`cp -R a/. b` works well,
121 remember that the working copy is empty)
123 6. Check for empty directories and add stub files as necessary.
124 Use `preserve-empty-dir`
126 7. Git add it all, and then commit as a new pristine version (v1.2.3)
128 8. Checkout the master branch
130 9. [FOR EXISTING REPOSITORIES]
131 Merge the pristine branch in. Resolve any conflicts that our
132 patches have with new changes. Do NOT let Git auto-commit it
133 with --no-commit (otherwise, you want to git commit --amend
134 to keep our history clean
136 [FOR NEW REPOSITORIES]
137 See if any patches are needed to make this run smoothly on
140 [FOR NEW REPOSITORIES]
142 echo "Deny from all" > .scripts/.htaccess
143 touch .scripts/update
144 chmod a+x .scripts/update
146 10. Check if there are any special update procedures, and update/create the
147 .scripts/update shell script as necessary (this means that any
148 application specific update logic will be kept with the actual
149 source code. The language of this update script will vary
150 depending on context.)
152 11. Commit your changes, and tag as v1.2.3-scripts (or scripts2, if
153 you are amending an install without an upstream changes)
155 12. Test the new update procedure using
156 `wizard upgrade --with=/path/to/repo /your/autoinstall` (this will
157 read out master as your "latest" version).
158 Use git commit --amend to fix any bugs (alternatively, squash them
161 13. You can also do a "mass" version of this using:
162 `wizard -d testbed.txt massupgrade --with=/path/to/repo app`
163 You'll need perms for any testbed stuff you want.
165 GET APPROVAL BEFORE PROCEEDING ANY FURTHER
167 NOTE: The following commands are to be run on not-backward.mit.edu.
168 You'll need to add daemon.scripts-security-upd to
169 scripts-security-upd to get bits to do this. Make sure you remove
170 these bits when you're done.
172 14. Run `wizard research appname`
173 which uses Git commands to check how many
174 working copies apply the change cleanly, and writes out a logfile
175 with the working copies that don't apply cleanly. It also tells
176 us about "corrupt" working copies.
178 15. Run `wizard massupgrade appname`, which applies the update to all working
179 copies possible, and sends mail to users to whom the working copy
180 did not apply cleanly. It also frobs .scripts-version for successful
181 upgrades (maybe not, depending on our plans).
183 16. Run parallel-find.pl to update our inventory
185 * For mass importing into the repository, the steps are:
186 (this probably won't ever be automated, becuase there are fiddly bits)
189 # let app-1.2.3 be the scripts folder originally in deploydev
190 # let this folder be srv/
191 # you can also do a git clone
196 unfurl app-1.2.3 app # [FIDDLY BIT]
197 # NOTE: contents of application are now in app directory
200 git commit -s -m "App 1.2.3"
203 # NOTE: you're still on master branch
204 # WARNING: the following operation might require -p1
205 patch -p0 < ../app-1.2.3/app-1.2.3.patch # [FIDDLY BIT]
206 # NOTE: please sanity check the patch!
208 # NOTE: -a flag is to handle if the patch deleted something
209 git commit -as -m "App 1.2.3-scripts"
210 git tag v1.2.3-scripts
213 # let this folder be srv/app.git
214 git checkout pristine
215 # NOTE: this preserves your .git folder, but removes everything
218 unfurl app-1.2.3 app # [FIDDLY BIT]
220 # NOTE: please sanity check app directory
222 # NOTE: -a is to take care of deletions
223 git commit -as -m "App 1.2.3"
225 [FIDDLE AROUND. FIDDLE AROUND]
226 [IF THE PATCH HAS CHANGED]
227 # You are on the pristine branch
228 # NOTE: Now, the tricky part (this is different from a real update)
229 git symbolic-ref HEAD refs/heads/master
230 # NOTE: Now, we think we're on the master branch, but we have
231 # pristine copy checked out
232 # NOTE: -p0 might need to be twiddled
233 patch -p0 < ../app-1.2.3/app-1.2.3.patch
235 # COMMENT: used to git checkout .scripts here
236 # then check if the directory needs an updated update script
237 # NOTE: Fake the merge
238 git rev-parse pristine > .git/MERGE_HEAD
239 [IF THE PATCH HASN'T CHANGED]
241 git merge --no-commit pristine
242 git commit -as -m "App 1.2.3-scripts"
243 git tag v1.2.3-scripts
245 * The repository for a given application will contain the following files:
247 - The actual application's files, as from the official tarball
249 - A .scripts directory, which contains the following information:
251 * .scripts/update shell script (with the +x bit set appropriately),
252 which performs the commands necessary to update a script. This can
255 * .scripts/.htaccess to prevent this directory from being accessed
258 * .scripts/database (generated) contains the database the
259 user installed the script to, so scripts-remove can clean it
261 XXX: Could cause problems if a user copies the autoinstall,
262 fiddles with the DB credentials, and then scripts-remove's
263 the autoinstall. Possible fix is to add the original
264 directory as a sanity check. Additionally, we could have
265 the application read out of this file.
267 * .scripts/old-version (optional) the old value of .scripts-versoin
269 * .scripts/install (eventually) interactively installs the
270 applicatoin from command line.
272 * The autoupgrade shall be the process of:
274 # Make the directory not accessible by the outside world (htaccess, but be careful!)
276 git commit -m 'automatically generated backup'
277 git pull origin master
278 if [ $? ne 0 ]; then git reset --hard; echo 'conflicts during upgrade'; fi
282 (with some more robust error checking, a proper dry run mechanism to, and
285 * Make 'wizard summary' generate nice pretty graphs of installs by date
286 (more histograms, will need to check actual .scripts-version files.)
288 * Update AFS patch to advertise its existence, so we can check for it