-
Notifications
You must be signed in to change notification settings - Fork 162
Feat: Introduce ExtendedGcsFileSystem for Zonal Bucket gRPC Read Path #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ankitaluthra1
wants to merge
65
commits into
fsspec:main
Choose a base branch
from
ankitaluthra1:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
ecbec0e
adds logic for handling requests from new adapter is bucket type os s…
ankitaluthra1 d506a60
adds logic for hnadling requests from new adapter is bucket type is z…
ankitaluthra1 9a70933
refactor bucket type enum to include value for HNS bucket type | Fixe…
ankitaluthra1 eb209f5
adds feature toggle behind which experimental feature support would b…
ankitaluthra1 0b606b1
updates tests to include experimental feature toggle
ankitaluthra1 409c86e
minor fix
ankitaluthra1 8a4ca85
moves mrd creation inside core.py
ankitaluthra1 c5a9eae
moves mrd creation to separate GCSFile
ankitaluthra1 e95495f
minor comment
ankitaluthra1 95440d5
Extend gcsfs to create new filesystem
suni72 dfcbb7f
Extend gcsfs and gcsfile to override methods. download happens synchr…
suni72 f3d1031
Merge pull request from ankitaluthra1/lankita-poc-zonal
ankitaluthra1 20b36fc
fixes new test in test_core.py
ankitaluthra1 c9f569a
refactors/renames GCS Filesystem Adapter
ankitaluthra1 e5fc935
Override _cat_file to handle other read methods of gcsfs
suni72 50d30b3
creates grpc client inside GCSHNSFilesystem
ankitaluthra1 cbf00b3
refactors to reuse grpc client in cat_ranges
ankitaluthra1 a202579
Move classmethods in ZonalFile to a util file
suni72 5064a97
Implement logic to process limits as offset and length
suni72 ac276f6
Add fallback logic for non zonal buckets
suni72 dbecb12
Add unit tests for zb_hns_utils
suni72 37a495b
Add test for GCSFSAdapter with read_block
suni72 cba7d27
Update _get_storage_layout to use a single return statement
suni72 4ff9fe4
Updated gcs_adapter.open to pass on correct default values to GCSFile
suni72 389a4b0
Move logic for handing 0 length in MRD to zb_hns_utils
suni72 133b4fa
Add comments for clarity
suni72 31b2a2f
Merge pull request #4 from ankitaluthra1/zb-features
suni72 e36b7ed
Updated zonal file to only create mrd for read mode.
suni72 25cd0ef
Updated gcs_adapter fixture to not setup bucket when real gcs endpoin…
suni72 8425464
Updated gcs_adapter.open to pass on correct default values to GCSFile
suni72 75fecce
Move logic for handing 0 length in MRD to zb_hns_utils
suni72 2b6af9c
Updated zonal file to only create mrd for read mode.
suni72 b648df4
Updated gcs_adapter fixture to not setup bucket when real gcs endpoin…
suni72 f71f4e8
Merge branch 'zb-ft-2' into zb-features
suni72 1c99137
Update test_read_block_zb to use subtests to avoid frequent setup run
suni72 1099375
fix: Optimizes info() and exists() methods
Mahalaxmibejugam d834b07
fix: Optimizes info() and exists() methods
Mahalaxmibejugam bfd513f
fixes lint errors
ankitaluthra1 efabe35
fixes comments
ankitaluthra1 2ed3cc6
fixes lint errors
ankitaluthra1 957d7b5
adds grpc and google-iam dependency
ankitaluthra1 cd222cb
Fix missing argument in open
suni72 17618d5
Fix: Raise NotImplementedError for modes other than read in Zonal bucket
suni72 064c286
Add ClientInfo in AsyncGrpcClient
suni72 8b2a8d9
refactors storage layout to use sdk control client
ankitaluthra1 b1f0117
fixes lint errors
ankitaluthra1 b254a14
Merge branch 'internal-main' into zb-features
ankitaluthra1 7983528
Merge pull request #5 from ankitaluthra1/zb-features
ankitaluthra1 cdf574a
Merge pull request from ankitaluthra1/internal-main
ankitaluthra1 b411bef
Merge branch 'fsspec:main' into main
ankitaluthra1 c47b53f
fixes lint errors
ankitaluthra1 e37d0fb
fixes lint errors
ankitaluthra1 11af000
fixes conda install error
ankitaluthra1 c4cf777
mocks fake test credentials for grpc client
ankitaluthra1 5714012
fixes conflicting lint rules black and isort
ankitaluthra1 fccd43a
adds missing pytest package in conda install
ankitaluthra1 11dd722
refactor get bucket type
ankitaluthra1 a2b5077
Implement Zonal Read Stream Cleanup (#7)
suni72 0c3df8e
adds GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT as env variable instead of kwargs
ankitaluthra1 0e9c2ab
removes timeout from pytest fixture coming as mark has no effect on t…
ankitaluthra1 c3ad9b2
Refactor: Rename GcsFileSystemAdapter to ExtendedGcsFileSystem & Fix …
suni72 a8945c2
Replaces __new__ with conditional import in init
ankitaluthra1 774b53d
Merge branch 'main' into main
ankitaluthra1 90d0cf4
fixes lint errors
ankitaluthra1 8672c28
simplified logic in cleanup_gcs for unit tests
suni72 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import os | ||
| import sys | ||
|
|
||
|
|
||
| class TestConditionalImport: | ||
| def setup_method(self, method): | ||
| """Setup for each test method.""" | ||
| self.original_env = os.environ.get("GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT") | ||
|
|
||
| # Snapshot original gcsfs modules | ||
| self.original_modules = { | ||
| name: mod for name, mod in sys.modules.items() if name.startswith("gcsfs") | ||
| } | ||
|
|
||
| # Unload gcsfs modules to force re-import during the test | ||
| modules_to_remove = list(self.original_modules.keys()) | ||
| for name in modules_to_remove: | ||
| if name in sys.modules: | ||
| del sys.modules[name] | ||
|
|
||
| def teardown_method(self, method): | ||
| """Teardown after each test method.""" | ||
| # Reset environment variable to its original state | ||
| if self.original_env is not None: | ||
| os.environ["GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT"] = self.original_env | ||
| elif "GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT" in os.environ: | ||
| del os.environ["GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT"] | ||
|
|
||
| # Clear any gcsfs modules loaded/modified during this test | ||
| modules_to_remove = [name for name in sys.modules if name.startswith("gcsfs")] | ||
| for name in modules_to_remove: | ||
| if name in sys.modules: | ||
| del sys.modules[name] | ||
|
|
||
| # Restore the original gcsfs modules from the snapshot to avoid side effect | ||
| # affecting other tests | ||
| sys.modules.update(self.original_modules) | ||
|
|
||
| def test_experimental_env_unset(self): | ||
| """ | ||
| Tests gcsfs.GCSFileSystem is core.GCSFileSystem when | ||
| GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT is NOT set. | ||
| """ | ||
| if "GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT" in os.environ: | ||
| del os.environ["GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT"] | ||
|
|
||
| import gcsfs | ||
|
|
||
| assert ( | ||
| gcsfs.GCSFileSystem is gcsfs.core.GCSFileSystem | ||
| ), "Should be core.GCSFileSystem" | ||
| assert not hasattr( | ||
| gcsfs, "ExtendedGcsFileSystem" | ||
| ), "ExtendedGcsFileSystem should not be imported directly on gcsfs" | ||
|
|
||
| def test_experimental_env_set(self): | ||
| """ | ||
| Tests gcsfs.GCSFileSystem is extended_gcsfs.ExtendedGcsFileSystem when | ||
| GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT IS set. | ||
| """ | ||
| os.environ["GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT"] = "true" | ||
|
|
||
| import gcsfs | ||
|
|
||
| assert ( | ||
| gcsfs.GCSFileSystem is gcsfs.extended_gcsfs.ExtendedGcsFileSystem | ||
| ), "Should be ExtendedGcsFileSystem" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.