Merge ~ltrager/maas-images:daily_to_candidate into maas-images:master
- Git
- lp:~ltrager/maas-images
- daily_to_candidate
- Merge into master
Proposed by
Lee Trager
Status: | Merged |
---|---|
Merge reported by: | Lee Trager |
Merged at revision: | 35f038367ab85a871b86773e59c2f07608c59e63 |
Proposed branch: | ~ltrager/maas-images:daily_to_candidate |
Merge into: | maas-images:master |
Diff against target: |
380 lines (+62/-62) 11 files modified
README (+22/-22) README.testing (+10/-10) conf/bootloaders.yaml (+2/-2) conf/centos.yaml (+2/-2) conf/meph-v3.yaml (+3/-3) meph2/commands/cloudimg_sync.py (+8/-8) meph2/commands/flags.py (+1/-1) meph2/commands/meph2_util.py (+10/-10) meph2/commands/mimport.py (+2/-2) meph2/stream.py (+1/-1) tools/genstream-muc (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alberto Donato (community) | Approve | ||
Review via email: mp+387405@code.launchpad.net |
Commit message
Rename daily to candidate
Description of the change
The daily stream is being renamed candidate and we'll be creating a new stable stream. Images produced by lp:maas-images need to be created using the candidate label so inserting works properly. This branch won't be landed until CPC is ready to create both streams.
To post a comment you must log in.
- bae0560... by Lee Trager
-
Merge branch 'master' into daily_to_candidate
- 35f0383... by Lee Trager
-
Merge branch 'master' into daily_to_candidate
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/README b/README | |||
2 | index df2a9ab..050bdcf 100644 | |||
3 | --- a/README | |||
4 | +++ b/README | |||
5 | @@ -1,6 +1,6 @@ | |||
7 | 1 | This builds maas ephemeral images from daily builds of cloud images. | 1 | This builds maas ephemeral images from candidate builds of cloud images. |
8 | 2 | Ie, it creates stuff that goes on | 2 | Ie, it creates stuff that goes on |
10 | 3 | http://images.maas.io/ephemeral-v2/daily/ | 3 | http://images.maas.io/ephemeral-v3/candidate |
11 | 4 | from stuff on | 4 | from stuff on |
12 | 5 | http://cloud-images.ubuntu.com/daily | 5 | http://cloud-images.ubuntu.com/daily |
13 | 6 | 6 | ||
14 | @@ -50,7 +50,7 @@ To force a build, use '--target=force' | |||
15 | 50 | copied from maas.ubuntu.com for all other products, but will only | 50 | copied from maas.ubuntu.com for all other products, but will only |
16 | 51 | create new content for products that match the provided filters. | 51 | create new content for products that match the provided filters. |
17 | 52 | 52 | ||
19 | 53 | If the maas ephemeral data is up to date with the latest cloud image daily | 53 | If the maas ephemeral data is up to date with the latest cloud image candidate |
20 | 54 | then meph2-cloudimg-sync will not do anything. | 54 | then meph2-cloudimg-sync will not do anything. |
21 | 55 | 55 | ||
22 | 56 | In order to 'rebuild' something. To create a new '20160101.1' even when | 56 | In order to 'rebuild' something. To create a new '20160101.1' even when |
23 | @@ -114,10 +114,10 @@ an existing stream. This option (meph2-util insert) is additive only. | |||
24 | 114 | 114 | ||
25 | 115 | === insert data === | 115 | === insert data === |
26 | 116 | Given output of a meph2-cloudimg-sync command above in build-output.d | 116 | Given output of a meph2-cloudimg-sync command above in build-output.d |
28 | 117 | and local daily stream directory daily-stream.d you can add the new data | 117 | and local candidate stream directory candidate-stream.d you can add the new data |
29 | 118 | with: | 118 | with: |
30 | 119 | 119 | ||
32 | 120 | meph2-util insert build-output.d daily-stream.d | 120 | meph2-util insert build-output.d candidate-stream.d |
33 | 121 | 121 | ||
34 | 122 | If you do not want to sign (create .gpg and .sjson files), then you will | 122 | If you do not want to sign (create .gpg and .sjson files), then you will |
35 | 123 | have to use '--no-sign'. | 123 | have to use '--no-sign'. |
36 | @@ -126,23 +126,23 @@ You can use '--dry-run' to only report what would be done. | |||
37 | 126 | 126 | ||
38 | 127 | === Promoting Builds === | 127 | === Promoting Builds === |
39 | 128 | Promoting is done on a specific version of a product. | 128 | Promoting is done on a specific version of a product. |
41 | 129 | You promote a daily build to a released build with a given label. | 129 | You promote a candidate build to a released build with a given label. |
42 | 130 | Likely that label is 'release'. | 130 | Likely that label is 'release'. |
43 | 131 | 131 | ||
44 | 132 | # list the product-ids and version are available for promotion | 132 | # list the product-ids and version are available for promotion |
45 | 133 | $ sstream-query --output-format="%(product_name)s %(version_name)s" --max=1 \ | 133 | $ sstream-query --output-format="%(product_name)s %(version_name)s" --max=1 \ |
53 | 134 | daily.d/streams/v1/index.json arch=i386 | sort -u | 134 | candidate.d/streams/v1/index.json arch=i386 | sort -u |
54 | 135 | com.ubuntu.maas.daily:v2:boot:12.04:i386:hwe-p 20140414 | 135 | com.ubuntu.maas.candidate:v3:boot:12.04:i386:hwe-p 20140414 |
55 | 136 | com.ubuntu.maas.daily:v2:boot:12.04:i386:hwe-q 20140414 | 136 | com.ubuntu.maas.candidate:v3:boot:12.04:i386:hwe-q 20140414 |
56 | 137 | com.ubuntu.maas.daily:v2:boot:12.04:i386:hwe-r 20140414 | 137 | com.ubuntu.maas.candidate:v3:boot:12.04:i386:hwe-r 20140414 |
57 | 138 | com.ubuntu.maas.daily:v2:boot:12.04:i386:hwe-s 20140414 | 138 | com.ubuntu.maas.candidate:v3:boot:12.04:i386:hwe-s 20140414 |
58 | 139 | com.ubuntu.maas.daily:v2:boot:13.10:i386:hwe-s 20140416 | 139 | com.ubuntu.maas.candidate:v3:boot:13.10:i386:hwe-s 20140416 |
59 | 140 | com.ubuntu.maas.daily:v2:boot:14.04:i386:hwe-t 20140416.1 | 140 | com.ubuntu.maas.candidate:v3:boot:14.04:i386:hwe-t 20140416.1 |
60 | 141 | 141 | ||
61 | 142 | # promote the listed version | 142 | # promote the listed version |
62 | 143 | $ meph2-util promote --label=release \ | 143 | $ meph2-util promote --label=release \ |
65 | 144 | daily.d/streams/v1/index.json releases.d/ 20140414 \ | 144 | candidate.d/streams/v1/index.json stable.d/ 20140414 \ |
66 | 145 | product_name=com.ubuntu.maas.daily:v2:boot:12.04:i386:hwe-q | 145 | product_name=com.ubuntu.maas.candidate:v3:boot:12.04:i386:hwe-q |
67 | 146 | 146 | ||
68 | 147 | 147 | ||
69 | 148 | == cleaning old images == | 148 | == cleaning old images == |
70 | @@ -158,7 +158,7 @@ clean-md is the meph-util subcommand that allows you to keep only a given | |||
71 | 158 | number of builds. For example, to keep the latest 3 versions of every | 158 | number of builds. For example, to keep the latest 3 versions of every |
72 | 159 | product in the meta-data, you would run: | 159 | product in the meta-data, you would run: |
73 | 160 | 160 | ||
75 | 161 | meph2-util clean-md --max=3 daily-sream.d/ | 161 | meph2-util clean-md --max=3 candidate-stream.d/ |
76 | 162 | 162 | ||
77 | 163 | This *only* modifies the meta-data, it does not delete files, use find-orphans | 163 | This *only* modifies the meta-data, it does not delete files, use find-orphans |
78 | 164 | and reap-orphans for that. | 164 | and reap-orphans for that. |
79 | @@ -176,7 +176,7 @@ Example usage: | |||
80 | 176 | my-orphans.json with any new items, but will not update first-orphaned | 176 | my-orphans.json with any new items, but will not update first-orphaned |
81 | 177 | timestamp. | 177 | timestamp. |
82 | 178 | 178 | ||
84 | 179 | $ meph2-util find-orphans my-orphans.json ./daily/ ./daily/streams/v1/*.json | 179 | $ meph2-util find-orphans my-orphans.json ./candidate/ ./candidate/streams/v1/*.json |
85 | 180 | 180 | ||
86 | 181 | More complex usage: | 181 | More complex usage: |
87 | 182 | Its possible that 2 streams dirs could share a data directory, similar | 182 | Its possible that 2 streams dirs could share a data directory, similar |
88 | @@ -184,11 +184,11 @@ More complex usage: | |||
89 | 184 | directory tree layout (note, 'path' elements would have 'data' in them in | 184 | directory tree layout (note, 'path' elements would have 'data' in them in |
90 | 185 | this example): | 185 | this example): |
91 | 186 | 186 | ||
93 | 187 | daily/ | 187 | candidate/ |
94 | 188 | data -> ../data/ | 188 | data -> ../data/ |
95 | 189 | streams/v1/index.json | 189 | streams/v1/index.json |
98 | 190 | streams/v1/daily.json | 190 | streams/v1/candidate.json |
99 | 191 | released/ | 191 | stable/ |
100 | 192 | data -> ../data | 192 | data -> ../data |
101 | 193 | streams/v1/index.json | 193 | streams/v1/index.json |
102 | 194 | streams/v1/released.json | 194 | streams/v1/released.json |
103 | @@ -199,10 +199,10 @@ More complex usage: | |||
104 | 199 | Then, we could run meph-util find-orphans with: | 199 | Then, we could run meph-util find-orphans with: |
105 | 200 | 200 | ||
106 | 201 | $ meph2-util find-orphans my-orphans.json ./data/ \ | 201 | $ meph2-util find-orphans my-orphans.json ./data/ \ |
108 | 202 | ./daily/streams/v1/index.json released/streams/v1/index.json | 202 | ./candidate/streams/v1/index.json stable/streams/v1/index.json |
109 | 203 | 203 | ||
110 | 204 | That will look through files in data/ that are not referenced by path | 204 | That will look through files in data/ that are not referenced by path |
112 | 205 | elements in either the daily/streams/v1/ or released/streams/v1/ files. | 205 | elements in either the candidate/streams/v1/ or stable/streams/v1/ files. |
113 | 206 | 206 | ||
114 | 207 | There is no --dry-run for finding orphans as it is non-destructive. | 207 | There is no --dry-run for finding orphans as it is non-destructive. |
115 | 208 | 208 | ||
116 | diff --git a/README.testing b/README.testing | |||
117 | index 1622e4a..f5d558a 100644 | |||
118 | --- a/README.testing | |||
119 | +++ b/README.testing | |||
120 | @@ -1,28 +1,28 @@ | |||
121 | 1 | To get local copies of maas ephemerals, you can do: | 1 | To get local copies of maas ephemerals, you can do: |
122 | 2 | 2 | ||
123 | 3 | burl=http://maas.ubuntu.com/images/ephemeral-v2 | 3 | burl=http://maas.ubuntu.com/images/ephemeral-v2 |
125 | 4 | for stream in releases daily; do | 4 | for stream in releases candidate; do |
126 | 5 | sstream-mirror --no-item-download \ | 5 | sstream-mirror --no-item-download \ |
127 | 6 | $burl/$stream/streams/v1/index.json "$stream.d"; done | 6 | $burl/$stream/streams/v1/index.json "$stream.d"; done |
128 | 7 | 7 | ||
129 | 8 | 8 | ||
130 | 9 | Then, to test promote you could do: | 9 | Then, to test promote you could do: |
131 | 10 | $ sstream-query --output-format="%(product_name)s %(version_name)s" --max=1 \ | 10 | $ sstream-query --output-format="%(product_name)s %(version_name)s" --max=1 \ |
139 | 11 | daily.d/streams/v1/index.json arch=i386 | sort -u | 11 | candidate.d/streams/v1/index.json arch=i386 | sort -u |
140 | 12 | com.ubuntu.maas.daily:v2:boot:12.04:i386:hwe-p 20140414 | 12 | com.ubuntu.maas.candidate:v3:boot:12.04:i386:hwe-p 20140414 |
141 | 13 | com.ubuntu.maas.daily:v2:boot:12.04:i386:hwe-q 20140414 | 13 | com.ubuntu.maas.candidate:v3:boot:12.04:i386:hwe-q 20140414 |
142 | 14 | com.ubuntu.maas.daily:v2:boot:12.04:i386:hwe-r 20140414 | 14 | com.ubuntu.maas.candidate:v3:boot:12.04:i386:hwe-r 20140414 |
143 | 15 | com.ubuntu.maas.daily:v2:boot:12.04:i386:hwe-s 20140414 | 15 | com.ubuntu.maas.candidate:v3:boot:12.04:i386:hwe-s 20140414 |
144 | 16 | com.ubuntu.maas.daily:v2:boot:13.10:i386:hwe-s 20140416 | 16 | com.ubuntu.maas.candidate:v3:boot:13.10:i386:hwe-s 20140416 |
145 | 17 | com.ubuntu.maas.daily:v2:boot:14.04:i386:hwe-t 20140416.1 | 17 | com.ubuntu.maas.candidate:v3:boot:14.04:i386:hwe-t 20140416.1 |
146 | 18 | 18 | ||
147 | 19 | $ sstream-query \ | 19 | $ sstream-query \ |
148 | 20 | --output-format="%(product_name)s %(version_name)s/%(item_name)s" \ | 20 | --output-format="%(product_name)s %(version_name)s/%(item_name)s" \ |
149 | 21 | releases.d/streams/v1/index.json | sort -u > before | 21 | releases.d/streams/v1/index.json | sort -u > before |
150 | 22 | 22 | ||
151 | 23 | $ meph2-util promote --no-sign --skip-file-copy --label=release \ | 23 | $ meph2-util promote --no-sign --skip-file-copy --label=release \ |
154 | 24 | daily.d/streams/v1/index.json releases.d/ 20140414 \ | 24 | candidate.d/streams/v1/index.json releases.d/ 20140414 \ |
155 | 25 | product_name=com.ubuntu.maas.daily:v2:boot:12.04:i386:hwe-q | 25 | product_name=com.ubuntu.maas.candidate:v3:boot:12.04:i386:hwe-q |
156 | 26 | 26 | ||
157 | 27 | $ sstream-query \ | 27 | $ sstream-query \ |
158 | 28 | --output-format="%(product_name)s %(version_name)s/%(item_name)s" \ | 28 | --output-format="%(product_name)s %(version_name)s/%(item_name)s" \ |
159 | diff --git a/conf/bootloaders.yaml b/conf/bootloaders.yaml | |||
160 | index cf83162..7fd275e 100644 | |||
161 | --- a/conf/bootloaders.yaml | |||
162 | +++ b/conf/bootloaders.yaml | |||
163 | @@ -1,5 +1,5 @@ | |||
166 | 1 | product_id: "com.ubuntu.maas.daily:1:{os}:{firmware_platform}:{arch}" | 1 | product_id: "com.ubuntu.maas.candidate:1:{os}:{firmware_platform}:{arch}" |
167 | 2 | content_id: "com.ubuntu.maas:daily:1:bootloader-download" | 2 | content_id: "com.ubuntu.maas:candidate:1:bootloader-download" |
168 | 3 | 3 | ||
169 | 4 | bootloaders: | 4 | bootloaders: |
170 | 5 | - firmware-platform: pxe | 5 | - firmware-platform: pxe |
171 | diff --git a/conf/centos.yaml b/conf/centos.yaml | |||
172 | index 55bc311..3c06369 100644 | |||
173 | --- a/conf/centos.yaml | |||
174 | +++ b/conf/centos.yaml | |||
175 | @@ -1,7 +1,7 @@ | |||
176 | 1 | image_index: http://cloud.centos.org/centos/{version}/images/image-index | 1 | image_index: http://cloud.centos.org/centos/{version}/images/image-index |
177 | 2 | 2 | ||
180 | 3 | product_id: "com.ubuntu.maas.daily:centos-bases:{version}:{arch}" | 3 | product_id: "com.ubuntu.maas.candidate:centos-bases:{version}:{arch}" |
181 | 4 | content_id: "com.ubuntu.maas:daily:centos-bases-download" | 4 | content_id: "com.ubuntu.maas:candidate:centos-bases-download" |
182 | 5 | os: centos | 5 | os: centos |
183 | 6 | arch: amd64 | 6 | arch: amd64 |
184 | 7 | base_mirror: http://mirrors.edge.kernel.org | 7 | base_mirror: http://mirrors.edge.kernel.org |
185 | diff --git a/conf/meph-v3.yaml b/conf/meph-v3.yaml | |||
186 | index 594918b..a7e45a8 100644 | |||
187 | --- a/conf/meph-v3.yaml | |||
188 | +++ b/conf/meph-v3.yaml | |||
189 | @@ -207,9 +207,9 @@ enable_di: False | |||
190 | 207 | ## so for now, we just don't have a stream for that. | 207 | ## so for now, we just don't have a stream for that. |
191 | 208 | ## * kernel meta package in all cases here is linux-image-<flavor> | 208 | ## * kernel meta package in all cases here is linux-image-<flavor> |
192 | 209 | 209 | ||
196 | 210 | default_target: http://images.maas.io/ephemeral-v3/daily/streams/v1/com.ubuntu.maas:daily:v3:download.json | 210 | default_target: http://images.maas.io/ephemeral-v3/candidate/streams/v1/com.ubuntu.maas:candidate:v3:download.json |
197 | 211 | content_id: com.ubuntu.maas:daily:v3:download | 211 | content_id: com.ubuntu.maas:candidate:v3:download |
198 | 212 | product_id_pre: com.ubuntu.maas.daily:v3:boot | 212 | product_id_pre: com.ubuntu.maas.candidate:v3:boot |
199 | 213 | 213 | ||
200 | 214 | # By default maas-images uses the krel in the boot path. This worked for the v2 | 214 | # By default maas-images uses the krel in the boot path. This worked for the v2 |
201 | 215 | # stream because there was only one kernel per release/arch/krel/kflavor. The | 215 | # stream because there was only one kernel per release/arch/krel/kflavor. The |
202 | diff --git a/meph2/commands/cloudimg_sync.py b/meph2/commands/cloudimg_sync.py | |||
203 | index a118a52..2ea1903 100755 | |||
204 | --- a/meph2/commands/cloudimg_sync.py | |||
205 | +++ b/meph2/commands/cloudimg_sync.py | |||
206 | @@ -16,8 +16,8 @@ import os | |||
207 | 16 | import sys | 16 | import sys |
208 | 17 | import yaml | 17 | import yaml |
209 | 18 | 18 | ||
212 | 19 | CLOUD_IMAGES_DAILY = ("http://cloud-images.ubuntu.com/daily/" | 19 | CLOUD_IMAGES_CANDIDATE = ("http://cloud-images.ubuntu.com/candidate/" |
213 | 20 | "streams/v1/com.ubuntu.cloud:daily:download.json") | 20 | "streams/v1/com.ubuntu.cloud:candidate:download.json") |
214 | 21 | 21 | ||
215 | 22 | FORCE_URL = "force" # a fake target url that will have nothing in it | 22 | FORCE_URL = "force" # a fake target url that will have nothing in it |
216 | 23 | DEFAULT_ARCHES = { | 23 | DEFAULT_ARCHES = { |
217 | @@ -36,7 +36,7 @@ def v2_to_cloudimg_products(prodtree, rebuilds={}): | |||
218 | 36 | # this turns a v2 products tree into a cloud-image products tree. | 36 | # this turns a v2 products tree into a cloud-image products tree. |
219 | 37 | # it pays attention only to products with krel == release | 37 | # it pays attention only to products with krel == release |
220 | 38 | # (in an attempt to only get "primary") | 38 | # (in an attempt to only get "primary") |
222 | 39 | ret = util.empty_iid_products("com.ubuntu.cloud:daily:download") | 39 | ret = util.empty_iid_products("com.ubuntu.cloud:candidate:download") |
223 | 40 | # rebuilds is {cloudimgYYYYMMDD:newYYYYMMDD} | 40 | # rebuilds is {cloudimgYYYYMMDD:newYYYYMMDD} |
224 | 41 | for product in prodtree.get('products'): | 41 | for product in prodtree.get('products'): |
225 | 42 | if not (prodtree['products'][product].get('krel') == | 42 | if not (prodtree['products'][product].get('krel') == |
226 | @@ -44,8 +44,8 @@ def v2_to_cloudimg_products(prodtree, rebuilds={}): | |||
227 | 44 | continue | 44 | continue |
228 | 45 | 45 | ||
229 | 46 | # com.ubuntu.maas:boot:12.04:amd64:hwe-s => | 46 | # com.ubuntu.maas:boot:12.04:amd64:hwe-s => |
232 | 47 | # com.ubuntu.cloud.daily:server:12.04:amd64 | 47 | # com.ubuntu.cloud.candidate:server:12.04:amd64 |
233 | 48 | tprod = ("com.ubuntu.cloud.daily:server:%(version)s:%(arch)s" % | 48 | tprod = ("com.ubuntu.cloud.candidate:server:%(version)s:%(arch)s" % |
234 | 49 | prodtree['products'][product]) | 49 | prodtree['products'][product]) |
235 | 50 | 50 | ||
236 | 51 | if tprod not in ret['products']: | 51 | if tprod not in ret['products']: |
237 | @@ -99,7 +99,7 @@ class CloudImg2Meph2Sync(mirrors.BasicMirrorWriter): | |||
238 | 99 | self.rebuilds = rebuilds | 99 | self.rebuilds = rebuilds |
239 | 100 | 100 | ||
240 | 101 | def load_products(self, path=None, content_id=None): | 101 | def load_products(self, path=None, content_id=None): |
242 | 102 | if content_id != "com.ubuntu.cloud:daily:download": | 102 | if content_id != "com.ubuntu.cloud:candidate:download": |
243 | 103 | raise ValueError("Not expecting to sync with content_id: %s" % | 103 | raise ValueError("Not expecting to sync with content_id: %s" % |
244 | 104 | content_id) | 104 | content_id) |
245 | 105 | 105 | ||
246 | @@ -172,7 +172,7 @@ class CloudImg2Meph2Sync(mirrors.BasicMirrorWriter): | |||
247 | 172 | fp.write(util.dump_data(index)) | 172 | fp.write(util.dump_data(index)) |
248 | 173 | 173 | ||
249 | 174 | def filter_index_entry(self, data, src, pedigree): | 174 | def filter_index_entry(self, data, src, pedigree): |
251 | 175 | if pedigree[0] != "com.ubuntu.cloud:daily:download": | 175 | if pedigree[0] != "com.ubuntu.cloud:candidate:download": |
252 | 176 | LOG.info("skipping index entry %s" % '/'.join(pedigree)) | 176 | LOG.info("skipping index entry %s" % '/'.join(pedigree)) |
253 | 177 | return False | 177 | return False |
254 | 178 | return True | 178 | return True |
255 | @@ -209,7 +209,7 @@ def main(): | |||
256 | 209 | parser.add_argument('--proposed', action='store_true', default=False) | 209 | parser.add_argument('--proposed', action='store_true', default=False) |
257 | 210 | parser.add_argument('--rebuild', action='append', default=[], | 210 | parser.add_argument('--rebuild', action='append', default=[], |
258 | 211 | help='rebuild version name YYYYMMDD:YYYMMDD.1') | 211 | help='rebuild version name YYYYMMDD:YYYMMDD.1') |
260 | 212 | parser.add_argument('--source', default=CLOUD_IMAGES_DAILY, | 212 | parser.add_argument('--source', default=CLOUD_IMAGES_CANDIDATE, |
261 | 213 | help='cloud images mirror') | 213 | help='cloud images mirror') |
262 | 214 | parser.add_argument('--target', default=None, | 214 | parser.add_argument('--target', default=None, |
263 | 215 | help="maas ephemeral v2 or v3 mirror, overrides " | 215 | help="maas ephemeral v2 or v3 mirror, overrides " |
264 | diff --git a/meph2/commands/flags.py b/meph2/commands/flags.py | |||
265 | index f3ca85d..f85060d 100644 | |||
266 | --- a/meph2/commands/flags.py | |||
267 | +++ b/meph2/commands/flags.py | |||
268 | @@ -59,7 +59,7 @@ SUBCOMMANDS = { | |||
269 | 59 | ] | 59 | ] |
270 | 60 | }, | 60 | }, |
271 | 61 | 'promote': { | 61 | 'promote': { |
273 | 62 | 'help': 'promote a product/version from daily to release', | 62 | 'help': 'promote a product/version from candidate to stable', |
274 | 63 | 'opts': [ | 63 | 'opts': [ |
275 | 64 | COMMON_FLAGS['dry-run'], COMMON_FLAGS['no-sign'], | 64 | COMMON_FLAGS['dry-run'], COMMON_FLAGS['no-sign'], |
276 | 65 | COMMON_FLAGS['keyring'], | 65 | COMMON_FLAGS['keyring'], |
277 | diff --git a/meph2/commands/meph2_util.py b/meph2/commands/meph2_util.py | |||
278 | index 295442d..f33b4be 100755 | |||
279 | --- a/meph2/commands/meph2_util.py | |||
280 | +++ b/meph2/commands/meph2_util.py | |||
281 | @@ -135,7 +135,7 @@ class InsertBareMirrorWriter(BareMirrorWriter): | |||
282 | 135 | 135 | ||
283 | 136 | class ReleasePromoteMirror(InsertBareMirrorWriter): | 136 | class ReleasePromoteMirror(InsertBareMirrorWriter): |
284 | 137 | # this does not do reference counting or .data/ storage | 137 | # this does not do reference counting or .data/ storage |
286 | 138 | # it converts a daily item to a release item and inserts it. | 138 | # it converts a candidate item to a release item and inserts it. |
287 | 139 | 139 | ||
288 | 140 | # we take care of writing file in insert_products | 140 | # we take care of writing file in insert_products |
289 | 141 | insert_index_entry = BareMirrorWriter._noop | 141 | insert_index_entry = BareMirrorWriter._noop |
290 | @@ -145,7 +145,7 @@ class ReleasePromoteMirror(InsertBareMirrorWriter): | |||
291 | 145 | objectstore=objectstore) | 145 | objectstore=objectstore) |
292 | 146 | self.label = label | 146 | self.label = label |
293 | 147 | 147 | ||
295 | 148 | def rel2daily(self, ptree): | 148 | def rel2candidate(self, ptree): |
296 | 149 | ret = copy.deepcopy(ptree) | 149 | ret = copy.deepcopy(ptree) |
297 | 150 | ret['content_id'] = self.fixed_content_id(ret['content_id']) | 150 | ret['content_id'] = self.fixed_content_id(ret['content_id']) |
298 | 151 | 151 | ||
299 | @@ -155,25 +155,25 @@ class ReleasePromoteMirror(InsertBareMirrorWriter): | |||
300 | 155 | del ptree['products'][oname] | 155 | del ptree['products'][oname] |
301 | 156 | 156 | ||
302 | 157 | def fixed_content_id(self, content_id): | 157 | def fixed_content_id(self, content_id): |
306 | 158 | # when promoting from daily, our content ids get ':daily' removed | 158 | # when promoting from candidate, our content ids get ':candidate' removed |
307 | 159 | # com.ubuntu.maas:daily:v2:download => com.ubuntu.maas:v2:download | 159 | # com.ubuntu.maas:candidate:v2:download => com.ubuntu.maas:v2:download |
308 | 160 | return(content_id.replace(":daily", "")) | 160 | return(content_id.replace(":candidate", "")) |
309 | 161 | 161 | ||
310 | 162 | def fixed_pedigree(self, pedigree): | 162 | def fixed_pedigree(self, pedigree): |
311 | 163 | return tuple([self.fixed_product_id(pedigree[0])] + list(pedigree[1:])) | 163 | return tuple([self.fixed_product_id(pedigree[0])] + list(pedigree[1:])) |
312 | 164 | 164 | ||
313 | 165 | def fixed_product_id(self, product_id): | 165 | def fixed_product_id(self, product_id): |
316 | 166 | # when promoting from daily, product ids get '.daily' removed | 166 | # when promoting from candidate, product ids get '.candidate' removed |
317 | 167 | # com.ubuntu.maas.daily:v2:boot:13.10:armhf:generic-lpae -> | 167 | # com.ubuntu.maas.candidate:v2:boot:13.10:armhf:generic-lpae -> |
318 | 168 | # com.ubuntu.maas:v2:boot:13.10:armhf:generic-lpae | 168 | # com.ubuntu.maas:v2:boot:13.10:armhf:generic-lpae |
320 | 169 | return product_id.replace(".daily:", ":") | 169 | return product_id.replace(".candidate:", ":") |
321 | 170 | 170 | ||
322 | 171 | def load_products(self, path, content_id): | 171 | def load_products(self, path, content_id): |
323 | 172 | # this loads the released products, but returns it in form | 172 | # this loads the released products, but returns it in form |
325 | 173 | # of daily products | 173 | # of candidate products |
326 | 174 | ret = super(ReleasePromoteMirror, self).load_products( | 174 | ret = super(ReleasePromoteMirror, self).load_products( |
327 | 175 | path=path, content_id=self.fixed_content_id(content_id)) | 175 | path=path, content_id=self.fixed_content_id(content_id)) |
329 | 176 | return self.rel2daily(ret) | 176 | return self.rel2candidate(ret) |
330 | 177 | 177 | ||
331 | 178 | def insert_item(self, data, src, target, pedigree, contentsource): | 178 | def insert_item(self, data, src, target, pedigree, contentsource): |
332 | 179 | ret = super(ReleasePromoteMirror, self).insert_item( | 179 | ret = super(ReleasePromoteMirror, self).insert_item( |
333 | diff --git a/meph2/commands/mimport.py b/meph2/commands/mimport.py | |||
334 | index 6344d3f..224a248 100644 | |||
335 | --- a/meph2/commands/mimport.py | |||
336 | +++ b/meph2/commands/mimport.py | |||
337 | @@ -67,7 +67,7 @@ def import_remote_config(args, product_tree, cfgdata): | |||
338 | 67 | print("Creating new product %s" % product_id) | 67 | print("Creating new product %s" % product_id) |
339 | 68 | product_tree['products'][product_id] = { | 68 | product_tree['products'][product_id] = { |
340 | 69 | 'subarches': 'generic', | 69 | 'subarches': 'generic', |
342 | 70 | 'label': 'daily', | 70 | 'label': 'candidate', |
343 | 71 | 'subarch': 'generic', | 71 | 'subarch': 'generic', |
344 | 72 | 'arch': arch, | 72 | 'arch': arch, |
345 | 73 | 'os': os_name, | 73 | 'os': os_name, |
346 | @@ -175,7 +175,7 @@ def import_bootloaders(args, product_tree, cfgdata): | |||
347 | 175 | if product_tree['products'].get(product_id) is None: | 175 | if product_tree['products'].get(product_id) is None: |
348 | 176 | print("Creating new product %s" % product_id) | 176 | print("Creating new product %s" % product_id) |
349 | 177 | product_tree['products'][product_id] = { | 177 | product_tree['products'][product_id] = { |
351 | 178 | 'label': 'daily', | 178 | 'label': 'candidate', |
352 | 179 | 'arch': firmware_platform['arch'], | 179 | 'arch': firmware_platform['arch'], |
353 | 180 | 'arches': firmware_platform['arches'], | 180 | 'arches': firmware_platform['arches'], |
354 | 181 | 'os': firmware_platform['os'], | 181 | 'os': firmware_platform['os'], |
355 | diff --git a/meph2/stream.py b/meph2/stream.py | |||
356 | index 3142401..47a9abd 100644 | |||
357 | --- a/meph2/stream.py | |||
358 | +++ b/meph2/stream.py | |||
359 | @@ -11,7 +11,7 @@ import yaml | |||
360 | 11 | 11 | ||
361 | 12 | from simplestreams.log import LOG | 12 | from simplestreams.log import LOG |
362 | 13 | 13 | ||
364 | 14 | ALL_ITEM_TAGS = {'label': 'daily', 'os': 'ubuntu'} | 14 | ALL_ITEM_TAGS = {'label': 'candidate', 'os': 'ubuntu'} |
365 | 15 | 15 | ||
366 | 16 | PATH_COMMON = "%(release)s/%(arch)s/" | 16 | PATH_COMMON = "%(release)s/%(arch)s/" |
367 | 17 | BOOT_COMMON = PATH_COMMON + "%(version_name)s/%(kname)s/%(flavor)s" | 17 | BOOT_COMMON = PATH_COMMON + "%(version_name)s/%(kname)s/%(flavor)s" |
368 | diff --git a/tools/genstream-muc b/tools/genstream-muc | |||
369 | index 0134afa..758836a 100755 | |||
370 | --- a/tools/genstream-muc | |||
371 | +++ b/tools/genstream-muc | |||
372 | @@ -162,7 +162,7 @@ class FakeProduct(object): | |||
373 | 162 | self._versions[version] = d | 162 | self._versions[version] = d |
374 | 163 | 163 | ||
375 | 164 | def get_label(self, version): | 164 | def get_label(self, version): |
377 | 165 | return 'daily' | 165 | return 'candidate' |
378 | 166 | 166 | ||
379 | 167 | def makepaths(self, target, makedata=makedata_filepath): | 167 | def makepaths(self, target, makedata=makedata_filepath): |
380 | 168 | for version_id, ver in self._versions.items(): | 168 | for version_id, ver in self._versions.items(): |
LGTM.
As mentioned on MM maybe we could keep a feature branch where to land these changed until the whole feature is complete.