Tail
A very simple app to display logs generated by Prow.
Why use Tail
By default, logs generated by Prow are stored in a GCS bucket and are displayed
publicly by a tool called Gubernator.
It is not possible to display logs privately using it.
Tail solves this by:
- Providing GitHub-based user authorization and restricting access to logs from
private repos to only members of a particular organisation.
- Publicly displaying logs from a specified whitelist of public repos, without any
need for authorization in these cases.
Installation
Tail requires Go version 1.7+.
$ go get github.com/kubermatic/tail
Usage
Environment Variables
Tail needs the following environment variables:
CLIENT_ID
and CLIENT_SECRET
- These values are required for GitHub
authorization. They can be created by registering a GitHub Oauth app.
TOKEN
- This is a personal access token (of any member of the org) which
has read access to the whole org. This token is required to view members of the
org who have their membership configured as private.
SESSION_KEY
- This is the key used for the cookie store.
Flags
Tail uses the following flags:
$ tail
Usage of tail:
-bucket-name string
Name of the bucket where logs are stored. (default "prow-data")
-cache-dir string
The directory to use for caching. (default "./")
-listen-port string
Port to listen on. (default ":8080")
-org string
The GitHub organization name whose members can access these logs. Required.
-public-repos string
Comma separated list of public repos in format org/repo. Optional.
-redirect-url string
The callback URL for the app. Should end with "/github/callback". (default "http://localhost:8080/github/callback")
Running
- Edit
manifest.yaml
to contain the bucket you use and a valid serviceAccountKey to access that bucket
- Run
kubectl apply -f manifest.yaml
- Add a line like this to your prows
config.yaml
in the plank
section: job_url_template: '{{if .Spec.Refs}}https://prow.mycompany.com/build/{{.Spec.Refs.Org}}_{{.Spec.Refs.Repo}}/{{with index .Spec.Refs.Pulls 0}}{{.Number}}{{end}}/{{.Spec.Job}}/{{.Status.BuildID}}{{end}}'