Merge lp:~cjwatson/launchpad/remove-distro-parts into lp:launchpad

Proposed by Colin Watson on 2012-05-23
Status: Merged
Approved by: Laura Czajkowski on 2012-05-23
Approved revision: no longer in the source branch.
Merged at revision: 15291
Proposed branch: lp:~cjwatson/launchpad/remove-distro-parts
Merge into: lp:launchpad
Diff against target: 269 lines (+11/-164)
10 files modified
cronscripts/publishing/distro-parts/ubuntu/finalize.d/10-germinate (+0/-6)
cronscripts/publishing/distro-parts/ubuntu/finalize.d/40-timestamp-trace-file (+0/-9)
cronscripts/publishing/distro-parts/ubuntu/finalize.d/90-trigger-mirrors (+0/-21)
cronscripts/publishing/distro-parts/ubuntu/finalize.d/README.txt (+0/-22)
cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/10-sign-releases (+0/-30)
cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/20-remove-uncompressed-listings (+0/-11)
cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/30-copy-indices (+0/-12)
cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/README.txt (+0/-25)
lib/lp/archivepublisher/scripts/publish_ftpmaster.py (+1/-8)
lib/lp/archivepublisher/tests/test_publish_ftpmaster.py (+10/-20)
To merge this branch: bzr merge lp:~cjwatson/launchpad/remove-distro-parts
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code 2012-05-23 Approve on 2012-05-23
Review via email: mp+106920@code.launchpad.net

Commit Message

Remove cronscripts/publishing/distro-parts/ubuntu and support for in-tree distro-parts scripts. This is now maintained as lp:ubuntu-archive-publishing for Ubuntu, and should similarly be maintained separately for derived distributions.

Description of the Change

== Summary ==

The distro-parts tree was apparently always supposed to be maintained by Ubuntu Engineering. I've now ripped it out into lp:ubuntu-archive-publishing, deployed that in /srv/launchpad.net/publisher-parts/ on relevant machines, William Grant has changed production configs to point to that, and I've changed dogfood configs likewise; so it's time to remove this from the Launchpad tree.

== Pre-implementation notes ==

I started out wanting to make changes to 10-sign-releases for bug 1002589; Julian Edwards and William Grant persuaded me that the best way to go about this would be to rip it out of the LP tree first.

== Implementation details ==

The test for relative run_parts_location becomes non-obvious after this removal, since it no longer has an in-tree copy to point to. I opted to just drop support for anything other than absolute paths, since I think relative paths will no longer be necessary. Shout if you disagree.

== Tests ==

bin/test -vvct test_publish_ftpmaster

== Demo and Q/A ==

Dogfood's configs are already updated and I've tested that the publisher still works without this change and uses the new run-parts directories; so I think it'd be sufficient to just give it another quick run there and make sure it doesn't fall over and that it still runs scripts from publish-distro.d and finalize.d.

To post a comment you must log in.
Steve Kowalik (stevenk) wrote :

