Skip to content
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

[content-service] Make the name of the usage report bucket configurable #11689

Merged
merged 3 commits into from
Aug 2, 2022

Conversation

andrew-farries
Copy link
Contributor

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

Description

As part of the move towards usage based pricing (#9036), we'd like for the usage aggregator (components/usage) to be able to upload its usage reports to cloud storage. This will provide an audit trail of usage reports, allowing us to cross reference usage entries in the database with the usage reports that provided the data. In future, we may also allow access to these reports to users directly.

Making the content-service able to upload usage reports was done in #11519.

This PR makes the usage report bucket name configurable.

The name of the object storage bucket to which usage reports are uploaded needs to be configurable for Gitpod SaaS. GCloud bucket names are globally unique, so the bucket name must vary between staging and production.

Related Issue(s)

#11688

How to test

Unit tests for the installer.

Hit the content-service UsageReport service with a gRPC client to generate a signed upload URL that includes the name of the bucket (edit the content-service configmap to change the name of the bucket):

image

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview

Andrew Farries added 2 commits July 27, 2022 11:00
The name of the object storage bucket to which usage reports are
uploaded needs to be configurable for Gitpod SaaS. GCloud bucket names
are globally unique, so the bucket name must vary between staging and
production.
Rather than hardcoding the name of the bucket.
@andrew-farries andrew-farries requested review from a team July 27, 2022 11:51
@github-actions github-actions bot added team: delivery Issue belongs to the self-hosted team team: workspace Issue belongs to the Workspace team labels Jul 27, 2022
@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-af-rename-usage-report-bucket.6 because the annotations in the pull request description changed
(with .werft/ from main)

Copy link
Contributor

@jenting jenting left a comment

Choose a reason for hiding this comment

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

nit: suggest rename the file usagereport-service.go to usage-report-service.go or usage-report-service_test.go to usagereport-service_test.go. It makes the unit test filename matches the source code file and is easy to read.

@andrew-farries
Copy link
Contributor Author

nit: suggest rename the file usagereport-service.go to usage-report-service.go or usage-report-service_test.go to usagereport-service_test.go

Thanks, renamed in 17e7c40

Copy link
Contributor

@jenting jenting left a comment

Choose a reason for hiding this comment

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

Code LGTM.

@roboquat roboquat merged commit 46cca98 into main Aug 2, 2022
@roboquat roboquat deleted the af/rename-usage-report-bucket branch August 2, 2022 07:43
@roboquat roboquat added the deployed: workspace Workspace team change is running in production label Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: workspace Workspace team change is running in production release-note-none size/L team: delivery Issue belongs to the self-hosted team team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants