Skip to content

Control included quota and storage providers via build tags#3664

Merged
phbnf merged 7 commits intogoogle:masterfrom
robstradling:cmd_storage_quota_build_tags
Nov 8, 2024
Merged

Control included quota and storage providers via build tags#3664
phbnf merged 7 commits intogoogle:masterfrom
robstradling:cmd_storage_quota_build_tags

Conversation

@robstradling
Copy link
Copy Markdown
Contributor

@robstradling robstradling commented Nov 7, 2024

#3644 (comment) noted that the log-signer and log-server binaries are huge, due in part to the presence of multiple quota and storage providers. This PR enables providers to be included selectively via Go build tags.

By default and for backwards compatibility, all providers are included:

go build && ls -sh trillian_log_server
62M trillian_log_server*

Specify one build tag to include just one provider:

go build -tags=cloudspanner && ls -sh trillian_log_server
54M trillian_log_server*
go build -tags=crdb && ls -sh trillian_log_server
37M trillian_log_server*
go build -tags=mysql && ls -sh trillian_log_server
34M trillian_log_server*
go build -tags=postgresql && ls -sh trillian_log_server
40M trillian_log_server*

Specify multiple, comma-separated build tags to include multiple providers. e.g.,:

go build -tags=mysql,cloudspanner && ls -sh trillian_log_server
55M trillian_log_server*
go build -tags=cloudspanner,crdb,mysql,postgresql && ls -sh trillian_log_server
62M trillian_log_server*

Checklist

@robstradling robstradling requested a review from a team as a code owner November 7, 2024 10:40
@robstradling robstradling requested a review from phbnf November 7, 2024 10:40
@phbnf
Copy link
Copy Markdown
Contributor

phbnf commented Nov 7, 2024

/gcbrun

@robstradling robstradling marked this pull request as draft November 7, 2024 10:56
@robstradling robstradling marked this pull request as ready for review November 7, 2024 11:12
@phbnf
Copy link
Copy Markdown
Contributor

phbnf commented Nov 7, 2024

Looks neat, thanks. Do you mind adding an entry in CHANGELOG.md, and something on the Working on the Code section to both publicize this feature and explain what needs to be done when someone adds a new backend storage?

@robstradling
Copy link
Copy Markdown
Contributor Author

Hi @phbnf. Done.

@phbnf
Copy link
Copy Markdown
Contributor

phbnf commented Nov 8, 2024

/gcbrun

@phbnf
Copy link
Copy Markdown
Contributor

phbnf commented Nov 8, 2024

Thanks @robstradling !

@phbnf phbnf merged commit cb94231 into google:master Nov 8, 2024
@robstradling robstradling deleted the cmd_storage_quota_build_tags branch November 14, 2024 15:29
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.

2 participants