Merge pull request #324 from hashicorp/fix-packaged-hang

Fix hanging commands when using packaged installation
This commit is contained in:
Chris Roberts 2022-07-26 09:12:50 -07:00 committed by GitHub
commit 54502d5d66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 376 additions and 177 deletions

View File

@ -10,10 +10,10 @@ import (
"strings"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/vagrant-plugin-sdk/component"
"github.com/hashicorp/vagrant-plugin-sdk/helper/paths"
"github.com/hashicorp/vagrant-plugin-sdk/internal-shared/cleanup"
"github.com/hashicorp/vagrant-plugin-sdk/terminal"
"github.com/hashicorp/vagrant/internal/clicontext"
"github.com/hashicorp/vagrant/internal/client"
@ -105,26 +105,24 @@ type baseCommand struct {
// options passed in at the global level
globalOptions []Option
// used to store cleanup tasks at close
cleanup cleanup.Cleanup
}
// Close cleans up any resources that the command created. This should be
// defered by any CLI command that embeds baseCommand in the Run command.
func (c *baseCommand) Close() (err error) {
c.Log.Trace("starting command closing")
if closer, ok := c.ui.(io.Closer); ok && closer != nil {
c.Log.Trace("closing command ui")
if e := closer.Close(); e != nil {
err = multierror.Append(err, e)
}
if c.cleanup == nil {
return nil
}
if c.client != nil {
c.Log.Trace("closing command client")
if e := c.client.Close(); e != nil {
err = multierror.Append(err, e)
}
err = c.cleanup.Close()
if err != nil {
c.Log.Error("failure encountered while closing command",
"error", err,
)
}
return
}
@ -133,9 +131,29 @@ func BaseCommand(ctx context.Context, log hclog.Logger, logOutput io.Writer, opt
Ctx: ctx,
Log: log,
LogOutput: logOutput,
cleanup: cleanup.New(),
flagData: map[*component.CommandFlag]interface{}{},
}
// Define a cleanup to close the UI if it's set
bc.cleanup.Do(func() error {
if bc.ui != nil {
if closer, ok := bc.ui.(io.Closer); ok && closer != nil {
return closer.Close()
}
}
return err
})
// Define a cleanup task to close the client if it's set
bc.cleanup.Do(func() error {
if bc.client != nil {
return bc.client.Close()
}
return nil
})
// Get just enough base configuration to
// allow setting up our client connection
c := &baseConfig{

View File

@ -111,6 +111,13 @@ func Main(args []string) int {
panic(err)
}
// Close the base here manually so we can detect if an
// error was encountered and modify the exit code if so
err = base.Close()
if err != nil {
exitCode = -1
}
return exitCode
}

View File

@ -2,6 +2,7 @@ package client
import (
"context"
"fmt"
"io/fs"
"net"
"os"
@ -205,8 +206,32 @@ func (c *Client) initVagrantRubyRuntime() (rubyRuntime plugin.ClientProtocol, er
return
}
// Ensure the plugin is halted when the basis is cleaned up
c.Cleanup(func() error { return rubyRuntime.Close() })
// Send a request to the vagrant ruby runtime to shut itself down
// NOTE: Closing the client when using the official package will not
// stop the process. This is because the package uses a custom
// wrapper for starting Vagrant which results in a different
// PID than what is originally started.
c.Cleanup(func() error {
vr, err := rubyRuntime.Dispense("vagrantrubyruntime")
if err != nil {
c.logger.Error("failed to dispense the vagrant ruby runtime",
"error", err,
)
return err
}
vrc, ok := vr.(serverclient.RubyVagrantClient)
if !ok {
c.logger.Error("dispensed value is not a ruby runtime client")
return fmt.Errorf("dispensed value is not a ruby vagrant client (%T)", vr)
}
return vrc.Stop()
})
// Close the ruby runtime client.
c.Cleanup(func() error {
return rubyRuntime.Close()
})
return
}

View File

@ -109,7 +109,54 @@ func (x Plugin_Type) Number() protoreflect.EnumNumber {
// Deprecated: Use Plugin_Type.Descriptor instead.
func (Plugin_Type) EnumDescriptor() ([]byte, []int) {
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{1, 0}
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{2, 0}
}
type GetPluginsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ProjectPath string `protobuf:"bytes,1,opt,name=project_path,json=projectPath,proto3" json:"project_path,omitempty"`
}
func (x *GetPluginsRequest) Reset() {
*x = GetPluginsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetPluginsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetPluginsRequest) ProtoMessage() {}
func (x *GetPluginsRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetPluginsRequest.ProtoReflect.Descriptor instead.
func (*GetPluginsRequest) Descriptor() ([]byte, []int) {
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{0}
}
func (x *GetPluginsRequest) GetProjectPath() string {
if x != nil {
return x.ProjectPath
}
return ""
}
type GetPluginsResponse struct {
@ -123,7 +170,7 @@ type GetPluginsResponse struct {
func (x *GetPluginsResponse) Reset() {
*x = GetPluginsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[0]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -136,7 +183,7 @@ func (x *GetPluginsResponse) String() string {
func (*GetPluginsResponse) ProtoMessage() {}
func (x *GetPluginsResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[0]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -149,7 +196,7 @@ func (x *GetPluginsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetPluginsResponse.ProtoReflect.Descriptor instead.
func (*GetPluginsResponse) Descriptor() ([]byte, []int) {
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{0}
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{1}
}
func (x *GetPluginsResponse) GetPlugins() []*Plugin {
@ -175,7 +222,7 @@ type Plugin struct {
func (x *Plugin) Reset() {
*x = Plugin{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[1]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -188,7 +235,7 @@ func (x *Plugin) String() string {
func (*Plugin) ProtoMessage() {}
func (x *Plugin) ProtoReflect() protoreflect.Message {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[1]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -201,7 +248,7 @@ func (x *Plugin) ProtoReflect() protoreflect.Message {
// Deprecated: Use Plugin.ProtoReflect.Descriptor instead.
func (*Plugin) Descriptor() ([]byte, []int) {
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{1}
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{2}
}
func (x *Plugin) GetName() string {
@ -237,7 +284,7 @@ type ParseVagrantfileRequest struct {
func (x *ParseVagrantfileRequest) Reset() {
*x = ParseVagrantfileRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[2]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -250,7 +297,7 @@ func (x *ParseVagrantfileRequest) String() string {
func (*ParseVagrantfileRequest) ProtoMessage() {}
func (x *ParseVagrantfileRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[2]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -263,7 +310,7 @@ func (x *ParseVagrantfileRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ParseVagrantfileRequest.ProtoReflect.Descriptor instead.
func (*ParseVagrantfileRequest) Descriptor() ([]byte, []int) {
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{2}
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{3}
}
func (x *ParseVagrantfileRequest) GetPath() string {
@ -284,7 +331,7 @@ type ParseVagrantfileProcRequest struct {
func (x *ParseVagrantfileProcRequest) Reset() {
*x = ParseVagrantfileProcRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[3]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -297,7 +344,7 @@ func (x *ParseVagrantfileProcRequest) String() string {
func (*ParseVagrantfileProcRequest) ProtoMessage() {}
func (x *ParseVagrantfileProcRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[3]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -310,7 +357,7 @@ func (x *ParseVagrantfileProcRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ParseVagrantfileProcRequest.ProtoReflect.Descriptor instead.
func (*ParseVagrantfileProcRequest) Descriptor() ([]byte, []int) {
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{3}
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{4}
}
func (x *ParseVagrantfileProcRequest) GetProc() *vagrant_plugin_sdk.Args_ProcRef {
@ -332,7 +379,7 @@ type ParseVagrantfileResponse struct {
func (x *ParseVagrantfileResponse) Reset() {
*x = ParseVagrantfileResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[4]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -345,7 +392,7 @@ func (x *ParseVagrantfileResponse) String() string {
func (*ParseVagrantfileResponse) ProtoMessage() {}
func (x *ParseVagrantfileResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[4]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -358,7 +405,7 @@ func (x *ParseVagrantfileResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ParseVagrantfileResponse.ProtoReflect.Descriptor instead.
func (*ParseVagrantfileResponse) Descriptor() ([]byte, []int) {
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{4}
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{5}
}
func (x *ParseVagrantfileResponse) GetData() *vagrant_plugin_sdk.Args_Hash {
@ -379,7 +426,7 @@ type ParseVagrantfileSubvmRequest struct {
func (x *ParseVagrantfileSubvmRequest) Reset() {
*x = ParseVagrantfileSubvmRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[5]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -392,7 +439,7 @@ func (x *ParseVagrantfileSubvmRequest) String() string {
func (*ParseVagrantfileSubvmRequest) ProtoMessage() {}
func (x *ParseVagrantfileSubvmRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[5]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -405,7 +452,7 @@ func (x *ParseVagrantfileSubvmRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ParseVagrantfileSubvmRequest.ProtoReflect.Descriptor instead.
func (*ParseVagrantfileSubvmRequest) Descriptor() ([]byte, []int) {
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{5}
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{6}
}
func (x *ParseVagrantfileSubvmRequest) GetSubvm() *vagrant_plugin_sdk.Config_RawRubyValue {
@ -427,7 +474,7 @@ type ParseVagrantfileProviderRequest struct {
func (x *ParseVagrantfileProviderRequest) Reset() {
*x = ParseVagrantfileProviderRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[6]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -440,7 +487,7 @@ func (x *ParseVagrantfileProviderRequest) String() string {
func (*ParseVagrantfileProviderRequest) ProtoMessage() {}
func (x *ParseVagrantfileProviderRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[6]
mi := &file_proto_ruby_vagrant_ruby_server_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -453,7 +500,7 @@ func (x *ParseVagrantfileProviderRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ParseVagrantfileProviderRequest.ProtoReflect.Descriptor instead.
func (*ParseVagrantfileProviderRequest) Descriptor() ([]byte, []int) {
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{6}
return file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP(), []int{7}
}
func (x *ParseVagrantfileProviderRequest) GetSubvm() *vagrant_plugin_sdk.Config_RawRubyValue {
@ -483,101 +530,109 @@ var file_proto_ruby_vagrant_ruby_server_proto_rawDesc = []byte{
0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x65, 0x72,
0x72, 0x6f, 0x72, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x0c, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
0x49, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73,
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f,
0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69,
0x6e, 0x52, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x22, 0xe0, 0x02, 0x0a, 0x06, 0x50,
0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x79, 0x70,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63,
0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x6c, 0x75, 0x67,
0x69, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a,
0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xdd, 0x01,
0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57,
0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x10, 0x01,
0x12, 0x10, 0x0a, 0x0c, 0x43, 0x4f, 0x4d, 0x4d, 0x55, 0x4e, 0x49, 0x43, 0x41, 0x54, 0x4f, 0x52,
0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x55, 0x45, 0x53, 0x54, 0x10, 0x03, 0x12, 0x08, 0x0a,
0x04, 0x48, 0x4f, 0x53, 0x54, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x52, 0x4f, 0x56, 0x49,
0x44, 0x45, 0x52, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49,
0x4f, 0x4e, 0x45, 0x52, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x59, 0x4e, 0x43, 0x45, 0x44,
0x46, 0x4f, 0x4c, 0x44, 0x45, 0x52, 0x10, 0x07, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x55, 0x54, 0x48,
0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x08, 0x12, 0x0f, 0x0a, 0x0b, 0x4c,
0x4f, 0x47, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x10, 0x09, 0x12, 0x0d, 0x0a, 0x09,
0x4c, 0x4f, 0x47, 0x56, 0x49, 0x45, 0x57, 0x45, 0x52, 0x10, 0x0a, 0x12, 0x0a, 0x0a, 0x06, 0x4d,
0x41, 0x50, 0x50, 0x45, 0x52, 0x10, 0x0b, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4e, 0x46, 0x49,
0x47, 0x10, 0x0c, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x49, 0x4e, 0x46,
0x4f, 0x10, 0x0d, 0x12, 0x08, 0x0a, 0x04, 0x50, 0x55, 0x53, 0x48, 0x10, 0x0e, 0x22, 0x2d, 0x0a,
0x17, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c,
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x56, 0x0a, 0x1b,
0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65,
0x50, 0x72, 0x6f, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x70,
0x72, 0x6f, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x68, 0x61, 0x73, 0x68,
0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x73, 0x64,
0x6b, 0x2e, 0x41, 0x72, 0x67, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x52, 0x65, 0x66, 0x52, 0x04,
0x70, 0x72, 0x6f, 0x63, 0x22, 0x50, 0x0a, 0x18, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67,
0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x34, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20,
0x36, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f,
0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a,
0x65, 0x63, 0x74, 0x50, 0x61, 0x74, 0x68, 0x22, 0x49, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x6c,
0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a,
0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19,
0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61,
0x6e, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x41, 0x72, 0x67, 0x73, 0x2e, 0x48, 0x61, 0x73, 0x68,
0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x60, 0x0a, 0x1c, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56,
0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x75, 0x62, 0x76, 0x6d, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x05, 0x73, 0x75, 0x62, 0x76, 0x6d, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72,
0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x61, 0x77, 0x52, 0x75, 0x62, 0x79, 0x56, 0x61, 0x6c, 0x75,
0x65, 0x52, 0x05, 0x73, 0x75, 0x62, 0x76, 0x6d, 0x22, 0x7f, 0x0a, 0x1f, 0x50, 0x61, 0x72, 0x73,
0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x76,
0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x05, 0x73,
0x75, 0x62, 0x76, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x68, 0x61, 0x73,
0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x73,
0x64, 0x6b, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x61, 0x77, 0x52, 0x75, 0x62,
0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x73, 0x75, 0x62, 0x76, 0x6d, 0x12, 0x1a, 0x0a,
0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x32, 0xb0, 0x04, 0x0a, 0x0b, 0x52, 0x75,
0x62, 0x79, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x4b, 0x0a, 0x0a, 0x47, 0x65, 0x74,
0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a,
0x25, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72,
0x6e, 0x74, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69,
0x6e, 0x73, 0x22, 0xe0, 0x02, 0x0a, 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x0a,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x1e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72,
0x61, 0x6e, 0x74, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52,
0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x6f, 0x70,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xdd, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b,
0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43,
0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x43, 0x4f, 0x4d, 0x4d,
0x55, 0x4e, 0x49, 0x43, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x55,
0x45, 0x53, 0x54, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f, 0x53, 0x54, 0x10, 0x04, 0x12,
0x0c, 0x0a, 0x08, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x10, 0x05, 0x12, 0x0f, 0x0a,
0x0b, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x52, 0x10, 0x06, 0x12, 0x10,
0x0a, 0x0c, 0x53, 0x59, 0x4e, 0x43, 0x45, 0x44, 0x46, 0x4f, 0x4c, 0x44, 0x45, 0x52, 0x10, 0x07,
0x12, 0x11, 0x0a, 0x0d, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x4f,
0x52, 0x10, 0x08, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x4f, 0x47, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f,
0x52, 0x4d, 0x10, 0x09, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x4f, 0x47, 0x56, 0x49, 0x45, 0x57, 0x45,
0x52, 0x10, 0x0a, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x41, 0x50, 0x50, 0x45, 0x52, 0x10, 0x0b, 0x12,
0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x0c, 0x12, 0x0e, 0x0a, 0x0a, 0x50,
0x4c, 0x55, 0x47, 0x49, 0x4e, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x0d, 0x12, 0x08, 0x0a, 0x04, 0x50,
0x55, 0x53, 0x48, 0x10, 0x0e, 0x22, 0x2d, 0x0a, 0x17, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61,
0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x70, 0x61, 0x74, 0x68, 0x22, 0x56, 0x0a, 0x1b, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67,
0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x63, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x70, 0x72, 0x6f, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x23, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61,
0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x41, 0x72, 0x67, 0x73, 0x2e, 0x50,
0x72, 0x6f, 0x63, 0x52, 0x65, 0x66, 0x52, 0x04, 0x70, 0x72, 0x6f, 0x63, 0x22, 0x50, 0x0a, 0x18,
0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f,
0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x41,
0x72, 0x67, 0x73, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x60,
0x0a, 0x1c, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69,
0x6c, 0x65, 0x53, 0x75, 0x62, 0x76, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40,
0x0a, 0x05, 0x73, 0x75, 0x62, 0x76, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e,
0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e,
0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x61, 0x77,
0x52, 0x75, 0x62, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x73, 0x75, 0x62, 0x76, 0x6d,
0x22, 0x7f, 0x0a, 0x1f, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74,
0x66, 0x69, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x05, 0x73, 0x75, 0x62, 0x76, 0x6d, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76,
0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x2e, 0x52, 0x61, 0x77, 0x52, 0x75, 0x62, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05,
0x73, 0x75, 0x62, 0x76, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
0x72, 0x32, 0xf6, 0x04, 0x0a, 0x0b, 0x52, 0x75, 0x62, 0x79, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e,
0x74, 0x12, 0x59, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12,
0x24, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72,
0x61, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x10, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56,
0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x2a, 0x2e, 0x68, 0x61, 0x73,
0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50,
0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f,
0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65,
0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, 0x14, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72,
0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x63, 0x12, 0x2e, 0x2e, 0x68, 0x61,
0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72,
0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75,
0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x10,
0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65,
0x50, 0x72, 0x6f, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x68, 0x61,
0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e,
0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x15, 0x50, 0x61, 0x72, 0x73,
0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x75, 0x62, 0x76,
0x6d, 0x12, 0x2f, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61,
0x12, 0x2a, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67,
0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e,
0x74, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x68,
0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74,
0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c,
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, 0x14, 0x50, 0x61, 0x72,
0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x72, 0x6f,
0x63, 0x12, 0x2e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61,
0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61,
0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x75, 0x62, 0x76, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76,
0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72,
0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x7b, 0x0a, 0x18, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66,
0x69, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x32, 0x2e, 0x68, 0x61,
0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e,
0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65,
0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x2b, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72,
0x61, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74,
0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x41, 0x5a, 0x3f,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69,
0x63, 0x6f, 0x72, 0x70, 0x2f, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2f, 0x69, 0x6e, 0x74,
0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x2f, 0x72, 0x75, 0x62, 0x79, 0x5f, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x2b, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61,
0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61,
0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75,
0x0a, 0x15, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69,
0x6c, 0x65, 0x53, 0x75, 0x62, 0x76, 0x6d, 0x12, 0x2f, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63,
0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x73,
0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x75, 0x62, 0x76,
0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69,
0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72,
0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x18, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61,
0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
0x72, 0x12, 0x32, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61,
0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56, 0x61, 0x67, 0x72, 0x61,
0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72,
0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x56,
0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f,
0x72, 0x70, 0x2f, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72,
0x6e, 0x61, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x72, 0x75, 0x62, 0x79, 0x5f, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -593,42 +648,45 @@ func file_proto_ruby_vagrant_ruby_server_proto_rawDescGZIP() []byte {
}
var file_proto_ruby_vagrant_ruby_server_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_proto_ruby_vagrant_ruby_server_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_proto_ruby_vagrant_ruby_server_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_proto_ruby_vagrant_ruby_server_proto_goTypes = []interface{}{
(Plugin_Type)(0), // 0: hashicorp.vagrant.Plugin.Type
(*GetPluginsResponse)(nil), // 1: hashicorp.vagrant.GetPluginsResponse
(*Plugin)(nil), // 2: hashicorp.vagrant.Plugin
(*ParseVagrantfileRequest)(nil), // 3: hashicorp.vagrant.ParseVagrantfileRequest
(*ParseVagrantfileProcRequest)(nil), // 4: hashicorp.vagrant.ParseVagrantfileProcRequest
(*ParseVagrantfileResponse)(nil), // 5: hashicorp.vagrant.ParseVagrantfileResponse
(*ParseVagrantfileSubvmRequest)(nil), // 6: hashicorp.vagrant.ParseVagrantfileSubvmRequest
(*ParseVagrantfileProviderRequest)(nil), // 7: hashicorp.vagrant.ParseVagrantfileProviderRequest
(*anypb.Any)(nil), // 8: google.protobuf.Any
(*vagrant_plugin_sdk.Args_ProcRef)(nil), // 9: hashicorp.vagrant.sdk.Args.ProcRef
(*vagrant_plugin_sdk.Args_Hash)(nil), // 10: hashicorp.vagrant.sdk.Args.Hash
(*vagrant_plugin_sdk.Config_RawRubyValue)(nil), // 11: hashicorp.vagrant.sdk.Config.RawRubyValue
(*emptypb.Empty)(nil), // 12: google.protobuf.Empty
(*GetPluginsRequest)(nil), // 1: hashicorp.vagrant.GetPluginsRequest
(*GetPluginsResponse)(nil), // 2: hashicorp.vagrant.GetPluginsResponse
(*Plugin)(nil), // 3: hashicorp.vagrant.Plugin
(*ParseVagrantfileRequest)(nil), // 4: hashicorp.vagrant.ParseVagrantfileRequest
(*ParseVagrantfileProcRequest)(nil), // 5: hashicorp.vagrant.ParseVagrantfileProcRequest
(*ParseVagrantfileResponse)(nil), // 6: hashicorp.vagrant.ParseVagrantfileResponse
(*ParseVagrantfileSubvmRequest)(nil), // 7: hashicorp.vagrant.ParseVagrantfileSubvmRequest
(*ParseVagrantfileProviderRequest)(nil), // 8: hashicorp.vagrant.ParseVagrantfileProviderRequest
(*anypb.Any)(nil), // 9: google.protobuf.Any
(*vagrant_plugin_sdk.Args_ProcRef)(nil), // 10: hashicorp.vagrant.sdk.Args.ProcRef
(*vagrant_plugin_sdk.Args_Hash)(nil), // 11: hashicorp.vagrant.sdk.Args.Hash
(*vagrant_plugin_sdk.Config_RawRubyValue)(nil), // 12: hashicorp.vagrant.sdk.Config.RawRubyValue
(*emptypb.Empty)(nil), // 13: google.protobuf.Empty
}
var file_proto_ruby_vagrant_ruby_server_proto_depIdxs = []int32{
2, // 0: hashicorp.vagrant.GetPluginsResponse.plugins:type_name -> hashicorp.vagrant.Plugin
3, // 0: hashicorp.vagrant.GetPluginsResponse.plugins:type_name -> hashicorp.vagrant.Plugin
0, // 1: hashicorp.vagrant.Plugin.type:type_name -> hashicorp.vagrant.Plugin.Type
8, // 2: hashicorp.vagrant.Plugin.options:type_name -> google.protobuf.Any
9, // 3: hashicorp.vagrant.ParseVagrantfileProcRequest.proc:type_name -> hashicorp.vagrant.sdk.Args.ProcRef
10, // 4: hashicorp.vagrant.ParseVagrantfileResponse.data:type_name -> hashicorp.vagrant.sdk.Args.Hash
11, // 5: hashicorp.vagrant.ParseVagrantfileSubvmRequest.subvm:type_name -> hashicorp.vagrant.sdk.Config.RawRubyValue
11, // 6: hashicorp.vagrant.ParseVagrantfileProviderRequest.subvm:type_name -> hashicorp.vagrant.sdk.Config.RawRubyValue
12, // 7: hashicorp.vagrant.RubyVagrant.GetPlugins:input_type -> google.protobuf.Empty
3, // 8: hashicorp.vagrant.RubyVagrant.ParseVagrantfile:input_type -> hashicorp.vagrant.ParseVagrantfileRequest
4, // 9: hashicorp.vagrant.RubyVagrant.ParseVagrantfileProc:input_type -> hashicorp.vagrant.ParseVagrantfileProcRequest
6, // 10: hashicorp.vagrant.RubyVagrant.ParseVagrantfileSubvm:input_type -> hashicorp.vagrant.ParseVagrantfileSubvmRequest
7, // 11: hashicorp.vagrant.RubyVagrant.ParseVagrantfileProvider:input_type -> hashicorp.vagrant.ParseVagrantfileProviderRequest
1, // 12: hashicorp.vagrant.RubyVagrant.GetPlugins:output_type -> hashicorp.vagrant.GetPluginsResponse
5, // 13: hashicorp.vagrant.RubyVagrant.ParseVagrantfile:output_type -> hashicorp.vagrant.ParseVagrantfileResponse
5, // 14: hashicorp.vagrant.RubyVagrant.ParseVagrantfileProc:output_type -> hashicorp.vagrant.ParseVagrantfileResponse
5, // 15: hashicorp.vagrant.RubyVagrant.ParseVagrantfileSubvm:output_type -> hashicorp.vagrant.ParseVagrantfileResponse
5, // 16: hashicorp.vagrant.RubyVagrant.ParseVagrantfileProvider:output_type -> hashicorp.vagrant.ParseVagrantfileResponse
12, // [12:17] is the sub-list for method output_type
7, // [7:12] is the sub-list for method input_type
9, // 2: hashicorp.vagrant.Plugin.options:type_name -> google.protobuf.Any
10, // 3: hashicorp.vagrant.ParseVagrantfileProcRequest.proc:type_name -> hashicorp.vagrant.sdk.Args.ProcRef
11, // 4: hashicorp.vagrant.ParseVagrantfileResponse.data:type_name -> hashicorp.vagrant.sdk.Args.Hash
12, // 5: hashicorp.vagrant.ParseVagrantfileSubvmRequest.subvm:type_name -> hashicorp.vagrant.sdk.Config.RawRubyValue
12, // 6: hashicorp.vagrant.ParseVagrantfileProviderRequest.subvm:type_name -> hashicorp.vagrant.sdk.Config.RawRubyValue
1, // 7: hashicorp.vagrant.RubyVagrant.GetPlugins:input_type -> hashicorp.vagrant.GetPluginsRequest
4, // 8: hashicorp.vagrant.RubyVagrant.ParseVagrantfile:input_type -> hashicorp.vagrant.ParseVagrantfileRequest
5, // 9: hashicorp.vagrant.RubyVagrant.ParseVagrantfileProc:input_type -> hashicorp.vagrant.ParseVagrantfileProcRequest
7, // 10: hashicorp.vagrant.RubyVagrant.ParseVagrantfileSubvm:input_type -> hashicorp.vagrant.ParseVagrantfileSubvmRequest
8, // 11: hashicorp.vagrant.RubyVagrant.ParseVagrantfileProvider:input_type -> hashicorp.vagrant.ParseVagrantfileProviderRequest
13, // 12: hashicorp.vagrant.RubyVagrant.Stop:input_type -> google.protobuf.Empty
2, // 13: hashicorp.vagrant.RubyVagrant.GetPlugins:output_type -> hashicorp.vagrant.GetPluginsResponse
6, // 14: hashicorp.vagrant.RubyVagrant.ParseVagrantfile:output_type -> hashicorp.vagrant.ParseVagrantfileResponse
6, // 15: hashicorp.vagrant.RubyVagrant.ParseVagrantfileProc:output_type -> hashicorp.vagrant.ParseVagrantfileResponse
6, // 16: hashicorp.vagrant.RubyVagrant.ParseVagrantfileSubvm:output_type -> hashicorp.vagrant.ParseVagrantfileResponse
6, // 17: hashicorp.vagrant.RubyVagrant.ParseVagrantfileProvider:output_type -> hashicorp.vagrant.ParseVagrantfileResponse
13, // 18: hashicorp.vagrant.RubyVagrant.Stop:output_type -> google.protobuf.Empty
13, // [13:19] is the sub-list for method output_type
7, // [7:13] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
@ -641,7 +699,7 @@ func file_proto_ruby_vagrant_ruby_server_proto_init() {
}
if !protoimpl.UnsafeEnabled {
file_proto_ruby_vagrant_ruby_server_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetPluginsResponse); i {
switch v := v.(*GetPluginsRequest); i {
case 0:
return &v.state
case 1:
@ -653,7 +711,7 @@ func file_proto_ruby_vagrant_ruby_server_proto_init() {
}
}
file_proto_ruby_vagrant_ruby_server_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Plugin); i {
switch v := v.(*GetPluginsResponse); i {
case 0:
return &v.state
case 1:
@ -665,7 +723,7 @@ func file_proto_ruby_vagrant_ruby_server_proto_init() {
}
}
file_proto_ruby_vagrant_ruby_server_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ParseVagrantfileRequest); i {
switch v := v.(*Plugin); i {
case 0:
return &v.state
case 1:
@ -677,7 +735,7 @@ func file_proto_ruby_vagrant_ruby_server_proto_init() {
}
}
file_proto_ruby_vagrant_ruby_server_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ParseVagrantfileProcRequest); i {
switch v := v.(*ParseVagrantfileRequest); i {
case 0:
return &v.state
case 1:
@ -689,7 +747,7 @@ func file_proto_ruby_vagrant_ruby_server_proto_init() {
}
}
file_proto_ruby_vagrant_ruby_server_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ParseVagrantfileResponse); i {
switch v := v.(*ParseVagrantfileProcRequest); i {
case 0:
return &v.state
case 1:
@ -701,7 +759,7 @@ func file_proto_ruby_vagrant_ruby_server_proto_init() {
}
}
file_proto_ruby_vagrant_ruby_server_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ParseVagrantfileSubvmRequest); i {
switch v := v.(*ParseVagrantfileResponse); i {
case 0:
return &v.state
case 1:
@ -713,6 +771,18 @@ func file_proto_ruby_vagrant_ruby_server_proto_init() {
}
}
file_proto_ruby_vagrant_ruby_server_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ParseVagrantfileSubvmRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_ruby_vagrant_ruby_server_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ParseVagrantfileProviderRequest); i {
case 0:
return &v.state
@ -731,7 +801,7 @@ func file_proto_ruby_vagrant_ruby_server_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_ruby_vagrant_ruby_server_proto_rawDesc,
NumEnums: 1,
NumMessages: 7,
NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},

View File

@ -13,17 +13,22 @@ import "plugin.proto";
// The service that is implemented for the server backend.
service RubyVagrant {
// Gets available ruby plugins
rpc GetPlugins(google.protobuf.Empty) returns (GetPluginsResponse);
rpc GetPlugins(GetPluginsRequest) returns (GetPluginsResponse);
rpc ParseVagrantfile(ParseVagrantfileRequest) returns (ParseVagrantfileResponse);
rpc ParseVagrantfileProc(ParseVagrantfileProcRequest) returns (ParseVagrantfileResponse);
rpc ParseVagrantfileSubvm(ParseVagrantfileSubvmRequest) returns (ParseVagrantfileResponse);
rpc ParseVagrantfileProvider(ParseVagrantfileProviderRequest) returns (ParseVagrantfileResponse);
rpc Stop(google.protobuf.Empty) returns (google.protobuf.Empty);
}
/********************************************************************
* Plugins
********************************************************************/
message GetPluginsRequest {
string project_path = 1;
}
message GetPluginsResponse {
repeated Plugin plugins = 1;
}

View File

@ -1,4 +1,8 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.19.4
// source: proto/ruby_vagrant/ruby-server.proto
package ruby_vagrant
@ -20,11 +24,12 @@ const _ = grpc.SupportPackageIsVersion7
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type RubyVagrantClient interface {
// Gets available ruby plugins
GetPlugins(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetPluginsResponse, error)
GetPlugins(ctx context.Context, in *GetPluginsRequest, opts ...grpc.CallOption) (*GetPluginsResponse, error)
ParseVagrantfile(ctx context.Context, in *ParseVagrantfileRequest, opts ...grpc.CallOption) (*ParseVagrantfileResponse, error)
ParseVagrantfileProc(ctx context.Context, in *ParseVagrantfileProcRequest, opts ...grpc.CallOption) (*ParseVagrantfileResponse, error)
ParseVagrantfileSubvm(ctx context.Context, in *ParseVagrantfileSubvmRequest, opts ...grpc.CallOption) (*ParseVagrantfileResponse, error)
ParseVagrantfileProvider(ctx context.Context, in *ParseVagrantfileProviderRequest, opts ...grpc.CallOption) (*ParseVagrantfileResponse, error)
Stop(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type rubyVagrantClient struct {
@ -35,7 +40,7 @@ func NewRubyVagrantClient(cc grpc.ClientConnInterface) RubyVagrantClient {
return &rubyVagrantClient{cc}
}
func (c *rubyVagrantClient) GetPlugins(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetPluginsResponse, error) {
func (c *rubyVagrantClient) GetPlugins(ctx context.Context, in *GetPluginsRequest, opts ...grpc.CallOption) (*GetPluginsResponse, error) {
out := new(GetPluginsResponse)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.RubyVagrant/GetPlugins", in, out, opts...)
if err != nil {
@ -80,16 +85,26 @@ func (c *rubyVagrantClient) ParseVagrantfileProvider(ctx context.Context, in *Pa
return out, nil
}
func (c *rubyVagrantClient) Stop(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/hashicorp.vagrant.RubyVagrant/Stop", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// RubyVagrantServer is the server API for RubyVagrant service.
// All implementations must embed UnimplementedRubyVagrantServer
// for forward compatibility
type RubyVagrantServer interface {
// Gets available ruby plugins
GetPlugins(context.Context, *emptypb.Empty) (*GetPluginsResponse, error)
GetPlugins(context.Context, *GetPluginsRequest) (*GetPluginsResponse, error)
ParseVagrantfile(context.Context, *ParseVagrantfileRequest) (*ParseVagrantfileResponse, error)
ParseVagrantfileProc(context.Context, *ParseVagrantfileProcRequest) (*ParseVagrantfileResponse, error)
ParseVagrantfileSubvm(context.Context, *ParseVagrantfileSubvmRequest) (*ParseVagrantfileResponse, error)
ParseVagrantfileProvider(context.Context, *ParseVagrantfileProviderRequest) (*ParseVagrantfileResponse, error)
Stop(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
mustEmbedUnimplementedRubyVagrantServer()
}
@ -97,7 +112,7 @@ type RubyVagrantServer interface {
type UnimplementedRubyVagrantServer struct {
}
func (UnimplementedRubyVagrantServer) GetPlugins(context.Context, *emptypb.Empty) (*GetPluginsResponse, error) {
func (UnimplementedRubyVagrantServer) GetPlugins(context.Context, *GetPluginsRequest) (*GetPluginsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPlugins not implemented")
}
func (UnimplementedRubyVagrantServer) ParseVagrantfile(context.Context, *ParseVagrantfileRequest) (*ParseVagrantfileResponse, error) {
@ -112,6 +127,9 @@ func (UnimplementedRubyVagrantServer) ParseVagrantfileSubvm(context.Context, *Pa
func (UnimplementedRubyVagrantServer) ParseVagrantfileProvider(context.Context, *ParseVagrantfileProviderRequest) (*ParseVagrantfileResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ParseVagrantfileProvider not implemented")
}
func (UnimplementedRubyVagrantServer) Stop(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented")
}
func (UnimplementedRubyVagrantServer) mustEmbedUnimplementedRubyVagrantServer() {}
// UnsafeRubyVagrantServer may be embedded to opt out of forward compatibility for this service.
@ -126,7 +144,7 @@ func RegisterRubyVagrantServer(s grpc.ServiceRegistrar, srv RubyVagrantServer) {
}
func _RubyVagrant_GetPlugins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
in := new(GetPluginsRequest)
if err := dec(in); err != nil {
return nil, err
}
@ -138,7 +156,7 @@ func _RubyVagrant_GetPlugins_Handler(srv interface{}, ctx context.Context, dec f
FullMethod: "/hashicorp.vagrant.RubyVagrant/GetPlugins",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RubyVagrantServer).GetPlugins(ctx, req.(*emptypb.Empty))
return srv.(RubyVagrantServer).GetPlugins(ctx, req.(*GetPluginsRequest))
}
return interceptor(ctx, in, info, handler)
}
@ -215,6 +233,24 @@ func _RubyVagrant_ParseVagrantfileProvider_Handler(srv interface{}, ctx context.
return interceptor(ctx, in, info, handler)
}
func _RubyVagrant_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RubyVagrantServer).Stop(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/hashicorp.vagrant.RubyVagrant/Stop",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RubyVagrantServer).Stop(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
// RubyVagrant_ServiceDesc is the grpc.ServiceDesc for RubyVagrant service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -242,6 +278,10 @@ var RubyVagrant_ServiceDesc = grpc.ServiceDesc{
MethodName: "ParseVagrantfileProvider",
Handler: _RubyVagrant_ParseVagrantfileProvider_Handler,
},
{
MethodName: "Stop",
Handler: _RubyVagrant_Stop_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "proto/ruby_vagrant/ruby-server.proto",

View File

@ -58,7 +58,7 @@ func (r *RubyVagrantClient) GRPCBroker() *plugin.GRPCBroker {
}
func (r *RubyVagrantClient) GetPlugins() ([]*ruby_vagrant.Plugin, error) {
plugins, err := r.client.GetPlugins(context.Background(), &emptypb.Empty{})
plugins, err := r.client.GetPlugins(context.Background(), &ruby_vagrant.GetPluginsRequest{})
if err != nil {
return nil, err
}
@ -121,3 +121,12 @@ func (r *RubyVagrantClient) ParseVagrantfileProvider(provider string, subvm *vag
return resp.Data, nil
}
func (r *RubyVagrantClient) Stop() error {
_, err := r.client.Stop(context.Background(), &emptypb.Empty{})
if err != nil {
return err
}
return nil
}

View File

@ -9,6 +9,9 @@ require 'google/rpc/error_details_pb'
require 'plugin_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("proto/ruby_vagrant/ruby-server.proto", :syntax => :proto3) do
add_message "hashicorp.vagrant.GetPluginsRequest" do
optional :project_path, :string, 1
end
add_message "hashicorp.vagrant.GetPluginsResponse" do
repeated :plugins, :message, 1, "hashicorp.vagrant.Plugin"
end
@ -55,6 +58,7 @@ end
module Hashicorp
module Vagrant
GetPluginsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.GetPluginsRequest").msgclass
GetPluginsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.GetPluginsResponse").msgclass
Plugin = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.Plugin").msgclass
Plugin::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.Plugin.Type").enummodule

View File

@ -17,11 +17,12 @@ module Hashicorp
self.service_name = 'hashicorp.vagrant.RubyVagrant'
# Gets available ruby plugins
rpc :GetPlugins, ::Google::Protobuf::Empty, ::Hashicorp::Vagrant::GetPluginsResponse
rpc :GetPlugins, ::Hashicorp::Vagrant::GetPluginsRequest, ::Hashicorp::Vagrant::GetPluginsResponse
rpc :ParseVagrantfile, ::Hashicorp::Vagrant::ParseVagrantfileRequest, ::Hashicorp::Vagrant::ParseVagrantfileResponse
rpc :ParseVagrantfileProc, ::Hashicorp::Vagrant::ParseVagrantfileProcRequest, ::Hashicorp::Vagrant::ParseVagrantfileResponse
rpc :ParseVagrantfileSubvm, ::Hashicorp::Vagrant::ParseVagrantfileSubvmRequest, ::Hashicorp::Vagrant::ParseVagrantfileResponse
rpc :ParseVagrantfileProvider, ::Hashicorp::Vagrant::ParseVagrantfileProviderRequest, ::Hashicorp::Vagrant::ParseVagrantfileResponse
rpc :Stop, ::Google::Protobuf::Empty, ::Google::Protobuf::Empty
end
Stub = Service.rpc_stub_class

View File

@ -32,6 +32,7 @@ module VagrantPlugins
class << self
attr_accessor :broker
attr_accessor :server
attr_reader :cache
end
@cache = Util::Cacher.new
@ -127,9 +128,12 @@ module VagrantPlugins
STDOUT.puts "1|1|tcp|#{bind_addr}:#{port}|grpc"
STDOUT.flush
logger.info("Vagrant GRPC service is now running addr=#{bind_addr.inspect} port=#{port.inspect}")
s.run_till_terminated_or_interrupted([1, 'int', 'SIGQUIT', 'SIGINT'])
VagrantPlugins::CommandServe.server = s
s.run_till_terminated_or_interrupted(['EXIT', 'HUP', 'INT', 'QUIT', 'ABRT'])
0
ensure
logger.info("Vagrant GRPC service is shutting down")
VagrantPlugins::CommandServe.server = nil
logger.info("Vagrant GRPC service shut down")
end
end
end

View File

@ -10,6 +10,7 @@ module VagrantPlugins
module CommandServe
module Service
class InternalService < ProtoService(Hashicorp::Vagrant::RubyVagrant::Service)
def get_plugins(req, _)
plugins = []
plugin_manager = Vagrant::Plugin::V2::Plugin.local_manager
@ -42,6 +43,21 @@ module VagrantPlugins
)
end
def stop(_, _)
if !VagrantPlugins::CommandServe.server.nil?
logger.info("stopping the Vagrant Ruby runtime service")
# We want to hop into a separate thread and pause for a moment
# so we can send our response, then stop the server.
Thread.new do
sleep(0.05)
VagrantPlugins::CommandServe.server.stop
end
else
logger.warn("cannot stop Vagrant Ruby runtime service, not running")
end
Empty.new
end
def parse_vagrantfile(req, _)
parse_item_to_proto(req.path.to_s)
end