Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Issue 4969003: Update cbuildbot.py to upload prebuilts from preflight buildbot. (Closed)

Created:
10 years, 1 month ago by davidjames
Modified:
9 years, 4 months ago
CC:
chromium-os-reviews_chromium.org, Mandeep Singh Baines, anush, sosa
Visibility:
Public.

Description

Update cbuildbot.py to upload prebuilts from preflight buildbot. This change updates cbuildbot.py to upload prebuilts and reference them via PREFLIGHT_BINHOST. Also ensure make.conf ends in a newline, as it looks nicer. BUG=chromium-os:5311 TEST=Test that prebuilt.py updates PREFLIGHT_BINHOST in right make.conf file. Test that cbuildbot.py runs prebuilt.py with right arguments. Run unit tests for cbuildbot and prebuilt.py. Test runs of cbuildbot.py with --dryrun. Test upload of Packages file to local web server and check that emerge works with them. Change-Id: Iad03c6c469e05b9ee1cceff69cbe2bdd51225e25 Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=c509a90

Patch Set 1 #

Total comments: 8

Patch Set 2 : Review comments. #

Patch Set 3 : Add comments. #

Patch Set 4 : Dedup packages. #

Patch Set 5 : Update cbuildbot tests to pass #

Patch Set 6 : Finish testing cbuildbot.py changes #

Patch Set 7 : Minor tweaks. #

Patch Set 8 : Add lots more unit tests. #

Total comments: 51

Patch Set 9 : Add more cbuildbot unit tests. #

Total comments: 2

Patch Set 10 : Move binhost into chromiumos-overlay to allow for atomic commits! #

Patch Set 11 : Remove deduplication to simplify change #

Patch Set 12 : Address comments by dianders #

Total comments: 19

Patch Set 13 : Re-upload same change, but with git rebase --mixed cros/master #

Patch Set 14 : Address review comments by sosa #

Total comments: 17

Patch Set 15 : Address review feedback #

Patch Set 16 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -18 lines) Patch
M bin/cbuildbot.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +66 lines, -5 lines 0 comments Download
M bin/cbuildbot_unittest.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +37 lines, -2 lines 0 comments Download
M prebuilt.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 13 chunks +57 lines, -11 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
davidjames
10 years, 1 month ago (2010-11-16 23:20:10 UTC) #1
sosa
http://codereview.chromium.org/4969003/diff/1/bin/cbuildbot.py File bin/cbuildbot.py (right): http://codereview.chromium.org/4969003/diff/1/bin/cbuildbot.py#newcode490 bin/cbuildbot.py:490: def _UploadPrebuilts(buildroot, board, overlay_config, master): Missing short docstring http://codereview.chromium.org/4969003/diff/1/bin/cbuildbot.py#newcode492 ...
10 years, 1 month ago (2010-11-16 23:48:06 UTC) #2
anush
Uploading of the preflight prebuilts is good for quick turnaround. However to not use up ...
10 years, 1 month ago (2010-11-17 00:06:04 UTC) #3
davidjames
PTAL. On 2010/11/17 00:06:04, anush wrote: > Uploading of the preflight prebuilts is good for ...
10 years, 1 month ago (2010-11-17 00:15:43 UTC) #4
anush
On Tue, Nov 16, 2010 at 4:15 PM, <davidjames@chromium.org> wrote: > PTAL. > > On ...
10 years, 1 month ago (2010-11-17 03:54:30 UTC) #5
davidjames
On 2010/11/17 03:54:30, anush wrote: > On Tue, Nov 16, 2010 at 4:15 PM, <mailto:davidjames@chromium.org> ...
10 years, 1 month ago (2010-11-17 22:21:40 UTC) #6
anush
On Wed, Nov 17, 2010 at 2:21 PM, <davidjames@chromium.org> wrote: > On 2010/11/17 03:54:30, anush ...
10 years, 1 month ago (2010-11-17 23:54:52 UTC) #7
sosa
I should have mentioned I'm ok with as is but I'm letting you and anush ...
10 years, 1 month ago (2010-11-18 01:59:35 UTC) #8
davidjames
Here is a potential approach to deduping the packages. Please take a look.
10 years, 1 month ago (2010-11-23 01:53:17 UTC) #9
dianders
David, Word on the street is that you're going to make a bunch more changes. ...
10 years, 1 month ago (2010-11-23 21:47:39 UTC) #10
davidjames
I've taken out the deduping per scottz's comments so as to simplify the CL and ...
10 years, 1 month ago (2010-11-23 22:53:14 UTC) #11
sosa
http://codereview.chromium.org/4969003/diff/34001/bin/cbuildbot.py File bin/cbuildbot.py (right): http://codereview.chromium.org/4969003/diff/34001/bin/cbuildbot.py#newcode637 bin/cbuildbot.py:637: _UprevPush(buildroot, tracking_branch, buildconfig['board'], I thought you said you wanted ...
10 years, 1 month ago (2010-11-23 23:56:21 UTC) #12
davidjames
http://codereview.chromium.org/4969003/diff/34001/bin/cbuildbot.py File bin/cbuildbot.py (right): http://codereview.chromium.org/4969003/diff/34001/bin/cbuildbot.py#newcode637 bin/cbuildbot.py:637: _UprevPush(buildroot, tracking_branch, buildconfig['board'], On 2010/11/23 23:56:21, sosa wrote: > ...
10 years, 1 month ago (2010-11-24 00:29:23 UTC) #13
sosa
LGTM http://codereview.chromium.org/4969003/diff/60001/bin/cbuildbot_unittest.py File bin/cbuildbot_unittest.py (right): http://codereview.chromium.org/4969003/diff/60001/bin/cbuildbot_unittest.py#newcode200 bin/cbuildbot_unittest.py:200: drop_file = cbuildbot._PACKAGE_FILE % {'buildroot': self._buildroot} Thanks for ...
10 years, 1 month ago (2010-11-24 00:40:02 UTC) #14
diandersAtChromium
I'm not sure that I'm able to see much here without understanding much more about ...
10 years, 1 month ago (2010-11-24 01:30:31 UTC) #15
scottz
http://codereview.chromium.org/4969003/diff/60001/bin/cbuildbot.py File bin/cbuildbot.py (right): http://codereview.chromium.org/4969003/diff/60001/bin/cbuildbot.py#newcode542 bin/cbuildbot.py:542: '--key', _PREFLIGHT_BINHOST] Agreed on both, if we want to ...
10 years ago (2010-11-29 17:56:39 UTC) #16
davidjames
10 years ago (2010-11-29 21:18:55 UTC) #17
http://codereview.chromium.org/4969003/diff/31001/chromite/lib/binpkg.py
File chromite/lib/binpkg.py (right):

