Merge lp:~deeptik/linaro-ci/use_precise_hwpacks_for_kernel_ci into lp:linaro-ci

Proposed by Deepti B. Kalakeri
Status: Merged
Merged at revision: 64
Proposed branch: lp:~deeptik/linaro-ci/use_precise_hwpacks_for_kernel_ci
Merge into: lp:linaro-ci
Diff against target: 144 lines (+24/-42)
3 files modified
find_latest.py (+19/-38)
get_latest_ci_hwpack (+4/-3)
get_latest_slo_hwpack (+1/-1)
To merge this branch: bzr merge lp:~deeptik/linaro-ci/use_precise_hwpacks_for_kernel_ci
Reviewer Review Type Date Requested Status
Fathi Boudra Approve
Linaro Infrastructure Pending
Review via email: mp+106143@code.launchpad.net

Description of the change

Switch daily kernel builds to Precise hwpacks

To post a comment you must log in.
Revision history for this message
Fathi Boudra (fboudra) wrote :

Approved. For further improvements:
- it will be nice to have tests. It will make the review easier.
- the code could be simplified if you use Jenkins API to get latest successful build.

review: Approve
Revision history for this message
Deepti B. Kalakeri (deeptik) wrote :

On Thu, May 17, 2012 at 7:26 PM, Fathi Boudra <email address hidden>wrote:

> Review: Approve
>
> Approved. For further improvements:
> - it will be nice to have tests. It will make the review easier.
> - the code could be simplified if you use Jenkins API to get latest
> successful build.
>
>
Yes, I will add the tests sometime soon. I wanted this merge to go in ASAP
as I want to stop using oneiric.
Use latest successful build for.
I will merge the changes for now as you have approved. I will work further
if required and propose a new merge.

> --
>
> https://code.launchpad.net/~deeptik/linaro-ci/use_precise_hwpacks_for_kernel_ci/+merge/106143<https://code.launchpad.net/%7Edeeptik/linaro-ci/use_precise_hwpacks_for_kernel_ci/+merge/106143>
> You are the owner of
> lp:~deeptik/linaro-ci/use_precise_hwpacks_for_kernel_ci.
>

--
Thanks!!!
Deepti

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'find_latest.py'
2--- find_latest.py 2012-05-04 13:27:16 +0000
3+++ find_latest.py 2012-05-17 13:12:17 +0000
4@@ -3,7 +3,6 @@
5 import shutil
6 import urllib2
7 import urlparse
8-import re
9 from datetime import datetime
10 from download_content_yes_to_lic import LicenseProtectedFileFetcher
11
12@@ -44,7 +43,7 @@
13
14 def _get_filename(filelist):
15 match = None
16- tgzpattern = re.compile('<a href="(?P<tgzfilename>[\w\-\.]+\.tar\.gz)"')
17+ tgzpattern = re.compile('<a href="(?P<tgzfilename>[\w\-]+(?!\.config)\.tar\.gz)"')
18 for match in tgzpattern.finditer(filelist):
19 pass
20 if match is None:
21@@ -52,62 +51,44 @@
22 return None
23 return match.group('tgzfilename')
24
25-def find_latest(url, extra):
26+def find_latest(url):
27 """Find the latest image at the specified url
28
29 :param url: The base url to search
30 :param extra: The extra path needed to complete the url
31 """
32 fetcher = LicenseProtectedFileFetcher()
33- builddates = fetcher.get(url)
34- dates = find_builds(builddates)
35- dates.sort()
36- try:
37- while dates:
38- lastdate = dates.pop()
39- lastdate = lastdate + "/"
40- path = urlparse.urljoin(url, lastdate)
41- builds = fetcher.get(path)
42- buildlist = find_builds(builds)
43- while buildlist:
44- lastbuild = buildlist.pop()
45- latesturl = os.path.join(path, lastbuild) + extra
46- content = fetcher.get(latesturl)
47- filename = _get_filename(content)
48- if filename:
49- raise StopIteration()
50- except StopIteration:
51- pass
52- fetcher.close()
53- build_id = "%s.%s" % (lastdate,lastbuild)
54+ latesturl = urlparse.urljoin(url, "latest")
55+ latesturl = latesturl + "/"
56+ content = fetcher.get(latesturl)
57+ filename = _get_filename(content)
58 tgz_url = os.path.join(latesturl, filename)
59- return build_id, tgz_url
60+ fetcher.close()
61+ return tgz_url
62
63 def find_latest_rootfs(imgtype):
64 """Find the latest root fs image and return the build_id and url
65
66 :param imgtype: The short name of the image type.
67 """
68- imageurl="http://snapshots.linaro.org/oneiric/linaro-o-%s/" % imgtype
69- extrapath="/images/tar/"
70- build_id, filename = find_latest(imageurl, extrapath)
71- return build_id, filename
72+ imageurl="http://snapshots.linaro.org/precise/images/%s/" % imgtype
73+ filename = find_latest(imageurl)
74+ return filename
75
76 def find_latest_hwpack(hwpack):
77 """Find the latest hardware pack and return the build_id and url
78
79 :param hwpack: The name of the hardware pack to look for.
80 """
81- # There is no omap3 hwpacks generated by landing team, hence use
82- # the default omap3 hwpack available.
83- if hwpack != 'omap3':
84- url="http://snapshots.linaro.org/oneiric/lt-%s-oneiric/" % hwpack
85+ # There is no omap3 and origen hwpacks generated for lt,
86+ # hence use the default omap3 and origen hwpack available.
87+ #url="http://snapshots.linaro.org/oneiric/lt-%s-oneiric/" % hwpack
88+ if hwpack != 'beagleboard' and hwpack != "origen":
89+ url="http://snapshots.linaro.org/precise/hwpacks/lt-%s/" % hwpack
90 else:
91- url="http://snapshots.linaro.org/oneiric/%s-oneiric/" % hwpack
92-
93- hwpackextra="/images/hwpack/"
94- build_id, filename = find_latest(url, hwpackextra)
95- return build_id, filename
96+ url="http://snapshots.linaro.org/precise/hwpacks/%s/" % hwpack
97+ filename = find_latest(url)
98+ return filename
99
100 def find_ci_builds(data):
101 found = []
102
103=== modified file 'get_latest_ci_hwpack'
104--- get_latest_ci_hwpack 2012-05-15 11:23:04 +0000
105+++ get_latest_ci_hwpack 2012-05-17 13:12:17 +0000
106@@ -6,7 +6,7 @@
107 import os
108 import re
109 import json
110-from find_latest import find_latest_hwpack, find_latest_rootfs, find_ci_latest
111+from find_latest import find_latest_rootfs, find_ci_latest
112
113 hwpacktype = os.getenv("HWPACK_TYPE", "unknown")
114 imagetype = os.getenv("ROOTFS_TYPE", "unknown")
115@@ -43,7 +43,9 @@
116 hwpack_url_path = os.path.join(hwpack_url_path, hwpack_dir_url)
117
118 hwpack_url = find_ci_latest(hwpack_url_path)
119-rootfs_id, rootfs_url = find_latest_rootfs(imagetype)
120+rootfs_url = find_latest_rootfs(imagetype)
121+rootfs_name, rootfsdate, rootfsbuild = os.path.basename(rootfs_url).\
122+ rsplit(".", 2)[0].rsplit("-", 2)
123
124 deploy_params = { 'hwpack':hwpack_url, 'rootfs':rootfs_url }
125 template['actions'][0]['parameters'] = deploy_params
126@@ -64,7 +66,6 @@
127 metadata['hwpack.type'] = hwpacktype
128 metadata['hwpack.date'] = hwpackdate
129
130-rootfsdate, rootfsbuild = rootfs_id.split('.')
131 metadata['rootfs.type'] = imagetype
132 metadata['rootfs.date'] = rootfsdate
133 metadata['rootfs.build'] = rootfsbuild
134
135=== modified file 'get_latest_slo_hwpack'
136--- get_latest_slo_hwpack 2011-09-05 12:40:52 +0000
137+++ get_latest_slo_hwpack 2012-05-17 13:12:17 +0000
138@@ -8,5 +8,5 @@
139 import os
140
141 hwpacktype = os.getenv("hwpack_type", "unknown")
142-hwpack_id, hwpack_url = find_latest_hwpack(hwpacktype)
143+hwpack_url = find_latest_hwpack(hwpacktype)
144 print hwpack_url

Subscribers

People subscribed via source and target branches