Skip to content

Add DataPlane API Support#936

Merged
hectorcast-db merged 44 commits intomainfrom
dataplane-support
Jul 5, 2024
Merged

Add DataPlane API Support#936
hectorcast-db merged 44 commits intomainfrom
dataplane-support

Conversation

@hectorcast-db
Copy link
Copy Markdown
Contributor

@hectorcast-db hectorcast-db commented Jun 3, 2024

Changes

Add DataPlane API Support

Tests

Manual test:

input := []string{}
input = append(input, "Hello, I'm a language model,")
_, err := w.ServingEndpointsDataPlane.Query(context.Background(), serving.QueryEndpointInput{
	Name:   <...>,
	Inputs: input,
})
require.NoError(t, err)
  • make test passing
  • make fmt applied
  • relevant integration tests applied

@hectorcast-db hectorcast-db requested a review from mgyucht June 3, 2024 09:35
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 16.74208% with 184 lines in your changes missing coverage. Please review.

Project coverage is 7.09%. Comparing base (d098b1a) to head (c5cfd49).

Files Patch % Lines
...ing/mock_serving_endpoints_data_plane_interface.go 5.81% 81 Missing ⚠️
service/serving/impl.go 0.00% 31 Missing ⚠️
service/catalog/model.go 0.00% 15 Missing ⚠️
service/serving/api.go 0.00% 13 Missing ⚠️
openapi/code/method.go 0.00% 12 Missing ⚠️
httpclient/request.go 0.00% 8 Missing ⚠️
openapi/code/service.go 11.11% 8 Missing ⚠️
httpclient/oauth_token.go 0.00% 6 Missing ⚠️
experimental/mocks/mock_workspace_client.go 16.66% 5 Missing ⚠️
client/client.go 0.00% 4 Missing ⚠️
... and 1 more
Additional details and impacted files
@@           Coverage Diff            @@
##            main    #936      +/-   ##
========================================
+ Coverage   7.04%   7.09%   +0.04%     
========================================
  Files        282     284       +2     
  Lines      65329   65542     +213     
========================================
+ Hits        4602    4648      +46     
- Misses     60418   60584     +166     
- Partials     309     310       +1     

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


// Returns a new OAuth scoped to the authorization details provided.
// It will return an error if the CredentialStrategy does not support OAuth tokens.
//
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We don't need this on the WorkspaceClient, but the Client itself.

@hectorcast-db hectorcast-db marked this pull request as ready for review June 10, 2024 06:58
@hectorcast-db hectorcast-db requested a review from tanmay-db June 11, 2024 07:35
Copy link
Copy Markdown
Contributor

@renaudhartert-db renaudhartert-db left a comment

Choose a reason for hiding this comment

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

@hectorcast-db, I left a few Go-style suggestions — please have a look. Happy to discuss these offline.

Copy link
Copy Markdown
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

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

Looking really good! Some feedback but I think we're close to the final cut here.

return nil, err
}
if response.{{(index .DataPlaneInfoFields 0).PascalName}} == nil {
return nil, errors.New("resource does not support direct Data Plane access")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When would this case happen? Is this a bug in the API definition? Or is it possible that some model serving endpoints support direct-to-dataplane access and others don't?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

DataPlane access needs to be enabled on a resource level. If you call this method for a Model which is not "optimized" (their flag for DataPlane), this field won't be set (the endpointURL does not exists)

Copy link
Copy Markdown
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

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

Two small notes, otherwise LGTM!

@hectorcast-db hectorcast-db added this pull request to the merge queue Jul 5, 2024
Merged via the queue into main with commit df99404 Jul 5, 2024
@hectorcast-db hectorcast-db deleted the dataplane-support branch July 5, 2024 12:58
tanmay-db added a commit that referenced this pull request Jul 8, 2024
### Internal Changes

 * Improve Changelog by grouping changes ([#962](#962)).

### Other Changes

 * Add ChangelogConfig to Generator struct ([#967](#967)).
 * Add DataPlane API Support ([#936](#936)).
 * Add a credentials provider for Github Azure OIDC ([#965](#965)).
 * Added more error messages for retriable errors (timeouts, etc.) ([#963](#963)).
 * Parse API Error messages with `int` error codes ([#960](#960)).
@tanmay-db tanmay-db mentioned this pull request Jul 8, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jul 8, 2024
## 0.43.1

### Major Changes and Improvements:
* Add a credentials provider for Github Azure OIDC
([#965](#965)).
* Add DataPlane API Support
([#936](#936)).
* Added more error messages for retriable errors (timeouts, etc.)
([#963](#963)).

### Internal Changes
* Add ChangelogConfig to Generator struct
([#967](#967)).
* Improve Changelog by grouping changes
([#962](#962)).
* Parse API Error messages with `int` error codes
([#960](#960)).
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.

4 participants