Skip to content

[usage] Implement initial gRPC API #11224

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

Merged
merged 7 commits into from
Jul 11, 2022
Merged

[usage] Implement initial gRPC API #11224

merged 7 commits into from
Jul 11, 2022

Conversation

andrew-farries
Copy link
Contributor

@andrew-farries andrew-farries commented Jul 8, 2022

Description

#11221 added the .proto definitions for a placeholder gRPC API for the usage component.

This PR implements the server side of that placeholder API.

Also updates the installer to deploy config for the usage component so that it serves gRPC and adds a k8s service through which it can be accessed.

Related Issue(s)

Fixes #10324

How to test

  • Run the usage service locally:
cd components/usage
leeway build .:init-testdb
DB_USERNAME=gitpod DB_PORT=23306 DB_PASSWORD=test go run . run
  • Access the gRPC API (using evans):
evans -p 9001 -r repl
> package usage.v1
> show services

The placeholder API is shown:

image

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview

/hold

@andrew-farries andrew-farries requested a review from a team July 8, 2022 08:46
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Jul 8, 2022
"services": {
"grpc": {
"address": ":9001",
"tls": null
Copy link
Member

Choose a reason for hiding this comment

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

I think you should be able to omit this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Go struct that gets serialized to create this config is this one:

TLS *TLSConfiguration `json:"tls" yaml:"tls"`

The TLS field doesn't specify omitempty so it's always unmarshalled to nil.

I think the TLS field should specify omitempty, then we can get rid of this line as you suggest.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense, wanna make that change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to do it in another PR because doing so will tag the workspace team into this one as reviewers which doesn't seem worth it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here: #11240

@andrew-farries andrew-farries requested a review from easyCZ July 8, 2022 10:34
@andrew-farries andrew-farries force-pushed the af/initial-usage-grpc-api branch from 43a3092 to 2538d22 Compare July 8, 2022 10:51
@andrew-farries andrew-farries requested a review from a team July 8, 2022 10:51
@github-actions github-actions bot added the team: delivery Issue belongs to the self-hosted team label Jul 8, 2022
Base automatically changed from af/initial-usage-grpc-api to main July 8, 2022 10:55
@roboquat roboquat added size/XXL and removed size/L labels Jul 8, 2022
Andrew Farries added 4 commits July 8, 2022 10:57
Add a service for the gRPC port exposed by the usage component.
Already implemented by the embedded struct.
@andrew-farries andrew-farries force-pushed the af/initial-usage-api-impl branch from 74acb58 to b681cc1 Compare July 8, 2022 10:57
@roboquat roboquat added size/L and removed size/XXL labels Jul 8, 2022
@andrew-farries andrew-farries requested a review from a team July 8, 2022 12:59
@github-actions github-actions bot added the team: workspace Issue belongs to the Workspace team label Jul 8, 2022
@andrew-farries andrew-farries force-pushed the af/initial-usage-api-impl branch from 6ee0243 to b681cc1 Compare July 8, 2022 13:01
@andrew-farries andrew-farries removed the request for review from a team July 8, 2022 13:01
@andrew-farries andrew-farries removed the team: workspace Issue belongs to the Workspace team label Jul 8, 2022
Copy link
Contributor

@mrsimonemms mrsimonemms left a comment

Choose a reason for hiding this comment

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

Approving as self-hosted wrongly marked as owner on these files

@geropl
Copy link
Member

geropl commented Jul 11, 2022

@andrew-farries With this being "blocked" I have a hard time understanding what state this PR is in. 😕 It is ready to be merged (marked as "ready for review" + approved)? Also, I did not notice any reason for the hold…..?

@andrew-farries
Copy link
Contributor Author

andrew-farries commented Jul 11, 2022

@andrew-farries With this being "blocked" I have a hard time understanding what state this PR is in. 😕 It is ready to be merged (marked as "ready for review" + approved)? Also, I did not notice any reason for the hold…..?

I'm not sure what you mean by "blocked" here.

The PR is ready to review. Only caveat is that ca861c2 was already reviewed in #11236 and 7b25556, 22f51dd were reviewed in #11240.

Maybe stacked PRs here are causing more confusion than they are worth.

I've removed the hold - there was no reason for it. I generally like to add it to PRs so I can be in control of when it gets merged eg if there are any "optional" changes required from reviewers.

/unhold

@roboquat roboquat merged commit f166459 into main Jul 11, 2022
@roboquat roboquat deleted the af/initial-usage-api-impl branch July 11, 2022 08:21
@easyCZ
Copy link
Member

easyCZ commented Jul 11, 2022

Personally, I'd recommend using stacked PRs as a Queue only and not to merge later PRs into their predecestor, it makes it easier to follow what needs reviewing. With that, I'd also keep any follow-on PRs as draft until they can actually be reviewed.

@roboquat roboquat added the deployed: webapp Meta team change is running in production label Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production release-note-none size/L team: delivery Issue belongs to the self-hosted team team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define usage APIs
5 participants