forked from cruxinformatics/crux-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Download small files from GCS (cruxinformatics#20)
We want all files downloaded from GCS, unless the user chooses to restrict to Crux domains. Even small files should come from GCS, just not using ChunkedDownload. Change file downloads to use plain requests for downloading small files from signed URLs. There is some additional work that still needs to be done to make the file downloads respect the client proxy settings, and throw crux-python exceptions instead requests exceptions. Also: - I got bothered that `file_pointer` wasn't technically a C file pointer, change it to `file_obj` instead. - Then I got really OCD about `local_path` for `download()` and `upload()` methods, because it it took either a file-like object or a file path. Change to `dest` for downloads and `src` for uploads. - Update docs with arg name changes, and remove args names when they are simple and required. - Simplify label docs. The integration tests were very unreliable. Use random names more, and change to longer random names (I actually hit duplicate random names). Skip a `test_folder_add_delete_permission()` because it is way too slow, or maybe doesn't even work. Skip `test_set_datasets_provenance()` because it is either really flaky or doesn't work. It isn't ideal to be skipping testing, they will be fixed another PR. **Test Plan:** All tests pass, lint, integration, type checking, formatting. I manually tested with a download script, with urllib3 DEBUG logging enabled, and was able to see the downloads coming from GCS. And I set `only_use_crux_domains=True` and it worked, and I was able to see the download coming from the API.
- Loading branch information
1 parent
ee33f1c
commit 9b4193b
Showing
18 changed files
with
185 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,4 @@ __pycache__/ | |
/.nox/ | ||
.pytest_cache/ | ||
.mypy_cache/ | ||
/pip-wheel-metadata/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.