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

Issue 1346213003: gsutil: Parallel-safe, specify target, add clean. (Closed)

Created:
5 years, 3 months ago by dnj
Modified:
5 years, 3 months ago
CC:
chromium-reviews, dpranke+depot_tools_chromium.org, iannucci+depot_tools_chromium.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

gsutil: Parallel-safe, specify target, add clean. - Update "gsutil.py" to be cooperatively safe when invoked multiple times simultaneously. - Allow the cache directory to be overridden by the DEPOT_TOOLS_GSUTIL_BIN_DIR environment variable. - Add a "--clean" flag to force "gsutil.py" to do a clean download. BUG=chromium:452497 TEST=local - for i in `seq 1 50`; do ./gsutil.py --clean -- version&; done Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=296772

Patch Set 1 #

Total comments: 8

Patch Set 2 : Use proper tempfile, comments. #

Patch Set 3 : Update variable name. #

Total comments: 6

Patch Set 4 : os.rename, temp directory on same FS. #

Patch Set 5 : Cleaner w/ contextmanager. #

Total comments: 2

Patch Set 6 : Catch IOError. #

Patch Set 7 : Explicitly create base directory. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -21 lines) Patch
M gsutil.py View 1 2 3 4 5 6 5 chunks +48 lines, -18 lines 0 comments Download
M tests/gsutil_test.py View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 32 (8 generated)
dnj
PTAL
5 years, 3 months ago (2015-09-17 19:04:22 UTC) #2
Ryan Tseng
https://codereview.chromium.org/1346213003/diff/1/gsutil.py File gsutil.py (right): https://codereview.chromium.org/1346213003/diff/1/gsutil.py#newcode93 gsutil.py:93: cache_dir = os.path.join(target, '.cache_dir.%s' % (suffix,)) this would be ...
5 years, 3 months ago (2015-09-17 19:26:45 UTC) #4
vapier
https://codereview.chromium.org/1346213003/diff/1/gsutil.py File gsutil.py (right): https://codereview.chromium.org/1346213003/diff/1/gsutil.py#newcode84 gsutil.py:84: suffix = '%d_%d' % (time.time(), os.getpid()) this isn't parallel ...
5 years, 3 months ago (2015-09-17 19:31:00 UTC) #5
iannucci
On 2015/09/17 19:31:00, vapier wrote: > https://codereview.chromium.org/1346213003/diff/1/gsutil.py > File gsutil.py (right): > > https://codereview.chromium.org/1346213003/diff/1/gsutil.py#newcode84 > ...
5 years, 3 months ago (2015-09-17 19:42:33 UTC) #6
dnj
https://codereview.chromium.org/1346213003/diff/1/gsutil.py File gsutil.py (right): https://codereview.chromium.org/1346213003/diff/1/gsutil.py#newcode84 gsutil.py:84: suffix = '%d_%d' % (time.time(), os.getpid()) On 2015/09/17 19:31:00, ...
5 years, 3 months ago (2015-09-17 19:51:47 UTC) #7
David James
https://codereview.chromium.org/1346213003/diff/60001/gsutil.py File gsutil.py (right): https://codereview.chromium.org/1346213003/diff/60001/gsutil.py#newcode89 gsutil.py:89: shutil.rmtree(cleanup_path) did you intend to catch errors from rmtree? ...
5 years, 3 months ago (2015-09-17 20:44:31 UTC) #10
dnj (Google)
Updated, fixed issue w/ rename where "/tmp" may not share filesystem by dropping tempdir underneath ...
5 years, 3 months ago (2015-09-17 21:16:39 UTC) #12
David James
https://codereview.chromium.org/1346213003/diff/100001/gsutil.py File gsutil.py (right): https://codereview.chromium.org/1346213003/diff/100001/gsutil.py#newcode99 gsutil.py:99: except OSError: Per https://www.python.org/dev/peps/pep-3151/#confusing-set-of-os-related-exceptions , you should catch IOError ...
5 years, 3 months ago (2015-09-17 21:56:50 UTC) #13
David James
lgtm otherwise
5 years, 3 months ago (2015-09-17 22:12:08 UTC) #14
dnj (Google)
WDYT hinoka@, iannucci@? https://codereview.chromium.org/1346213003/diff/100001/gsutil.py File gsutil.py (right): https://codereview.chromium.org/1346213003/diff/100001/gsutil.py#newcode99 gsutil.py:99: except OSError: On 2015/09/17 21:56:50, David ...
5 years, 3 months ago (2015-09-18 00:20:22 UTC) #15
iannucci
I don't have much context on this script (other than the very high-level context), but ...
5 years, 3 months ago (2015-09-18 00:27:54 UTC) #17
Ryan Tseng
lgtm
5 years, 3 months ago (2015-09-18 00:28:55 UTC) #18
dnj (Google)
On 2015/09/18 00:28:55, Ryan Tseng wrote: > lgtm Alrighty, I'll wait until tomorrow to deploy ...
5 years, 3 months ago (2015-09-18 00:32:24 UTC) #19
chromium-reviews
What exactly can it affect? There's nothing changing in script's semantics unless DEPOT_TOOLS_GSUTIL_BIN_DIR is set, ...
5 years, 3 months ago (2015-09-18 00:36:30 UTC) #20
chromium-reviews
Yep On Thu, Sep 17, 2015 at 5:36 PM, Andrey Ulanov <andreyu@google.com> wrote: > What ...
5 years, 3 months ago (2015-09-18 00:41:49 UTC) #21
dnj (Google)
> What exactly can it affect? There's nothing changing in script's semantics > unless DEPOT_TOOLS_GSUTIL_BIN_DIR ...
5 years, 3 months ago (2015-09-18 00:44:15 UTC) #22
chromium-reviews
First of all, I appreciate you taking time to deal with this problem. If you're ...
5 years, 3 months ago (2015-09-18 01:04:41 UTC) #23
dnj (Google)
> To complete a very simple task of downloading a file from the network Some ...
5 years, 3 months ago (2015-09-18 01:32:44 UTC) #24
vapier
fwiw, the GS team doesn't support older versions of gsutil, and CrOS has had a ...
5 years, 3 months ago (2015-09-18 04:10:50 UTC) #25
chromium-reviews
Thanks for explanation Daniel. I do understand that for a project that has been under ...
5 years, 3 months ago (2015-09-18 04:54:05 UTC) #26
vapier
it is not possible for people who use gsutil directly to be "good citizens". the ...
5 years, 3 months ago (2015-09-18 06:06:01 UTC) #27
dnj (Google)
> this is exactly why CrOS has written a gs.py library to wrap gsutil and ...
5 years, 3 months ago (2015-09-18 06:15:54 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1346213003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1346213003/140001
5 years, 3 months ago (2015-09-18 22:29:59 UTC) #31
commit-bot: I haz the power
5 years, 3 months ago (2015-09-18 22:33:55 UTC) #32
Message was sent while issue was closed.
Committed patchset #7 (id:140001) as
http://src.chromium.org/viewvc/chrome?view=rev&revision=296772

Powered by Google App Engine
This is Rietveld 408576698