-
Notifications
You must be signed in to change notification settings - Fork 30
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
Api definition guidelines #71
base: main
Are you sure you want to change the base?
Api definition guidelines #71
Conversation
fc7d51d
to
27121d7
Compare
This looks pretty good to me, thanks! My main request is that we merge #69 first (should be able to next week) and then we treat this as one of the first artifacts coming out of that working group. The only change I'd suggest then is to move the There is a bit of additional context I'd like to capture, but I'm OK not blocking this PR on it. For example, this is written with an architecture in mind about an InstrutLab API and supporting platform APIs. I'd like to write a high level backend direction doc that would introduce these concepts. I have existing content for this. If feedback on that doc changes anything substantially, we can always adjust these docs too. It's all a moving target. |
The |
That sounds good. I have an internal platform ADR about the decision to make REST APIs as the common service layer that we can adapt for the general backend architecture perspective. |
#69 merged, so I'll drop the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, though I'd like to get some other reviews on it before we merge it.
One point that may be worth adding is something like:
We make no guarantees about any type of API stability at this time as we are still working on the initial implementations of these APIs. As implementation progresses, we may decide to make significant breaking changes to what you find here.
27121d7
to
83b627c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this.
I'm still a bit surprised that nobody else has reviewed it though. Maybe we aren't making it visible in enough of the right places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting started on the API definition!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good, thanks for pushing this @gabe-l-hart. Some small nits inline and questions around where specifications should reside.
api-definitions/README.md
Outdated
@@ -0,0 +1,23 @@ | |||
# API Definitions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "API Specification" a better fit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above comment about API Definition
vs API Specification
from Open API docs
dismissing approval for the moment, as I want to make sure my approval reflects that i see consensus on the PR and there's some ongoing discussion. Thanks for engaging, everyone!
This looks good to me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your diligence in revisiting all the comments. We're making great progress, and I appreciate your efforts!
|
||
## Where will service API definitions live? | ||
|
||
Service API definitions will live a new repository github.com/instructlab/service-api-definitions. This repo will have two primary responsibilities: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service API definitions will live a new repository github.com/instructlab/service-api-definitions. This repo will have two primary responsibilities: | |
Service API definitions will live a new repository `instructlab/service-api-definitions`. This repo will have two primary responsibilities: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer specification over definitions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hickeyma, can you elaborate on that preference in light of the definition vs specification article? My thought is that this new repo would explicitly house definitions
(for machine consumption). Are you thinking that it would also house specifications
(for human consumption)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to weigh in, the Kubernetes community often uses "spec" to define the API specification. I've seen "model" being used elsewhere. I'm ok with both TBH.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point. I think you're right that the kubernetes
community uses spec
in this context a lot. I do think it's also a little muddy with CustomResourceDefinition
which is the thing that defines the schema
for a "thing" and then spec
being the canonical name for the field within that schema
where a user would create an instance of that "thing." I that vein, it still feels like Definition
is the consistent word where the schema
is defined.
That said, I'm a big fan of putting a Cares About
number (1-10) on this kind of opinion and then just taking the highest one.
CA: 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we went with instructlab/openai
. I'm fine with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates @gabe-l-hart. Some more comments provided.
|
||
## Where will service API definitions live? | ||
|
||
Service API definitions will live a new repository github.com/instructlab/service-api-definitions. This repo will have two primary responsibilities: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer specification over definitions
|
||
## Where will service API definitions live? | ||
|
||
Service API definitions will live a new repository github.com/instructlab/service-api-definitions. This repo will have two primary responsibilities: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service API definitions will live a new repository github.com/instructlab/service-api-definitions. This repo will have two primary responsibilities: | |
Service API specifications will live a new repository `instructlab/service-api-specification`. This repo will have two primary responsibilities: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as above. Why the preference for specification
vs definition
if the explicit goal of the repo is to own machine-consumable definitions
. Are you thinking that the yaml
format is the human-readable specification
vs the generated language-specific packages are the machine-readable definitions
?
2a76b78
to
c13ab85
Compare
Signed-off-by: Gabe Goodhart <[email protected]>
Signed-off-by: Gabe Goodhart <[email protected]>
Signed-off-by: Gabe Goodhart <[email protected]>
API and 'extensibilitiy' should be in the dictionary, but yaml -> YAML is reasonable. Signed-off-by: Gabe Goodhart <[email protected]>
Signed-off-by: Gabe Goodhart <[email protected]>
Signed-off-by: Gabe Goodhart <[email protected]>
Signed-off-by: Gabe Goodhart <[email protected]>
…repo Signed-off-by: Gabe Goodhart <[email protected]>
Co-authored-by: Martin Hickey <[email protected]> Signed-off-by: Gabe Goodhart <[email protected]>
Signed-off-by: Gabe Goodhart <[email protected]>
Signed-off-by: Gabe Goodhart <[email protected]>
08aefd1
to
aba535b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are getting close, thanks for keeping up Gabe!
|
||
## Where will service API definitions live? | ||
|
||
Service API definitions will live a new repository github.com/instructlab/service-api-definitions. This repo will have two primary responsibilities: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to weigh in, the Kubernetes community often uses "spec" to define the API specification. I've seen "model" being used elsewhere. I'm ok with both TBH.
…r repo name Signed-off-by: Gabe Goodhart <[email protected]>
Signed-off-by: Gabe Goodhart <[email protected]>
Directionally, this looks fine. The initial guidelines are quite abstract and perhaps will be clarified / filled with essence once actual APIs are proposed and actual bindings are generated. The main point is - the guidelines clarified that bindings will be auto-generated and hosted elsewhere; and there will be a separate repo for schema itself. This should be enough to merge it IMO. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with the current content. The "how we sync generated APIs" many not yet be fully formed or may change a little as we begin to deep dive more into the implementation. However, I think we all agreed on:
- Having a new repo for the source of truth (the API)
- Generate client/SDK/server code using that API def onto new repository:
- it could be a pull from a client repo
- it can be a build/push from the API def repo
Thanks for all your efforts Gabe!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nit but otherwise LGTM
Phrasing change for `openai` repo Co-authored-by: Nathan Weinberg <[email protected]> Signed-off-by: Gabe Goodhart <[email protected]>
Signed-off-by: Martin Hickey <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates @gabe-l-hart. Nearly there, just some small nits.
Co-authored-by: Martin Hickey <[email protected]> Signed-off-by: Gabe Goodhart <[email protected]>
Co-authored-by: Martin Hickey <[email protected]> Signed-off-by: Gabe Goodhart <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine as it gives guidelines and direction with API definitions. I think the "how" will be worked out as we generate and sync specific APIs. We are taking the right approach using OpenAPI specifications and adding the specifications to a new repo for source of truth.
Thanks @gabe-l-hart for working on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Description
This PR introduces a framework for managing
OpenAPI
definitions forInstructLab APIs
andPlatform APIs
.