Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <pingsutw@apache.org>
  • Loading branch information
pingsutw committed Mar 6, 2023
1 parent 145422f commit c185a89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion go/tasks/plugins/webapi/grpc/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ import (
"github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/core"
pluginsCore "github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/core"
"github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/webapi"
"github.com/flyteorg/flytestdlib/logger"
"github.com/flyteorg/flytestdlib/promutils"
"google.golang.org/grpc"
"time"
)

type Plugin struct {
Expand Down Expand Up @@ -62,11 +64,12 @@ func (p Plugin) Create(ctx context.Context, taskCtx webapi.TaskExecutionContextR
return nil, nil, fmt.Errorf("failed to connect backend plugin system")
}
defer conn.Close()

client := service.NewBackendPluginServiceClient(conn)
t := taskTemplate.Type
taskTemplate.Type = "dummy" // Dummy plugin is used to test performance
start := time.Now()
res, err := client.CreateTask(ctx, &service.TaskCreateRequest{Inputs: inputs, Template: taskTemplate, OutputPrefix: outputPrefix})
logger.Infof(ctx, "grpc create request latency [%v]", time.Since(start).Round(time.Microsecond).String())
taskTemplate.Type = t
if err != nil {
return nil, nil, err
Expand Down

0 comments on commit c185a89

Please sign in to comment.