Skip to content

Commit

Permalink
feat: updated deps
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Jun 14, 2024
1 parent 9305ed6 commit 0b9608e
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/cenkalti/backoff/v4 v4.1.0
github.com/crawlab-team/crawlab-db v0.6.0-beta.20220417.1300.0.20221226064900-5a357ee73484
github.com/crawlab-team/crawlab-fs v0.6.3-2
github.com/crawlab-team/crawlab-grpc v0.6.4-0.20240614065204-c753fc33f7ca
github.com/crawlab-team/crawlab-grpc v0.6.4-0.20240614072247-7558f2150cee
github.com/crawlab-team/crawlab-vcs v0.6.2-0.20230629045457-afe0be0e2185
github.com/crawlab-team/go-trace v0.1.1
github.com/crawlab-team/template-parser v0.0.4-0.20221006034646-9bb77a7ae86e
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ github.com/crawlab-team/crawlab-fs v0.6.3-2 h1:GAovTF1R1PLoQgj+0F1GpePrlp1k7RtW/
github.com/crawlab-team/crawlab-fs v0.6.3-2/go.mod h1:Nob0uFr82IPbkk6LEYG0BAB2NgJ3PKoNVhtcbf5fLf0=
github.com/crawlab-team/crawlab-grpc v0.6.4-0.20240614065204-c753fc33f7ca h1:7LOFAWCIK+153f5J437xXhlI1miUQ3mrm3OXGq2/m3U=
github.com/crawlab-team/crawlab-grpc v0.6.4-0.20240614065204-c753fc33f7ca/go.mod h1:j5FaFuWfIxHbmFXedFaUZHO2DpLqS3QZ0x7W3APN0fQ=
github.com/crawlab-team/crawlab-grpc v0.6.4-0.20240614072247-7558f2150cee h1:jlT64UPWbf5Xny3jOzKE35od1F+OuGK+y8PTNomyxiM=
github.com/crawlab-team/crawlab-grpc v0.6.4-0.20240614072247-7558f2150cee/go.mod h1:j5FaFuWfIxHbmFXedFaUZHO2DpLqS3QZ0x7W3APN0fQ=
github.com/crawlab-team/crawlab-vcs v0.6.2-0.20230629045457-afe0be0e2185 h1:A/XSUuGgGMn+z+lFd2ye2ClgIKhDZYUerhOL5jePQhU=
github.com/crawlab-team/crawlab-vcs v0.6.2-0.20230629045457-afe0be0e2185/go.mod h1:YHMYUEoSqfXUZHsWW/M/DaLh/zOpRtiElaRWcrGyv/I=
github.com/crawlab-team/go-trace v0.1.0/go.mod h1:LcWyn68HoT+d29CHM8L41pFHxsAcBMF1xjqJmWdyFh8=
Expand Down
5 changes: 2 additions & 3 deletions grpc/client/client_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type GrpcClientV2 struct {
NodeClient grpc2.NodeServiceClient
TaskClient grpc2.TaskServiceClient
ModelBaseServiceV2Client grpc2.ModelBaseServiceV2Client
DependenciesClient grpc2.DependencyServiceV2Client
}

func (c *GrpcClientV2) Init() (err error) {
Expand Down Expand Up @@ -91,12 +92,10 @@ func (c *GrpcClientV2) Stop() (err error) {
}

func (c *GrpcClientV2) Register() {
// node
c.NodeClient = grpc2.NewNodeServiceClient(c.conn)
// model base service
c.ModelBaseServiceV2Client = grpc2.NewModelBaseServiceV2Client(c.conn)
// task
c.TaskClient = grpc2.NewTaskServiceClient(c.conn)
c.DependenciesClient = grpc2.NewDependencyServiceV2Client(c.conn)

// log
log.Infof("[GrpcClient] grpc client registered client services")
Expand Down
32 changes: 32 additions & 0 deletions grpc/server/dependencies_server_v2.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package server

import (
"context"
grpc "github.com/crawlab-team/crawlab-grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

type DependenciesServerV2 struct {
grpc.UnimplementedDependencyServiceV2Server
}

func (svr DependenciesServerV2) Connect(stream grpc.DependencyServiceV2_ConnectServer) (err error) {
return status.Errorf(codes.Unimplemented, "method Connect not implemented")
}

func (svr DependenciesServerV2) Sync(ctx context.Context, request *grpc.DependenciesServiceV2SyncRequest) (response *grpc.Response, err error) {
return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented")
}

func (svr DependenciesServerV2) Install(stream grpc.DependencyServiceV2_InstallServer) (err error) {
return status.Errorf(codes.Unimplemented, "method Install not implemented")
}

func (svr DependenciesServerV2) UninstallDependencies(stream grpc.DependencyServiceV2_UninstallDependenciesServer) (err error) {
return status.Errorf(codes.Unimplemented, "method UninstallDependencies not implemented")
}

func NewDependenciesServerV2() *DependenciesServerV2 {
return &DependenciesServerV2{}
}
8 changes: 5 additions & 3 deletions grpc/server/server_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ type GrpcServerV2 struct {
stopped bool

// dependencies
nodeCfgSvc interfaces.NodeConfigService
nodeCfgSvc interfaces.NodeConfigService

// servers
nodeSvr *NodeServerV2
taskSvr *TaskServerV2
modelBaseServiceSvr *ModelBaseServiceServerV2
dependenciesSvr *DependenciesServerV2
}

func (svr *GrpcServerV2) GetConfigPath() (path string) {
Expand Down Expand Up @@ -207,13 +210,12 @@ func NewGrpcServerV2() (svr *GrpcServerV2, err error) {
if err != nil {
return nil, err
}

svr.modelBaseServiceSvr = NewModelBaseServiceV2Server()

svr.taskSvr, err = NewTaskServerV2()
if err != nil {
return nil, err
}
svr.dependenciesSvr = NewDependenciesServerV2()

// recovery options
recoveryOpts := []grpc_recovery.Option{
Expand Down
2 changes: 1 addition & 1 deletion node/service/master_service_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func NewMasterServiceV2() (res interfaces.NodeMasterService, err error) {
}

// grpc server
svc.server, err = server.NewGrpcServerV2()
svc.server, err = server.GetGrpcServerV2()
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 0b9608e

Please sign in to comment.