results

module
v0.0.0-...-7db8d2e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2020 License: Apache-2.0

README

Tekton Results API

This package contains experimental code to support a richly queryable API for Tekton execution history and results.

The full proposal is here: https://docs.google.com/document/d/1-XBYQ4kBlCHIHSVoYAAf_iC01_by_KoK2aRVO0t8ZQ0/edit

The main components of this design are a queryable indexed API server backed by persistent storage, and an in-cluster watcher to report updates to the API server.

The API server interface is defined in ./proto/api.proto, and a reference implementation backed by Sqlite will live in ./cmd/api. A reference implementation of the in-cluster watcher will live in ./cmd/watcher.

Development

Configure your database.

The reference implementation of the API Server requires a SQL database for result storage. The database schema can be found under schema/results.sql.

Initial one-time setup is required to configure the password and initial config:

kubectl create secret generic tekton-results-mysql --namespace="tekton-pipelines" --from-literal=user=root --from-literal=password=$(openssl rand -base64 20)
kubectl create configmap mysql-initdb-config --from-file="schema/results.sql" --namespace="tekton-pipelines"
Deploying

To build and deploy both components, use ko. Make sure you have a valid kubeconfig, and have set the KO_DOCKER_REPO env var.

ko apply -f config/

To only build and deploy one component:

ko apply -f config/watcher.yaml
Regenerating protobuf-generated code
  1. Install protobuf compiler

e.g., for macOS:

brew install protobuf
  1. Install the protoc Go plugin
$ go get -u github.com/golang/protobuf/protoc-gen-go
  1. Rebuild the generated Go code
$ go generate ./proto/

Directories

Path Synopsis
cmd
api
pkg
api/server/db
Package db defines database models for Result data.
Package db defines database models for Result data.
api/server/v1alpha2/result
Package result provides utilities for manipulating and validating Results.
Package result provides utilities for manipulating and validating Results.
watcher/convert
Package convert provides a method to convert v1beta1 API objects to Results API proto objects.
Package convert provides a method to convert v1beta1 API objects to Results API proto objects.
watcher/grpc
Package grpc provides utilities for working with gRPC clients/servers.
Package grpc provides utilities for working with gRPC clients/servers.
proto

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL