]> scripts.mit.edu Git - wizard.git/blob - TODO
Major refactoring of modules and packages to enforce Google style guide.
[wizard.git] / TODO
1 The Git Autoinstaller
2
3 TODO NOW:
4
5 - Check how many autoinstalls are missing w bits for
6   daemon.scripts
7 - Whiteboard the flow for performing an upgrade on a single
8   install. How assisted does it need to be?
9 - Conduct migration tool testing (check andersk, geofft for
10   sample MediaWikis)
11 - Set up migration server
12 - Run parallel-find.pl
13 - Migrate all mediawikis
14 - Wordpress needs to have a .scripts/update script written for
15   its latest version
16
17 NOTES:
18
19 - A perfectly formed autoinstall with upgrade paths for all of
20   the intervening versions is not really feasible to implement.
21   As such, we want to migrate everything to -scripts, and then
22   generate a -scripts2 with the correct .scripts directory.
23   We will then nop update some installs, but this will prevent
24   us from having to migrate and update concurrently.
25
26 - summary and info are still not using loggers. Maybe they should,
27   maybe they shouldn't
28
29 - We need another patched AFS server to deploy updates off of.
30
31 OVERALL PLAN:
32
33 * Some parts of the infrastructure will not be touched, although I plan
34   on documenting them.  Specifically, we will be keeping:
35
36     - parallel-find.pl, and the resulting
37 /mit/scripts/sec-tools/store/scriptslist
38
39     - The current install scripts will be kept in place, sans changes
40       necessary to make them use Git install of copying the script over.
41       Porting these scripts to Python and making them modular would be
42       nice, but is priority.  For the long term, seeing this scripts
43       be packaged with rest of our code would be optimal.
44
45 * The new procedure for generating an update is as follows (this is
46   also similar to procedure for creating these repositories):
47
48     1. Have the Git repository and working copy for the project on hand.
49
50     2. Checkout the pristine branch
51
52     3. Remove all files from the working copy (rm -Rf *, and then delete
53        any dot stragglers.  A script to do this would be handy)
54
55     4. Download the new tarball
56
57     5. Extract the tarball over the working copy (`cp -R a/. b` works well,
58        remember that the working copy is empty)
59
60     6. Check for empty directories and add stub files as necessary
61        (use preserve-empty-dir)
62
63     7. Git add it all, and then commit as a new pristine version (v1.2.3)
64
65     8. Checkout the master branch
66
67     9. [FOR EXISTING REPOSITORIES]
68        Merge the pristine branch in. Resolve any conflicts that our
69        patches have with new changes. Do NOT let Git auto-commit it
70        with --no-commit (otherwise, you want to git commit --amend
71        to keep our history clean
72
73        [FOR THE FIRST TIME]
74        Apply the scripts patch that was used for that version here
75        (usually patch -p1 < patch)
76
77    10. Check if there are any special update procedures, and update the
78        .scripts/update shell script as necessary (this means that any
79        application specific update logic will be kept with the actual
80        source code.  The language of this update script will vary
81        depending on context.)
82
83    11. Commit your changes, and tag as v1.2.3-scripts
84
85    If you're setting up a repository from scratch, stop here, and
86    repeat as necessary
87
88        XXX: Should we force people to push to the real repository at
89        this point, or just make the repository that the script pulls
90        stuff out of configurable? (Twiddling origin can get you a
91        devel setup with no code changes)
92
93    12. Run the "dry-run script", which uses Git commands to check how many
94        working copies apply the change cleanly, and writes out a logfile
95        with the working copies that don't apply cleanly.
96
97    13. Run the "limited run" script, which applies the update to our
98        test-bed, and lets us check the basic functionality of the update.
99        This can include a script that lets us update a single directory
100        with verbose output.
101
102    14. Run the "deploy" script, which applies the update to all working
103        copies possible, and sends mail to users to whom the working copy
104        did not apply cleanly. It also frobs .scripts/version for successful
105        upgrades.
106
107    15. Run parallel-find.pl
108
109 * For mass importing into the repository, the steps are:
110
111 [TO SET IT UP]
112 # let app-1.2.3 be the scripts folder originally in deploydev
113 # let this folder be srv/
114 # you can also do a git clone
115     mkdir app
116     cd app
117     git init
118     cd ..
119 unfurl app-1.2.3 app
120 # NOTE: contents of application are now in app directory
121 cd app
122 git add .
123 git commit -s -m "App 1.2.3"
124 git tag v1.2.3
125 git branch pristine
126 # NOTE: you're still on master branch
127 # WARNING: the following operation might require -p1
128 patch -p0 < ../app-1.2.3/app-1.2.3.patch
129 # NOTE: please sanity check the patch!
130 git add .
131 # NOTE: -a flag is to handle if the patch deleted something
132 git commit -as -m "App 1.2.3-scripts"
133 git tag v1.2.3-scripts
134
135 [TO ADD AN UPDATE]
136 # let this folder be srv/app.git
137 git checkout pristine
138 # NOTE: this preserves your .git folder, but removes everything
139 wipe-working-dir .
140 cd ..
141 unfurl app-1.2.3 app
142 cd app
143 # NOTE: please sanity check app directory
144 git add .
145 # NOTE: -a is to take care of deletions
146 git commit -as -m "App 1.2.3"
147 git tag v1.2.3
148 [IF THE PATCH HAS CHANGED]
149     # You are on the pristine branch
150     # NOTE: Now, the tricky part (this is different from a real update)
151     git symbolic-ref HEAD refs/heads/master
152     # NOTE: Now, we think we're on the master branch, but we have
153     # pristine copy checked out
154     # NOTE: -p0 might need to be twiddled
155     patch -p0 < ../app-1.2.3/app-1.2.3.patch
156     git add .
157     # COMMENT: used to git checkout .scripts here
158     # then check if the directory needs an updated update script
159     # NOTE: Fake the merge
160     git rev-parse pristine > .git/MERGE_HEAD
161 [IF THE PATCH HASN'T CHANGED]
162     git checkout master
163     git merge --no-commit pristine
164 git commit -as -m "App 1.2.3-scripts"
165 git tag v1.2.3-scripts
166
167
168 * The repository for a given application will contain the following files:
169
170     - The actual application's files, as from the official tarball
171
172     - A .scripts directory, which contains the following information:
173
174         [IF THIS IS THE FIRST UPDATE]
175             mkdir .scripts
176             echo "Deny from all" > .scripts/.htaccess
177             touch .scripts/update
178             chmod a+x .scripts/update
179             # OPERATION: create the update script
180
181         * .scripts/update shell script (with the +x bit set appropriately),
182           which performs the commands necessary to update a script.  This can
183           be in any language.
184
185         * .scripts/.htaccess to prevent this directory from being accessed
186           from the web.
187
188         * .scripts/database (generated) contains the database the
189           user installed the script to, so scripts-remove can clean it
190
191             XXX: Could cause problems if a user copies the autoinstall,
192             fiddles with the DB credentials, and then scripts-remove's
193             the autoinstall.  Possible fix is to add the original
194             directory as a sanity check.  Additionally, we could have
195             the application read out of this file.
196
197         * .scripts/version (generated) which contains the version
198           last autoinstalled (as distinct from the actual version
199           the script is) (This is the same as .scripts-version right
200           now; probably want to keep that for now)
201
202             XXX: It's unclear if we want to move to this wholesale, or
203             delay this indefinitely.
204
205 * The migration process has been implemented, see 'wizard migrate'.
206
207     XXX: We have not decided what migration should do to .scripts-version;
208     if it does move it to .scripts, repositories should have a .gitignore
209     in those directories
210
211 * The autoupgrade shall be the process of:
212
213     # Make the directory not accessible by the outside world (htaccess, but be careful!)
214     git add -u .
215     git commit -m 'automatically generated backup'
216     git pull origin master
217     if [ $? ne 0 ]; then git reset --hard; echo 'conflicts during upgrade'; fi
218     ./.scripts/update
219     # Make it accessible
220
221   (with some more robust error checking)
222
223 * Make 'wizard summary' generate nice pretty graphs of installs by date
224   (more histograms, will need to check actual .scripts-version files.)