Merge lp:~jtv/maas/multi-arch-imports into lp:~maas-maintainers/maas/new-import-script-integration

Proposed by Jeroen T. Vermeulen
Status: Merged
Merged at revision: 2170
Proposed branch: lp:~jtv/maas/multi-arch-imports
Merge into: lp:~maas-maintainers/maas/new-import-script-integration
Diff against target: 93 lines (+28/-8)
4 files modified
etc/maas/pserv.yaml (+24/-4)
src/provisioningserver/config.py (+1/-1)
src/provisioningserver/import_images/boot_resources.py (+2/-2)
src/provisioningserver/tests/test_config.py (+1/-1)
To merge this branch: bzr merge lp:~jtv/maas/multi-arch-imports
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Review via email: mp+212392@code.launchpad.net

Commit message

Support multiple architectures in one simplestreams source.

Description of the change

This can be used for good or for evil. Good: specify a single source for completely identical, run-of-the-mill downloads — think “amd64 and oh, all the same stuff for i386 as well please.” Evil: “I want i386/generic plus amd64/hwe-t, but let's just specify them as one source and watch my company's bandwidth crumble under the load of 4 instead of 2 sets of images.”

There's a comment to warn people of the potential for evil. If you specify something like "i386 and armhf, generic and highbank" you probably get just what you'd expect: i386/generic, armhf/generic, armhf/highbank (with the third item actually being just an alias for the second, so bad example). But I'm not too interested in the minutiae right now; when in doubt, specify multiple sources. I think this even comes out clearer than before.

Jeroen

To post a comment you must log in.
Revision history for this message
Raphaël Badin (rvb) wrote :

Looks good!

[0]

26 + #
27 + # Be careful: these constraints tend to multiply. For example if you

I'd use another verb here: 'tend' implies that this happens frequently but opens the door for "not always".

[1]

[...] If you only want some of
31 + # those combinations, keep them as separate sources.

Maybe mention that you can also use separate 'selections'.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'etc/maas/pserv.yaml'
--- etc/maas/pserv.yaml 2014-03-21 13:31:55 +0000
+++ etc/maas/pserv.yaml 2014-03-25 02:05:44 +0000
@@ -40,17 +40,37 @@
4040
41## Boot configuration.41## Boot configuration.
42boot:42boot:
43 ## Storage location for boot images.
44 #
45 # These images can get quite large: some files are hundreds of megabytes,
46 # and you may need multiple copies for different architectures, OS releases,
47 # etc.
43 storage: "/var/lib/maas/boot-resources/"48 storage: "/var/lib/maas/boot-resources/"
49
50 ## Sources of downloadable boot images.
51 #
52 # Each source downloads from one simplestreams URL, though it is possible to
53 # have multiple sources using the same URL. For example, if you want to
54 # download "release" images for one OS release and just the "beta-2" images
55 # for another, specify two separate sources. Otherwise, the importer would
56 # have to download both kinds of images for both releases.
44 sources:57 sources:
45 - path: "http://maas.ubuntu.com/images/ephemeral/releases/"58 - path: "http://maas.ubuntu.com/images/ephemeral/releases/"
46 keyring: "/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg"59 keyring: "/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg"
60 ## Filters for this source's imports.
61 #
62 # Be careful: these items tend to multiply. For example if you specify
63 # architectures "i386" and "amd64", and subarchitectures "generic",
64 # "hwe-s", and "hwe-t", the import script will need to import 6 images,
65 # for each possible combination. If you only want some of those
66 # combinations, keep them as separate sources.
47 selections:67 selections:
48 - release: "*"68 - release: "*"
49 arch: "*"69 arches: ["*"]
50 subarches: ["*"]70 subarches: ["*"]
51## other source example:71## other source example:
52# - path: "http://hyperscale.ubuntu.com/images/"72# - path: "http://hyperscale.ubuntu.com/images/"
53# selections:73# selections:
54# - release: *74# - release: "*"
55# arch: *75# arches: ["*"]
56# subarches: ['*']76# subarches: ["*"]
5777
=== modified file 'src/provisioningserver/config.py'
--- src/provisioningserver/config.py 2014-03-22 17:26:36 +0000
+++ src/provisioningserver/config.py 2014-03-25 02:05:44 +0000
@@ -137,7 +137,7 @@
137 if_key_missing = None137 if_key_missing = None
138138
139 release = String(if_missing="*")139 release = String(if_missing="*")
140 arch = String(if_missing="*")140 arches = Set(if_missing=["*"])
141 subarches = Set(if_missing=['*'])141 subarches = Set(if_missing=['*'])
142142
143143
144144
=== modified file 'src/provisioningserver/import_images/boot_resources.py'
--- src/provisioningserver/import_images/boot_resources.py 2014-03-24 14:16:59 +0000
+++ src/provisioningserver/import_images/boot_resources.py 2014-03-25 02:05:44 +0000
@@ -131,7 +131,7 @@
131 for filter_dict in filters:131 for filter_dict in filters:
132 item_matches = (132 item_matches = (
133 value_passes_filter(filter_dict['release'], release) and133 value_passes_filter(filter_dict['release'], release) and
134 value_passes_filter(filter_dict['arch'], arch) and134 value_passes_filter_list(filter_dict['arches'], arch) and
135 value_passes_filter_list(filter_dict['subarches'], subarch)135 value_passes_filter_list(filter_dict['subarches'], subarch)
136 )136 )
137 if item_matches:137 if item_matches:
@@ -151,7 +151,7 @@
151 :param filters: list of dicts each of which contains 'arch', 'subarch',151 :param filters: list of dicts each of which contains 'arch', 'subarch',
152 'release' keys; function takes d[arch][subarch][release] chain to the152 'release' keys; function takes d[arch][subarch][release] chain to the
153 first dict only if filters contain at least one dict with153 first dict only if filters contain at least one dict with
154 d['arch'] == arch, subarch in d['subarch'], d['release'] == release;154 arch in d['arches'], subarch in d['subarch'], d['release'] == release;
155 dict may have '*' as a value for 'arch' and 'release' keys and as a155 dict may have '*' as a value for 'arch' and 'release' keys and as a
156 member of 'subarch' list -- in that case key-specific check always156 member of 'subarch' list -- in that case key-specific check always
157 passes.157 passes.
158158
=== modified file 'src/provisioningserver/tests/test_config.py'
--- src/provisioningserver/tests/test_config.py 2014-03-22 17:26:36 +0000
+++ src/provisioningserver/tests/test_config.py 2014-03-25 02:05:44 +0000
@@ -144,7 +144,7 @@
144 '/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg'),144 '/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg'),
145 'selections': [145 'selections': [
146 {146 {
147 'arch': '*',147 'arches': ['*'],
148 'release': '*',148 'release': '*',
149 'subarches': ['*'],149 'subarches': ['*'],
150 },150 },

Subscribers

People subscribed via source and target branches