This looks like excellent work, thanks.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed directory 'cronscripts/publishing/distro-parts'
2=== removed directory 'cronscripts/publishing/distro-parts/ubuntu'
3=== removed directory 'cronscripts/publishing/distro-parts/ubuntu/finalize.d'
4=== removed file 'cronscripts/publishing/distro-parts/ubuntu/finalize.d/10-germinate'
5--- cronscripts/publishing/distro-parts/ubuntu/finalize.d/10-germinate 2011-03-28 09:18:42 +0000
6+++ cronscripts/publishing/distro-parts/ubuntu/finalize.d/10-germinate 1970-01-01 00:00:00 +0000
7@@ -1,6 +0,0 @@
8-#!/bin/sh
9-
10-if [ "$SECURITY_UPLOAD_ONLY" != "yes" ]
11-then
12- cron.germinate || /bin/true
13-fi
14
15=== removed file 'cronscripts/publishing/distro-parts/ubuntu/finalize.d/40-timestamp-trace-file'
16--- cronscripts/publishing/distro-parts/ubuntu/finalize.d/40-timestamp-trace-file 2011-04-07 09:51:36 +0000
17+++ cronscripts/publishing/distro-parts/ubuntu/finalize.d/40-timestamp-trace-file 1970-01-01 00:00:00 +0000
18@@ -1,9 +0,0 @@
19-#! /bin/sh
20-#
21-# Timestamp the trace file, so we can track when the last archive publisher
22-# run took place.
23-for DIR in $ARCHIVEROOTS
24-do
25- mkdir -p -- "$DIR/project/trace"
26- date -u > "$DIR/project/trace/$(hostname --fqdn)"
27-done
28
29=== removed file 'cronscripts/publishing/distro-parts/ubuntu/finalize.d/90-trigger-mirrors'
30--- cronscripts/publishing/distro-parts/ubuntu/finalize.d/90-trigger-mirrors 2012-04-26 00:12:52 +0000
31+++ cronscripts/publishing/distro-parts/ubuntu/finalize.d/90-trigger-mirrors 1970-01-01 00:00:00 +0000
32@@ -1,21 +0,0 @@
33-#!/bin/sh
34-
35-# Prod the master mirrors to propagate the update.
36-
37-MASTERMIRRORS="archive.syncproxy.ubuntu.com wahoo"
38-MASTERMIRRORS_ASYNC="scandium sadalbari kudan"
39-echo "$(date -R): Triggering master mirrors..."
40-
41-for HOST in $MASTERMIRRORS
42-do
43- echo "$(date -R): Triggering $HOST:"
44- ssh archvsync@$HOST
45-done
46-
47-for HOST in $MASTERMIRRORS_ASYNC
48-do
49- echo "$(date -R): Triggering $HOST in background:"
50- ssh archvsync@$HOST &
51-done
52-
53-echo "$(date -R): Master mirror triggers completed."
54
55=== removed file 'cronscripts/publishing/distro-parts/ubuntu/finalize.d/README.txt'
56--- cronscripts/publishing/distro-parts/ubuntu/finalize.d/README.txt 2011-03-31 11:25:53 +0000
57+++ cronscripts/publishing/distro-parts/ubuntu/finalize.d/README.txt 1970-01-01 00:00:00 +0000
58@@ -1,22 +0,0 @@
59-Put scripts here that should be run at completion of the publish-ftpmaster
60-script. They will be executed through the run-parts command, in alphabetical
61-order.
62-
63-The scripts' filenames must consist entirely of ASCII letters (both upper and
64-lower case allowed), digits, underscores, and hyphens. All other files,
65-including this text file, are ignored.
66-
67-Publication happens in two passes: the first, expedited pass processes only
68-security updates. The second pass processes all packages. The scripts in
69-this directory will be run once for each pass, with the variable
70-SECURITY_UPLOAD_ONLY set to indicate which pass is in progress; see below.
71-
72-The following variables will be set for the script:
73-
74-ARCHIVEROOTS - the list of root directories for the distribution's archives.
75-(e.g. "/srv/ubuntu-archive/ubuntu/ /srv/ubuntu-archive/ubuntu-partner/" )
76-
77-SECURITY_UPLOAD_ONLY - "yes" during the security pass, or "no" otherwise.
78-
79-The script's PATH will be extended with the Launchpad source tree's
80-cronscripts/publishing directory.
81
82=== removed directory 'cronscripts/publishing/distro-parts/ubuntu/publish-distro.d'
83=== removed file 'cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/10-sign-releases'
84--- cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/10-sign-releases 2011-12-14 14:19:47 +0000
85+++ cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/10-sign-releases 1970-01-01 00:00:00 +0000
86@@ -1,30 +0,0 @@
87-#!/bin/sh -e
88-
89-# The calling script may set GNUPGHOME to a value set up by Launchpad's
90-# script machinery. In production, we have a dedicated directory set up
91-# for this.
92-GNUPGHOME=/srv/launchpad.net/ubuntu-archive/gnupg-home
93-
94-if ! test -d "$GNUPGHOME"
95-then
96- echo "There is no $GNUPGHOME; not signing Release files."
97- exit 0
98-fi
99-
100-RELEASE_FILES=`find $DISTSROOT -maxdepth 2 -name Release`
101-DIST_UPGRADER_TARBALLS=`
102- find $DISTSROOT/*/*/dist-upgrader* -name "*.tar.gz" || true`
103-INSTALLER_CHECKSUMS=`
104- find $DISTSROOT/*/*/installer-* -name "*SUMS" || true`
105-
106-for CANDIDATE in $RELEASE_FILES $DIST_UPGRADER_TARBALLS $INSTALLER_CHECKSUMS
107-do
108- if [ ! -f "$CANDIDATE.gpg" ] || [ "$CANDIDATE" -nt "$CANDIDATE.gpg" ]
109- then
110- echo "$(date -R): (re-)signing $CANDIDATE"
111- gpg --yes --detach-sign --armor -o "$CANDIDATE.gpg" \
112- --sign "$CANDIDATE"
113- else
114- echo "$(date -R): Not re-signing $CANDIDATE"
115- fi
116-done
117
118=== removed file 'cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/20-remove-uncompressed-listings'
119--- cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/20-remove-uncompressed-listings 2011-04-12 07:13:08 +0000
120+++ cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/20-remove-uncompressed-listings 1970-01-01 00:00:00 +0000
121@@ -1,11 +0,0 @@
122-#!/bin/sh
123-#
124-# Remove uncompressed Packages and Sources files.
125-#
126-# The uncompressed versions of these files are very large and could cause
127-# problems for our mirrors, so get rid of them.
128-#
129-# It's safe to do this since the uncompressed MD5 hashes have already been
130-# computed for inclusion in the Release files.
131-
132-find $DISTSROOT \( -name Packages -o -name Sources \) -exec rm -f -- "{}" \;
133
134=== removed file 'cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/30-copy-indices'
135--- cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/30-copy-indices 2011-04-08 18:59:20 +0000
136+++ cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/30-copy-indices 1970-01-01 00:00:00 +0000
137@@ -1,12 +0,0 @@
138-#!/bin/sh -e
139-
140-if [ -n "$OVERRIDEROOT" ]
141-then
142- echo "$(date -R): Copying the indices into place."
143-
144- INDICES=$ARCHIVEROOT/indices
145-
146- mkdir -p -- $INDICES
147- rm -f -- $INDICES/override
148- cp -- $OVERRIDEROOT/override.* $INDICES/
149-fi
150
151=== removed file 'cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/README.txt'
152--- cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/README.txt 2011-04-12 07:13:08 +0000
153+++ cronscripts/publishing/distro-parts/ubuntu/publish-distro.d/README.txt 1970-01-01 00:00:00 +0000
154@@ -1,25 +0,0 @@
155-Put scripts here that should be run after publish-ftpmaster executes
156-publish-distro. They will be executed through the run-parts command, in
157-alphabetical order.
158-
159-The scripts' filenames must consist entirely of ASCII letters (both upper and
160-lower case allowed), digits, underscores, and hyphens. All other files,
161-including this text file, are ignored.
162-
163-Scripts in this directory will be run separately for each distro archive,
164-possibly twice because publication happens in two passes: an expedited one for
165-just the security uploads and then a second, slower pass for all packages.
166-
167-Some variables will be set before each script is run:
168-
169-ARCHIVEROOT - the archive's root directory
170-(e.g. /srv/launchpad.net/ubuntu-archive/ubuntu/ )
171-
172-DISTSROOT - a working copy of the archive's dists root directory
173-(e.g. /srv/launchpad.net/ubuntu-archive/ubuntu/dists.new )
174-
175-OVERRIDEROOT - the archive's overrides root directory (primary archive only)
176-(e.g. /srv/launchpad.net/ubuntu-overrides, or the empty string for partner)
177-
178-The script's PATH will be extended with the Launchpad source tree's
179-cronscripts/publishing directory.
180
181=== modified file 'lib/lp/archivepublisher/scripts/publish_ftpmaster.py'
182--- lib/lp/archivepublisher/scripts/publish_ftpmaster.py 2012-04-16 15:28:47 +0000
183+++ lib/lp/archivepublisher/scripts/publish_ftpmaster.py 2012-05-23 00:36:20 +0000
184@@ -131,14 +131,7 @@
185 if not run_parts_location:
186 return
187
188- if run_parts_location.startswith("/"):
189- # Absolute path.
190- base_dir = run_parts_location
191- else:
192- # Relative path.
193- base_dir = os.path.join(config.root, run_parts_location)
194-
195- parts_dir = os.path.join(base_dir, distro.name, parts)
196+ parts_dir = os.path.join(run_parts_location, distro.name, parts)
197 if file_exists(parts_dir):
198 return parts_dir
199 else:
200
201=== modified file 'lib/lp/archivepublisher/tests/test_publish_ftpmaster.py'
202--- lib/lp/archivepublisher/tests/test_publish_ftpmaster.py 2012-04-16 15:28:47 +0000
203+++ lib/lp/archivepublisher/tests/test_publish_ftpmaster.py 2012-05-23 00:36:20 +0000
204@@ -88,11 +88,6 @@
205 return get_archive_root(pub_config) + "-distscopy"
206
207
208-def get_run_parts_path():
209- """Get relative path to run-parts location the Launchpad source."""
210- return os.path.join("cronscripts", "publishing", "distro-parts")
211-
212-
213 def write_marker_file(path, contents):
214 """Write a marker file for checking directory movements.
215
216@@ -133,12 +128,15 @@
217 def enableRunParts(self, parts_directory=None):
218 """Set up for run-parts execution.
219
220- :param parts_directory: Base location for the run-parts
221- directories. If omitted, the run-parts directory from the
222- Launchpad source tree will be used.
223+ :param parts_directory: Base location for the run-parts directories.
224+ If omitted, a temporary directory will be used.
225 """
226 if parts_directory is None:
227- parts_directory = get_run_parts_path()
228+ parts_directory = self.makeTemporaryDirectory()
229+ os.makedirs(os.path.join(
230+ parts_directory, "ubuntu", "publish-distro.d"))
231+ os.makedirs(os.path.join(parts_directory, "ubuntu", "finalize.d"))
232+ self.parts_directory = parts_directory
233
234 config.push("run-parts", dedent("""\
235 [archivepublisher]
236@@ -213,22 +211,14 @@
237 class TestFindRunPartsDir(TestCaseWithFactory, HelpersMixin):
238 layer = ZopelessDatabaseLayer
239
240- def test_find_run_parts_dir_finds_relative_runparts_directory(self):
241+ def test_find_run_parts_dir_finds_runparts_directory(self):
242 self.enableRunParts()
243 ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
244 self.assertEqual(
245 os.path.join(
246- config.root, get_run_parts_path(), "ubuntu", "finalize.d"),
247+ config.root, self.parts_directory, "ubuntu", "finalize.d"),
248 find_run_parts_dir(ubuntu, "finalize.d"))
249
250- def test_find_run_parts_dir_finds_absolute_runparts_directory(self):
251- self.enableRunParts(os.path.join(config.root, get_run_parts_path()))
252- ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
253- self.assertEqual(
254- os.path.join(
255- config.root, get_run_parts_path(), "ubuntu", "finalize.d"),
256- find_run_parts_dir(ubuntu, "finalize.d"))
257-
258 def test_find_run_parts_dir_ignores_blank_config(self):
259 self.enableRunParts("")
260 ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
261@@ -609,7 +599,7 @@
262 command_line, = args
263 self.assertIn("run-parts", command_line)
264 self.assertIn(
265- "cronscripts/publishing/distro-parts/ubuntu/finalize.d",
266+ os.path.join(self.parts_directory, "ubuntu/finalize.d"),
267 command_line)
268
269 def test_runParts_passes_parameters(self):