~xubuntu-dev/ubuntu-cdimage/xubuntu-base

322 by Colin Watson
add a README for cdimage operators
1
Operating cdimage
2
=================
3
1202 by Colin Watson
README: everything is now in Python!
4
cdimage is a collection of Python scripts wrapped around the debian-cd
5
package.  Originally, it was just the few things you had to type to make
6
debian-cd build CDs; since then it has evolved to handle generating package
7
lists using germinate, live CD building, and CD publication for multiple
8
projects.  The following is a quick operator's guide.
994 by Colin Watson
README: update to mention Python requirement
9
10
cdimage requires Python >= 2.7.  It should also work with Python >= 3.1 (not
11
3.0), but at the moment this has only been confirmed by unit-testing and not
12
by field experience.
322 by Colin Watson
add a README for cdimage operators
13
999 by Colin Watson
README: document python-mock requirement
14
Running the cdimage test suite also requires python-mock.
15
322 by Colin Watson
add a README for cdimage operators
16
17
Day-to-day operation
18
--------------------
19
992 by Colin Watson
README: space-dot-dot
20
etc/crontab lists the jobs that are run regularly from cron.  These include
322 by Colin Watson
add a README for cdimage operators
21
the following scripts, which may be called by hand:
22
23
  * cron.daily
24
815 by Colin Watson
build primary and ports architectures together (ubuntutheproject-foundations-n-cdimage-ports-consolidation)
25
    Build install CDs for all relevant Ubuntu architectures.
322 by Colin Watson
add a README for cdimage operators
26
27
  * cron.daily-live
28
815 by Colin Watson
build primary and ports architectures together (ubuntutheproject-foundations-n-cdimage-ports-consolidation)
29
    Build live CDs for all relevant Ubuntu architectures.
322 by Colin Watson
add a README for cdimage operators
30
31
  * cron.dvd
32
992 by Colin Watson
README: space-dot-dot
33
    Build DVDs for all relevant Ubuntu architectures.  These are normally
815 by Colin Watson
build primary and ports architectures together (ubuntutheproject-foundations-n-cdimage-ports-consolidation)
34
    combined install/live images.
322 by Colin Watson
add a README for cdimage operators
35
36
  * for-project
37
38
    Execute a command in the context of a certain project: run for-project
992 by Colin Watson
README: space-dot-dot
39
    without arguments to see the available list.  At the moment, this just
322 by Colin Watson
add a README for cdimage operators
40
    sets the PROJECT and CAPPROJECT environment variables and then runs the
41
    command (many parts of cdimage and of the Ubuntu branch of debian-cd pay
42
    attention to these variables), but you should always use the for-project
43
    command to do this in case this changes.
44
45
    The project context affects a number of parameters of image building and
46
    publication, such as the set of seeds passed to germinate, the location
47
    of live filesystem images, the preseed files installed on the CD, the
48
    place where images are published in the WWW output tree, and the
49
    frequency with which old published images are purged.
50
51
Each of these scripts sets a few variables and then calls the main
52
underlying script, which is the core of cdimage:
53
54
  * build-image-set
55
992 by Colin Watson
README: space-dot-dot
56
This calls lots of other scripts to build a set of images.  For day-to-day
322 by Colin Watson
add a README for cdimage operators
57
operation it is not necessary to be intimately familiar with all of these
992 by Colin Watson
README: space-dot-dot
58
scripts, but fixing bugs may require some level of knowledge of them.
59
Here's a quick run-down of the steps:
322 by Colin Watson
add a README for cdimage operators
60
61
  * anonftpsync
62
63
    Sync cdimage's mirror of the Ubuntu archive.
64
65
  * update-local-indices
66
67
    Update index files for the local override archive; packages in this
68
    archive will be used in preference to packages in the Ubuntu archive
992 by Colin Watson
README: space-dot-dot
69
    proper.  Nowadays, of course, this local archive is rarely used, but it
322 by Colin Watson
add a README for cdimage operators
70
    is still occasionally useful for specialised custom builds.
71
72
  * extract-debootstrap
73
74
    Extract debootstrap scripts from debootstrap-udeb packages in the
992 by Colin Watson
README: space-dot-dot
75
    archive.  debian-cd uses these to make sure that it has a complete base
76
    system on the CD.  (This is largely unnecessary as of Ubuntu 5.10, since
322 by Colin Watson
add a README for cdimage operators
77
    debootstrap now calculates the base system based on the Packages file.)
78
79
  * run-germinate
80
81
    Run germinate for each architecture to determine the list of packages in
992 by Colin Watson
README: space-dot-dot
82
    each seed output (desktop, installer, etc.).  See
322 by Colin Watson
add a README for cdimage operators
83
    https://wiki.ubuntu.com/SeedManagement and the germinate documentation
84
    for more details.
85
86
  * germinate-to-tasks
87
88
    Translate germinate output into debian-cd task lists.
89
90
  * update-tasks
91
992 by Colin Watson
README: space-dot-dot
92
    Install new debian-cd task lists.  This can optionally mail the
