Open
Conversation
…on-sdk into tim/sdk-configures-edge
…on-sdk into tim/sdk-configures-edge
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds SDK methods for reading and modifying edge endpoint configuration at runtime, accessible via a namespaced
gl.edgepattern. Depends on companion Edge PR.New code
EdgeAPIclass (groundlight/edge/api.py)Provides three methods:
get_config()-- callsGET /edge-config, returnsEdgeEndpointConfigset_config(config, timeout_sec)-- callsPUT /edge-config, then pollsGET /edge-detector-readinessuntil all desired detectors are ready (or timeout)get_detector_readiness()-- callsGET /edge-detector-readiness, returnsdict[str, bool]All HTTP calls go through
_request(), which raisesEdgeNotAvailableErroron 404 or connection failure with an informative message guiding the user to check their endpoint configuration.EdgeNotAvailableErrorNew exception in
groundlight.client. Raised when an edge-only method is called against a non-edge endpoint (cloud API, unreachable host). The error message includes a hint about theGROUNDLIGHT_ENDPOINTenv var.gl.edgeaccess patternExperimentalApi.__init__creates anEdgeAPIinstance asself.edge. Edge methods are only accessible through this namespace.Version
Bumped to
0.26.0(minor version bump for new public API surface).Release order
The companion edge-endpoint PR must be deployed first. The
gl.edge.*methods call endpoints (/edge-config,/edge-detector-readiness) that only exist after the edge PR is deployed. Releasing this SDK version first would cause those methods to raiseEdgeNotAvailableError(404).Authentication note
These methods do not add authentication headers beyond what the SDK already sends (the standard
x-api-token). The edge endpoint does not currently enforce auth on the config or readiness endpoints. The SDK sends the token in case auth is added in the future, but it is not required today.