Move cncd/pipeline/pipeline/ to pipeline/ (#347)

* Refactor: move cncd/pipeline/ to pipeline/

* Refactor: move pipeline/pipeline/ to pipeline/
This commit is contained in:
Jacob Floyd
2021-09-24 06:18:34 -05:00
committed by GitHub
parent a0d008e071
commit e34daae0cf
114 changed files with 57 additions and 74 deletions

303
pipeline/rpc/client_grpc.go Normal file
View File

@@ -0,0 +1,303 @@
package rpc
import (
"context"
"encoding/json"
"log"
"time"
"github.com/woodpecker-ci/woodpecker/pipeline/backend"
"github.com/woodpecker-ci/woodpecker/pipeline/rpc/proto"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
)
// generate protobuffs
// protoc --go_out=plugins=grpc,import_path=proto:. *.proto
var backoff = time.Second
type client struct {
client proto.DroneClient
conn *grpc.ClientConn
}
// NewGrpcClient returns a new grpc Client.
func NewGrpcClient(conn *grpc.ClientConn) Peer {
client := new(client)
client.client = proto.NewDroneClient(conn)
client.conn = conn
return client
}
func (c *client) Close() error {
return c.conn.Close()
}
// Next returns the next pipeline in the queue.
func (c *client) Next(ctx context.Context, f Filter) (*Pipeline, error) {
var res *proto.NextReply
var err error
req := new(proto.NextRequest)
req.Filter = new(proto.Filter)
req.Filter.Expr = f.Expr
req.Filter.Labels = f.Labels
for {
res, err = c.client.Next(ctx, req)
if err == nil {
break
} else {
log.Printf("grpc error: done(): code: %v: %s", grpc.Code(err), err)
}
switch grpc.Code(err) {
case
codes.Aborted,
codes.DataLoss,
codes.DeadlineExceeded,
codes.Internal,
codes.Unavailable:
// non-fatal errors
default:
return nil, err
}
if ctx.Err() != nil {
return nil, ctx.Err()
}
<-time.After(backoff)
}
if res.GetPipeline() == nil {
return nil, nil
}
p := new(Pipeline)
p.ID = res.GetPipeline().GetId()
p.Timeout = res.GetPipeline().GetTimeout()
p.Config = new(backend.Config)
json.Unmarshal(res.GetPipeline().GetPayload(), p.Config)
return p, nil
}
// Wait blocks until the pipeline is complete.
func (c *client) Wait(ctx context.Context, id string) (err error) {
req := new(proto.WaitRequest)
req.Id = id
for {
_, err = c.client.Wait(ctx, req)
if err == nil {
break
} else {
log.Printf("grpc error: wait(): code: %v: %s", grpc.Code(err), err)
}
switch grpc.Code(err) {
case
codes.Aborted,
codes.DataLoss,
codes.DeadlineExceeded,
codes.Internal,
codes.Unavailable:
// non-fatal errors
default:
return err
}
<-time.After(backoff)
}
return nil
}
// Init signals the pipeline is initialized.
func (c *client) Init(ctx context.Context, id string, state State) (err error) {
req := new(proto.InitRequest)
req.Id = id
req.State = new(proto.State)
req.State.Error = state.Error
req.State.ExitCode = int32(state.ExitCode)
req.State.Exited = state.Exited
req.State.Finished = state.Finished
req.State.Started = state.Started
req.State.Name = state.Proc
for {
_, err = c.client.Init(ctx, req)
if err == nil {
break
} else {
log.Printf("grpc error: init(): code: %v: %s", grpc.Code(err), err)
}
switch grpc.Code(err) {
case
codes.Aborted,
codes.DataLoss,
codes.DeadlineExceeded,
codes.Internal,
codes.Unavailable:
// non-fatal errors
default:
return err
}
<-time.After(backoff)
}
return nil
}
// Done signals the pipeline is complete.
func (c *client) Done(ctx context.Context, id string, state State) (err error) {
req := new(proto.DoneRequest)
req.Id = id
req.State = new(proto.State)
req.State.Error = state.Error
req.State.ExitCode = int32(state.ExitCode)
req.State.Exited = state.Exited
req.State.Finished = state.Finished
req.State.Started = state.Started
req.State.Name = state.Proc
for {
_, err = c.client.Done(ctx, req)
if err == nil {
break
} else {
log.Printf("grpc error: done(): code: %v: %s", grpc.Code(err), err)
}
switch grpc.Code(err) {
case
codes.Aborted,
codes.DataLoss,
codes.DeadlineExceeded,
codes.Internal,
codes.Unavailable:
// non-fatal errors
default:
return err
}
<-time.After(backoff)
}
return nil
}
// Extend extends the pipeline deadline
func (c *client) Extend(ctx context.Context, id string) (err error) {
req := new(proto.ExtendRequest)
req.Id = id
for {
_, err = c.client.Extend(ctx, req)
if err == nil {
break
} else {
log.Printf("grpc error: extend(): code: %v: %s", grpc.Code(err), err)
}
switch grpc.Code(err) {
case
codes.Aborted,
codes.DataLoss,
codes.DeadlineExceeded,
codes.Internal,
codes.Unavailable:
// non-fatal errors
default:
return err
}
<-time.After(backoff)
}
return nil
}
// Update updates the pipeline state.
func (c *client) Update(ctx context.Context, id string, state State) (err error) {
req := new(proto.UpdateRequest)
req.Id = id
req.State = new(proto.State)
req.State.Error = state.Error
req.State.ExitCode = int32(state.ExitCode)
req.State.Exited = state.Exited
req.State.Finished = state.Finished
req.State.Started = state.Started
req.State.Name = state.Proc
for {
_, err = c.client.Update(ctx, req)
if err == nil {
break
} else {
log.Printf("grpc error: update(): code: %v: %s", grpc.Code(err), err)
}
switch grpc.Code(err) {
case
codes.Aborted,
codes.DataLoss,
codes.DeadlineExceeded,
codes.Internal,
codes.Unavailable:
// non-fatal errors
default:
return err
}
<-time.After(backoff)
}
return nil
}
// Upload uploads the pipeline artifact.
func (c *client) Upload(ctx context.Context, id string, file *File) (err error) {
req := new(proto.UploadRequest)
req.Id = id
req.File = new(proto.File)
req.File.Name = file.Name
req.File.Mime = file.Mime
req.File.Proc = file.Proc
req.File.Size = int32(file.Size)
req.File.Time = file.Time
req.File.Data = file.Data
req.File.Meta = file.Meta
for {
_, err = c.client.Upload(ctx, req)
if err == nil {
break
} else {
log.Printf("grpc error: upload(): code: %v: %s", grpc.Code(err), err)
}
switch grpc.Code(err) {
case
codes.Aborted,
codes.DataLoss,
codes.DeadlineExceeded,
codes.Internal,
codes.Unavailable:
// non-fatal errors
default:
return err
}
<-time.After(backoff)
}
return nil
}
// Log writes the pipeline log entry.
func (c *client) Log(ctx context.Context, id string, line *Line) (err error) {
req := new(proto.LogRequest)
req.Id = id
req.Line = new(proto.Line)
req.Line.Out = line.Out
req.Line.Pos = int32(line.Pos)
req.Line.Proc = line.Proc
req.Line.Time = line.Time
for {
_, err = c.client.Log(ctx, req)
if err == nil {
break
} else {
log.Printf("grpc error: log(): code: %v: %s", grpc.Code(err), err)
}
switch grpc.Code(err) {
case
codes.Aborted,
codes.DataLoss,
codes.DeadlineExceeded,
codes.Internal,
codes.Unavailable:
// non-fatal errors
default:
return err
}
<-time.After(backoff)
}
return nil
}

View File

@@ -0,0 +1,61 @@
package rpc
import (
"context"
// "encoding/json"
"time"
// "github.com/woodpecker-ci/woodpecker/pipeline/backend"
"github.com/woodpecker-ci/woodpecker/pipeline/rpc/proto"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
)
// generate protobuffs
// protoc --go_out=plugins=grpc,import_path=proto:. *.proto
type healthClient struct {
client proto.HealthClient
conn *grpc.ClientConn
}
// NewGrpcHealthClient returns a new grpc Client.
func NewGrpcHealthClient(conn *grpc.ClientConn) Health {
client := new(healthClient)
client.client = proto.NewHealthClient(conn)
client.conn = conn
return client
}
func (c *healthClient) Close() error {
return c.conn.Close()
}
func (c *healthClient) Check(ctx context.Context) (bool, error) {
var res *proto.HealthCheckResponse
var err error
req := new(proto.HealthCheckRequest)
for {
res, err = c.client.Check(ctx, req)
if err == nil {
if res.GetStatus() == proto.HealthCheckResponse_SERVING {
return true, nil
}
return false, nil
}
switch grpc.Code(err) {
case
codes.Aborted,
codes.DataLoss,
codes.DeadlineExceeded,
codes.Internal,
codes.Unavailable:
// non-fatal errors
default:
return false, err
}
<-time.After(backoff)
}
}

11
pipeline/rpc/health.go Normal file
View File

@@ -0,0 +1,11 @@
package rpc
import (
"context"
)
// Health defines a health-check connection.
type Health interface {
// Check returns if server is healthy or not
Check(c context.Context) (bool, error)
}

107
pipeline/rpc/line.go Normal file
View File

@@ -0,0 +1,107 @@
package rpc
import (
"context"
"fmt"
"strings"
"time"
)
// Identifies the type of line in the logs.
const (
LineStdout int = iota
LineStderr
LineExitCode
LineMetadata
LineProgress
)
// Line is a line of console output.
type Line struct {
Proc string `json:"proc,omitempty"`
Time int64 `json:"time,omitempty"`
Type int `json:"type,omitempty"`
Pos int `json:"pos,omityempty"`
Out string `json:"out,omitempty"`
}
func (l *Line) String() string {
switch l.Type {
case LineExitCode:
return fmt.Sprintf("[%s] exit code %s", l.Proc, l.Out)
default:
return fmt.Sprintf("[%s:L%v:%vs] %s", l.Proc, l.Pos, l.Time, l.Out)
}
}
// LineWriter sends logs to the client.
type LineWriter struct {
peer Peer
id string
name string
num int
now time.Time
rep *strings.Replacer
lines []*Line
}
// NewLineWriter returns a new line reader.
func NewLineWriter(peer Peer, id, name string, secret ...string) *LineWriter {
w := new(LineWriter)
w.peer = peer
w.id = id
w.name = name
w.num = 0
w.now = time.Now().UTC()
var oldnew []string
for _, old := range secret {
oldnew = append(oldnew, old)
oldnew = append(oldnew, "********")
}
if len(oldnew) != 0 {
w.rep = strings.NewReplacer(oldnew...)
}
return w
}
func (w *LineWriter) Write(p []byte) (n int, err error) {
out := string(p)
if w.rep != nil {
out = w.rep.Replace(out)
}
line := &Line{
Out: out,
Proc: w.name,
Pos: w.num,
Time: int64(time.Since(w.now).Seconds()),
Type: LineStdout,
}
w.peer.Log(context.Background(), w.id, line)
w.num++
// for _, part := range bytes.Split(p, []byte{'\n'}) {
// line := &Line{
// Out: string(part),
// Proc: w.name,
// Pos: w.num,
// Time: int64(time.Since(w.now).Seconds()),
// Type: LineStdout,
// }
// w.peer.Log(context.Background(), w.id, line)
// w.num++
// }
w.lines = append(w.lines, line)
return len(p), nil
}
// Lines returns the line history
func (w *LineWriter) Lines() []*Line {
return w.lines
}
// Clear clears the line history
func (w *LineWriter) Clear() {
w.lines = w.lines[:0]
}

18
pipeline/rpc/line_test.go Normal file
View File

@@ -0,0 +1,18 @@
package rpc
import (
"testing"
)
func TestLine(t *testing.T) {
line := Line{
Proc: "redis",
Time: 60,
Pos: 1,
Out: "starting redis server",
}
got, want := line.String(), "[redis:L1:60s] starting redis server"
if got != want {
t.Errorf("Wanted line string %q, got %q", want, got)
}
}

76
pipeline/rpc/peer.go Normal file
View File

@@ -0,0 +1,76 @@
package rpc
import (
"context"
"github.com/woodpecker-ci/woodpecker/pipeline/backend"
)
// ErrCancelled signals the pipeine is cancelled.
// var ErrCancelled = errors.New("cancelled")
type (
// Filter defines filters for fetching items from the queue.
Filter struct {
Labels map[string]string `json:"labels"`
Expr string `json:"expr"`
}
// State defines the pipeline state.
State struct {
Proc string `json:"proc"`
Exited bool `json:"exited"`
ExitCode int `json:"exit_code"`
Started int64 `json:"started"`
Finished int64 `json:"finished"`
Error string `json:"error"`
}
// Pipeline defines the pipeline execution details.
Pipeline struct {
ID string `json:"id"`
Config *backend.Config `json:"config"`
Timeout int64 `json:"timeout"`
}
// File defines a pipeline artifact.
File struct {
Name string `json:"name"`
Proc string `json:"proc"`
Mime string `json:"mime"`
Time int64 `json:"time"`
Size int `json:"size"`
Data []byte `json:"data"`
Meta map[string]string `json:"meta"`
}
)
// NoFilter is an empty filter.
var NoFilter = Filter{}
// Peer defines a peer-to-peer connection.
type Peer interface {
// Next returns the next pipeline in the queue.
Next(c context.Context, f Filter) (*Pipeline, error)
// Wait blocks until the pipeline is complete.
Wait(c context.Context, id string) error
// Init signals the pipeline is initialized.
Init(c context.Context, id string, state State) error
// Done signals the pipeline is complete.
Done(c context.Context, id string, state State) error
// Extend extends the pipeline deadline
Extend(c context.Context, id string) error
// Update updates the pipeline state.
Update(c context.Context, id string, state State) error
// Upload uploads the pipeline artifact.
Upload(c context.Context, id string, file *File) error
// Log writes the pipeline log entry.
Log(c context.Context, id string, line *Line) error
}

View File

@@ -0,0 +1,958 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: drone.proto
/*
Package proto is a generated protocol buffer package.
It is generated from these files:
drone.proto
It has these top-level messages:
File
State
Line
Filter
Pipeline
HealthCheckRequest
HealthCheckResponse
NextRequest
NextReply
InitRequest
WaitRequest
DoneRequest
ExtendRequest
UploadRequest
UpdateRequest
LogRequest
Empty
*/
package proto
import proto1 "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto1.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto1.ProtoPackageIsVersion2 // please upgrade the proto package
type HealthCheckResponse_ServingStatus int32
const (
HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0
HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1
HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2
)
var HealthCheckResponse_ServingStatus_name = map[int32]string{
0: "UNKNOWN",
1: "SERVING",
2: "NOT_SERVING",
}
var HealthCheckResponse_ServingStatus_value = map[string]int32{
"UNKNOWN": 0,
"SERVING": 1,
"NOT_SERVING": 2,
}
func (x HealthCheckResponse_ServingStatus) String() string {
return proto1.EnumName(HealthCheckResponse_ServingStatus_name, int32(x))
}
func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) {
return fileDescriptor0, []int{6, 0}
}
type File struct {
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
Proc string `protobuf:"bytes,2,opt,name=proc" json:"proc,omitempty"`
Mime string `protobuf:"bytes,3,opt,name=mime" json:"mime,omitempty"`
Time int64 `protobuf:"varint,4,opt,name=time" json:"time,omitempty"`
Size int32 `protobuf:"varint,5,opt,name=size" json:"size,omitempty"`
Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
Meta map[string]string `protobuf:"bytes,7,rep,name=meta" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}
func (m *File) Reset() { *m = File{} }
func (m *File) String() string { return proto1.CompactTextString(m) }
func (*File) ProtoMessage() {}
func (*File) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *File) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *File) GetProc() string {
if m != nil {
return m.Proc
}
return ""
}
func (m *File) GetMime() string {
if m != nil {
return m.Mime
}
return ""
}
func (m *File) GetTime() int64 {
if m != nil {
return m.Time
}
return 0
}
func (m *File) GetSize() int32 {
if m != nil {
return m.Size
}
return 0
}
func (m *File) GetData() []byte {
if m != nil {
return m.Data
}
return nil
}
func (m *File) GetMeta() map[string]string {
if m != nil {
return m.Meta
}
return nil
}
type State struct {
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
Exited bool `protobuf:"varint,2,opt,name=exited" json:"exited,omitempty"`
ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode" json:"exit_code,omitempty"`
Started int64 `protobuf:"varint,4,opt,name=started" json:"started,omitempty"`
Finished int64 `protobuf:"varint,5,opt,name=finished" json:"finished,omitempty"`
Error string `protobuf:"bytes,6,opt,name=error" json:"error,omitempty"`
}
func (m *State) Reset() { *m = State{} }
func (m *State) String() string { return proto1.CompactTextString(m) }
func (*State) ProtoMessage() {}
func (*State) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *State) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *State) GetExited() bool {
if m != nil {
return m.Exited
}
return false
}
func (m *State) GetExitCode() int32 {
if m != nil {
return m.ExitCode
}
return 0
}
func (m *State) GetStarted() int64 {
if m != nil {
return m.Started
}
return 0
}
func (m *State) GetFinished() int64 {
if m != nil {
return m.Finished
}
return 0
}
func (m *State) GetError() string {
if m != nil {
return m.Error
}
return ""
}
type Line struct {
Proc string `protobuf:"bytes,1,opt,name=proc" json:"proc,omitempty"`
Time int64 `protobuf:"varint,2,opt,name=time" json:"time,omitempty"`
Pos int32 `protobuf:"varint,3,opt,name=pos" json:"pos,omitempty"`
Out string `protobuf:"bytes,4,opt,name=out" json:"out,omitempty"`
}
func (m *Line) Reset() { *m = Line{} }
func (m *Line) String() string { return proto1.CompactTextString(m) }
func (*Line) ProtoMessage() {}
func (*Line) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *Line) GetProc() string {
if m != nil {
return m.Proc
}
return ""
}
func (m *Line) GetTime() int64 {
if m != nil {
return m.Time
}
return 0
}
func (m *Line) GetPos() int32 {
if m != nil {
return m.Pos
}
return 0
}
func (m *Line) GetOut() string {
if m != nil {
return m.Out
}
return ""
}
type Filter struct {
Labels map[string]string `protobuf:"bytes,1,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
Expr string `protobuf:"bytes,2,opt,name=expr" json:"expr,omitempty"`
}
func (m *Filter) Reset() { *m = Filter{} }
func (m *Filter) String() string { return proto1.CompactTextString(m) }
func (*Filter) ProtoMessage() {}
func (*Filter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *Filter) GetLabels() map[string]string {
if m != nil {
return m.Labels
}
return nil
}
func (m *Filter) GetExpr() string {
if m != nil {
return m.Expr
}
return ""
}
type Pipeline struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Timeout int64 `protobuf:"varint,2,opt,name=timeout" json:"timeout,omitempty"`
Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
}
func (m *Pipeline) Reset() { *m = Pipeline{} }
func (m *Pipeline) String() string { return proto1.CompactTextString(m) }
func (*Pipeline) ProtoMessage() {}
func (*Pipeline) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
func (m *Pipeline) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *Pipeline) GetTimeout() int64 {
if m != nil {
return m.Timeout
}
return 0
}
func (m *Pipeline) GetPayload() []byte {
if m != nil {
return m.Payload
}
return nil
}
type HealthCheckRequest struct {
Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"`
}
func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} }
func (m *HealthCheckRequest) String() string { return proto1.CompactTextString(m) }
func (*HealthCheckRequest) ProtoMessage() {}
func (*HealthCheckRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
func (m *HealthCheckRequest) GetService() string {
if m != nil {
return m.Service
}
return ""
}
type HealthCheckResponse struct {
Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,enum=proto.HealthCheckResponse_ServingStatus" json:"status,omitempty"`
}
func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} }
func (m *HealthCheckResponse) String() string { return proto1.CompactTextString(m) }
func (*HealthCheckResponse) ProtoMessage() {}
func (*HealthCheckResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
func (m *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus {
if m != nil {
return m.Status
}
return HealthCheckResponse_UNKNOWN
}
type NextRequest struct {
Filter *Filter `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"`
}
func (m *NextRequest) Reset() { *m = NextRequest{} }
func (m *NextRequest) String() string { return proto1.CompactTextString(m) }
func (*NextRequest) ProtoMessage() {}
func (*NextRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
func (m *NextRequest) GetFilter() *Filter {
if m != nil {
return m.Filter
}
return nil
}
type NextReply struct {
Pipeline *Pipeline `protobuf:"bytes,1,opt,name=pipeline" json:"pipeline,omitempty"`
}
func (m *NextReply) Reset() { *m = NextReply{} }
func (m *NextReply) String() string { return proto1.CompactTextString(m) }
func (*NextReply) ProtoMessage() {}
func (*NextReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
func (m *NextReply) GetPipeline() *Pipeline {
if m != nil {
return m.Pipeline
}
return nil
}
type InitRequest struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
State *State `protobuf:"bytes,2,opt,name=state" json:"state,omitempty"`
}
func (m *InitRequest) Reset() { *m = InitRequest{} }
func (m *InitRequest) String() string { return proto1.CompactTextString(m) }
func (*InitRequest) ProtoMessage() {}
func (*InitRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} }
func (m *InitRequest) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *InitRequest) GetState() *State {
if m != nil {
return m.State
}
return nil
}
type WaitRequest struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
}
func (m *WaitRequest) Reset() { *m = WaitRequest{} }
func (m *WaitRequest) String() string { return proto1.CompactTextString(m) }
func (*WaitRequest) ProtoMessage() {}
func (*WaitRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} }
func (m *WaitRequest) GetId() string {
if m != nil {
return m.Id
}
return ""
}
type DoneRequest struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
State *State `protobuf:"bytes,2,opt,name=state" json:"state,omitempty"`
}
func (m *DoneRequest) Reset() { *m = DoneRequest{} }
func (m *DoneRequest) String() string { return proto1.CompactTextString(m) }
func (*DoneRequest) ProtoMessage() {}
func (*DoneRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} }
func (m *DoneRequest) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *DoneRequest) GetState() *State {
if m != nil {
return m.State
}
return nil
}
type ExtendRequest struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
}
func (m *ExtendRequest) Reset() { *m = ExtendRequest{} }
func (m *ExtendRequest) String() string { return proto1.CompactTextString(m) }
func (*ExtendRequest) ProtoMessage() {}
func (*ExtendRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} }
func (m *ExtendRequest) GetId() string {
if m != nil {
return m.Id
}
return ""
}
type UploadRequest struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
File *File `protobuf:"bytes,2,opt,name=file" json:"file,omitempty"`
}
func (m *UploadRequest) Reset() { *m = UploadRequest{} }
func (m *UploadRequest) String() string { return proto1.CompactTextString(m) }
func (*UploadRequest) ProtoMessage() {}
func (*UploadRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} }
func (m *UploadRequest) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *UploadRequest) GetFile() *File {
if m != nil {
return m.File
}
return nil
}
type UpdateRequest struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
State *State `protobuf:"bytes,2,opt,name=state" json:"state,omitempty"`
}
func (m *UpdateRequest) Reset() { *m = UpdateRequest{} }
func (m *UpdateRequest) String() string { return proto1.CompactTextString(m) }
func (*UpdateRequest) ProtoMessage() {}
func (*UpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} }
func (m *UpdateRequest) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *UpdateRequest) GetState() *State {
if m != nil {
return m.State
}
return nil
}
type LogRequest struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Line *Line `protobuf:"bytes,2,opt,name=line" json:"line,omitempty"`
}
func (m *LogRequest) Reset() { *m = LogRequest{} }
func (m *LogRequest) String() string { return proto1.CompactTextString(m) }
func (*LogRequest) ProtoMessage() {}
func (*LogRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} }
func (m *LogRequest) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *LogRequest) GetLine() *Line {
if m != nil {
return m.Line
}
return nil
}
type Empty struct {
}
func (m *Empty) Reset() { *m = Empty{} }
func (m *Empty) String() string { return proto1.CompactTextString(m) }
func (*Empty) ProtoMessage() {}
func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} }
func init() {
proto1.RegisterType((*File)(nil), "proto.File")
proto1.RegisterType((*State)(nil), "proto.State")
proto1.RegisterType((*Line)(nil), "proto.Line")
proto1.RegisterType((*Filter)(nil), "proto.Filter")
proto1.RegisterType((*Pipeline)(nil), "proto.Pipeline")
proto1.RegisterType((*HealthCheckRequest)(nil), "proto.HealthCheckRequest")
proto1.RegisterType((*HealthCheckResponse)(nil), "proto.HealthCheckResponse")
proto1.RegisterType((*NextRequest)(nil), "proto.NextRequest")
proto1.RegisterType((*NextReply)(nil), "proto.NextReply")
proto1.RegisterType((*InitRequest)(nil), "proto.InitRequest")
proto1.RegisterType((*WaitRequest)(nil), "proto.WaitRequest")
proto1.RegisterType((*DoneRequest)(nil), "proto.DoneRequest")
proto1.RegisterType((*ExtendRequest)(nil), "proto.ExtendRequest")
proto1.RegisterType((*UploadRequest)(nil), "proto.UploadRequest")
proto1.RegisterType((*UpdateRequest)(nil), "proto.UpdateRequest")
proto1.RegisterType((*LogRequest)(nil), "proto.LogRequest")
proto1.RegisterType((*Empty)(nil), "proto.Empty")
proto1.RegisterEnum("proto.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for Drone service
type DroneClient interface {
Next(ctx context.Context, in *NextRequest, opts ...grpc.CallOption) (*NextReply, error)
Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*Empty, error)
Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*Empty, error)
Done(ctx context.Context, in *DoneRequest, opts ...grpc.CallOption) (*Empty, error)
Extend(ctx context.Context, in *ExtendRequest, opts ...grpc.CallOption) (*Empty, error)
Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*Empty, error)
Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*Empty, error)
Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*Empty, error)
}
type droneClient struct {
cc *grpc.ClientConn
}
func NewDroneClient(cc *grpc.ClientConn) DroneClient {
return &droneClient{cc}
}
func (c *droneClient) Next(ctx context.Context, in *NextRequest, opts ...grpc.CallOption) (*NextReply, error) {
out := new(NextReply)
err := grpc.Invoke(ctx, "/proto.Drone/Next", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *droneClient) Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := grpc.Invoke(ctx, "/proto.Drone/Init", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *droneClient) Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := grpc.Invoke(ctx, "/proto.Drone/Wait", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *droneClient) Done(ctx context.Context, in *DoneRequest, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := grpc.Invoke(ctx, "/proto.Drone/Done", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *droneClient) Extend(ctx context.Context, in *ExtendRequest, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := grpc.Invoke(ctx, "/proto.Drone/Extend", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *droneClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := grpc.Invoke(ctx, "/proto.Drone/Update", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *droneClient) Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := grpc.Invoke(ctx, "/proto.Drone/Upload", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *droneClient) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := grpc.Invoke(ctx, "/proto.Drone/Log", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Drone service
type DroneServer interface {
Next(context.Context, *NextRequest) (*NextReply, error)
Init(context.Context, *InitRequest) (*Empty, error)
Wait(context.Context, *WaitRequest) (*Empty, error)
Done(context.Context, *DoneRequest) (*Empty, error)
Extend(context.Context, *ExtendRequest) (*Empty, error)
Update(context.Context, *UpdateRequest) (*Empty, error)
Upload(context.Context, *UploadRequest) (*Empty, error)
Log(context.Context, *LogRequest) (*Empty, error)
}
func RegisterDroneServer(s *grpc.Server, srv DroneServer) {
s.RegisterService(&_Drone_serviceDesc, srv)
}
func _Drone_Next_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(NextRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DroneServer).Next(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.Drone/Next",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DroneServer).Next(ctx, req.(*NextRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Drone_Init_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InitRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DroneServer).Init(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.Drone/Init",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DroneServer).Init(ctx, req.(*InitRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Drone_Wait_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(WaitRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DroneServer).Wait(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.Drone/Wait",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DroneServer).Wait(ctx, req.(*WaitRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Drone_Done_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DoneRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DroneServer).Done(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.Drone/Done",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DroneServer).Done(ctx, req.(*DoneRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Drone_Extend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ExtendRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DroneServer).Extend(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.Drone/Extend",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DroneServer).Extend(ctx, req.(*ExtendRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Drone_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DroneServer).Update(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.Drone/Update",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DroneServer).Update(ctx, req.(*UpdateRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Drone_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UploadRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DroneServer).Upload(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.Drone/Upload",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DroneServer).Upload(ctx, req.(*UploadRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Drone_Log_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LogRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DroneServer).Log(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.Drone/Log",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DroneServer).Log(ctx, req.(*LogRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Drone_serviceDesc = grpc.ServiceDesc{
ServiceName: "proto.Drone",
HandlerType: (*DroneServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Next",
Handler: _Drone_Next_Handler,
},
{
MethodName: "Init",
Handler: _Drone_Init_Handler,
},
{
MethodName: "Wait",
Handler: _Drone_Wait_Handler,
},
{
MethodName: "Done",
Handler: _Drone_Done_Handler,
},
{
MethodName: "Extend",
Handler: _Drone_Extend_Handler,
},
{
MethodName: "Update",
Handler: _Drone_Update_Handler,
},
{
MethodName: "Upload",
Handler: _Drone_Upload_Handler,
},
{
MethodName: "Log",
Handler: _Drone_Log_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "drone.proto",
}
// Client API for Health service
type HealthClient interface {
Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
}
type healthClient struct {
cc *grpc.ClientConn
}
func NewHealthClient(cc *grpc.ClientConn) HealthClient {
return &healthClient{cc}
}
func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
out := new(HealthCheckResponse)
err := grpc.Invoke(ctx, "/proto.Health/Check", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Health service
type HealthServer interface {
Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
}
func RegisterHealthServer(s *grpc.Server, srv HealthServer) {
s.RegisterService(&_Health_serviceDesc, srv)
}
func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(HealthCheckRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HealthServer).Check(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.Health/Check",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Health_serviceDesc = grpc.ServiceDesc{
ServiceName: "proto.Health",
HandlerType: (*HealthServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Check",
Handler: _Health_Check_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "drone.proto",
}
func init() { proto1.RegisterFile("drone.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 780 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x5f, 0x4f, 0xd3, 0x50,
0x14, 0xa7, 0x5b, 0xdb, 0x6d, 0xa7, 0x0c, 0xe6, 0x15, 0x4d, 0x99, 0x31, 0x2c, 0x4d, 0x4c, 0xa6,
0x26, 0x4d, 0x9c, 0x26, 0x22, 0x89, 0x06, 0x03, 0x43, 0x88, 0x73, 0x98, 0x3b, 0x91, 0x47, 0x52,
0xd6, 0x0b, 0x34, 0x74, 0x6d, 0x6d, 0xef, 0xc8, 0xe6, 0x47, 0xf0, 0xd5, 0x57, 0x3f, 0x9d, 0xdf,
0xc1, 0x77, 0x73, 0xee, 0x6d, 0x4b, 0x07, 0x9b, 0x89, 0xe1, 0xa9, 0xe7, 0xcf, 0xef, 0xdc, 0x73,
0xce, 0xef, 0xd7, 0x7b, 0xc1, 0x70, 0xe3, 0x30, 0x60, 0x76, 0x14, 0x87, 0x3c, 0x24, 0x9a, 0xf8,
0x58, 0xbf, 0x15, 0x50, 0xf7, 0x3c, 0x9f, 0x11, 0x02, 0x6a, 0xe0, 0x8c, 0x98, 0xa9, 0xb4, 0x94,
0x76, 0x8d, 0x0a, 0x1b, 0x63, 0x51, 0x1c, 0x0e, 0xcd, 0x92, 0x8c, 0xa1, 0x8d, 0xb1, 0x91, 0x37,
0x62, 0x66, 0x59, 0xc6, 0xd0, 0xc6, 0x18, 0xc7, 0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xb7, 0x1c, 0x5b, 0x10, 0x71, 0x1e, 0x16, 0x45, 0xcc, 0xb1, 0x05, 0x45, 0x6f, 0x61, 0x6d, 0xd0,
0xa5, 0x5a, 0x64, 0x2d, 0xcb, 0x14, 0xc5, 0x9b, 0x87, 0x97, 0xd4, 0xe7, 0xf8, 0x19, 0x25, 0xe6,
0xe3, 0x51, 0xec, 0x02, 0xbe, 0xa0, 0xfd, 0x2d, 0x7c, 0x1b, 0xca, 0xbd, 0xf0, 0x9c, 0xdc, 0xcb,
0x08, 0xcf, 0x15, 0xba, 0x89, 0xec, 0xec, 0x83, 0x2e, 0x6f, 0x39, 0x79, 0x07, 0x9a, 0xb8, 0xe9,
0x64, 0x7d, 0xde, 0xed, 0x97, 0xd5, 0xcd, 0xc5, 0x0f, 0xc3, 0xa9, 0x2e, 0x52, 0x2f, 0xff, 0x06,
0x00, 0x00, 0xff, 0xff, 0x59, 0x78, 0xda, 0x5d, 0x5e, 0x07, 0x00, 0x00,
}

View File

@@ -0,0 +1,117 @@
syntax = "proto3";
package proto;
message File {
string name = 1;
string proc = 2;
string mime = 3;
int64 time = 4;
int32 size = 5;
bytes data = 6;
map<string, string> meta = 7;
}
message State {
string name = 1;
bool exited = 2;
int32 exit_code = 3;
int64 started = 4;
int64 finished = 5;
string error = 6;
}
message Line {
string proc = 1;
int64 time = 2;
int32 pos = 3;
string out = 4;
}
message Filter {
map<string, string> labels = 1;
string expr = 2;
}
message Pipeline {
string id = 1;
int64 timeout = 2;
bytes payload = 3;
}
message HealthCheckRequest {
string service = 1;
}
message HealthCheckResponse {
enum ServingStatus {
UNKNOWN = 0;
SERVING = 1;
NOT_SERVING = 2;
}
ServingStatus status = 1;
}
service Drone {
rpc Next (NextRequest) returns (NextReply) {}
rpc Init (InitRequest) returns (Empty) {}
rpc Wait (WaitRequest) returns (Empty) {}
rpc Done (DoneRequest) returns (Empty) {}
rpc Extend (ExtendRequest) returns (Empty) {}
rpc Update (UpdateRequest) returns (Empty) {}
rpc Upload (UploadRequest) returns (Empty) {}
rpc Log (LogRequest) returns (Empty) {}
}
service Health {
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
}
//
// next
//
message NextRequest {
Filter filter = 1;
}
message NextReply {
Pipeline pipeline = 1;
}
message InitRequest {
string id = 1;
State state = 2;
}
message WaitRequest {
string id = 1;
}
message DoneRequest {
string id = 1;
State state = 2;
}
message ExtendRequest {
string id = 1;
}
message UploadRequest {
string id = 1;
File file = 2;
}
message UpdateRequest {
string id = 1;
State state = 2;
}
message LogRequest {
string id = 1;
Line line = 2;
}
message Empty {
}