diff --git a/Makefile b/Makefile index 45efb0ecf..d00c057ba 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,6 @@ proto-gen: protoc protos/target/target.proto --go_out=plugins=grpc:$(GOPATH)/src protoc protos/workflow/workflow.proto --go_out=plugins=grpc:$(GOPATH)/src protoc protos/hardware/hardware.proto --go_out=plugins=grpc:$(GOPATH)/src - protoc -I$(GOPATH)/src --go_out=plugins=grpc:$(GOPATH)/src $(GOPATH)/src/github.com/packethost/rover/protos/rover/rover.proto run: ${binaries} docker-compose up -d --build db diff --git a/db/workflow.go b/db/workflow.go index 397e7c0a8..b99b5f69d 100644 --- a/db/workflow.go +++ b/db/workflow.go @@ -11,8 +11,7 @@ import ( "github.com/docker/distribution/reference" "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/timestamp" - pb "github.com/packethost/rover/protos/rover" - workflowpb "github.com/packethost/rover/protos/workflow" + pb "github.com/packethost/rover/protos/workflow" "github.com/pkg/errors" uuid "github.com/satori/go.uuid" "gopkg.in/yaml.v2" @@ -367,7 +366,7 @@ func UpdateWorkflow(ctx context.Context, db *sql.DB, wf Workflow, state int32) e return nil } -func UpdateWorkflowState(ctx context.Context, db *sql.DB, wfContext *workflowpb.WorkflowContext) error { +func UpdateWorkflowState(ctx context.Context, db *sql.DB, wfContext *pb.WorkflowContext) error { tx, err := db.BeginTx(ctx, &sql.TxOptions{Isolation: sql.LevelSerializable}) if err != nil { return errors.Wrap(err, "BEGIN transaction") @@ -393,7 +392,7 @@ func UpdateWorkflowState(ctx context.Context, db *sql.DB, wfContext *workflowpb. return nil } -func GetWorkflowContexts(ctx context.Context, db *sql.DB, wfId string) (*workflowpb.WorkflowContext, error) { +func GetWorkflowContexts(ctx context.Context, db *sql.DB, wfId string) (*pb.WorkflowContext, error) { query := ` SELECT current_worker, current_task_name, current_action_name, current_action_index, current_action_state, total_number_of_actions FROM workflow_state @@ -403,10 +402,10 @@ func GetWorkflowContexts(ctx context.Context, db *sql.DB, wfId string) (*workflo row := db.QueryRowContext(ctx, query, wfId) var cw, ct, ca string var cai, tact int64 - var cas workflowpb.ActionState + var cas pb.ActionState err := row.Scan(&cw, &ct, &ca, &cai, &cas, &tact) if err == nil { - return &workflowpb.WorkflowContext{ + return &pb.WorkflowContext{ WorkflowId: wfId, CurrentWorker: cw, CurrentTask: ct, @@ -421,7 +420,7 @@ func GetWorkflowContexts(ctx context.Context, db *sql.DB, wfId string) (*workflo } else { err = nil } - return &workflowpb.WorkflowContext{}, nil + return &pb.WorkflowContext{}, nil } func GetWorkflowActions(ctx context.Context, db *sql.DB, wfId string) (*pb.WorkflowActionList, error) { @@ -449,7 +448,7 @@ func GetWorkflowActions(ctx context.Context, db *sql.DB, wfId string) (*pb.Workf return &pb.WorkflowActionList{}, nil } -func InsertIntoWorkflowEventTable(ctx context.Context, db *sql.DB, wfEvent *workflowpb.WorkflowActionStatus, time time.Time) error { +func InsertIntoWorkflowEventTable(ctx context.Context, db *sql.DB, wfEvent *pb.WorkflowActionStatus, time time.Time) error { tx, err := db.BeginTx(ctx, &sql.TxOptions{Isolation: sql.LevelSerializable}) if err != nil { return errors.Wrap(err, "BEGIN transaction") @@ -473,7 +472,7 @@ func InsertIntoWorkflowEventTable(ctx context.Context, db *sql.DB, wfEvent *work } // ShowWorkflowEvents returns all workflows -func ShowWorkflowEvents(db *sql.DB, wfId string, fn func(wfs workflowpb.WorkflowActionStatus) error) error { +func ShowWorkflowEvents(db *sql.DB, wfId string, fn func(wfs pb.WorkflowActionStatus) error) error { rows, err := db.Query(` SELECT worker_id, task_name, action_name, execution_time, message, status, created_at FROM workflow_event @@ -503,13 +502,13 @@ func ShowWorkflowEvents(db *sql.DB, wfId string, fn func(wfs workflowpb.Workflow return err } createdAt, _ := ptypes.TimestampProto(evTime) - wfs := workflowpb.WorkflowActionStatus{ + wfs := pb.WorkflowActionStatus{ WorkerId: id, TaskName: tName, ActionName: aName, Seconds: secs, Message: msg, - ActionStatus: workflowpb.ActionState(status), + ActionStatus: pb.ActionState(status), CreatedAt: createdAt, } err = fn(wfs) diff --git a/executor/executor.go b/executor/executor.go index 92c85d4be..5d3b2f13b 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -6,10 +6,8 @@ import ( "fmt" "time" - empty "github.com/golang/protobuf/ptypes/empty" "github.com/packethost/rover/db" - pb "github.com/packethost/rover/protos/rover" - workflowpb "github.com/packethost/rover/protos/workflow" + pb "github.com/packethost/rover/protos/workflow" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -24,7 +22,7 @@ func GetWorkflowContexts(context context.Context, req *pb.WorkflowContextRequest return nil, status.Errorf(codes.InvalidArgument, "Worker not found for any workflows") } - wfContexts := []*workflowpb.WorkflowContext{} + wfContexts := []*pb.WorkflowContext{} for _, wf := range wfs { wfContext, err := db.GetWorkflowContexts(context, sdb, wf) @@ -53,7 +51,7 @@ func GetWorkflowActions(context context.Context, req *pb.WorkflowActionsRequest, } // ReportActionStatus implements rover.ReportActionStatus -func ReportActionStatus(context context.Context, req *workflowpb.WorkflowActionStatus, sdb *sql.DB) (*empty.Empty, error) { +func ReportActionStatus(context context.Context, req *pb.WorkflowActionStatus, sdb *sql.DB) (*pb.Empty, error) { wfID := req.GetWorkflowId() if len(wfID) == 0 { return nil, status.Errorf(codes.InvalidArgument, "workflow_id is invalid") @@ -77,7 +75,7 @@ func ReportActionStatus(context context.Context, req *workflowpb.WorkflowActionS // We need bunch of checks here considering // Considering concurrency and network latencies & accuracy for proceeding of WF actionIndex := wfContext.GetCurrentActionIndex() - if req.GetActionStatus() == workflowpb.ActionState_ACTION_IN_PROGRESS { + if req.GetActionStatus() == pb.ActionState_ACTION_IN_PROGRESS { if wfContext.GetCurrentAction() != "" { actionIndex = actionIndex + 1 } @@ -96,14 +94,14 @@ func ReportActionStatus(context context.Context, req *workflowpb.WorkflowActionS wfContext.CurrentActionIndex = actionIndex err = db.UpdateWorkflowState(context, sdb, wfContext) if err != nil { - return &empty.Empty{}, fmt.Errorf("Failed to update the workflow_state table. Error : %s", err) + return &pb.Empty{}, fmt.Errorf("Failed to update the workflow_state table. Error : %s", err) } // TODO the below "time" would be a part of the request which is coming form worker. time := time.Now() err = db.InsertIntoWorkflowEventTable(context, sdb, req, time) if err != nil { - return &empty.Empty{}, fmt.Errorf("Failed to update the workflow_event table. Error : %s", err) + return &pb.Empty{}, fmt.Errorf("Failed to update the workflow_event table. Error : %s", err) } fmt.Printf("Current context %s\n", wfContext) - return &empty.Empty{}, nil + return &pb.Empty{}, nil } diff --git a/grpc-server/grpc-server.go b/grpc-server/grpc-server.go index d9fe96678..bb0be229d 100644 --- a/grpc-server/grpc-server.go +++ b/grpc-server/grpc-server.go @@ -16,7 +16,6 @@ import ( "github.com/packethost/rover/db" "github.com/packethost/rover/metrics" "github.com/packethost/rover/protos/hardware" - "github.com/packethost/rover/protos/rover" "github.com/packethost/rover/protos/target" "github.com/packethost/rover/protos/template" "github.com/packethost/rover/protos/workflow" @@ -74,7 +73,6 @@ func SetupGRPC(ctx context.Context, log log.Logger, facility string, errCh chan< target.RegisterTargetServer(s, server) workflow.RegisterWorkflowSvcServer(s, server) hardware.RegisterHardwareServiceServer(s, server) - rover.RegisterRoverServer(s, server) grpc_prometheus.Register(s) diff --git a/grpc-server/rover.go b/grpc-server/rover.go index bdc3a53ae..b2c76ae99 100644 --- a/grpc-server/rover.go +++ b/grpc-server/rover.go @@ -3,10 +3,8 @@ package grpcserver import ( "context" - "github.com/golang/protobuf/ptypes/empty" exec "github.com/packethost/rover/executor" - pb "github.com/packethost/rover/protos/rover" - workflowpb "github.com/packethost/rover/protos/workflow" + pb "github.com/packethost/rover/protos/workflow" ) // GetWorkflowContexts implements rover.GetWorkflowContexts @@ -20,6 +18,6 @@ func (s *server) GetWorkflowActions(context context.Context, req *pb.WorkflowAct } // ReportActionStatus implements rover.ReportActionStatus -func (s *server) ReportActionStatus(context context.Context, req *workflowpb.WorkflowActionStatus) (*empty.Empty, error) { +func (s *server) ReportActionStatus(context context.Context, req *pb.WorkflowActionStatus) (*pb.Empty, error) { return exec.ReportActionStatus(context, req, s.db) } diff --git a/protos/rover/rover.pb.go b/protos/rover/rover.pb.go deleted file mode 100644 index b21ff30a4..000000000 --- a/protos/rover/rover.pb.go +++ /dev/null @@ -1,476 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/packethost/rover/protos/rover/rover.proto - -package rover - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - empty "github.com/golang/protobuf/ptypes/empty" - workflow "github.com/packethost/rover/protos/workflow" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.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 _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type WorkflowContextRequest struct { - WorkerId string `protobuf:"bytes,1,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WorkflowContextRequest) Reset() { *m = WorkflowContextRequest{} } -func (m *WorkflowContextRequest) String() string { return proto.CompactTextString(m) } -func (*WorkflowContextRequest) ProtoMessage() {} -func (*WorkflowContextRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_388c2149c9643233, []int{0} -} - -func (m *WorkflowContextRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WorkflowContextRequest.Unmarshal(m, b) -} -func (m *WorkflowContextRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WorkflowContextRequest.Marshal(b, m, deterministic) -} -func (m *WorkflowContextRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WorkflowContextRequest.Merge(m, src) -} -func (m *WorkflowContextRequest) XXX_Size() int { - return xxx_messageInfo_WorkflowContextRequest.Size(m) -} -func (m *WorkflowContextRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WorkflowContextRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WorkflowContextRequest proto.InternalMessageInfo - -func (m *WorkflowContextRequest) GetWorkerId() string { - if m != nil { - return m.WorkerId - } - return "" -} - -type WorkflowContextList struct { - WorkflowContexts []*workflow.WorkflowContext `protobuf:"bytes,1,rep,name=workflow_contexts,json=workflowContexts,proto3" json:"workflow_contexts,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WorkflowContextList) Reset() { *m = WorkflowContextList{} } -func (m *WorkflowContextList) String() string { return proto.CompactTextString(m) } -func (*WorkflowContextList) ProtoMessage() {} -func (*WorkflowContextList) Descriptor() ([]byte, []int) { - return fileDescriptor_388c2149c9643233, []int{1} -} - -func (m *WorkflowContextList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WorkflowContextList.Unmarshal(m, b) -} -func (m *WorkflowContextList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WorkflowContextList.Marshal(b, m, deterministic) -} -func (m *WorkflowContextList) XXX_Merge(src proto.Message) { - xxx_messageInfo_WorkflowContextList.Merge(m, src) -} -func (m *WorkflowContextList) XXX_Size() int { - return xxx_messageInfo_WorkflowContextList.Size(m) -} -func (m *WorkflowContextList) XXX_DiscardUnknown() { - xxx_messageInfo_WorkflowContextList.DiscardUnknown(m) -} - -var xxx_messageInfo_WorkflowContextList proto.InternalMessageInfo - -func (m *WorkflowContextList) GetWorkflowContexts() []*workflow.WorkflowContext { - if m != nil { - return m.WorkflowContexts - } - return nil -} - -type WorkflowActionsRequest struct { - WorkflowId string `protobuf:"bytes,1,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WorkflowActionsRequest) Reset() { *m = WorkflowActionsRequest{} } -func (m *WorkflowActionsRequest) String() string { return proto.CompactTextString(m) } -func (*WorkflowActionsRequest) ProtoMessage() {} -func (*WorkflowActionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_388c2149c9643233, []int{2} -} - -func (m *WorkflowActionsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WorkflowActionsRequest.Unmarshal(m, b) -} -func (m *WorkflowActionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WorkflowActionsRequest.Marshal(b, m, deterministic) -} -func (m *WorkflowActionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WorkflowActionsRequest.Merge(m, src) -} -func (m *WorkflowActionsRequest) XXX_Size() int { - return xxx_messageInfo_WorkflowActionsRequest.Size(m) -} -func (m *WorkflowActionsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WorkflowActionsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WorkflowActionsRequest proto.InternalMessageInfo - -func (m *WorkflowActionsRequest) GetWorkflowId() string { - if m != nil { - return m.WorkflowId - } - return "" -} - -type WorkflowAction struct { - TaskName string `protobuf:"bytes,1,opt,name=task_name,json=taskName,proto3" json:"task_name,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` - Timeout int64 `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"` - Command string `protobuf:"bytes,5,opt,name=command,proto3" json:"command,omitempty"` - OnTimeout string `protobuf:"bytes,6,opt,name=on_timeout,json=onTimeout,proto3" json:"on_timeout,omitempty"` - OnFailure string `protobuf:"bytes,7,opt,name=on_failure,json=onFailure,proto3" json:"on_failure,omitempty"` - WorkerId string `protobuf:"bytes,8,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WorkflowAction) Reset() { *m = WorkflowAction{} } -func (m *WorkflowAction) String() string { return proto.CompactTextString(m) } -func (*WorkflowAction) ProtoMessage() {} -func (*WorkflowAction) Descriptor() ([]byte, []int) { - return fileDescriptor_388c2149c9643233, []int{3} -} - -func (m *WorkflowAction) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WorkflowAction.Unmarshal(m, b) -} -func (m *WorkflowAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WorkflowAction.Marshal(b, m, deterministic) -} -func (m *WorkflowAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_WorkflowAction.Merge(m, src) -} -func (m *WorkflowAction) XXX_Size() int { - return xxx_messageInfo_WorkflowAction.Size(m) -} -func (m *WorkflowAction) XXX_DiscardUnknown() { - xxx_messageInfo_WorkflowAction.DiscardUnknown(m) -} - -var xxx_messageInfo_WorkflowAction proto.InternalMessageInfo - -func (m *WorkflowAction) GetTaskName() string { - if m != nil { - return m.TaskName - } - return "" -} - -func (m *WorkflowAction) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *WorkflowAction) GetImage() string { - if m != nil { - return m.Image - } - return "" -} - -func (m *WorkflowAction) GetTimeout() int64 { - if m != nil { - return m.Timeout - } - return 0 -} - -func (m *WorkflowAction) GetCommand() string { - if m != nil { - return m.Command - } - return "" -} - -func (m *WorkflowAction) GetOnTimeout() string { - if m != nil { - return m.OnTimeout - } - return "" -} - -func (m *WorkflowAction) GetOnFailure() string { - if m != nil { - return m.OnFailure - } - return "" -} - -func (m *WorkflowAction) GetWorkerId() string { - if m != nil { - return m.WorkerId - } - return "" -} - -type WorkflowActionList struct { - ActionList []*WorkflowAction `protobuf:"bytes,1,rep,name=action_list,json=actionList,proto3" json:"action_list,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WorkflowActionList) Reset() { *m = WorkflowActionList{} } -func (m *WorkflowActionList) String() string { return proto.CompactTextString(m) } -func (*WorkflowActionList) ProtoMessage() {} -func (*WorkflowActionList) Descriptor() ([]byte, []int) { - return fileDescriptor_388c2149c9643233, []int{4} -} - -func (m *WorkflowActionList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WorkflowActionList.Unmarshal(m, b) -} -func (m *WorkflowActionList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WorkflowActionList.Marshal(b, m, deterministic) -} -func (m *WorkflowActionList) XXX_Merge(src proto.Message) { - xxx_messageInfo_WorkflowActionList.Merge(m, src) -} -func (m *WorkflowActionList) XXX_Size() int { - return xxx_messageInfo_WorkflowActionList.Size(m) -} -func (m *WorkflowActionList) XXX_DiscardUnknown() { - xxx_messageInfo_WorkflowActionList.DiscardUnknown(m) -} - -var xxx_messageInfo_WorkflowActionList proto.InternalMessageInfo - -func (m *WorkflowActionList) GetActionList() []*WorkflowAction { - if m != nil { - return m.ActionList - } - return nil -} - -func init() { - proto.RegisterType((*WorkflowContextRequest)(nil), "jackfan.us.kg.packethost.rover.protos.rover.WorkflowContextRequest") - proto.RegisterType((*WorkflowContextList)(nil), "jackfan.us.kg.packethost.rover.protos.rover.WorkflowContextList") - proto.RegisterType((*WorkflowActionsRequest)(nil), "jackfan.us.kg.packethost.rover.protos.rover.WorkflowActionsRequest") - proto.RegisterType((*WorkflowAction)(nil), "jackfan.us.kg.packethost.rover.protos.rover.WorkflowAction") - proto.RegisterType((*WorkflowActionList)(nil), "jackfan.us.kg.packethost.rover.protos.rover.WorkflowActionList") -} - -func init() { - proto.RegisterFile("github.com/packethost/rover/protos/rover/rover.proto", fileDescriptor_388c2149c9643233) -} - -var fileDescriptor_388c2149c9643233 = []byte{ - // 473 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x51, 0x8b, 0xd3, 0x40, - 0x10, 0xbe, 0xd8, 0xeb, 0xdd, 0x75, 0x0a, 0xa2, 0x7b, 0x72, 0x84, 0x1c, 0x62, 0xc9, 0x53, 0xf0, - 0x61, 0x0b, 0xa7, 0x82, 0xca, 0x09, 0x9e, 0xa2, 0x72, 0x20, 0x3e, 0x44, 0x41, 0xf4, 0x25, 0x6c, - 0xd3, 0x6d, 0x6f, 0x69, 0x93, 0x69, 0xb3, 0x13, 0xab, 0x6f, 0xfe, 0x0a, 0xf1, 0x57, 0xf8, 0xb3, - 0xfc, 0x1d, 0x92, 0xdd, 0x6c, 0xda, 0xf4, 0xa9, 0xf6, 0xa5, 0xe4, 0xfb, 0x66, 0xbe, 0xd9, 0x6f, - 0x98, 0xe9, 0xc0, 0xe3, 0xa9, 0xa2, 0x9b, 0x72, 0xc4, 0x53, 0xcc, 0x86, 0x0b, 0x91, 0xce, 0x24, - 0xdd, 0xa0, 0xa6, 0x61, 0x81, 0xdf, 0x64, 0x31, 0x5c, 0x14, 0x48, 0xa8, 0x6b, 0x60, 0x7e, 0xb9, - 0xa1, 0x58, 0xb4, 0x56, 0xf1, 0xb5, 0x8a, 0x6f, 0xa4, 0x68, 0x0b, 0x82, 0xf3, 0x29, 0xe2, 0x74, - 0x2e, 0x6d, 0xa9, 0x51, 0x39, 0x19, 0xca, 0x6c, 0x41, 0x3f, 0x6c, 0x4e, 0xf0, 0x7c, 0x87, 0xc7, - 0x57, 0x58, 0xcc, 0x26, 0x73, 0x5c, 0x35, 0x1f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 0x25, 0xda, 0x63, - 0x3a, 0xd9, 0x1a, 0x13, 0x02, 0x6b, 0xf7, 0x69, 0x86, 0xf4, 0x05, 0xfa, 0xc2, 0xa0, 0x64, 0xae, - 0x34, 0xd5, 0xe3, 0x79, 0xca, 0x77, 0x5d, 0x46, 0xde, 0x2e, 0x19, 0x83, 0x68, 0x4a, 0x5f, 0xfc, - 0xe9, 0x40, 0x37, 0xae, 0x92, 0xd8, 0x6f, 0x0f, 0x4e, 0xdf, 0x49, 0xda, 0x9a, 0xa3, 0x66, 0x2f, - 0xff, 0xff, 0x9d, 0xf6, 0x62, 0x06, 0x2f, 0xf6, 0xae, 0x50, 0x59, 0x0c, 0x0f, 0xd8, 0x2f, 0x0f, - 0xd8, 0x86, 0xb5, 0x7a, 0x7b, 0xf6, 0x71, 0xd6, 0x5e, 0xbc, 0xe0, 0x72, 0xdf, 0x0a, 0xb5, 0xb1, - 0x25, 0xb0, 0x58, 0x2e, 0xb0, 0x20, 0xcb, 0x7e, 0x24, 0x41, 0xa5, 0x66, 0x57, 0x7b, 0xfd, 0x71, - 0x36, 0x4b, 0x04, 0x67, 0xdc, 0xde, 0x0f, 0xee, 0xee, 0x07, 0x7f, 0x53, 0xdd, 0x8f, 0xf0, 0xe0, - 0xd5, 0xc3, 0xaf, 0xd1, 0xae, 0xa7, 0x6b, 0x74, 0x64, 0xd0, 0xa3, 0x7f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x1a, 0x0c, 0x16, 0x95, 0xed, 0x04, 0x00, 0x00, -} - -// 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 - -// RoverClient is the client API for Rover service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RoverClient interface { - GetWorkflowContexts(ctx context.Context, in *WorkflowContextRequest, opts ...grpc.CallOption) (*WorkflowContextList, error) - GetWorkflowActions(ctx context.Context, in *WorkflowActionsRequest, opts ...grpc.CallOption) (*WorkflowActionList, error) - ReportActionStatus(ctx context.Context, in *workflow.WorkflowActionStatus, opts ...grpc.CallOption) (*empty.Empty, error) -} - -type roverClient struct { - cc *grpc.ClientConn -} - -func NewRoverClient(cc *grpc.ClientConn) RoverClient { - return &roverClient{cc} -} - -func (c *roverClient) GetWorkflowContexts(ctx context.Context, in *WorkflowContextRequest, opts ...grpc.CallOption) (*WorkflowContextList, error) { - out := new(WorkflowContextList) - err := c.cc.Invoke(ctx, "/jackfan.us.kg.packethost.rover.protos.rover.Rover/GetWorkflowContexts", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *roverClient) GetWorkflowActions(ctx context.Context, in *WorkflowActionsRequest, opts ...grpc.CallOption) (*WorkflowActionList, error) { - out := new(WorkflowActionList) - err := c.cc.Invoke(ctx, "/jackfan.us.kg.packethost.rover.protos.rover.Rover/GetWorkflowActions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *roverClient) ReportActionStatus(ctx context.Context, in *workflow.WorkflowActionStatus, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) - err := c.cc.Invoke(ctx, "/jackfan.us.kg.packethost.rover.protos.rover.Rover/ReportActionStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RoverServer is the server API for Rover service. -type RoverServer interface { - GetWorkflowContexts(context.Context, *WorkflowContextRequest) (*WorkflowContextList, error) - GetWorkflowActions(context.Context, *WorkflowActionsRequest) (*WorkflowActionList, error) - ReportActionStatus(context.Context, *workflow.WorkflowActionStatus) (*empty.Empty, error) -} - -// UnimplementedRoverServer can be embedded to have forward compatible implementations. -type UnimplementedRoverServer struct { -} - -func (*UnimplementedRoverServer) GetWorkflowContexts(ctx context.Context, req *WorkflowContextRequest) (*WorkflowContextList, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetWorkflowContexts not implemented") -} -func (*UnimplementedRoverServer) GetWorkflowActions(ctx context.Context, req *WorkflowActionsRequest) (*WorkflowActionList, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetWorkflowActions not implemented") -} -func (*UnimplementedRoverServer) ReportActionStatus(ctx context.Context, req *workflow.WorkflowActionStatus) (*empty.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ReportActionStatus not implemented") -} - -func RegisterRoverServer(s *grpc.Server, srv RoverServer) { - s.RegisterService(&_Rover_serviceDesc, srv) -} - -func _Rover_GetWorkflowContexts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WorkflowContextRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RoverServer).GetWorkflowContexts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/jackfan.us.kg.packethost.rover.protos.rover.Rover/GetWorkflowContexts", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoverServer).GetWorkflowContexts(ctx, req.(*WorkflowContextRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Rover_GetWorkflowActions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WorkflowActionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RoverServer).GetWorkflowActions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/jackfan.us.kg.packethost.rover.protos.rover.Rover/GetWorkflowActions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoverServer).GetWorkflowActions(ctx, req.(*WorkflowActionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Rover_ReportActionStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(workflow.WorkflowActionStatus) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RoverServer).ReportActionStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/jackfan.us.kg.packethost.rover.protos.rover.Rover/ReportActionStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoverServer).ReportActionStatus(ctx, req.(*workflow.WorkflowActionStatus)) - } - return interceptor(ctx, in, info, handler) -} - -var _Rover_serviceDesc = grpc.ServiceDesc{ - ServiceName: "jackfan.us.kg.packethost.rover.protos.rover.Rover", - HandlerType: (*RoverServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetWorkflowContexts", - Handler: _Rover_GetWorkflowContexts_Handler, - }, - { - MethodName: "GetWorkflowActions", - Handler: _Rover_GetWorkflowActions_Handler, - }, - { - MethodName: "ReportActionStatus", - Handler: _Rover_ReportActionStatus_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/packethost/rover/protos/rover/rover.proto", -} diff --git a/protos/rover/rover.proto b/protos/rover/rover.proto deleted file mode 100644 index cbae7c29d..000000000 --- a/protos/rover/rover.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; - -option go_package = "github.com/packethost/rover/protos/rover"; - -import "google/protobuf/empty.proto"; -import "github.com/packethost/rover/protos/workflow/workflow.proto"; - -package jackfan.us.kg.packethost.rover.protos.rover; - -service Rover { - rpc GetWorkflowContexts(WorkflowContextRequest) returns (WorkflowContextList) {} - rpc GetWorkflowActions(WorkflowActionsRequest) returns (WorkflowActionList) {} - rpc ReportActionStatus(jackfan.us.kg.packethost.rover.protos.workflow.WorkflowActionStatus) returns (google.protobuf.Empty) {} -} - -message WorkflowContextRequest { - string worker_id = 1; -} - -message WorkflowContextList { - repeated jackfan.us.kg.packethost.rover.protos.workflow.WorkflowContext workflow_contexts = 1; -} - -message WorkflowActionsRequest { - string workflow_id = 1; -} - -message WorkflowAction { - string task_name = 1; - string name = 2; - string image = 3; - int64 timeout = 4; - string command = 5; - string on_timeout = 6; - string on_failure = 7; - string worker_id = 8; -} - -message WorkflowActionList { - repeated WorkflowAction action_list = 1; -} diff --git a/protos/workflow/workflow.pb.go b/protos/workflow/workflow.pb.go index 5825b9933..6e773384d 100644 --- a/protos/workflow/workflow.pb.go +++ b/protos/workflow/workflow.pb.go @@ -526,6 +526,257 @@ func (m *WorkflowActionStatus) GetWorkerId() string { return "" } +type WorkflowContextRequest struct { + WorkerId string `protobuf:"bytes,1,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WorkflowContextRequest) Reset() { *m = WorkflowContextRequest{} } +func (m *WorkflowContextRequest) String() string { return proto.CompactTextString(m) } +func (*WorkflowContextRequest) ProtoMessage() {} +func (*WorkflowContextRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ba7a18437cf3c9b, []int{7} +} + +func (m *WorkflowContextRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WorkflowContextRequest.Unmarshal(m, b) +} +func (m *WorkflowContextRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WorkflowContextRequest.Marshal(b, m, deterministic) +} +func (m *WorkflowContextRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkflowContextRequest.Merge(m, src) +} +func (m *WorkflowContextRequest) XXX_Size() int { + return xxx_messageInfo_WorkflowContextRequest.Size(m) +} +func (m *WorkflowContextRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WorkflowContextRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_WorkflowContextRequest proto.InternalMessageInfo + +func (m *WorkflowContextRequest) GetWorkerId() string { + if m != nil { + return m.WorkerId + } + return "" +} + +type WorkflowContextList struct { + WorkflowContexts []*WorkflowContext `protobuf:"bytes,1,rep,name=workflow_contexts,json=workflowContexts,proto3" json:"workflow_contexts,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WorkflowContextList) Reset() { *m = WorkflowContextList{} } +func (m *WorkflowContextList) String() string { return proto.CompactTextString(m) } +func (*WorkflowContextList) ProtoMessage() {} +func (*WorkflowContextList) Descriptor() ([]byte, []int) { + return fileDescriptor_5ba7a18437cf3c9b, []int{8} +} + +func (m *WorkflowContextList) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WorkflowContextList.Unmarshal(m, b) +} +func (m *WorkflowContextList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WorkflowContextList.Marshal(b, m, deterministic) +} +func (m *WorkflowContextList) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkflowContextList.Merge(m, src) +} +func (m *WorkflowContextList) XXX_Size() int { + return xxx_messageInfo_WorkflowContextList.Size(m) +} +func (m *WorkflowContextList) XXX_DiscardUnknown() { + xxx_messageInfo_WorkflowContextList.DiscardUnknown(m) +} + +var xxx_messageInfo_WorkflowContextList proto.InternalMessageInfo + +func (m *WorkflowContextList) GetWorkflowContexts() []*WorkflowContext { + if m != nil { + return m.WorkflowContexts + } + return nil +} + +type WorkflowActionsRequest struct { + WorkflowId string `protobuf:"bytes,1,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WorkflowActionsRequest) Reset() { *m = WorkflowActionsRequest{} } +func (m *WorkflowActionsRequest) String() string { return proto.CompactTextString(m) } +func (*WorkflowActionsRequest) ProtoMessage() {} +func (*WorkflowActionsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ba7a18437cf3c9b, []int{9} +} + +func (m *WorkflowActionsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WorkflowActionsRequest.Unmarshal(m, b) +} +func (m *WorkflowActionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WorkflowActionsRequest.Marshal(b, m, deterministic) +} +func (m *WorkflowActionsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkflowActionsRequest.Merge(m, src) +} +func (m *WorkflowActionsRequest) XXX_Size() int { + return xxx_messageInfo_WorkflowActionsRequest.Size(m) +} +func (m *WorkflowActionsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WorkflowActionsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_WorkflowActionsRequest proto.InternalMessageInfo + +func (m *WorkflowActionsRequest) GetWorkflowId() string { + if m != nil { + return m.WorkflowId + } + return "" +} + +type WorkflowAction struct { + TaskName string `protobuf:"bytes,1,opt,name=task_name,json=taskName,proto3" json:"task_name,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` + Timeout int64 `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"` + Command string `protobuf:"bytes,5,opt,name=command,proto3" json:"command,omitempty"` + OnTimeout string `protobuf:"bytes,6,opt,name=on_timeout,json=onTimeout,proto3" json:"on_timeout,omitempty"` + OnFailure string `protobuf:"bytes,7,opt,name=on_failure,json=onFailure,proto3" json:"on_failure,omitempty"` + WorkerId string `protobuf:"bytes,8,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WorkflowAction) Reset() { *m = WorkflowAction{} } +func (m *WorkflowAction) String() string { return proto.CompactTextString(m) } +func (*WorkflowAction) ProtoMessage() {} +func (*WorkflowAction) Descriptor() ([]byte, []int) { + return fileDescriptor_5ba7a18437cf3c9b, []int{10} +} + +func (m *WorkflowAction) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WorkflowAction.Unmarshal(m, b) +} +func (m *WorkflowAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WorkflowAction.Marshal(b, m, deterministic) +} +func (m *WorkflowAction) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkflowAction.Merge(m, src) +} +func (m *WorkflowAction) XXX_Size() int { + return xxx_messageInfo_WorkflowAction.Size(m) +} +func (m *WorkflowAction) XXX_DiscardUnknown() { + xxx_messageInfo_WorkflowAction.DiscardUnknown(m) +} + +var xxx_messageInfo_WorkflowAction proto.InternalMessageInfo + +func (m *WorkflowAction) GetTaskName() string { + if m != nil { + return m.TaskName + } + return "" +} + +func (m *WorkflowAction) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *WorkflowAction) GetImage() string { + if m != nil { + return m.Image + } + return "" +} + +func (m *WorkflowAction) GetTimeout() int64 { + if m != nil { + return m.Timeout + } + return 0 +} + +func (m *WorkflowAction) GetCommand() string { + if m != nil { + return m.Command + } + return "" +} + +func (m *WorkflowAction) GetOnTimeout() string { + if m != nil { + return m.OnTimeout + } + return "" +} + +func (m *WorkflowAction) GetOnFailure() string { + if m != nil { + return m.OnFailure + } + return "" +} + +func (m *WorkflowAction) GetWorkerId() string { + if m != nil { + return m.WorkerId + } + return "" +} + +type WorkflowActionList struct { + ActionList []*WorkflowAction `protobuf:"bytes,1,rep,name=action_list,json=actionList,proto3" json:"action_list,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WorkflowActionList) Reset() { *m = WorkflowActionList{} } +func (m *WorkflowActionList) String() string { return proto.CompactTextString(m) } +func (*WorkflowActionList) ProtoMessage() {} +func (*WorkflowActionList) Descriptor() ([]byte, []int) { + return fileDescriptor_5ba7a18437cf3c9b, []int{11} +} + +func (m *WorkflowActionList) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WorkflowActionList.Unmarshal(m, b) +} +func (m *WorkflowActionList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WorkflowActionList.Marshal(b, m, deterministic) +} +func (m *WorkflowActionList) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkflowActionList.Merge(m, src) +} +func (m *WorkflowActionList) XXX_Size() int { + return xxx_messageInfo_WorkflowActionList.Size(m) +} +func (m *WorkflowActionList) XXX_DiscardUnknown() { + xxx_messageInfo_WorkflowActionList.DiscardUnknown(m) +} + +var xxx_messageInfo_WorkflowActionList proto.InternalMessageInfo + +func (m *WorkflowActionList) GetActionList() []*WorkflowAction { + if m != nil { + return m.ActionList + } + return nil +} + func init() { proto.RegisterEnum("jackfan.us.kg.packethost.rover.protos.workflow.State", State_name, State_value) proto.RegisterEnum("jackfan.us.kg.packethost.rover.protos.workflow.ActionState", ActionState_name, ActionState_value) @@ -536,63 +787,82 @@ func init() { proto.RegisterType((*GetRequest)(nil), "jackfan.us.kg.packethost.rover.protos.workflow.GetRequest") proto.RegisterType((*WorkflowContext)(nil), "jackfan.us.kg.packethost.rover.protos.workflow.WorkflowContext") proto.RegisterType((*WorkflowActionStatus)(nil), "jackfan.us.kg.packethost.rover.protos.workflow.WorkflowActionStatus") + proto.RegisterType((*WorkflowContextRequest)(nil), "jackfan.us.kg.packethost.rover.protos.workflow.WorkflowContextRequest") + proto.RegisterType((*WorkflowContextList)(nil), "jackfan.us.kg.packethost.rover.protos.workflow.WorkflowContextList") + proto.RegisterType((*WorkflowActionsRequest)(nil), "jackfan.us.kg.packethost.rover.protos.workflow.WorkflowActionsRequest") + proto.RegisterType((*WorkflowAction)(nil), "jackfan.us.kg.packethost.rover.protos.workflow.WorkflowAction") + proto.RegisterType((*WorkflowActionList)(nil), "jackfan.us.kg.packethost.rover.protos.workflow.WorkflowActionList") } func init() { proto.RegisterFile("protos/workflow/workflow.proto", fileDescriptor_5ba7a18437cf3c9b) } var fileDescriptor_5ba7a18437cf3c9b = []byte{ - // 804 bytes of a gzipped FileDesc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xaf, 0x7e, 0xae, 0xa1, 0xdf, 0x34, 0x40, 0x29, - 0xf1, 0xd5, 0xda, 0xce, 0xac, 0xc0, 0x57, 0x99, 0x0a, 0x51, 0xc7, 0xfe, 0xae, 0x01, 0x9a, 0xdc, - 0xd3, 0x47, 0x85, 0x0f, 0x1f, 0x88, 0xcf, 0x59, 0xf6, 0x6a, 0xfa, 0x99, 0xaa, 0x49, 0x2f, 0xd0, - 0x73, 0xed, 0xeb, 0x4f, 0xbf, 0x4f, 0x7d, 0x11, 0x75, 0x77, 0x59, 0xba, 0x22, 0x4b, 0xf7, 0xc5, - 0xd7, 0xd4, 0xac, 0x28, 0x80, 0xcf, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0xf0, 0xa4, 0x8b, 0x9f, - 0x67, 0x09, 0x00, 0x00, + // 1027 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0x5f, 0x8f, 0xe2, 0x54, + 0x14, 0x9f, 0xc2, 0x00, 0xc3, 0x61, 0x41, 0xf6, 0xee, 0x64, 0x24, 0xac, 0xba, 0xd8, 0xc4, 0x64, + 0xb2, 0xc6, 0x32, 0xc1, 0x4c, 0x5c, 0x5d, 0x13, 0x45, 0x86, 0x45, 0x92, 0x95, 0xd9, 0x14, 0x26, + 0x9b, 0x18, 0x0d, 0xe9, 0xd0, 0x0b, 0x53, 0xa1, 0xbd, 0xd8, 0x7b, 0x3b, 0xb3, 0x26, 0x6e, 0xe2, + 0xa3, 0xc6, 0xf8, 0xe2, 0xb3, 0xf1, 0x83, 0xf9, 0xe2, 0x9b, 0x9f, 0xc1, 0x47, 0x73, 0xff, 0x41, + 0xcb, 0xc6, 0x9d, 0x50, 0xde, 0x7a, 0xfe, 0xfc, 0xce, 0x3d, 0xf7, 0x9c, 0xdf, 0xe9, 0x69, 0xe1, + 0x9d, 0x65, 0x48, 0x18, 0xa1, 0xcd, 0x1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, 0x00, 0xff, 0xff, 0xc0, 0x47, 0x6d, 0x4c, 0x89, + 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -613,6 +883,9 @@ type WorkflowSvcClient interface { ListWorkflows(ctx context.Context, in *Empty, opts ...grpc.CallOption) (WorkflowSvc_ListWorkflowsClient, error) GetWorkflowContext(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*WorkflowContext, error) ShowWorkflowEvents(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (WorkflowSvc_ShowWorkflowEventsClient, error) + GetWorkflowContexts(ctx context.Context, in *WorkflowContextRequest, opts ...grpc.CallOption) (*WorkflowContextList, error) + GetWorkflowActions(ctx context.Context, in *WorkflowActionsRequest, opts ...grpc.CallOption) (*WorkflowActionList, error) + ReportActionStatus(ctx context.Context, in *WorkflowActionStatus, opts ...grpc.CallOption) (*Empty, error) } type workflowSvcClient struct { @@ -723,6 +996,33 @@ func (x *workflowSvcShowWorkflowEventsClient) Recv() (*WorkflowActionStatus, err return m, nil } +func (c *workflowSvcClient) GetWorkflowContexts(ctx context.Context, in *WorkflowContextRequest, opts ...grpc.CallOption) (*WorkflowContextList, error) { + out := new(WorkflowContextList) + err := c.cc.Invoke(ctx, "/jackfan.us.kg.packethost.rover.protos.workflow.WorkflowSvc/GetWorkflowContexts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowSvcClient) GetWorkflowActions(ctx context.Context, in *WorkflowActionsRequest, opts ...grpc.CallOption) (*WorkflowActionList, error) { + out := new(WorkflowActionList) + err := c.cc.Invoke(ctx, "/jackfan.us.kg.packethost.rover.protos.workflow.WorkflowSvc/GetWorkflowActions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowSvcClient) ReportActionStatus(ctx context.Context, in *WorkflowActionStatus, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/jackfan.us.kg.packethost.rover.protos.workflow.WorkflowSvc/ReportActionStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // WorkflowSvcServer is the server API for WorkflowSvc service. type WorkflowSvcServer interface { CreateWorkflow(context.Context, *CreateRequest) (*CreateResponse, error) @@ -731,6 +1031,9 @@ type WorkflowSvcServer interface { ListWorkflows(*Empty, WorkflowSvc_ListWorkflowsServer) error GetWorkflowContext(context.Context, *GetRequest) (*WorkflowContext, error) ShowWorkflowEvents(*GetRequest, WorkflowSvc_ShowWorkflowEventsServer) error + GetWorkflowContexts(context.Context, *WorkflowContextRequest) (*WorkflowContextList, error) + GetWorkflowActions(context.Context, *WorkflowActionsRequest) (*WorkflowActionList, error) + ReportActionStatus(context.Context, *WorkflowActionStatus) (*Empty, error) } // UnimplementedWorkflowSvcServer can be embedded to have forward compatible implementations. @@ -755,6 +1058,15 @@ func (*UnimplementedWorkflowSvcServer) GetWorkflowContext(ctx context.Context, r func (*UnimplementedWorkflowSvcServer) ShowWorkflowEvents(req *GetRequest, srv WorkflowSvc_ShowWorkflowEventsServer) error { return status.Errorf(codes.Unimplemented, "method ShowWorkflowEvents not implemented") } +func (*UnimplementedWorkflowSvcServer) GetWorkflowContexts(ctx context.Context, req *WorkflowContextRequest) (*WorkflowContextList, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetWorkflowContexts not implemented") +} +func (*UnimplementedWorkflowSvcServer) GetWorkflowActions(ctx context.Context, req *WorkflowActionsRequest) (*WorkflowActionList, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetWorkflowActions not implemented") +} +func (*UnimplementedWorkflowSvcServer) ReportActionStatus(ctx context.Context, req *WorkflowActionStatus) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReportActionStatus not implemented") +} func RegisterWorkflowSvcServer(s *grpc.Server, srv WorkflowSvcServer) { s.RegisterService(&_WorkflowSvc_serviceDesc, srv) @@ -874,6 +1186,60 @@ func (x *workflowSvcShowWorkflowEventsServer) Send(m *WorkflowActionStatus) erro return x.ServerStream.SendMsg(m) } +func _WorkflowSvc_GetWorkflowContexts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WorkflowContextRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowSvcServer).GetWorkflowContexts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackfan.us.kg.packethost.rover.protos.workflow.WorkflowSvc/GetWorkflowContexts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowSvcServer).GetWorkflowContexts(ctx, req.(*WorkflowContextRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowSvc_GetWorkflowActions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WorkflowActionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowSvcServer).GetWorkflowActions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackfan.us.kg.packethost.rover.protos.workflow.WorkflowSvc/GetWorkflowActions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowSvcServer).GetWorkflowActions(ctx, req.(*WorkflowActionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowSvc_ReportActionStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WorkflowActionStatus) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowSvcServer).ReportActionStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jackfan.us.kg.packethost.rover.protos.workflow.WorkflowSvc/ReportActionStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowSvcServer).ReportActionStatus(ctx, req.(*WorkflowActionStatus)) + } + return interceptor(ctx, in, info, handler) +} + var _WorkflowSvc_serviceDesc = grpc.ServiceDesc{ ServiceName: "jackfan.us.kg.packethost.rover.protos.workflow.WorkflowSvc", HandlerType: (*WorkflowSvcServer)(nil), @@ -894,6 +1260,18 @@ var _WorkflowSvc_serviceDesc = grpc.ServiceDesc{ MethodName: "GetWorkflowContext", Handler: _WorkflowSvc_GetWorkflowContext_Handler, }, + { + MethodName: "GetWorkflowContexts", + Handler: _WorkflowSvc_GetWorkflowContexts_Handler, + }, + { + MethodName: "GetWorkflowActions", + Handler: _WorkflowSvc_GetWorkflowActions_Handler, + }, + { + MethodName: "ReportActionStatus", + Handler: _WorkflowSvc_ReportActionStatus_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/protos/workflow/workflow.proto b/protos/workflow/workflow.proto index 13ee6dc9d..0f8ac46ca 100644 --- a/protos/workflow/workflow.proto +++ b/protos/workflow/workflow.proto @@ -13,6 +13,9 @@ service WorkflowSvc { rpc ListWorkflows(Empty) returns (stream Workflow); rpc GetWorkflowContext(GetRequest) returns (WorkflowContext); rpc ShowWorkflowEvents(GetRequest) returns (stream WorkflowActionStatus); + rpc GetWorkflowContexts(WorkflowContextRequest) returns (WorkflowContextList) {} + rpc GetWorkflowActions(WorkflowActionsRequest) returns (WorkflowActionList) {} + rpc ReportActionStatus(WorkflowActionStatus) returns (Empty) {} } message Empty { @@ -78,3 +81,31 @@ message WorkflowActionStatus { google.protobuf.Timestamp createdAt = 7; string worker_id = 8; } + +message WorkflowContextRequest { + string worker_id = 1; +} + +message WorkflowContextList { + repeated WorkflowContext workflow_contexts = 1; +} + +message WorkflowActionsRequest { + string workflow_id = 1; +} + +message WorkflowAction { + string task_name = 1; + string name = 2; + string image = 3; + int64 timeout = 4; + string command = 5; + string on_timeout = 6; + string on_failure = 7; + string worker_id = 8; +} + +message WorkflowActionList { + repeated WorkflowAction action_list = 1; +} + diff --git a/worker/action.go b/worker/action.go index a39eef90e..e3d6e0722 100644 --- a/worker/action.go +++ b/worker/action.go @@ -13,8 +13,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" - pb "github.com/packethost/rover/protos/rover" - workflowpb "github.com/packethost/rover/protos/workflow" + pb "github.com/packethost/rover/protos/workflow" "github.com/pkg/errors" ) @@ -23,7 +22,7 @@ var ( cli *client.Client ) -func executeAction(ctx context.Context, action *pb.WorkflowAction) (string, workflowpb.ActionState, error) { +func executeAction(ctx context.Context, action *pb.WorkflowAction) (string, pb.ActionState, error) { err := pullActionImage(ctx, action) if err != nil { return fmt.Sprintf("Failed to pull Image : %s", action.GetImage()), 1, errors.Wrap(err, "DOCKER PULL") @@ -90,7 +89,7 @@ func executeAction(ctx context.Context, action *pb.WorkflowAction) (string, work return fmt.Sprintf("Failed to remove container of action"), status, errors.Wrap(rerr, "DOCKER_REMOVE") } if status != 0 { - if status == workflowpb.ActionState_ACTION_FAILED && action.OnFailure != "" { + if status == pb.ActionState_ACTION_FAILED && action.OnFailure != "" { id, err = createContainer(ctx, action, action.OnFailure) if err != nil { fmt.Println("Failed to create on-failure command: ", err) @@ -99,7 +98,7 @@ func executeAction(ctx context.Context, action *pb.WorkflowAction) (string, work if err != nil { fmt.Println("Failed to run on-failure command: ", err) } - } else if status == workflowpb.ActionState_ACTION_TIMEOUT && action.OnTimeout != "" { + } else if status == pb.ActionState_ACTION_TIMEOUT && action.OnTimeout != "" { id, err = createContainer(ctx, action, action.OnTimeout) if err != nil { fmt.Println("Failed to create on-timeout command: ", err) @@ -199,19 +198,19 @@ func getLogs(ctx context.Context, cli *client.Client, id string, srt string) (io return logs, nil } -func waitContainer(ctx context.Context, id string, stopLogs chan bool) (workflowpb.ActionState, error) { +func waitContainer(ctx context.Context, id string, stopLogs chan bool) (pb.ActionState, error) { // send API call to wait for the container completion wait, errC := cli.ContainerWait(ctx, id, container.WaitConditionNotRunning) select { case status := <-wait: stopLogs <- true - return workflowpb.ActionState(status.StatusCode), nil + return pb.ActionState(status.StatusCode), nil case err := <-errC: stopLogs <- true - return workflowpb.ActionState_ACTION_FAILED, err + return pb.ActionState_ACTION_FAILED, err case <-ctx.Done(): stopLogs <- true - return workflowpb.ActionState_ACTION_TIMEOUT, ctx.Err() + return pb.ActionState_ACTION_TIMEOUT, ctx.Err() } } diff --git a/worker/main.go b/worker/main.go index cac77da01..1d1d264f9 100644 --- a/worker/main.go +++ b/worker/main.go @@ -7,7 +7,7 @@ import ( "time" "github.com/packethost/rover/client" - pb "github.com/packethost/rover/protos/rover" + pb "github.com/packethost/rover/protos/workflow" "google.golang.org/grpc" ) @@ -17,7 +17,7 @@ const ( ) var ( - rClient pb.RoverClient + rClient pb.WorkflowSvcClient retryInterval time.Duration retries int ) @@ -28,7 +28,7 @@ func main() { if err != nil { log.Fatalln(err) } - rClient = pb.NewRoverClient(conn) + rClient = pb.NewWorkflowSvcClient(conn) err = initializeWorker(rClient) if err != nil { log.Fatalln(err) diff --git a/worker/worker.go b/worker/worker.go index 4d5b32f8e..2cbe4b320 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -7,18 +7,17 @@ import ( "os" "time" - pb "github.com/packethost/rover/protos/rover" - workflowpb "github.com/packethost/rover/protos/workflow" + pb "github.com/packethost/rover/protos/workflow" "google.golang.org/grpc/status" ) var ( - workflowcontexts = map[string]*workflowpb.WorkflowContext{} + workflowcontexts = map[string]*pb.WorkflowContext{} workflowactions = map[string]*pb.WorkflowActionList{} ) -func initializeWorker(client pb.RoverClient) error { +func initializeWorker(client pb.WorkflowSvcClient) error { workerID := os.Getenv("WORKER_ID") if workerID == "" { return fmt.Errorf("requried WORKER_NAME") @@ -57,17 +56,17 @@ func initializeWorker(client pb.RoverClient) error { } } else { switch wfContext.GetCurrentActionState() { - case workflowpb.ActionState_ACTION_SUCCESS: + case pb.ActionState_ACTION_SUCCESS: if isLastAction(wfContext, actions) { fmt.Printf("Workflow %s completed successfully\n", wfID) continue } nextAction = actions.GetActionList()[wfContext.GetCurrentActionIndex()+1] actionIndex = int(wfContext.GetCurrentActionIndex()) + 1 - case workflowpb.ActionState_ACTION_FAILED: + case pb.ActionState_ACTION_FAILED: fmt.Printf("Workflow %s Failed\n", wfID) continue - case workflowpb.ActionState_ACTION_TIMEOUT: + case pb.ActionState_ACTION_TIMEOUT: fmt.Printf("Workflow %s Timeout\n", wfID) continue default: @@ -89,12 +88,12 @@ func initializeWorker(client pb.RoverClient) error { for turn { action := actions.GetActionList()[actionIndex] - if wfContext.GetCurrentActionState() != workflowpb.ActionState_ACTION_IN_PROGRESS { - actionStatus := &workflowpb.WorkflowActionStatus{ + if wfContext.GetCurrentActionState() != pb.ActionState_ACTION_IN_PROGRESS { + actionStatus := &pb.WorkflowActionStatus{ WorkflowId: wfID, TaskName: action.GetTaskName(), ActionName: action.GetName(), - ActionStatus: workflowpb.ActionState_ACTION_IN_PROGRESS, + ActionStatus: pb.ActionState_ACTION_IN_PROGRESS, Seconds: 0, Message: "Started execution", WorkerId: action.GetWorkerId(), @@ -111,7 +110,7 @@ func initializeWorker(client pb.RoverClient) error { message, status, err := executeAction(ctx, actions.GetActionList()[actionIndex]) elapsed := time.Since(start) - actionStatus := &workflowpb.WorkflowActionStatus{ + actionStatus := &pb.WorkflowActionStatus{ WorkflowId: wfID, TaskName: action.GetTaskName(), ActionName: action.GetName(), @@ -120,12 +119,12 @@ func initializeWorker(client pb.RoverClient) error { } if err != nil || status != 0 { - if status == workflowpb.ActionState_ACTION_TIMEOUT { + if status == pb.ActionState_ACTION_TIMEOUT { fmt.Printf("Action \"%s\" from task \"%s\" timeout\n", action.GetName(), action.GetTaskName()) - actionStatus.ActionStatus = workflowpb.ActionState_ACTION_TIMEOUT + actionStatus.ActionStatus = pb.ActionState_ACTION_TIMEOUT } else { fmt.Printf("Action \"%s\" from task \"%s\" failed\n", action.GetName(), action.GetTaskName()) - actionStatus.ActionStatus = workflowpb.ActionState_ACTION_FAILED + actionStatus.ActionStatus = pb.ActionState_ACTION_FAILED } actionStatus.Message = message rerr := reportActionStatus(ctx, client, actionStatus) @@ -135,7 +134,7 @@ func initializeWorker(client pb.RoverClient) error { return err } - actionStatus.ActionStatus = workflowpb.ActionState_ACTION_SUCCESS + actionStatus.ActionStatus = pb.ActionState_ACTION_SUCCESS actionStatus.Message = "Finished Execution Successfully" err = reportActionStatus(ctx, client, actionStatus) @@ -161,7 +160,7 @@ func initializeWorker(client pb.RoverClient) error { } } -func fetchLatestContext(ctx context.Context, client pb.RoverClient, workerID string) error { +func fetchLatestContext(ctx context.Context, client pb.WorkflowSvcClient, workerID string) error { fmt.Printf("Fetching latest context for worker %s\n", workerID) res, err := client.GetWorkflowContexts(ctx, &pb.WorkflowContextRequest{WorkerId: workerID}) if err != nil { @@ -183,10 +182,10 @@ func fetchLatestContext(ctx context.Context, client pb.RoverClient, workerID str func allWorkflowsFinished() bool { for wfID, wfContext := range workflowcontexts { actions := workflowactions[wfID] - if wfContext.GetCurrentActionState() == workflowpb.ActionState_ACTION_FAILED || wfContext.GetCurrentActionState() == workflowpb.ActionState_ACTION_TIMEOUT { + if wfContext.GetCurrentActionState() == pb.ActionState_ACTION_FAILED || wfContext.GetCurrentActionState() == pb.ActionState_ACTION_TIMEOUT { continue } - if !(wfContext.GetCurrentActionState() == workflowpb.ActionState_ACTION_SUCCESS && isLastAction(wfContext, actions)) { + if !(wfContext.GetCurrentActionState() == pb.ActionState_ACTION_SUCCESS && isLastAction(wfContext, actions)) { return false } } @@ -202,11 +201,11 @@ func exitWithGrpcError(err error) { } } -func isLastAction(wfContext *workflowpb.WorkflowContext, actions *pb.WorkflowActionList) bool { +func isLastAction(wfContext *pb.WorkflowContext, actions *pb.WorkflowActionList) bool { return int(wfContext.GetCurrentActionIndex()) == len(actions.GetActionList())-1 } -func reportActionStatus(ctx context.Context, client pb.RoverClient, actionStatus *workflowpb.WorkflowActionStatus) error { +func reportActionStatus(ctx context.Context, client pb.WorkflowSvcClient, actionStatus *pb.WorkflowActionStatus) error { var err error for r := 1; r <= retries; r++ { _, err = client.ReportActionStatus(ctx, actionStatus)