Skip to content

Fix Storage Control endpoint resolution for TPC#847

Open
Mahalaxmibejugam wants to merge 18 commits into
fsspec:mainfrom
ankitaluthra1:tpc-testing
Open

Fix Storage Control endpoint resolution for TPC#847
Mahalaxmibejugam wants to merge 18 commits into
fsspec:mainfrom
ankitaluthra1:tpc-testing

Conversation

@Mahalaxmibejugam
Copy link
Copy Markdown
Collaborator

@Mahalaxmibejugam Mahalaxmibejugam commented May 14, 2026

This PR fixes the endpoint resolution for the Storage Control API in ExtendedGcsFileSystem to support TPC environments correctly.

Changes

  • gcsfs/extended_gcsfs.py: Refactored _get_control_plane_client to use self._location for deriving secure or insecure channel endpoints dynamically
  • gcsfs/tests/test_extended_hns_gcsfs.py: Added test_get_control_plane_client_endpoint to cover explicit endpoint, universe domain, emulator, and default fallback scenarios.
  • cloudbuild/setup_vm.sh: Added a log to print the fsspec version after installing it from head, to help debug CI issues.
  • Improved is_real_gcs() to dynamically detect custom universes using _location().
  • Configured gcs_factory to inject default project and location parameters to prevent location and project validation errors in private clouds. In TPC universe, providing a location is must while creating the buckets unlike standard production where it has a default region

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.50%. Comparing base (e768973) to head (65126d0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #847      +/-   ##
==========================================
+ Coverage   88.19%   88.50%   +0.31%     
==========================================
  Files          15       15              
  Lines        2989     2993       +4     
==========================================
+ Hits         2636     2649      +13     
+ Misses        353      344       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

In TPC universe, we must provide the region/location for creating the
buckets unlike standard universe which has a default location

Added this env variable to use it while initializing the FileSystem
@Mahalaxmibejugam Mahalaxmibejugam force-pushed the tpc-testing branch 2 times, most recently from f81f609 to f5b4a58 Compare May 18, 2026 16:13
Comment thread gcsfs/extended_gcsfs.py
}
if self._location:
endpoint = self._location.split("://")[-1]
channel_kwargs["host"] = endpoint
Copy link
Copy Markdown
Collaborator

@ankitaluthra1 ankitaluthra1 May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case of self_location being empty, channel is not getting initialised, is that expected ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If self._location is empty, channel is initialised in the else block without passing the endpoint. In such cases default storage endpoint would be used in the control client.

Additionally, self._location() will always have a default standard endpoint if it is not specified in the environment variables or during FileSystem creation.

Comment thread gcsfs/extended_gcsfs.py Outdated
if self._location and self._location.startswith("http://"):
host = channel_kwargs["host"]
channel = grpc.aio.insecure_channel(
host, options=channel_kwargs.get("options")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quota project in insecure grpc channels is intentionally skipped ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grpc.aio.insecure_channel() function does not have support for concept of Google-specific options like quota_project_id

We can pass quota_project_id in transport_cls() but passing it along with channel would completely ignore the quota_project_id. Since insecure channels are only used for local emulators(starting with http://) that lack any quota or billing systems, the emulator would completely ignore these GCP billing headers even if they were sent.

Comment thread gcsfs/extended_gcsfs.py Outdated
Comment thread gcsfs/tests/utils.py
from gcsfs.core import _location

host = _location()
return host.startswith("https://")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can custom endpoint for real GCS start with http ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am checking with the TPC team regarding this. If http:// endpoints are supported, we will need to update both the production code and the test utilities. I will include the necessary changes in my next PR if http is confirmed to be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants