-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add Support for storing logs to Google Cloud Storage #552
Conversation
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.
/kind feature
/assign @enarha @sayan-biswas |
76f86d0
to
fd39398
Compare
19048db
to
6884a65
Compare
7bb8862
to
1d53de3
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Generally looks good - my comments are mainly nits on function names and log messages. It took me a while to understand what a lot of the test code was doing.
As a follow up, we should update https://github.com/tektoncd/results/blob/main/docs/DEVELOPMENT.md to include guidance on how to emulate the different log storage providers. Alternatively, we could add a separate doc that focuses on this topic.
EDIT: filed #559 for the follow up.
@@ -29,6 +29,9 @@ type Config struct { | |||
LOGS_BUFFER_SIZE int `mapstructure:"LOGS_BUFFER_SIZE"` | |||
LOGS_PATH string `mapstructure:"LOGS_PATH"` | |||
|
|||
GCS_BUCKET_NAME string `mapstructure:"GCS_BUCKET_NAME"` | |||
STORAGE_EMULATOR_HOST string `mapstructure:"STORAGE_EMULATOR_HOST"` |
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 this intended to be GCS specific? If so, please prefix this config item with GCS
:
STORAGE_EMULATOR_HOST string `mapstructure:"STORAGE_EMULATOR_HOST"` | |
GCS_STORAGE_EMULATOR_HOST string `mapstructure:"GCS_STORAGE_EMULATOR_HOST"` |
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.
GCS driver uses this exact value. It uses the STORAGE_EMULATOR_HOST
environment variable.
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.
Please add a comment above with this information.
if cfg.STORAGE_EMULATOR_HOST != "" { | ||
creds, _ = google.CredentialsFromJSON(ctx, []byte(`{"type": "service_account", "project_id": "my-project-id"}`)) | ||
} else { |
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 there a project that emulates GCS storage (unauthenticated)? Is this something useful for contributors who want to test this without launching on GCP/GKE?
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.
Yes. There is one storage emulator in python. A couple of storage in go.
This one works fine: https://github.com/fullstorydev/emulators
77656fc
to
be8a16e
Compare
Logs can be stored to GCS. GOOGLE_APPLICATION_CREDENTIALS environment variable needs to be passed to api-server alongwith bucketname.
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.
Apart from the test issue, the rest is LGTM.
) | ||
|
||
// This function is to create a replay or record http client depending | ||
// upon whether a -record flag was passed durin testing |
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.
typo: during
/lgtm |
Changes
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you review them:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes