Skip to content

Commit 70596b7

Browse files
authored
doc: updated production installation instructions (ietf-tools#3829)
* doc: updated production installation instructions * doc: add missing install step
1 parent 72d1293 commit 70596b7

File tree

1 file changed

+41
-222
lines changed

1 file changed

+41
-222
lines changed

dev/INSTALL

Lines changed: 41 additions & 222 deletions
Original file line numberDiff line numberDiff line change
@@ -11,272 +11,91 @@
1111
General Instructions for Deployment of a New Release
1212
====================================================
1313

14-
1. In order to fetch a new release of the django datatracker code, simply
15-
check out the appropriate tag from svn::
14+
1. Make a directory to hold the new release::
15+
sudo su - -s /bin/bash wwwrun
16+
mkdir /a/www/ietf-datatracker/${releasenumber}
17+
cd /a/www/ietf-datatracker/${releasenumber}
1618

17-
svn co http://svn.tools.ietf.org/svn/tools/ietfdb/tags/$releasenumber
19+
2. Fetch the release tarball from github
20+
(see https://github.com/ietf-tools/datatracker/releases)::
1821

19-
2. Don't forget to copy $releasenumber/ietf/settings_local.py from the
20-
old release to the new one; otherwise things won't work!
21-
::
22+
wget https://github.com/ietf-tools/datatracker/archive/refs/tags/${releasenumber}.tar.gz
23+
tar xzvf ${releasenumber}.tar.gz
24+
25+
3. Copy ietf/settings_local.py from previous release::
2226

23-
cp $oldreleasenumber/ietf/settings_local.py $releasenumber/ietf/
27+
cp ../web/ietf/settings_local.py ietf/
2428

25-
3. Change into the directory of the new release::
26-
27-
cd $releasenumber
28-
29-
It is recommended set up a Python virtual environment
30-
under $releasenumber/env/::
31-
32-
virtualenv env # optional
33-
source env/bin/activate # optional
34-
35-
4. Install requirements (make sure your pip is reasonably fresh first).
36-
The following will install required python modules locally if you
37-
are using a virtualenv, or globally if you are not::
29+
4. Setup a new virtual environment and install requirements::
3830

31+
python3.6 -mvenv env
32+
source env/bin/activate
33+
pip install --upgrade setuptools
3934
pip install -r requirements.txt
4035

41-
5. Move static files to the appropriate direcrory for serving via CDN::
42-
43-
ietf/manage.py collectstatic
36+
5. Run system checks (which patches the just installed modules)::
4437

45-
6. Run migrations. Some migrations create files which need to be writeable
46-
by the web servers, so make sure that you're running as wwwrun when
47-
doing this::
38+
ietf/manage.py check
4839

49-
sudo su wwwrun -s /bin/bash
50-
source env/bin/activate
51-
ietf/manage.py migrate
52-
^D
40+
6. Move static files into place for CDN (/a/www/www6s/lib/dt):
5341

54-
7. Run some basic datatracker system checks::
42+
ietf/manage.py collectstatic --noinput --ignore=bower.json --ignore='README.*' --ignore=rev | grep -v "Found another file with the destination path"
5543

56-
ietf/manage.py check
44+
7. Run migrations:
5745

46+
ietf/manage.py migrate
47+
5848
8. Back out one directory level, then re-point the 'web' symlink::
5949

6050
cd ..
61-
rm ./web
62-
ln -s $releasenumber web
51+
rm ./web; ln -s ${releasenumber} web
6352

64-
9. Reload apache::
53+
9. Reload both apache and the datatracker service ::
6554

66-
sudo service apache2 reload
55+
exit # or CTRL-D, back to root level shell
56+
systemctl restart apache2 datatracker.service
6757

68-
10. It's now also a good idea to go to the datatracker front page::
58+
10. Verify operation:
6959

7060
http://datatracker.ietf.org/
7161

72-
and then check that it's alive and kicking, and displaying the new release
73-
number at the bottom of the left-side menubar :-)
74-
75-
11. If things **aren't** cool, revert the symlink step, re-pointing the
76-
symlink to the release that was running before the new release, and restart
77-
apache again to roll back to that.
78-
79-
80-
Installing from Scratch
81-
=======================
82-
83-
In addition to the new release deployment instructions above, the
84-
settings_local.py file has to be set up properly, and Apache has to be
85-
configured. Since the IETF datatracker is only intended to be deployed from
86-
scratch once, these instructions don't cover this scenario in any more detail.
87-
The general Django depoloyment instructions are relevant, however.
88-
62+
11. If install failed, revert web symlink and repeat the restart in step 9.
8963

64+
9065
Patching a Production Release
9166
=============================
9267

93-
Sometimes it can prove necessary to patch an existing release. The following
94-
process should be used:
68+
Sometimes it can prove necessary to patch an existing release.
69+
The following process should be used:
9570

96-
1. Code and test the patch on a development system copy of the production
97-
release which has no other code changes (or on trunk, with no uncommitted
98-
code changes, if it's sufficiently close).
71+
1. Code and test the patch on an copy of the release with any
72+
previously applied patches put in place.
9973

10074
2. Produce a patch file, named with date and subject::
10175

102-
~/src/ietfdb/working $ svn diff > 2013-03-25-ballot-calculation.patch
76+
$ git diff > 2013-03-25-ballot-calculation.patch
10377

10478
3. Move the patch file to the production server, and place it in
10579
'/a/www/ietf-datatracker/patches/'
10680

107-
4. Make a recursive copy of the production code to a new directory, named
108-
with a patch number. Assuming the production code is in 4.43/, and we
109-
have web -> 4.43/::
110-
111-
/a/www/ietf-datatracker $ rsync -a web/ 4.43.p1/
81+
4. Make a recursive copy of the production code to a new directory, named with a patch number.
11282

113-
(you could use 'cp -rp' instead, but rsync seems to do this faster).
83+
/a/www/ietf-datatracker $ rsync -a web/ ${releasenumber}.p1/
11484

11585
5. Apply the patch::
11686

117-
/a/www/ietf-datatracker $ cd 4.43.p1/
118-
/a/www/ietf-datatracker/4.43.p1 $ patch -p0 \
87+
/a/www/ietf-datatracker $ cd ${releasenumber}.p1/
88+
/a/www/ietf-datatracker/${releasnumber}.p1 $ patch -p1 \
11989
< ../patches/2013-03-25-ballot-calculation.patch
12090

121-
This should not produce any messages about failing to apply any chunks;
122-
if it does, you probably should go back to 1. and figure
123-
out why.
91+
This must not produce any messages about failing to apply any chunks;
92+
if it does, go back to 1. and figure out why.
12493

12594
6. Edit ``.../ietf/__init__.py`` in the new patched release to indicate the patch
12695
version in the ``__patch__`` string.
12796

12897
7. Change the 'web' symlink, reload etc. as described in
129-
`General Instructions for Deployment of a New Release`_ .
130-
131-
132-
Additional Version-Specific Instructions
133-
========================================
134-
135-
Version 4.50
136-
------------
137-
138-
Before you run step 3 (migration) of the general instructions, please run some specific
139-
initial migrations with the a --fake argument:
140-
141-
cd $releasenumber
142-
PYTHONPATH=$PWD ietf/manage.py migrate group 0001 --fake
143-
cd ..
144-
145-
146-
Version 4.42
147-
------------
148-
149-
- In order to serve the secretariat tools static pages (such as image, css and js
150-
files) the exceptions to which urls need to be handled by the python-handler
151-
must be updated.
152-
153-
In the datatracker test server, the following configuration has been used to
154-
make apache handle the static files, and Django the dynamic pages. The new
155-
part is the <LocationMatch/> which mentions /secr/. Adapt as needed for ietfa::
156-
157-
----------------
158-
# Logging and document root settings omitted
159-
160-
<Location "/">
161-
PythonPath "['/srv/www/ietfdb'] + sys.path"
162-
SetHandler python-program
163-
PythonHandler django.core.handlers.modpython
164-
SetEnv DJANGO_SETTINGS_MODULE ietf.settings
165-
PythonDebug On
166-
</Location>
167-
168-
<LocationMatch "^/(robots.txt|favicon.ico|images|css|js|media|error)(/|$)">
169-
SetHandler None
170-
</LocationMatch>
171-
172-
# New for secretariat tools:
173-
<LocationMatch "^/secr/(img|css|js|error)">
174-
SetHandler None
175-
</LocationMatch>
176-
177-
<Location "/accounts/login/">
178-
AuthType Digest
179-
AuthName "IETF"
180-
AuthUserFile /var/local/loginmgr/digest
181-
AuthGroupFile /var/local/loginmgr/groups
182-
AuthDigestDomain http://tools.ietf.org/
183-
Require valid-user
184-
</Location>
185-
186-
# Caching and compression settings omitted
187-
----------------
188-
189-
Version 4.40
190-
------------
191-
192-
- (DONE) Add ianasync user with an auth role in the "iana" group and an
193-
rfceditorsync user with an auth role in the "rfceditor" group (don't
194-
think Group(acronym="rfceditor") exists yet); IANA and RFC Editor need
195-
to know the passwords for the poke mechanism
196-
197-
198-
- (DONE) Make sure mailing list for iab-stream@iab.org is up (since we're now
199-
emailing that)
200-
201-
- (DONE) Set rfc_must_published_later_than date in bin/iana-protocols-updates to today
202-
203-
- (DONE) Run the 3 new doc South migrations
204-
205-
- (DONE) New polling scripts, to be run every hour::
206-
207-
web/ietf/bin/iana-changes-updates
208-
web/ietf/bin/iana-protocols-updates
209-
web/ietf/bin/rfc-editor-index-updates (replaces mirror_rfc_index)
210-
web/ietf/bin/rfc-editor-queue-updates (replaces mirror_rfc_queue)
211-
212-
- (DONE) Import old events from IANA::
213-
214-
bin/iana-changes-updates --from="2005-01-01 00:00:00" --to="2013-01-31 00:00:00" --no-email
215-
216-
- (DONE) Pipe IANA review emails to the datatracker. There used to be an action to pipe
217-
such mails to henrik@levkowetz.com, for testing this feature, but I haven't seen
218-
any in a little while, so I don't know if this has broken. Anyway, the iana review
219-
emails should be piped into::
220-
221-
/www/ietf-datatracker/web/ietf/bin/iana-review-email
222-
223-
224-
- (DONE) Tell IANA we're doing this for real now.
225-
226-
227-
Version 4.34
228-
------------
229-
230-
The migration step you do as a part of the release sequence is going to take
231-
quite some time -- probably minutes. It will generate some output while it's
232-
working, too. As long as it doesn't halt and say that something failed or
233-
gave an error, this is as expected, and when it terminates, you should be OK
234-
to continue.
235-
236-
Version 4.21
237-
------------
238-
239-
This release will you to run migrations before moving the link to the new
240-
version and doing the apache reload. I know you have a routine for the steps
241-
needed to deploy a new release by now, but thought I'd mention it, anyway.
242-
243-
If there is any problem at all doing the migrations, then you'll need to
244-
do a fake initial migration, as follows::
245-
246-
web $ PYTHONPATH=PWD ietf/manage.py migrate --fake meeting 0001
247-
248-
and then to the regular migration again.
249-
250-
Version 4.20
251-
------------
252-
253-
Some one-time actions that need to be taken are as follows::
254-
255-
Assuming that the release has been checked out in /a/www/ietf-datatracker/4.20:
256-
257-
cd /a/www/ietf-datatracker/4.20
258-
259-
PYTHONPATH=$PWD ietf/manage.py migrate --fake doc 0001
260-
PYTHONPATH=$PWD ietf/manage.py migrate --fake name 0001
261-
262-
PYTHONPATH=$PWD ietf/manage.py dbshell <<< "delete from django_content_type where app_label='doc'
263-
and model='groupballotpositiondocevent';"
264-
265-
PYTHONPATH=$PWD ietf/manage.py migrate doc || { \
266-
PYTHONPATH=$PWD ietf/manage.py dbshell <<< 'CREATE TABLE `doc_groupballotpositiondocevent`
267-
(`block_comment` longtext NOT NULL, `comment` longtext NOT NULL,
268-
`ad_id` integer NOT NULL, `comment_time` datetime NULL,
269-
`block_comment_time` datetime NULL, `pos_id` varchar(8) NOT NULL DEFAULT "norecord",
270-
`docevent_ptr_id` integer NOT NULL PRIMARY KEY);'
271-
PYTHONPATH=$PWD ietf/manage.py dbshell <<< 'DROP TABLE `doc_ballottype` CASCADE;'
272-
PYTHONPATH=$PWD ietf/manage.py dbshell <<< 'DROP TABLE `doc_ballottype_positions` CASCADE;'
273-
PYTHONPATH=$PWD ietf/manage.py dbshell <<< 'DROP TABLE `doc_ballotdocevent` CASCADE;'
274-
PYTHONPATH=$PWD ietf/manage.py dbshell <<< 'ALTER TABLE `doc_ballotpositiondocevent`
275-
DROP COLUMN `ballot_id` CASCADE;'
276-
}
98+
`General Instructions for Deployment of a New Release`_.
27799

278-
PYTHONPATH=$PWD ietf/manage.py migrate doc
279-
PYTHONPATH=$PWD ietf/manage.py migrate name
280-
PYTHONPATH=$PWD python ietf/wgcharter/migrate.py | tee -a ~/charter-migration.log
281100

282101

0 commit comments

Comments
 (0)