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

Issue 11664024: Scripts to download files from google storage based on sha1 sums (Closed)

Created:
7 years, 12 months ago by Ryan Tseng
Modified:
7 years, 11 months ago
Reviewers:
cmp, szager, szager1, M-A Ruel
CC:
chromium-reviews
Visibility:
Public.

Description

Scripts to download files from google storage based on sha1 sums BUG=153360

Patch Set 1 #

Patch Set 2 : newline fixes #

Total comments: 44

Patch Set 3 : #

Patch Set 4 : #

Total comments: 19

Patch Set 5 : Partial progress #

Patch Set 6 : Changed upload script, fixed to run #

Total comments: 18

Patch Set 7 : Moved files into new folder #

Unified diffs Side-by-side diffs Delta from patch set Stats (+541 lines, -0 lines) Patch
A build/google_storage_tools/download_from_google_storage.py View 1 2 3 4 5 6 1 chunk +273 lines, -0 lines 0 comments Download
A build/google_storage_tools/upload_to_google_storage.py View 1 2 3 4 5 6 1 chunk +268 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Ryan Tseng
7 years, 11 months ago (2013-01-04 01:29:33 UTC) #1
cmp
here are some initial comments https://codereview.chromium.org/11664024/diff/2001/build/download_from_google_storage.py File build/download_from_google_storage.py (right): https://codereview.chromium.org/11664024/diff/2001/build/download_from_google_storage.py#newcode19 build/download_from_google_storage.py:19: import Queue these should ...
7 years, 11 months ago (2013-01-04 17:42:04 UTC) #2
szager1
I only reviewed one of the files. You have some significant changes to make, so ...
7 years, 11 months ago (2013-01-04 17:54:02 UTC) #3
M-A Ruel
https://codereview.chromium.org/11664024/diff/18001/build/download_from_google_storage.py File build/download_from_google_storage.py (right): https://codereview.chromium.org/11664024/diff/18001/build/download_from_google_storage.py#newcode20 build/download_from_google_storage.py:20: from optparse import OptionParser Actually, why import this one ...
7 years, 11 months ago (2013-01-10 02:33:08 UTC) #4
Ryan Tseng
Made changes to scripts, including: * Added a timeout to gsutil * More verbose help ...
7 years, 11 months ago (2013-01-14 21:37:12 UTC) #5
M-A Ruel
7 years, 11 months ago (2013-01-17 19:53:17 UTC) #6
https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
File build/download_from_google_storage.py (right):

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:21: # TODO(hinoka): This is currently
incorrect. Should find a better default.
Why is it incorrect.

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:23:
os.path.dirname(os.path.normpath(__file__)),
You want abspath or realpath, not normpath.

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:27: class Gsutil():
object

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:28: def __init__(self, path,
boto_path=None, timeout=None):
Are the default values necessary?

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:39: env = os.environ.copy()
You can make this in the main thread instead of the worker thread.

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:42: thr.status =
subprocess.call((sys.executable, self.path) + args, env=env)
subprocess2.check_call(timeout=) works well and is unit tested.

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:102: input_sha1_sum, output_filename =
q.get_nowait()
Please move the except: up here and move the rest out of the try/except.

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:111: print >>sys.stderr, 'File %s for %s
does not exist, skipping.' % (
You are outputing from a thread? I'd recommend against that.

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:152: help='The target is a file containing
a sha1 sum.  '
What's the goal of this flag? Is it necessary/useful?

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:162: elif len(args) > 1:
s/elif/if/ on all of these

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:163: # TODO(hinoka): Multi target support.
Not necessary.

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:189: raise Exception('Unreachable state.')
raise NotImplementedError()

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:208: # Check if we have permissions to the
Google Storage bucket.
Since the argument parsing code is non trivial, which includes finding gsutil,
I'd like you to split the actual work into another function. You can name it
"download_from_google_storage"

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:228: if '.svn' in dirs:
And .git?

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:237: sha1_match =
re.search('([A-Za-z0-9]{40})', f.read(1024))
match(r'^...$', ...) ?

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:238: if sha1_match:
Silently drop otherwise?

https://codereview.chromium.org/11664024/diff/27001/build/download_from_googl...
build/download_from_google_storage.py:246: # Start up all the worker threads.
Why not start up before the enumeration?

https://codereview.chromium.org/11664024/diff/27001/build/upload_to_google_st...
File build/upload_to_google_storage.py (right):

https://codereview.chromium.org/11664024/diff/27001/build/upload_to_google_st...
build/upload_to_google_storage.py:42: class Gsutil():
Can you share code?

Powered by Google App Engine
This is Rietveld 408576698