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

Issue 4906001: Reworked devserver so that update images generated are cached in directories named after (Closed)

Created:
10 years, 1 month ago by dgarrett
Modified:
9 years, 7 months ago
CC:
chromium-os-reviews_chromium.org, Nick Sanders, sosa, petkov, ericli, DaleCurtis
Visibility:
Public.

Description

Reworked devserver so that update images generated are cached in directories named after the md5 hashes of the images used to generate the updates. Only the 12 most recent deltas are preserved. All deltas generated (outside of the factory codepath) are modified. The purpose of this is to speed up delta generation during automated tests, especially when running autotest and/or ctest. autoupdate.py has been refactored in a number of small ways. All of the Generate methods now return the name of the update generated (or retrieved from cache), instead of the update file being assumed to be static/update.gz. Update files are now created directly in the cache directories instead of in the image directory and then copied. --clear_cache has been added to devserver.py to force clearing of all cached update values. --use_cached no longer does anything, but has not yet been removed. It appears to be intended to force the use of static/update.gz, but I can't find any cases where it's used. TEST=The autoupdate unit test has been udpated and is passing. ./image_to_live.sh has been tested by hand with both full image and delta updates. ./ctest can run successfully. BUG=chromium-os:8207 (early prep) Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=710470d Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=f90edf0

Patch Set 1 #

Patch Set 2 : Removed workaround for bug chromium-os:9073. #

Total comments: 14

Patch Set 3 : Restore changes accidentally removed during merge. #

Total comments: 25

Patch Set 4 : Fixes for problems found in code review. #

Total comments: 16

Patch Set 5 : Finished revising for review notes. #

Patch Set 6 : Address more code review issues. #

Total comments: 11

Patch Set 7 : More fixes for review notes. #

Total comments: 1

Patch Set 8 : Fix TODO Formatting #

Patch Set 9 : Cached payloads are now symlinked from old/known paths. #

Total comments: 10

