Uh oh!
There was an error while loading. Please reload this page.
Make storage upload have no chunk size by default. - #606
Conversation
coveralls
commented
Feb 10, 2015
thobrla
commented
Feb 10, 2015
It hasn't been merged into the mainline yet, but I implemented a chunksize=None approach for uploads in gsutil's fork of apitools: https://github.com/GoogleCloudPlatform/gsutil/blob/master/gslib/third_party/storage_apitools/transfer.py#L773 However, because you're using httplib2, there are a number of other issues that you'll need to solve to get this to work. https://github.com/GoogleCloudPlatform/gsutil/blob/master/gslib/gcs_json_media.py has some examples. |
thobrla
commented
Feb 10, 2015
As for chunk size in general, the ideal thing is not to use chunks for uploads or downloads at all unless you have a specific reason to do so (for example, buffering a streaming transfer). |
tseaver
commented
Feb 10, 2015
Rather than passing in an |
dhermes
commented
Feb 12, 2015
tseaver
commented
Feb 12, 2015
Are we leaving the blob's own CHUNK_SIZE around, but just using it for downloads? Should we be making it an explicit parameter there, too? |
dhermes
commented
Feb 12, 2015
I plan on implementing the default I just wanted to make sure passing |
craigcitro
commented
Feb 12, 2015
so i've finally got myself an official repo for apitools; i'm planning on finally doing a round-robin merge to get all the copies back in sync. in particular:
|
dhermes
commented
Feb 12, 2015
@craigcitro w00t! Thanks for the news. The main question is
which @thobrla indicates is only in upstream ( |
dhermes
commented
Feb 18, 2015
Ping @craigcitro
|
craigcitro
commented
Feb 19, 2015
sorry, i missed this question earlier in the thread. i believe the code you're looking for is still upstream in gsutil, but i'm working on getting the various versions of apitools unified. |
dhermes
commented
Feb 19, 2015
@craigcitro Do you need help on the unification? |
dhermes
commented
Mar 2, 2015
UPDATE: Chatting with @craigcitro today (March 2, 2015) it seems the @tseaver Do you want to vendor in the latest updates from |
tseaver
commented
Mar 2, 2015
Yeah, I'll vendor it in. |
tseaver
commented
Mar 3, 2015
@craigcitroI've done the re-vendoring, but now lack context to get the last set of tests passing: ======================================================================ERROR: test_upload_from_file_resumable (gcloud.storage.test_blob.Test_Blob)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/tseaver/projects/agendaless/Google/src/gcloud-python/gcloud/storage/test_blob.py", line418, intest_upload_from_file_resumableblob.upload_from_file(fh, rewind=True)
File"/home/tseaver/projects/agendaless/Google/src/gcloud-python/gcloud/storage/blob.py", line354, inupload_from_filefinish_callback=lambda*args: None)
File"/home/tseaver/projects/agendaless/Google/src/gcloud-python/_gcloud_vendor/apitools/base/py/transfer.py", line804, inStreamInChunksadditional_headers=additional_headers)
File"/home/tseaver/projects/agendaless/Google/src/gcloud-python/_gcloud_vendor/apitools/base/py/transfer.py", line764, in__StreamMedia'%d'%self.progress)
CommunicationError: Failedtotransferallbytesinchunk, uploadpausedatbyte4======================================================================FAIL: test_download_as_string (gcloud.storage.test_blob.Test_Blob)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/tseaver/projects/agendaless/Google/src/gcloud-python/gcloud/storage/test_blob.py", line328, intest_download_as_stringself.assertEqual(fetched, b'abcdef')
AssertionError: 'abc'!='abcdef'-abc+abcdef======================================================================FAIL: test_download_to_file (gcloud.storage.test_blob.Test_Blob)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/tseaver/projects/agendaless/Google/src/gcloud-python/gcloud/storage/test_blob.py", line272, intest_download_to_fileself.assertEqual(fh.getvalue(), b'abcdef')
AssertionError: 'abc'!='abcdef'-abc+abcdef======================================================================FAIL: test_download_to_filename (gcloud.storage.test_blob.Test_Blob)
----------------------------------------------------------------------Traceback (mostrecentcalllast):
File"/home/tseaver/projects/agendaless/Google/src/gcloud-python/gcloud/storage/test_blob.py", line307, intest_download_to_filenameself.assertEqual(wrote, b'abcdef')
AssertionError: 'abc'!='abcdef'-abc+abcdef----------------------------------------------------------------------It looks as though code which deals with explicitly-chunked stuff from the server side is now broken. |
craigcitro
commented
Mar 3, 2015
is the easiest way for me to play with it just to clone your branch? |
tseaver
commented
Mar 3, 2015
Likely so: I don't want to make it a PR here until things pass. Just run |
dhermes
commented
Mar 23, 2015
@tseaver@craigcitro I'm happy to take up the vendor-ing in process of |
craigcitro
commented
Mar 23, 2015
i think he was hitting test failures on upload/download; i'm intending to try it, but i've been believing that for 3+ weeks. 😉 |
dhermes
commented
Mar 23, 2015
I can babysit you if you like. |
craigcitro
commented
Mar 23, 2015
my issue is that it hasn't hit the top of my todo list -- currently heads-down on something else completely. gsutil is currently using the version of apitools at master, so i'm reasonably confident in that code. i just need to drop the new version in and see why it's failing for veneer. |
dhermes
commented
Mar 24, 2015
Cool |
tseaver
commented
Mar 24, 2015
#755 will lead to de-vendoring Once that lands, we can re-visit this one. |
dhermes
commented
Mar 24, 2015
I agree. After hacking on #754 and a late night chat with Craig, it seems that is the best way forward. |
tseaver
commented
Apr 9, 2015
dhermes
commented
Apr 9, 2015
Yes this PR is the one that made us realize #811 was "necessary" (more like was an option). |
dhermes
commented
Apr 9, 2015
Closing this PR and going to take the new approach of just making |
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@050953d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:65e656411895bff71cffcae97246966460160028f253c2e45b7a25d805a5b142 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(deps): update all dependencies to v4 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * revert Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Co-authored-by: larkee <31196561+larkee@users.noreply.github.com>
Fixes#546.
@tseaver@thobrla
I took a stab at the issue but am still unsure of a few things:
apitoolsactually attempt a full upload whenchunksize=None? (/cc @craigcitro)use_chunked=Falseand then just use the chunk size on theBlob?Also @thobrla I'm curious, RE: "We should allow the user to override the chunk size". Do we need a default chunk size for downloads? In the case that someone creates an object with a custom chunk size, should we use it in this method or still try the "all in one go" approach?