| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
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. |
Sorry, something went wrong.
|
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). |
Sorry, something went wrong.
|
Rather than passing in an upload_chunk_size, wouldn't it be more sensible to have Blob.CHUNK_SIZE be None as the appropriate default, but settable for cases where the application wanted to do chunking (maybe via a subclass?). |
Sorry, something went wrong.
|
@tseaver That's why I asked "Do we need a default chunk size for downloads?". From @thobrla answer above it seems that a default is not needed. I'm still unclear if passing chunksize=None to our vendored in code is sufficient to fix #546. |
Sorry, something went wrong.
|
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? |
Sorry, something went wrong.
|
I plan on implementing the default chunk_size=None and then just using blob.chunk_size the way the class constant was used. I just wanted to make sure passing chunksize=None to our vendored in code is sufficient before moving too much further. |
Sorry, something went wrong.
|
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:
|
Sorry, something went wrong.
|
@craigcitro w00t! Thanks for the news. The main question is
which @thobrla indicates is only in upstream (gsutil). |
Sorry, something went wrong.
|
Ping @craigcitro
|
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
@craigcitro Do you need help on the unification? |
Sorry, something went wrong.
|
UPDATE: Chatting with @craigcitro today (March 2, 2015) it seems the gsutil upstream changes have been merged into https://github.com/google/apitools @tseaver Do you want to vendor in the latest updates from apitools and then I'll rebase? (I could vendor in too, but presume you could do it faster since you did it the first 2 times.) |
Sorry, something went wrong.
|
Yeah, I'll vendor it in. |
Sorry, something went wrong.
|
@craigcitro I'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 (most recent call last):
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/gcloud/storage/test_blob.py", line 418, in test_upload_from_file_resumable
blob.upload_from_file(fh, rewind=True)
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/gcloud/storage/blob.py", line 354, in upload_from_file
finish_callback=lambda *args: None)
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/_gcloud_vendor/apitools/base/py/transfer.py", line 804, in StreamInChunks
additional_headers=additional_headers)
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/_gcloud_vendor/apitools/base/py/transfer.py", line 764, in __StreamMedia
'%d' % self.progress)
CommunicationError: Failed to transfer all bytes in chunk, upload paused at byte 4
======================================================================
FAIL: test_download_as_string (gcloud.storage.test_blob.Test_Blob)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/gcloud/storage/test_blob.py", line 328, in test_download_as_string
self.assertEqual(fetched, b'abcdef')
AssertionError: 'abc' != 'abcdef'
- abc
+ abcdef
======================================================================
FAIL: test_download_to_file (gcloud.storage.test_blob.Test_Blob)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/gcloud/storage/test_blob.py", line 272, in test_download_to_file
self.assertEqual(fh.getvalue(), b'abcdef')
AssertionError: 'abc' != 'abcdef'
- abc
+ abcdef
======================================================================
FAIL: test_download_to_filename (gcloud.storage.test_blob.Test_Blob)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/gcloud/storage/test_blob.py", line 307, in test_download_to_filename
self.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. |
Sorry, something went wrong.
|
is the easiest way for me to play with it just to clone your branch? |
Sorry, something went wrong.
|
Likely so: I don't want to make it a PR here until things pass. Just run tox -e py27 to see it fail. |
Sorry, something went wrong.
|
@tseaver @craigcitro I'm happy to take up the vendor-ing in process of HEAD in apitools. What is required? @tseaver What stopped you before? |
Sorry, something went wrong.
|
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. 😉 |
Sorry, something went wrong.
|
I can babysit you if you like. |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
Cool |
Sorry, something went wrong.
|
#755 will lead to de-vendoring apitools, which will then require us to get our tests compatible with the new semantics (causing the failures above). Once that lands, we can re-visit this one. |
Sorry, something went wrong.
|
I agree. After hacking on #754 and a late night chat with Craig, it seems that is the best way forward. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Yes this PR is the one that made us realize #811 was "necessary" (more like was an option). |
Sorry, something went wrong.
|
Closing this PR and going to take the new approach of just making CHUNK_SIZE optional. |
Sorry, something went wrong.
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>
| Back | FazBrowse Home | New Git URL |
Fixes #546.
@tseaver @thobrla
I took a stab at the issue but am still unsure of a few things:
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?