Patch Set 10 : Revised based on comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+202 lines, -123 lines) Patch
M autoupdate.py View 1 2 3 4 5 6 7 8 9 15 chunks +171 lines, -110 lines 0 comments Download
M autoupdate_unittest.py View 4 chunks +11 lines, -10 lines 0 comments Download
M devserver.py View 1 2 3 4 5 6 5 chunks +20 lines, -3 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
dgarrett
10 years, 1 month ago (2010-11-13 00:24:13 UTC) #1
ericli
Please also include dalecurtis as the reviewer for this cl. We had been affected so ...
10 years, 1 month ago (2010-11-13 00:49:49 UTC) #2
petkov
You'd also need to make sure you're not breaking the factory flow. http://codereview.chromium.org/4906001/diff/2001/autoupdate.py File autoupdate.py ...
10 years, 1 month ago (2010-11-13 00:55:17 UTC) #3
DaleCurtis
I'll take a more thorough look at this on Monday, but just from your summary: ...
10 years, 1 month ago (2010-11-13 01:53:44 UTC) #4
dgarrett
Hopefully, everything has now been addressed. http://codereview.chromium.org/4906001/diff/2001/autoupdate.py File autoupdate.py (right): http://codereview.chromium.org/4906001/diff/2001/autoupdate.py#newcode212 autoupdate.py:212: update_path = os.path.join(static_image_dir, ...
10 years, 1 month ago (2010-11-15 21:50:33 UTC) #5
sosa
Periods at end of comments. I noticed there is some code paths you don't use ...
10 years, 1 month ago (2010-11-15 21:59:17 UTC) #6
DaleCurtis
Mostly style nits. I've patched in your CL to our test farm and was able ...
10 years, 1 month ago (2010-11-15 22:38:04 UTC) #7
DaleCurtis
Whoops, I meant I moved just update.gz in the cache folder. stateful.tgz / stateful.image.gz stayed ...
10 years, 1 month ago (2010-11-15 22:43:30 UTC) #8
dgarrett
On 2010/11/15 21:59:17, sosa wrote: > Periods at end of comments. That's foreign to me, ...
10 years, 1 month ago (2010-11-15 23:08:30 UTC) #9
dgarrett
Re-uploaded to address more code review issues. http://codereview.chromium.org/4906001/diff/10001/autoupdate.py File autoupdate.py (right): http://codereview.chromium.org/4906001/diff/10001/autoupdate.py#newcode238 autoupdate.py:238: def FindCachedUpdateImageSubDir(self, ...
10 years, 1 month ago (2010-11-15 23:32:39 UTC) #10
petkov
LGTM but wait for the other reviewers.
10 years, 1 month ago (2010-11-15 23:51:03 UTC) #11
sosa
Few nits. You can add a TODO to remove use_cached in a separate CL if ...
10 years, 1 month ago (2010-11-15 23:59:08 UTC) #12
dgarrett
http://codereview.chromium.org/4906001/diff/17002/autoupdate.py File autoupdate.py (right): http://codereview.chromium.org/4906001/diff/17002/autoupdate.py#newcode220 autoupdate.py:220: """Generates a stateful update gz given a full path ...
10 years, 1 month ago (2010-11-16 00:41:39 UTC) #13
sosa
LGTM w/ nit though dale may wanna dbl check http://codereview.chromium.org/4906001/diff/31001/autoupdate.py File autoupdate.py (right): http://codereview.chromium.org/4906001/diff/31001/autoupdate.py#newcode381 autoupdate.py:381: ...
10 years, 1 month ago (2010-11-16 01:16:39 UTC) #14
DaleCurtis
Retested with all fixes, still works. LGTM. On 2010/11/16 01:16:39, sosa wrote: > LGTM w/ ...
10 years, 1 month ago (2010-11-16 01:30:05 UTC) #15
sosa
Looks like this commit broke stateful updates for ctest on the official builders (they can't ...
10 years, 1 month ago (2010-11-16 17:51:13 UTC) #16
sosa
Filed http://code.google.com/p/chromium-os/issues/detail?id=9215 On Tue, Nov 16, 2010 at 9:51 AM, <sosa@chromium.org> wrote: > Looks like ...
10 years, 1 month ago (2010-11-16 17:53:14 UTC) #17
dgarrett
Because of the problem in which stateful.tgz wasn't being found, cached values are now symlinked ...
10 years, 1 month ago (2010-11-16 22:32:38 UTC) #18
dgarrett
On 2010/11/16 22:32:38, dgarrett wrote: > Because of the problem in which stateful.tgz wasn't being ...
10 years, 1 month ago (2010-11-16 23:45:51 UTC) #19
sosa
Just a few comments http://codereview.chromium.org/4906001/diff/40001/autoupdate.py File autoupdate.py (right): http://codereview.chromium.org/4906001/diff/40001/autoupdate.py#newcode147 autoupdate.py:147: os.remove(dest) unlink better? http://codereview.chromium.org/4906001/diff/40001/autoupdate.py#newcode273 autoupdate.py:273: ...
10 years, 1 month ago (2010-11-17 00:07:40 UTC) #20
Dale Curtis
I'm confused why you want to put the stateful update in the cache directory. Unlike ...
10 years, 1 month ago (2010-11-17 00:33:51 UTC) #21
dgarrett
http://codereview.chromium.org/4906001/diff/40001/autoupdate.py File autoupdate.py (right): http://codereview.chromium.org/4906001/diff/40001/autoupdate.py#newcode147 autoupdate.py:147: os.remove(dest) On 2010/11/17 00:07:40, sosa wrote: > unlink better? ...
10 years, 1 month ago (2010-11-17 00:35:27 UTC) #22
sosa
LGTM w/ nit after you address dale's comments. http://codereview.chromium.org/4906001/diff/40001/autoupdate.py File autoupdate.py (right): http://codereview.chromium.org/4906001/diff/40001/autoupdate.py#newcode353 autoupdate.py:353: # ...
10 years, 1 month ago (2010-11-17 00:39:41 UTC) #23
dgarrett
On 2010/11/17 00:33:51, Dale Curtis wrote: > I'm confused why you want to put the ...
10 years, 1 month ago (2010-11-17 00:41:03 UTC) #24
sosa
stateful image doesn't differ on cached deltas w/ same target image, but does differ on ...
10 years, 1 month ago (2010-11-17 00:41:09 UTC) #25
dgarrett
10 years, 1 month ago (2010-11-17 00:41:30 UTC) #26
dgarrett
http://codereview.chromium.org/4906001/diff/40001/autoupdate.py File autoupdate.py (right): http://codereview.chromium.org/4906001/diff/40001/autoupdate.py#newcode353 autoupdate.py:353: # If the generation worked, create symlinks On 2010/11/17 ...
10 years, 1 month ago (2010-11-17 00:56:02 UTC) #27
Dale Curtis
On 2010/11/17 00:41:03, dgarrett wrote: > On 2010/11/17 00:33:51, Dale Curtis wrote: > > I'm ...
10 years, 1 month ago (2010-11-17 01:21:14 UTC) #28
Dale Curtis
10 years, 1 month ago (2010-11-17 01:30:25 UTC) #29
After using the right URL :| , testing worked fine.

LGTM

On 2010/11/17 01:21:14, Dale Curtis wrote:
> On 2010/11/17 00:41:03, dgarrett wrote:
> > On 2010/11/17 00:33:51, Dale Curtis wrote:
> > > I'm confused why you want to put the stateful update in the cache
directory.
> > > Unlike update.gz it doesn't change based on a source image. Unless I'm
> missing
> > > something you'll regenerate it every time you get a new update.
> > 
> > You will. Does it never change? Or just infrequently? This isn't something I
> > understand very well.
> 
> I forgot there are users who reuse the same image directory. We use
> --archive_dir plus subdirectories to avoid the problem this solves. For
someone
> who keeps dropping a new base image in the dev server, the stateful partition
> will keep getting clobbered otherwise.
> 
> > 
> > > 
> > > Also, now that you're generating sym links. What happens when multiple dev
> > > server requests come in at the same time for different src/dest images? I
> > > haven't looked closely, but is there a chance for a race
> condition/clobbering
> > > here?
> > 
> > Does that ever happen? My understanding is that devserver is only run with a
> > single
> > client out there, at least for Non Factory requests which are the only ones
> > affected
> > by this change.
> > 
> > I think I can back up my understanding by pointing out that the server was
> > putting
> > the real files right where I'm not putting symlinks before I started making
> > changes,
> > which means it would have had the same issue before.
> 
> Good point. We pre-generate components in the lab here, so it wouldn't affect
> us. And I doubt many dev servers see the bandwidth to hit this issue.
> 
> Some issues came up in testing. E-mail sent.

Powered by Google App Engine
This is Rietveld 408576698