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

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

Created:
7 years, 11 months ago by Ryan Tseng
Modified:
7 years, 3 months ago
CC:
chromium-reviews, Dirk Pranke, cmp+cc_chromium.org, M-A Ruel, iannucci+depot_tools_chromium.org, szager1, kjellander_chromium
Base URL:
https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Visibility:
Public.

Description

Scripts to download files from google storage based on sha1 sums continuation of: https://codereview.chromium.org/11664024 Moved it from chrome/trunk/src/build to depot_tools/ BUG=153360 TEST=two unittests included in tests/ For end-to-end testing, check out a large directory. Run find . -name .svn -prune -o -size +1000k -type f -print0 | upload_to_google_storage.py -b chrome-artifacts -0 - (replacing chrome-artifacts with an upload-able bucket) to test upload run "find . -name .svn -prune -o -size +1000k -type f -print0 | xargs -0 rm" to remove the files uploaded. Check that the large binary files have been removed run "download_from_google_storage.py -r -d -b chrome-artifacts ." to download the files again. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=187951

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Added gsutil #

Patch Set 4 : bug fixes #

Patch Set 5 : Removed gsutil/tests and gsutil/docs #

Total comments: 65

Patch Set 6 : Review fixes, updated gsutil #

Total comments: 33

Patch Set 7 : Removed gsutil into a separate patch #

Patch Set 8 : Review fixes #

Patch Set 9 : Added some unittests #

Total comments: 23

Patch Set 10 : Review fixes #

Patch Set 11 : Removed wrappers #

Patch Set 12 : Test fix #

Total comments: 16

Patch Set 13 : Review fixes #

Total comments: 5

Patch Set 14 : Removed gstools.py, added more error messages #

Total comments: 6

Patch Set 15 : Review changes, fixed race condition #

Total comments: 7

Patch Set 16 : Small review fixes #

Patch Set 17 : Move printing from main thread to printer thread #

Total comments: 12

Patch Set 18 : Added exception types, renamed variables #

Total comments: 21

Patch Set 19 : Review fixes #

Total comments: 6

Patch Set 20 : More review fixes #

Total comments: 20

Patch Set 21 : Review fixes #

Total comments: 2

Patch Set 22 : Split tests, fixed ret_code seeding #

Total comments: 9

Patch Set 23 : Bug fix in gsutil wrapper #

Patch Set 24 : Updated messages, switched main thread to use stdout_queue #

Total comments: 22

Patch Set 25 : Review fixes, mostly in unittests #

Total comments: 12

Patch Set 26 : Style fixes #

