support stream => websocket for web clients

This commit is contained in:
rushtehrani
2020-01-02 10:45:51 -08:00
parent 724c73b421
commit bc1e19fbc7
7 changed files with 159 additions and 44 deletions

View File

@@ -391,48 +391,49 @@ func init() {
func init() { proto.RegisterFile("workflow.proto", fileDescriptor_892c7f566756b0be) }
var fileDescriptor_892c7f566756b0be = []byte{
// 649 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4d, 0x4f, 0x13, 0x4f,
0x18, 0xff, 0x0f, 0xa5, 0x84, 0x3e, 0x04, 0xfe, 0xe4, 0xa1, 0xc0, 0xba, 0xc1, 0x88, 0x63, 0x4c,
0x40, 0xc8, 0x2e, 0x54, 0xb9, 0x60, 0x48, 0x34, 0x44, 0xf0, 0xc0, 0xc1, 0xac, 0x2f, 0x24, 0x5c,
0x64, 0x28, 0x03, 0x6e, 0x2c, 0xbb, 0xeb, 0xce, 0x6c, 0x39, 0x90, 0x5e, 0xf4, 0x23, 0xe8, 0xcd,
0x0f, 0xe1, 0xd5, 0xc4, 0x9b, 0x5f, 0x81, 0xaf, 0xe0, 0x07, 0x31, 0x9d, 0xdd, 0x19, 0xba, 0xdb,
0x55, 0xdb, 0xf4, 0x36, 0xf3, 0x3c, 0x4f, 0x7f, 0x2f, 0x33, 0xbf, 0xd9, 0xc2, 0xcc, 0x65, 0x18,
0xbf, 0x3f, 0x6b, 0x85, 0x97, 0x4e, 0x14, 0x87, 0x32, 0xc4, 0x0a, 0x8b, 0x7c, 0x7b, 0xe9, 0x3c,
0x0c, 0xcf, 0x5b, 0xdc, 0x65, 0x91, 0xef, 0xb2, 0x20, 0x08, 0x25, 0x93, 0x7e, 0x18, 0x88, 0x74,
0xc4, 0x5e, 0xd4, 0x3f, 0x79, 0x2b, 0xf9, 0x45, 0xd4, 0x62, 0x92, 0xa7, 0x0d, 0x7a, 0x0c, 0xf3,
0xbb, 0x31, 0x67, 0x92, 0x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7e, 0x18, 0x8c, 0x22, 0xf2, 0x4c, 0x89, 0x3c, 0xa6, 0x07, 0xc3, 0x88, 0x74, 0xaf,
0x8a, 0x22, 0x9d, 0xc4, 0x3f, 0xed, 0xb8, 0xed, 0x54, 0x4f, 0x99, 0x89, 0x6b, 0x02, 0x73, 0x3d,
0x81, 0x33, 0xf5, 0x3b, 0xc5, 0x28, 0x0e, 0xa8, 0xfb, 0x13, 0x51, 0xc2, 0x3b, 0xd8, 0x18, 0x4e,
0x78, 0x57, 0xe7, 0xd1, 0x3e, 0x3e, 0x1b, 0xfe, 0x57, 0xc6, 0x9d, 0x7b, 0x95, 0xad, 0x3a, 0xf8,
0x9d, 0xc0, 0x52, 0x6f, 0x7c, 0x0b, 0x17, 0x23, 0x70, 0xa5, 0x2f, 0xe1, 0xc5, 0x11, 0xed, 0x73,
0x75, 0x80, 0xc9, 0xec, 0x69, 0xec, 0x2a, 0xeb, 0x3b, 0xf8, 0x78, 0x04, 0x13, 0xf8, 0x85, 0xe4,
0x3f, 0xf6, 0x9a, 0x4d, 0xe0, 0xdd, 0x3f, 0x2a, 0x31, 0x62, 0xe9, 0xdf, 0x46, 0x32, 0x95, 0x8f,
0x94, 0x4a, 0x07, 0x87, 0x8a, 0xff, 0xc9, 0x84, 0xfa, 0x97, 0x7f, 0xf8, 0x3b, 0x00, 0x00, 0xff,
0xff, 0xbd, 0xf5, 0xec, 0x7d, 0x33, 0x08, 0x00, 0x00,
// 660 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xdf, 0x4e, 0xd4, 0x40,
0x14, 0xc6, 0x33, 0x2c, 0x4b, 0xd8, 0x43, 0x40, 0x72, 0x58, 0x60, 0x6d, 0x30, 0xe2, 0x18, 0x13,
0x10, 0xd2, 0xc2, 0x2a, 0x89, 0xc1, 0x98, 0x68, 0x88, 0xe0, 0x05, 0x17, 0xa6, 0xfe, 0x21, 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81, 0x97, 0x91, 0x2f, 0xd1, 0x3e, 0x57, 0x4b, 0x54, 0xa6, 0x4f, 0x6a,
0x47, 0x59, 0x7f, 0x82, 0x8f, 0x47, 0x30, 0x81, 0x5f, 0x49, 0xf6, 0x9f, 0x84, 0xee, 0x26, 0xf0,
0xce, 0x5f, 0x49, 0x0c, 0x2c, 0xfd, 0x57, 0x49, 0x4a, 0xf9, 0x50, 0x51, 0xda, 0x38, 0x54, 0xfc,
0x8f, 0x27, 0xd4, 0xaf, 0x83, 0x07, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x32, 0xe7, 0x89, 0x2c,
0x6b, 0x08, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

View File

@@ -246,6 +246,52 @@ func local_request_WorkflowService_ListWorkflows_0(ctx context.Context, marshale
}
func request_WorkflowService_WatchWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (WorkflowService_WatchWorkflowClient, runtime.ServerMetadata, error) {
var protoReq WatchWorkflowRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["namespace"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
}
protoReq.Namespace, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
val, ok = pathParams["name"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
}
protoReq.Name, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
stream, err := client.WatchWorkflow(ctx, &protoReq)
if err != nil {
return nil, metadata, err
}
header, err := stream.Header()
if err != nil {
return nil, metadata, err
}
metadata.HeaderMD = header
return stream, metadata, nil
}
func request_WorkflowService_CreateWorkflowTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateWorkflowTemplateRequest
var metadata runtime.ServerMetadata
@@ -792,6 +838,13 @@ func RegisterWorkflowServiceHandlerServer(ctx context.Context, mux *runtime.Serv
})
mux.Handle("GET", pattern_WorkflowService_WatchWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
})
mux.Handle("POST", pattern_WorkflowService_CreateWorkflowTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1013,6 +1066,26 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
})
mux.Handle("GET", pattern_WorkflowService_WatchWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WorkflowService_WatchWorkflow_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_WatchWorkflow_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_WorkflowService_CreateWorkflowTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1143,6 +1216,8 @@ var (
pattern_WorkflowService_ListWorkflows_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workflows"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_WatchWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflows", "name", "watch"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_CreateWorkflowTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workflow_templates"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_CreateWorkflowTemplateVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflow_templates", "workflowTemplate.uid", "versions"}, "", runtime.AssumeColonVerbOpt(true)))
@@ -1163,6 +1238,8 @@ var (
forward_WorkflowService_ListWorkflows_0 = runtime.ForwardResponseMessage
forward_WorkflowService_WatchWorkflow_0 = runtime.ForwardResponseStream
forward_WorkflowService_CreateWorkflowTemplate_0 = runtime.ForwardResponseMessage
forward_WorkflowService_CreateWorkflowTemplateVersion_0 = runtime.ForwardResponseMessage

View File

@@ -26,7 +26,11 @@ service WorkflowService {
};
}
rpc WatchWorkflow (WatchWorkflowRequest) returns (stream Workflow) {}
rpc WatchWorkflow (WatchWorkflowRequest) returns (stream Workflow) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflows/{name}/watch"
};
}
rpc CreateWorkflowTemplate (CreateWorkflowTemplateRequest) returns (WorkflowTemplate) {
option (google.api.http) = {

View File

@@ -297,6 +297,36 @@
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflows/{name}/watch": {
"get": {
"operationId": "WatchWorkflow",
"responses": {
"200": {
"description": "A successful response.(streaming responses)",
"schema": {
"$ref": "#/x-stream-definitions/apiWorkflow"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
}
},
"definitions": {

1
go.mod
View File

@@ -30,6 +30,7 @@ require (
github.com/pressly/goose v2.6.0+incompatible
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/spf13/viper v1.6.1
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5
github.com/valyala/fasttemplate v1.1.0 // indirect
golang.org/x/crypto v0.0.0-20191128160524-b544559bb6d1 // indirect
golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933 // indirect

1
go.sum
View File

@@ -240,6 +240,7 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=

View File

@@ -18,6 +18,7 @@ import (
"github.com/spf13/viper"
"google.golang.org/grpc"
"github.com/gorilla/handlers"
"github.com/tmc/grpc-websocket-proxy/wsproxy"
)
var (
@@ -94,7 +95,7 @@ func startHTTPProxy() {
}
log.Printf("Starting HTTP proxy on port %v", *httpPort)
if err = http.ListenAndServe(*httpPort, handlers.CORS()(mux)); err != nil {
if err = http.ListenAndServe(*httpPort, wsproxy.WebsocketProxy(handlers.CORS()(mux))); err != nil {
log.Fatalf("Failed to serve HTTP listener: %v", err)
}
}