http://codereview.chromium.org/4969003/diff/31001/chromite/lib/binpkg.py#newc...
chromite/lib/binpkg.py:14: class PackageIndex(object):
On 2010/11/23 21:47:39, dianders wrote:
> Docstring?
> 
> ...would be nice to include a spec for what a package file should look like.

Done. (See http://codereview.chromium.org/5344002/ )

http://codereview.chromium.org/4969003/diff/31001/chromite/lib/binpkg.py#newc...
chromite/lib/binpkg.py:17: """Constructor."""
On 2010/11/23 21:47:39, dianders wrote:
> All of these members are public?  Can you document what they are supposed to
> contain?

Done.

http://codereview.chromium.org/4969003/diff/31001/chromite/lib/binpkg.py#newc...
chromite/lib/binpkg.py:23: """Read entry from packages file.
On 2010/11/23 21:47:39, dianders wrote:
> Read entries (plural).

Done.

http://codereview.chromium.org/4969003/diff/31001/chromite/lib/binpkg.py#newc...
chromite/lib/binpkg.py:24: 
On 2010/11/23 21:47:39, dianders wrote:
> Docstring: 
> 
> This will read entries that look like:
> 
> key: value
> 
> ...until a blank line is encountered.  
> 
> Any lines without a colon in them are ignored.

Done.

http://codereview.chromium.org/4969003/diff/31001/chromite/lib/binpkg.py#newc...
chromite/lib/binpkg.py:26: pkgfile: A python file object.
On 2010/11/23 21:47:39, dianders wrote:
> Returns: ?

Done.

http://codereview.chromium.org/4969003/diff/31001/chromite/lib/binpkg.py#newc...
chromite/lib/binpkg.py:41: 
On 2010/11/23 21:47:39, dianders wrote:
> This will terminate the list of items with a blank line.

Done.

http://codereview.chromium.org/4969003/diff/31001/chromite/lib/binpkg.py#newc...
chromite/lib/binpkg.py:44: items: A list of tuples containing the entries to
write.
On 2010/11/23 21:47:39, dianders wrote:
> ...containing (key, value) pairs to write.

Done.

http://codereview.chromium.org/4969003/diff/31001/chromite/lib/binpkg.py#newc...
chromite/lib/binpkg.py:46: for k, v in items:
On 2010/11/23 21:47:39, dianders wrote:
> assert ':' not in k

Skipped this one.

http://codereview.chromium.org/4969003/diff/31001/chromite/lib/binpkg.py#newc...
chromite/lib/binpkg.py:52: 
On 2010/11/23 21:47:39, dianders wrote:
> This is a shortcut for calling ReadHeader() and ReadBody().
> 
> ...should be noted, since ReadHeader() and ReadBody() are public.  ...or
should
> ReadHeader() and ReadBody() not be public?

Made those two functions private.

http://codereview.chromium.org/4969003/diff/60001/bin/cbuildbot.py
File bin/cbuildbot.py (right):

http://codereview.chromium.org/4969003/diff/60001/bin/cbuildbot.py#newcode542
bin/cbuildbot.py:542: '--key', _PREFLIGHT_BINHOST]
On 2010/11/29 17:56:39, scottz wrote:
> Agreed on both, if we want to convert to importing later that is fine but
> os.path.join should be used for the path.
> 
> On 2010/11/24 01:30:31, diandersAtChromium wrote:
> > Still a little curious why this is done through RunCommand rather than
simply
> > importing a function from prebuilt.py.
> > 
> > Also a NIT that the two paths in this function should be using
os.path.join(),
> > though not a big deal.
> 

Which of the following do you mean?
  1. os.path.join(buildroot, 'src/scripts/prebuilt.py')
  2. os.path.join(buildroot, 'src', 'scripts', 'prebuilt.py')

If it's the former, I agree, because it's helpful to catch the case where
buildroot maybe ends in a slash and ensures we don't have two slashes in the
path.

If it's the latter, should we convert all similar examples to use os.path.join?
E.g. the _SetupBoard function uses './setup_board'. Should that be
os.path.join('.', 'setup_board') ? That seems a lot more verbose.

importing is a bit of a pain because the two scripts use different versions of
cros_build_lib (one uses the chromite version, the other does not.) If you
import one into the other you might confuse Python because it changes the import
path.

That should be cleaned up but we haven't merged in chromite yet.

One advantage of using command-line interaction between the two scripts is it
ensures we can't have any complex interdependencies between the two scripts such
as the above. But there are also advantages to importing, so once we fix the
above problem I'd be happy with either approach.

http://codereview.chromium.org/4969003/diff/60001/bin/cbuildbot.py#newcode590
bin/cbuildbot.py:590: board = buildconfig['board']
On 2010/11/24 01:30:31, diandersAtChromium wrote:
> Curious about whether these two lines should be in the try block.

Done.

http://codereview.chromium.org/4969003/diff/60001/prebuilt.py
File prebuilt.py (right):

http://codereview.chromium.org/4969003/diff/60001/prebuilt.py#newcode439
prebuilt.py:439: '%s/host/%s.conf' % (_BINHOST_CONF_DIR, _HOST_TARGET))
On 2010/11/29 17:56:39, scottz wrote:
> Agreed but the last one will still need the .conf added. 
> 
> 
> On 2010/11/24 01:30:31, diandersAtChromium wrote:
> > Just pass 4 params to os.path.join:
> > 
> > os.path.join(build_path, _BINHOST_CONF_DIR, 'host', HOST_TARGET)
> 

Done.

http://codereview.chromium.org/4969003/diff/60001/prebuilt.py#newcode447
prebuilt.py:447: '%s/target/%s.conf' % (_BINHOST_CONF_DIR, board))
On 2010/11/24 01:30:31, diandersAtChromium wrote:
> Same: 4 params to os.path.join.

Done.

http://codereview.chromium.org/4969003/diff/60001/prebuilt.py#newcode471
prebuilt.py:471: if sync_binhost_conf:
On 2010/11/29 17:56:39, scottz wrote:
> Move this into a function. 

Done.

http://codereview.chromium.org/4969003/diff/60001/prebuilt.py#newcode477
prebuilt.py:477: f = file(binhost_conf, 'w')
On 2010/11/29 17:56:39, scottz wrote:
> Nit, use something better than f please. I know you use it for three lines but
I
> still prefer to keep our variable names coherent throughout. 

Done.

Powered by Google App Engine
This is Rietveld 408576698