Patch Set 27 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1051 lines, -0 lines) Patch
A download_from_google_storage.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +339 lines, -0 lines 2 comments Download
A tests/download_from_google_storage_unittests.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +282 lines, -0 lines 0 comments Download
A tests/gstools/download_test_data/rootfolder_text.txt View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A tests/gstools/download_test_data/rootfolder_text.txt.sha1 View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A tests/gstools/download_test_data/subfolder/subfolder_text.txt View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
A tests/gstools/download_test_data/subfolder/subfolder_text.txt.sha1 View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A tests/gstools/download_test_data/uploaded_lorem_ipsum.txt.sha1 View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A tests/gstools/lorem_ipsum.txt View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
A tests/gstools/lorem_ipsum.txt.md5 View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A tests/gstools/lorem_ipsum2.txt View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -0 lines 0 comments Download
A tests/upload_to_google_storage_unittests.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +165 lines, -0 lines 0 comments Download
A upload_to_google_storage.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +245 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (0 generated)
Ryan Tseng
This includes all of gsutil except for docs/ and tests/ inside third_party/ I put this ...
7 years, 10 months ago (2013-02-21 22:45:55 UTC) #1
M-A Ruel
https://codereview.chromium.org/12042069/diff/20105/common.py File common.py (right): https://codereview.chromium.org/12042069/diff/20105/common.py#newcode4 common.py:4: # common.py: Utility functions common to the Google storage ...
7 years, 10 months ago (2013-02-22 01:15:56 UTC) #2
Ryan Tseng
https://codereview.chromium.org/12042069/diff/20105/common.py File common.py (right): https://codereview.chromium.org/12042069/diff/20105/common.py#newcode4 common.py:4: # common.py: Utility functions common to the Google storage ...
7 years, 10 months ago (2013-02-22 02:38:00 UTC) #3
M-A Ruel
Can you split this CL in two? - First CL: all the third_party. What's the ...
7 years, 10 months ago (2013-02-25 15:15:06 UTC) #4
cmp
+iannucci and szager Robbie, can you take a look at Ryan's CL?
7 years, 10 months ago (2013-02-26 17:17:07 UTC) #5
iannucci1
One general question before I start... Why have two scripts for interacting with google storage ...
7 years, 10 months ago (2013-02-26 18:03:33 UTC) #6
iannucci
On 2013/02/26 18:03:33, iannucci (DO NOT WANT) wrote: > One general question before I start... ...
7 years, 10 months ago (2013-02-26 18:07:37 UTC) #7
Ryan Tseng
Regarding the two scripts - Its because one is meant to be called by a ...
7 years, 9 months ago (2013-02-27 02:06:55 UTC) #8
M-A Ruel
https://chromiumcodereview.appspot.com/12042069/diff/11143/gsdl File gsdl (right): https://chromiumcodereview.appspot.com/12042069/diff/11143/gsdl#newcode8 gsdl:8: PYTHONDONTWRITEBYTECODE=1 exec python "$base_dir/download_from_google_storage.py" "$@" On 2013/02/27 02:06:56, Ryan ...
7 years, 9 months ago (2013-02-27 21:52:07 UTC) #9
Ryan Tseng
Wrappers removed https://chromiumcodereview.appspot.com/12042069/diff/12249/download_from_google_storage.py File download_from_google_storage.py (right): https://chromiumcodereview.appspot.com/12042069/diff/12249/download_from_google_storage.py#newcode40 download_from_google_storage.py:40: sha1_match = re.search('^([A-Za-z0-9]{40})$', f.read(1024)) On 2013/02/27 21:52:07, ...
7 years, 9 months ago (2013-02-27 23:34:41 UTC) #10
M-A Ruel
https://chromiumcodereview.appspot.com/12042069/diff/12249/upload_to_google_storage.py File upload_to_google_storage.py (right): https://chromiumcodereview.appspot.com/12042069/diff/12249/upload_to_google_storage.py#newcode62 upload_to_google_storage.py:62: code = gsutil.call('cp', '-q', filename, file_url) On 2013/02/27 23:34:41, ...
7 years, 9 months ago (2013-02-28 14:53:56 UTC) #11
Ryan Tseng
https://chromiumcodereview.appspot.com/12042069/diff/38002/download_from_google_storage.py File download_from_google_storage.py (right): https://chromiumcodereview.appspot.com/12042069/diff/38002/download_from_google_storage.py#newcode25 download_from_google_storage.py:25: def enumerate_work_queue(input_filename, work_queue, options): On 2013/02/28 14:53:56, Marc-Antoine Ruel ...
7 years, 9 months ago (2013-03-01 02:41:35 UTC) #12
M-A Ruel
https://chromiumcodereview.appspot.com/12042069/diff/43002/download_from_google_storage.py File download_from_google_storage.py (right): https://chromiumcodereview.appspot.com/12042069/diff/43002/download_from_google_storage.py#newcode28 download_from_google_storage.py:28: with open(input_filename, 'rb') as f: is it fine if ...
7 years, 9 months ago (2013-03-03 02:13:14 UTC) #13
Ryan Tseng
gstools.py has been merged back into download_from_google_storage https://chromiumcodereview.appspot.com/12042069/diff/43002/download_from_google_storage.py File download_from_google_storage.py (right): https://chromiumcodereview.appspot.com/12042069/diff/43002/download_from_google_storage.py#newcode30 download_from_google_storage.py:30: if sha1_match: ...
7 years, 9 months ago (2013-03-04 21:43:54 UTC) #14
Marc-Antoine Ruel (Google)
https://chromiumcodereview.appspot.com/12042069/diff/37015/download_from_google_storage.py File download_from_google_storage.py (right): https://chromiumcodereview.appspot.com/12042069/diff/37015/download_from_google_storage.py#newcode102 download_from_google_storage.py:102: def GetMD5(filename, lock): This functions is not used in ...
7 years, 9 months ago (2013-03-05 02:04:07 UTC) #15
Ryan Tseng
I think switching it to "and" will solve the race condition. What do you think? ...
7 years, 9 months ago (2013-03-06 19:03:56 UTC) #16
M-A Ruel
https://codereview.chromium.org/12042069/diff/48001/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/48001/download_from_google_storage.py#newcode77 download_from_google_storage.py:77: # Check if we have permissions to the Google ...
7 years, 9 months ago (2013-03-06 19:49:59 UTC) #17
Ryan Tseng
https://codereview.chromium.org/12042069/diff/48001/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/48001/download_from_google_storage.py#newcode77 download_from_google_storage.py:77: # Check if we have permissions to the Google ...
7 years, 9 months ago (2013-03-06 20:19:08 UTC) #18
Ryan Tseng
https://codereview.chromium.org/12042069/diff/48001/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/48001/download_from_google_storage.py#newcode202 download_from_google_storage.py:202: while not work_queue.empty() and any(t.is_alive() for t in all_threads): ...
7 years, 9 months ago (2013-03-06 20:24:45 UTC) #19
Ryan Tseng
Moved printing to different thread, how does that look?
7 years, 9 months ago (2013-03-06 21:14:51 UTC) #20
M-A Ruel
https://codereview.chromium.org/12042069/diff/59002/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/59002/download_from_google_storage.py#newcode71 download_from_google_storage.py:71: def CheckBucketPermissions(bucket, gsutil): Since it's new code; either use ...
7 years, 9 months ago (2013-03-07 16:22:46 UTC) #21
Ryan Tseng
https://codereview.chromium.org/12042069/diff/59002/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/59002/download_from_google_storage.py#newcode71 download_from_google_storage.py:71: def CheckBucketPermissions(bucket, gsutil): On 2013/03/07 16:22:46, Marc-Antoine Ruel wrote: ...
7 years, 9 months ago (2013-03-07 18:51:47 UTC) #22
M-A Ruel
https://codereview.chromium.org/12042069/diff/62001/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/62001/download_from_google_storage.py#newcode162 download_from_google_storage.py:162: out_q.put('Thread %d is done' % thread_num) I'd prefer you ...
7 years, 9 months ago (2013-03-07 19:41:22 UTC) #23
Ryan Tseng
https://codereview.chromium.org/12042069/diff/62001/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/62001/download_from_google_storage.py#newcode162 download_from_google_storage.py:162: out_q.put('Thread %d is done' % thread_num) On 2013/03/07 19:41:22, ...
7 years, 9 months ago (2013-03-07 20:35:18 UTC) #24
M-A Ruel
https://codereview.chromium.org/12042069/diff/62001/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/62001/download_from_google_storage.py#newcode178 download_from_google_storage.py:178: code, _, err = gsutil.check_call('cp', '-q', file_url, output_filename) On ...
7 years, 9 months ago (2013-03-07 22:26:56 UTC) #25
Ryan Tseng
https://codereview.chromium.org/12042069/diff/63013/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/63013/download_from_google_storage.py#newcode46 download_from_google_storage.py:46: if self.boto_path is not None: On 2013/03/07 22:26:56, Marc-Antoine ...
7 years, 9 months ago (2013-03-07 22:42:20 UTC) #26
M-A Ruel
https://codereview.chromium.org/12042069/diff/76001/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/76001/download_from_google_storage.py#newcode67 download_from_google_storage.py:67: elif ('You are attempting to access protected data with ...
7 years, 9 months ago (2013-03-08 02:07:00 UTC) #27
Ryan Tseng
https://codereview.chromium.org/12042069/diff/76001/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/76001/download_from_google_storage.py#newcode67 download_from_google_storage.py:67: elif ('You are attempting to access protected data with ...
7 years, 9 months ago (2013-03-08 02:34:37 UTC) #28
M-A Ruel
https://codereview.chromium.org/12042069/diff/52002/tests/gstools_unittest.py File tests/gstools_unittest.py (right): https://codereview.chromium.org/12042069/diff/52002/tests/gstools_unittest.py#newcode392 tests/gstools_unittest.py:392: download_from_google_storage.download_from_google_storage( You don't check the return code here. Split ...
7 years, 9 months ago (2013-03-08 13:27:41 UTC) #29
Ryan Tseng
https://codereview.chromium.org/12042069/diff/52002/tests/gstools_unittest.py File tests/gstools_unittest.py (right): https://codereview.chromium.org/12042069/diff/52002/tests/gstools_unittest.py#newcode392 tests/gstools_unittest.py:392: download_from_google_storage.download_from_google_storage( On 2013/03/08 13:27:41, Marc-Antoine Ruel wrote: > You ...
7 years, 9 months ago (2013-03-08 23:22:12 UTC) #30
M-A Ruel
https://codereview.chromium.org/12042069/diff/88001/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/88001/download_from_google_storage.py#newcode74 download_from_google_storage.py:74: def clone(self): Technically, you don't need that. You can ...
7 years, 9 months ago (2013-03-09 12:41:13 UTC) #31
Ryan Tseng
https://codereview.chromium.org/12042069/diff/88001/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/88001/download_from_google_storage.py#newcode74 download_from_google_storage.py:74: def clone(self): On 2013/03/09 12:41:13, Marc-Antoine Ruel wrote: > ...
7 years, 9 months ago (2013-03-11 17:35:14 UTC) #32
Ryan Tseng
Bug fix in check_call, updated messages to be more terse (doesn't print out md5 or ...
7 years, 9 months ago (2013-03-11 18:13:44 UTC) #33
M-A Ruel
https://codereview.chromium.org/12042069/diff/102001/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/102001/download_from_google_storage.py#newcode53 download_from_google_storage.py:53: def check_call(self, *args): BTW, this is slightly confusing since ...
7 years, 9 months ago (2013-03-11 19:52:01 UTC) #34
Ryan Tseng
https://codereview.chromium.org/12042069/diff/102001/download_from_google_storage.py File download_from_google_storage.py (right): https://codereview.chromium.org/12042069/diff/102001/download_from_google_storage.py#newcode244 download_from_google_storage.py:244: '(default) a sha1 sum ([A-Za-z0-9]{40}).\n(-s or --sha1_file) a ' ...
7 years, 9 months ago (2013-03-11 21:34:18 UTC) #35
M-A Ruel
https://codereview.chromium.org/12042069/diff/104003/tests/upload_to_google_storage_unittests.py File tests/upload_to_google_storage_unittests.py (right): https://codereview.chromium.org/12042069/diff/104003/tests/upload_to_google_storage_unittests.py#newcode25 tests/upload_to_google_storage_unittests.py:25: 2 lines https://codereview.chromium.org/12042069/diff/104003/tests/upload_to_google_storage_unittests.py#newcode30 tests/upload_to_google_storage_unittests.py:30: os.path.dirname(os.path.abspath(__file__)), 'gstools') Use a global ...
7 years, 9 months ago (2013-03-11 22:48:58 UTC) #36
Ryan Tseng
https://codereview.chromium.org/12042069/diff/104003/tests/upload_to_google_storage_unittests.py File tests/upload_to_google_storage_unittests.py (right): https://codereview.chromium.org/12042069/diff/104003/tests/upload_to_google_storage_unittests.py#newcode25 tests/upload_to_google_storage_unittests.py:25: On 2013/03/11 22:48:58, Marc-Antoine Ruel wrote: > 2 lines ...
7 years, 9 months ago (2013-03-11 23:14:20 UTC) #37
M-A Ruel
lgtm
7 years, 9 months ago (2013-03-11 23:29:18 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hinoka@google.com/12042069/110001
7 years, 9 months ago (2013-03-13 21:40:34 UTC) #39
commit-bot: I haz the power
Change committed as 187951
7 years, 9 months ago (2013-03-13 21:43:52 UTC) #40
Isaac (away)
https://chromiumcodereview.appspot.com/12042069/diff/110001/download_from_google_storage.py File download_from_google_storage.py (right): https://chromiumcodereview.appspot.com/12042069/diff/110001/download_from_google_storage.py#newcode70 download_from_google_storage.py:70: return (403, out, err) These lines appear to silence ...
7 years, 3 months ago (2013-09-19 12:25:16 UTC) #41
Ryan Tseng
https://chromiumcodereview.appspot.com/12042069/diff/110001/download_from_google_storage.py File download_from_google_storage.py (right): https://chromiumcodereview.appspot.com/12042069/diff/110001/download_from_google_storage.py#newcode70 download_from_google_storage.py:70: return (403, out, err) On 2013/09/19 12:25:16, Isaac wrote: ...
7 years, 3 months ago (2013-09-19 17:42:18 UTC) #42
Isaac (away)
Could we add something like: Server error: "<msg>" Henrik and I were only able to ...
7 years, 3 months ago (2013-09-19 17:47:51 UTC) #43
Ryan Tseng
7 years, 3 months ago (2013-09-19 17:53:56 UTC) #44
Yep https://codereview.chromium.org/23484061/


On Thu, Sep 19, 2013 at 10:47 AM, <ilevy@chromium.org> wrote:

> Could we add something like:
>
> Server error: "<msg>"
>
> Henrik and I were only able to file b/10837616 after he added this as a
> local
> diff on the webrtc bots. :-\
>
>
https://chromiumcodereview.**appspot.com/12042069/<https://chromiumcodereview...
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698