5 - Something needs to be done if disk quota is exceeded:
6 - Catch the OSError and throw a domain-specific error
7 so massmigrate can deal gracefully
8 - Perform an added memory calculation, check this against
9 remaining quotai, and bail out if it's within some
10 percentage of their remaining quota
11 - Checks should also be performed against the partition
12 X with the new --shared flag this may not be necessary
13 as repos weighs less than 200K
14 - Should write to a "processed" file to make resuming with
15 unexpected failure faster (possibly should be database if
16 parallelized). Remember that each subprocess will be a fork
17 - Figure out IPC logging.
18 - Make version directory also work with a location (with no
19 colon) format; this will make making fake "testbed" directories
20 easier to do. Also let it accept a file, instead of a directory.
21 - Check how many autoinstalls are missing w bits for
22 daemon.scripts (this would need pyafs)
23 - Run parallel-find.pl
24 - Migrate all mediawikis
25 - Wordpress needs to have a .scripts/update script written for
30 - A perfectly formed autoinstall with upgrade paths for all of
31 the intervening versions is not really feasible to implement.
32 As such, we want to migrate everything to -scripts, and then
33 generate a -scripts2 with the correct .scripts directory.
34 We will then nop update some installs, but this will prevent
35 us from having to migrate and update concurrently. Treat
36 a scripts2 upgrade from migration the same way you would treat
37 a botched scripts upgrade.
39 - summary and info are still not using loggers. Maybe they should,
40 maybe they shouldn't. Using loggers means we lose interactivity
43 - Currently all repositories are initialized with --shared, which
44 means they have basically ~no space footprint. However, it
45 also means that /mit/scripts/wizard/srv MUST NOT lose revs.
49 * Some parts of the infrastructure will not be touched, although I plan
50 on documenting them. Specifically, we will be keeping:
52 - parallel-find.pl, and the resulting
53 /mit/scripts/sec-tools/store/scriptslist
54 This script might need to be adapted if we decide to nuke
55 .scripts-version files.
57 - The current install scripts will be kept in place, sans changes
58 necessary to make them use Git install of copying the script over.
59 Porting these scripts to Python and making them modular would be
60 nice, but is priority. For the long term, seeing this scripts
61 be packaged with rest of our code would be optimal.
63 * The new procedure for generating an update is as follows:
64 (check out the mass-migration instructions for something in this spirit,
65 although uglier in some ways)
67 0. ssh into not-backward, temporarily give the daemon.scripts-security-upd
68 bits by blanching it on system:scripts-security-upd, and run parallel-find.pl
70 1. Have the Git repository and working copy for the project on hand.
72 2. Checkout the pristine branch
74 3. Remove all files from the working copy. Use `wipe-working-dir`
76 4. Download the new tarball
78 5. Extract the tarball over the working copy (`cp -R a/. b` works well,
79 remember that the working copy is empty)
81 6. Check for empty directories and add stub files as necessary.
82 Use `preserve-empty-dir`
84 7. Git add it all, and then commit as a new pristine version (v1.2.3)
86 8. Checkout the master branch
88 9. [FOR EXISTING REPOSITORIES]
89 Merge the pristine branch in. Resolve any conflicts that our
90 patches have with new changes. Do NOT let Git auto-commit it
91 with --no-commit (otherwise, you want to git commit --amend
92 to keep our history clean
94 [FOR NEW REPOSITORIES]
95 See if any patches are needed to make this run smoothly on
98 [FOR NEW REPOSITORIES]
100 echo "Deny from all" > .scripts/.htaccess
101 touch .scripts/update
102 chmod a+x .scripts/update
104 10. Check if there are any special update procedures, and update/create the
105 .scripts/update shell script as necessary (this means that any
106 application specific update logic will be kept with the actual
107 source code. The language of this update script will vary
108 depending on context.)
110 11. Commit your changes, and tag as v1.2.3-scripts (or scripts2, if
111 you are amending an install without an upstream changes)
113 12. Test the new update procedure using
114 `wizard upgrade --with=/path/to/repo /your/autoinstall` (this will
115 read out master as your "latest" version).
116 Use git commit --amend to fix any bugs (alternatively, squash them
119 13. You can also do a "mass" version of this using:
120 `wizard -d testbed.txt massupgrade --with=/path/to/repo app`
121 You'll need perms for any testbed stuff you want.
123 GET APPROVAL BEFORE PROCEEDING ANY FURTHER
125 NOTE: The following commands are to be run on not-backward.mit.edu.
126 You'll need to add daemon.scripts-security-upd to
127 scripts-security-upd to get bits to do this. Make sure you remove
128 these bits when you're done.
130 14. Run `wizard research appname`
131 which uses Git commands to check how many
132 working copies apply the change cleanly, and writes out a logfile
133 with the working copies that don't apply cleanly. It also tells
134 us about "corrupt" working copies.
136 15. Run `wizard massupgrade appname`, which applies the update to all working
137 copies possible, and sends mail to users to whom the working copy
138 did not apply cleanly. It also frobs .scripts-version for successful
139 upgrades (maybe not, depending on our plans).
141 16. Run parallel-find.pl to update our inventory
143 * For mass importing into the repository, the steps are:
144 (this probably won't ever be automated, becuase there are fiddly bits)
147 # let app-1.2.3 be the scripts folder originally in deploydev
148 # let this folder be srv/
149 # you can also do a git clone
154 unfurl app-1.2.3 app # [FIDDLY BIT]
155 # NOTE: contents of application are now in app directory
158 git commit -s -m "App 1.2.3"
161 # NOTE: you're still on master branch
162 # WARNING: the following operation might require -p1
163 patch -p0 < ../app-1.2.3/app-1.2.3.patch # [FIDDLY BIT]
164 # NOTE: please sanity check the patch!
166 # NOTE: -a flag is to handle if the patch deleted something
167 git commit -as -m "App 1.2.3-scripts"
168 git tag v1.2.3-scripts
171 # let this folder be srv/app.git
172 git checkout pristine
173 # NOTE: this preserves your .git folder, but removes everything
176 unfurl app-1.2.3 app # [FIDDLY BIT]
178 # NOTE: please sanity check app directory
180 # NOTE: -a is to take care of deletions
181 git commit -as -m "App 1.2.3"
183 [FIDDLE AROUND. FIDDLE AROUND]
184 [IF THE PATCH HAS CHANGED]
185 # You are on the pristine branch
186 # NOTE: Now, the tricky part (this is different from a real update)
187 git symbolic-ref HEAD refs/heads/master
188 # NOTE: Now, we think we're on the master branch, but we have
189 # pristine copy checked out
190 # NOTE: -p0 might need to be twiddled
191 patch -p0 < ../app-1.2.3/app-1.2.3.patch
193 # COMMENT: used to git checkout .scripts here
194 # then check if the directory needs an updated update script
195 # NOTE: Fake the merge
196 git rev-parse pristine > .git/MERGE_HEAD
197 [IF THE PATCH HASN'T CHANGED]
199 git merge --no-commit pristine
200 git commit -as -m "App 1.2.3-scripts"
201 git tag v1.2.3-scripts
204 * The repository for a given application will contain the following files:
206 - The actual application's files, as from the official tarball
208 - A .scripts directory, which contains the following information:
210 * .scripts/update shell script (with the +x bit set appropriately),
211 which performs the commands necessary to update a script. This can
214 * .scripts/.htaccess to prevent this directory from being accessed
217 * .scripts/database (generated) contains the database the
218 user installed the script to, so scripts-remove can clean it
220 XXX: Could cause problems if a user copies the autoinstall,
221 fiddles with the DB credentials, and then scripts-remove's
222 the autoinstall. Possible fix is to add the original
223 directory as a sanity check. Additionally, we could have
224 the application read out of this file.
226 * .scripts/version (generated) which contains the version
227 last autoinstalled (as distinct from the actual version
228 the script is) (This is the same as .scripts-version right
229 now; probably want to keep that for now)
231 XXX: It's unclear if we want to move to this wholesale, or
232 delay this indefinitely. quentin thinks that the Git
233 repository itself is a sufficient record.
235 * The migration process has been implemented, see 'wizard migrate'.
237 XXX: We have not decided what migration should do to .scripts-version;
238 if it does move it to .scripts, repositories should have a .gitignore
241 * The autoupgrade shall be the process of:
243 # Make the directory not accessible by the outside world (htaccess, but be careful!)
245 git commit -m 'automatically generated backup'
246 git pull origin master
247 if [ $? ne 0 ]; then git reset --hard; echo 'conflicts during upgrade'; fi
251 (with some more robust error checking, a proper dry run mechanism to, and
254 * All code that operates on an untrusted Git repository, or runs
255 executable code, should be done on NOT-BACKWARD.mit.edu. Pending
256 accounts confirmation, it will also get a principal
257 daemon.scripts-security-upd, which is what we'll actually put
258 in the scripts-security-upd group. parallel-find.pl should also
259 be run on not-backward, by virtue of its fat pipe to the AFS servers.
261 * Make 'wizard summary' generate nice pretty graphs of installs by date
262 (more histograms, will need to check actual .scripts-version files.)