322 by Colin Watson
add a README for cdimage operators
93
    differences versus the last set of task lists to an operator, which can
94
    be useful for spotting problems.
95
96
  * download-live-filesystems
97
98
    For live CD builds, fetch the live filesystem image from a build daemon.
99
100
At this stage, debian-cd's build_all.sh script is invoked to build the
101
images.
102
103
  * check-installable
104
105
    For install CD builds, generate a report on uninstallable packages on
106
    the image.
107
108
  * publish-daily
109
110
    Publish the image to the WWW output tree.
111
112
  * purge-old-images
113
114
    Delete images older than a certain number of days (configured in
115
    etc/purge-days) from the WWW output tree.
116
117
  * sync-mirrors
118
119
    Trigger mirrors to update from the WWW output tree, thereby making the
120
    images available to the world.
121
122
123
Releasing images
124
----------------
125
126
From time to time, an operator will need to tag a set of images as a release
992 by Colin Watson
README: space-dot-dot
127
of some kind.  The script responsible for this (which is always run by hand,
322 by Colin Watson
add a README for cdimage operators
128
never automatically) is:
129
130
  * publish-release
131
132
    This is heavily geared to the requirements of Ubuntu and its
133
    derivatives, although it's possible that other users could adapt it to
992 by Colin Watson
README: space-dot-dot
134
    their needs.  It publishes images from a daily build (as published by
135
    publish-daily) to a special release tree.  An OFFICIAL argument governs
136
    the layout of the result.  Run publish-release without arguments to see
137
    a usage message.
322 by Colin Watson
add a README for cdimage operators
138
992 by Colin Watson
README: space-dot-dot
139
There are in fact three important subtrees of the release tree.  The
140
'simple' tree is intended for smaller mirrors and for ease of use by naïve
141
end users.  It contains a pool of images and a tree per release of symlinks
142
into that pool with filenames that include the status of the image (e.g.
143
preview, sounder-9, release).
322 by Colin Watson
add a README for cdimage operators
144
145
The 'full' tree contains everything except the releases that are in the
146
simple tree (so in practice it contains alpha/beta releases), and has a more
147
complicated structure that ordinary users ultimately shouldn't have to pay
148
too much attention to.
149
150
The 'torrent' tree is mirrored by the BitTorrent tracker so that it knows
992 by Colin Watson
README: space-dot-dot
151
what it's supposed to be tracking.  It is not otherwise visible to the
152
world.
322 by Colin Watson
add a README for cdimage operators
153
992 by Colin Watson
README: space-dot-dot
154
It is best to give a few examples here.  The Breezy Colony 5 release was
322 by Colin Watson
add a README for cdimage operators
155
published using the following commands:
156
157
  for-project ubuntu publish-release daily 20050923.3 install no colony-5
158
  for-project ubuntu publish-release daily-live 20050923.1 live no colony-5
159
  sync-mirrors
160
161
As you can see, it is possible to publish two sets of images into the same
162
release directory, provided that they have different types (the "install"
163
and "live" arguments).
164
165
Note that it is always necessary to run sync-mirrors after publish-release;
166
publish-release does not do so automatically, in order to give the operator
167
a chance to make sure that the release tree is correct before publishing it
168
to the world with sync-mirrors.
169
170
The Edubuntu 5.10 Preview release (which consisted of only an install CD)
171
was initially published using the following commands:
172
173
  for-project edubuntu publish-release daily 20050909.4 install poolonly preview
174
  sync-mirrors
175
176
The "poolonly" OFFICIAL argument instructs publish-release to place the
177
images only in the .pool directory, which is generally not visible in
992 by Colin Watson
README: space-dot-dot
178
directory listings on mirrors.  This is polite to mirrors by giving them a
322 by Colin Watson
add a README for cdimage operators
179
little time to catch up before the images are made visible to everyone (and
180
generally announced shortly afterwards) using the following commands:
181
182
  for-project edubuntu publish-release daily 20050909.4 install yes preview
183
  sync-mirrors
184
185
When the Edubuntu 5.10 release is later published, publish-release will
186
automatically remove the preview images.
187
188
HTML indices
189
------------
190
191
A requirement common to both daily and release publication is the generation
992 by Colin Watson
README: space-dot-dot
192
of HTML pages describing the images that are available.  This is mostly
322 by Colin Watson
add a README for cdimage operators
193
handled automatically, but the script is full of special cases and sadly the
194
output is not always perfect, so it is sometimes necessary to correct it and
195
run it by hand.
196
197
  * make-web-indices
198
199
    Generate HEADER.html, FOOTER.html, and .htaccess files instructing
200
    Apache to emit directory listings with added descriptions of what images
201
    are available.
202
203
The HEADER.html, FOOTER.html, and .htaccess files at the top of the simple
204
tree and in each project's subdirectory are currently generated by hand, as
205
are the version number symlinks; because they only change every six months,
992 by Colin Watson
README: space-dot-dot
206
there has not been much impetus to automate this task.  When publishing a
322 by Colin Watson
add a README for cdimage operators
207
release to the simple tree for the first time, the operator will need to
208
edit these files manually.