Add protobufs for commands used by build_parallels_image

Define ProvisionRequest and SaveRequest protos. These will be
used by new commands added to phosphorus.

BUG=chromium:1105967
TEST=./generate.sh

Change-Id: I31b1f227e06c13939e0b260d69226f7bb677e812
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/infra/proto/+/2580921
Commit-Queue: Patrick Meiring <meiring@google.com>
Reviewed-by: Sean Abraham <seanabraham@chromium.org>
diff --git a/go/uprev/build_parallels_image/common.pb.go b/go/uprev/build_parallels_image/common.pb.go
new file mode 100644
index 0000000..6de01a3
--- /dev/null
+++ b/go/uprev/build_parallels_image/common.pb.go
@@ -0,0 +1,85 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: uprev/build_parallels_image/common.proto
+
+package build_parallels_image
+
+import (
+	fmt "fmt"
+	proto "github.com/golang/protobuf/proto"
+	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
+
+// Config defines configuration parameters of `phosphorus build-parallels-image-*` commands.
+type Config struct {
+	// Unified Fleet System service host, e.g. ufs.api.cr.dev.
+	CrosUfsService       string   `protobuf:"bytes,1,opt,name=cros_ufs_service,json=crosUfsService,proto3" json:"cros_ufs_service,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *Config) Reset()         { *m = Config{} }
+func (m *Config) String() string { return proto.CompactTextString(m) }
+func (*Config) ProtoMessage()    {}
+func (*Config) Descriptor() ([]byte, []int) {
+	return fileDescriptor_0fbba075d2a19ce4, []int{0}
+}
+
+func (m *Config) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_Config.Unmarshal(m, b)
+}
+func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_Config.Marshal(b, m, deterministic)
+}
+func (m *Config) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_Config.Merge(m, src)
+}
+func (m *Config) XXX_Size() int {
+	return xxx_messageInfo_Config.Size(m)
+}
+func (m *Config) XXX_DiscardUnknown() {
+	xxx_messageInfo_Config.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Config proto.InternalMessageInfo
+
+func (m *Config) GetCrosUfsService() string {
+	if m != nil {
+		return m.CrosUfsService
+	}
+	return ""
+}
+
+func init() {
+	proto.RegisterType((*Config)(nil), "uprev.build_parallels_image.Config")
+}
+
+func init() {
+	proto.RegisterFile("uprev/build_parallels_image/common.proto", fileDescriptor_0fbba075d2a19ce4)
+}
+
+var fileDescriptor_0fbba075d2a19ce4 = []byte{
+	// 162 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0xce, 0xb1, 0x0a, 0xc2, 0x30,
+	0x10, 0xc6, 0x71, 0xba, 0x14, 0xec, 0x20, 0xd2, 0x49, 0x70, 0x11, 0xa7, 0x4e, 0x39, 0xd0, 0x37,
+	0x50, 0xc4, 0x5d, 0x71, 0x71, 0x09, 0x69, 0x4c, 0xe2, 0x41, 0xd2, 0x2b, 0x77, 0xa6, 0xcf, 0x2f,
+	0x46, 0xdc, 0xc4, 0xf1, 0xfe, 0xfc, 0xe0, 0xbe, 0xa6, 0xcb, 0x23, 0xbb, 0x09, 0xfa, 0x8c, 0xf1,
+	0xae, 0x47, 0xc3, 0x26, 0x46, 0x17, 0x45, 0x63, 0x32, 0xc1, 0x81, 0xa5, 0x94, 0x68, 0x50, 0x23,
+	0xd3, 0x93, 0xda, 0x55, 0x91, 0xea, 0xa7, 0xdc, 0x6c, 0x9b, 0xfa, 0x40, 0x83, 0xc7, 0xd0, 0x76,
+	0xcd, 0xc2, 0x32, 0x89, 0xce, 0x5e, 0xb4, 0x38, 0x9e, 0xd0, 0xba, 0x65, 0xb5, 0xae, 0xba, 0xd9,
+	0x79, 0xfe, 0xee, 0x57, 0x2f, 0x97, 0x4f, 0xdd, 0x9f, 0x6e, 0xc7, 0x40, 0xca, 0x3e, 0x98, 0x12,
+	0xe6, 0xa4, 0x88, 0x03, 0x7c, 0x0f, 0x12, 0xc0, 0xc1, 0xb3, 0x81, 0xf2, 0x1a, 0x02, 0xc1, 0x9f,
+	0x99, 0x7d, 0x5d, 0xd4, 0xee, 0x15, 0x00, 0x00, 0xff, 0xff, 0x73, 0x69, 0x2c, 0xe7, 0xcc, 0x00,
+	0x00, 0x00,
+}
diff --git a/go/uprev/build_parallels_image/provision.pb.go b/go/uprev/build_parallels_image/provision.pb.go
new file mode 100644
index 0000000..1e60369
--- /dev/null
+++ b/go/uprev/build_parallels_image/provision.pb.go
@@ -0,0 +1,121 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: uprev/build_parallels_image/provision.proto
+
+package build_parallels_image
+
+import (
+	fmt "fmt"
+	proto "github.com/golang/protobuf/proto"
+	timestamp "github.com/golang/protobuf/ptypes/timestamp"
+	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
+
+// ProvisionRequest defines the input of `phosphorus build-parallels-image-provision`.
+type ProvisionRequest struct {
+	Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
+	// DUT hostname.
+	DutName string `protobuf:"bytes,2,opt,name=dut_name,json=dutName,proto3" json:"dut_name,omitempty"`
+	// The Google Storage path (prefix) where images are located. For example,
+	// 'gs://chromeos-image-archive/eve-release/R86-13380.0.0'.
+	ImageGsPath string `protobuf:"bytes,3,opt,name=image_gs_path,json=imageGsPath,proto3" json:"image_gs_path,omitempty"`
+	// Hard deadline for execution.
+	//
+	// All provisioning should abort beyond this deadline.
+	Deadline             *timestamp.Timestamp `protobuf:"bytes,4,opt,name=deadline,proto3" json:"deadline,omitempty"`
+	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
+	XXX_unrecognized     []byte               `json:"-"`
+	XXX_sizecache        int32                `json:"-"`
+}
+
+func (m *ProvisionRequest) Reset()         { *m = ProvisionRequest{} }
+func (m *ProvisionRequest) String() string { return proto.CompactTextString(m) }
+func (*ProvisionRequest) ProtoMessage()    {}
+func (*ProvisionRequest) Descriptor() ([]byte, []int) {
+	return fileDescriptor_745d1069a49b7a00, []int{0}
+}
+
+func (m *ProvisionRequest) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_ProvisionRequest.Unmarshal(m, b)
+}
+func (m *ProvisionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_ProvisionRequest.Marshal(b, m, deterministic)
+}
+func (m *ProvisionRequest) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_ProvisionRequest.Merge(m, src)
+}
+func (m *ProvisionRequest) XXX_Size() int {
+	return xxx_messageInfo_ProvisionRequest.Size(m)
+}
+func (m *ProvisionRequest) XXX_DiscardUnknown() {
+	xxx_messageInfo_ProvisionRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ProvisionRequest proto.InternalMessageInfo
+
+func (m *ProvisionRequest) GetConfig() *Config {
+	if m != nil {
+		return m.Config
+	}
+	return nil
+}
+
+func (m *ProvisionRequest) GetDutName() string {
+	if m != nil {
+		return m.DutName
+	}
+	return ""
+}
+
+func (m *ProvisionRequest) GetImageGsPath() string {
+	if m != nil {
+		return m.ImageGsPath
+	}
+	return ""
+}
+
+func (m *ProvisionRequest) GetDeadline() *timestamp.Timestamp {
+	if m != nil {
+		return m.Deadline
+	}
+	return nil
+}
+
+func init() {
+	proto.RegisterType((*ProvisionRequest)(nil), "uprev.build_parallels_image.ProvisionRequest")
+}
+
+func init() {
+	proto.RegisterFile("uprev/build_parallels_image/provision.proto", fileDescriptor_745d1069a49b7a00)
+}
+
+var fileDescriptor_745d1069a49b7a00 = []byte{
+	// 266 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0x3f, 0x4b, 0xc4, 0x30,
+	0x18, 0xc6, 0xa9, 0xca, 0x79, 0xe6, 0x10, 0xa4, 0x53, 0xad, 0x83, 0xc7, 0xb9, 0x14, 0x84, 0x04,
+	0x14, 0x5c, 0xdc, 0x14, 0xb9, 0x4d, 0x8e, 0xe2, 0xe4, 0x52, 0xd2, 0xf6, 0x6d, 0x1a, 0x48, 0xfa,
+	0xc6, 0xfc, 0xb9, 0x8f, 0xe8, 0xe7, 0x12, 0x52, 0xe3, 0x24, 0x1d, 0x93, 0xfc, 0x1e, 0x7e, 0x79,
+	0x1e, 0x72, 0x1f, 0x8c, 0x85, 0x23, 0x6b, 0x83, 0x54, 0x7d, 0x63, 0xb8, 0xe5, 0x4a, 0x81, 0x72,
+	0x8d, 0xd4, 0x5c, 0x00, 0x33, 0x16, 0x8f, 0xd2, 0x49, 0x9c, 0xa8, 0xb1, 0xe8, 0x31, 0xbf, 0x89,
+	0x30, 0xfd, 0x17, 0x2e, 0x6f, 0x05, 0xa2, 0x50, 0x31, 0xe4, 0xb1, 0x0d, 0x03, 0xf3, 0x52, 0x83,
+	0xf3, 0x5c, 0x9b, 0x39, 0x5d, 0x56, 0x4b, 0xaa, 0x0e, 0xb5, 0x4e, 0x9e, 0xdd, 0x77, 0x46, 0xae,
+	0x0e, 0xc9, 0x5d, 0xc3, 0x57, 0x00, 0xe7, 0xf3, 0x67, 0xb2, 0xea, 0x70, 0x1a, 0xa4, 0x28, 0xb2,
+	0x6d, 0x56, 0x6d, 0x1e, 0xee, 0xe8, 0xc2, 0x6f, 0xe8, 0x6b, 0x44, 0xeb, 0xdf, 0x48, 0x7e, 0x4d,
+	0xd6, 0x7d, 0xf0, 0xcd, 0xc4, 0x35, 0x14, 0x27, 0xdb, 0xac, 0xba, 0xa8, 0xcf, 0xfb, 0xe0, 0xdf,
+	0xb9, 0x86, 0x7c, 0x47, 0x2e, 0x63, 0xa4, 0x11, 0xae, 0x31, 0xdc, 0x8f, 0xc5, 0x69, 0x7c, 0xdf,
+	0xc4, 0xcb, 0xbd, 0x3b, 0x70, 0x3f, 0xe6, 0x4f, 0x64, 0xdd, 0x03, 0xef, 0x95, 0x9c, 0xa0, 0x38,
+	0x8b, 0xf6, 0x92, 0xce, 0x75, 0x69, 0xaa, 0x4b, 0x3f, 0x52, 0xdd, 0xfa, 0x8f, 0x7d, 0xd9, 0x7f,
+	0xbe, 0x09, 0xa4, 0xdd, 0x68, 0x51, 0xcb, 0xa0, 0x29, 0x5a, 0xc1, 0xd2, 0x01, 0x1d, 0x93, 0xd3,
+	0x60, 0xf9, 0xbc, 0x17, 0x13, 0xc8, 0x16, 0xe6, 0x69, 0x57, 0x91, 0x7a, 0xfc, 0x09, 0x00, 0x00,
+	0xff, 0xff, 0x96, 0x44, 0xe3, 0x5c, 0xaf, 0x01, 0x00, 0x00,
+}
diff --git a/go/uprev/build_parallels_image/save.pb.go b/go/uprev/build_parallels_image/save.pb.go
new file mode 100644
index 0000000..229e847
--- /dev/null
+++ b/go/uprev/build_parallels_image/save.pb.go
@@ -0,0 +1,105 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: uprev/build_parallels_image/save.proto
+
+package build_parallels_image
+
+import (
+	fmt "fmt"
+	proto "github.com/golang/protobuf/proto"
+	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
+
+// SaveRequest defines the input of `phosphorus build-parallels-image-save`.
+type SaveRequest struct {
+	Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
+	// DUT hostname.
+	DutName string `protobuf:"bytes,2,opt,name=dut_name,json=dutName,proto3" json:"dut_name,omitempty"`
+	// E.g. "needs_repair", "ready" etc.
+	DutState             string   `protobuf:"bytes,3,opt,name=dut_state,json=dutState,proto3" json:"dut_state,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *SaveRequest) Reset()         { *m = SaveRequest{} }
+func (m *SaveRequest) String() string { return proto.CompactTextString(m) }
+func (*SaveRequest) ProtoMessage()    {}
+func (*SaveRequest) Descriptor() ([]byte, []int) {
+	return fileDescriptor_e1991645bc5d5a9c, []int{0}
+}
+
+func (m *SaveRequest) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_SaveRequest.Unmarshal(m, b)
+}
+func (m *SaveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_SaveRequest.Marshal(b, m, deterministic)
+}
+func (m *SaveRequest) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_SaveRequest.Merge(m, src)
+}
+func (m *SaveRequest) XXX_Size() int {
+	return xxx_messageInfo_SaveRequest.Size(m)
+}
+func (m *SaveRequest) XXX_DiscardUnknown() {
+	xxx_messageInfo_SaveRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_SaveRequest proto.InternalMessageInfo
+
+func (m *SaveRequest) GetConfig() *Config {
+	if m != nil {
+		return m.Config
+	}
+	return nil
+}
+
+func (m *SaveRequest) GetDutName() string {
+	if m != nil {
+		return m.DutName
+	}
+	return ""
+}
+
+func (m *SaveRequest) GetDutState() string {
+	if m != nil {
+		return m.DutState
+	}
+	return ""
+}
+
+func init() {
+	proto.RegisterType((*SaveRequest)(nil), "uprev.build_parallels_image.SaveRequest")
+}
+
+func init() {
+	proto.RegisterFile("uprev/build_parallels_image/save.proto", fileDescriptor_e1991645bc5d5a9c)
+}
+
+var fileDescriptor_e1991645bc5d5a9c = []byte{
+	// 214 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x8f, 0x3d, 0x4f, 0xc4, 0x30,
+	0x0c, 0x86, 0x15, 0x90, 0x0e, 0x2e, 0xb7, 0x65, 0x2a, 0xdc, 0x72, 0x02, 0x09, 0x75, 0x4a, 0x24,
+	0x18, 0xd9, 0x40, 0x88, 0x8d, 0xa1, 0xdd, 0x58, 0x2a, 0xb7, 0x75, 0x43, 0xa4, 0x24, 0x2e, 0xf9,
+	0xe8, 0x0f, 0xe0, 0x97, 0xa3, 0x06, 0xd8, 0x50, 0xc7, 0x57, 0xef, 0xe3, 0xc7, 0x36, 0xbf, 0xcb,
+	0x73, 0xc0, 0x45, 0xf5, 0xd9, 0xd8, 0xb1, 0x9b, 0x21, 0x80, 0xb5, 0x68, 0x63, 0x67, 0x1c, 0x68,
+	0x54, 0x11, 0x16, 0x94, 0x73, 0xa0, 0x44, 0xe2, 0x58, 0x38, 0xf9, 0x2f, 0x77, 0x5d, 0x6f, 0x49,
+	0x06, 0x72, 0x8e, 0xfc, 0x8f, 0xe6, 0xe6, 0x8b, 0xf1, 0x43, 0x0b, 0x0b, 0x36, 0xf8, 0x99, 0x31,
+	0x26, 0xf1, 0xc8, 0x77, 0x03, 0xf9, 0xc9, 0xe8, 0x8a, 0x9d, 0x58, 0x7d, 0xb8, 0xbf, 0x95, 0x1b,
+	0x7b, 0xe4, 0x73, 0x41, 0x9b, 0xdf, 0x11, 0x71, 0xc5, 0x2f, 0xc7, 0x9c, 0x3a, 0x0f, 0x0e, 0xab,
+	0xb3, 0x13, 0xab, 0xf7, 0xcd, 0xc5, 0x98, 0xd3, 0x1b, 0x38, 0x14, 0x47, 0xbe, 0x5f, 0xab, 0x98,
+	0x20, 0x61, 0x75, 0x5e, 0xba, 0x95, 0x6d, 0xd7, 0xfc, 0xf4, 0xfa, 0xfe, 0xa2, 0x49, 0x0e, 0x1f,
+	0x81, 0x9c, 0xc9, 0x4e, 0x52, 0xd0, 0xea, 0x2f, 0x50, 0x54, 0xc6, 0x4f, 0x01, 0x54, 0x39, 0x57,
+	0x69, 0x52, 0x1b, 0xaf, 0xf5, 0xbb, 0x42, 0x3d, 0x7c, 0x07, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x4d,
+	0xb9, 0xf6, 0x45, 0x01, 0x00, 0x00,
+}
diff --git a/src/README.md b/src/README.md
index a378919..dc58796 100644
--- a/src/README.md
+++ b/src/README.md
@@ -25,6 +25,10 @@
 
 This folder contains definitions of the cros_test_platform API, as well as internal protos used for communication between cros_test_platform components.
 
+## uprev
+
+This folder contains protos used for communication between uprev recipes and their components.
+
 ## device
 
 ## testplans
diff --git a/src/uprev/build_parallels_image/OWNERS b/src/uprev/build_parallels_image/OWNERS
new file mode 100644
index 0000000..77722f8
--- /dev/null
+++ b/src/uprev/build_parallels_image/OWNERS
@@ -0,0 +1,5 @@
+# Chrome OS Virtualisation EngProd
+meiring@google.com
+mwarton@google.com
+jinrongwu@google.com
+
diff --git a/src/uprev/build_parallels_image/common.proto b/src/uprev/build_parallels_image/common.proto
new file mode 100644
index 0000000..3453955
--- /dev/null
+++ b/src/uprev/build_parallels_image/common.proto
@@ -0,0 +1,16 @@
+// Copyright 2020 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto3";
+
+package uprev.build_parallels_image;
+
+option go_package = "go.chromium.org/chromiumos/infra/proto/go/uprev/build_parallels_image";
+
+// Config defines configuration parameters of `phosphorus build-parallels-image-*` commands.
+message Config {
+  // Unified Fleet System service host, e.g. ufs.api.cr.dev.
+  string cros_ufs_service = 1;
+}
+
diff --git a/src/uprev/build_parallels_image/provision.proto b/src/uprev/build_parallels_image/provision.proto
new file mode 100644
index 0000000..502da7b
--- /dev/null
+++ b/src/uprev/build_parallels_image/provision.proto
@@ -0,0 +1,30 @@
+// Copyright 2020 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto3";
+
+package uprev.build_parallels_image;
+
+option go_package = "go.chromium.org/chromiumos/infra/proto/go/uprev/build_parallels_image";
+
+import "google/protobuf/timestamp.proto";
+import "uprev/build_parallels_image/common.proto";
+
+// ProvisionRequest defines the input of `phosphorus build-parallels-image-provision`.
+message ProvisionRequest {
+  Config config = 1;
+
+  // DUT hostname.
+  string dut_name = 2;
+
+  // The Google Storage path (prefix) where images are located. For example,
+  // 'gs://chromeos-image-archive/eve-release/R86-13380.0.0'.
+  string image_gs_path = 3;
+
+  // Hard deadline for execution.
+  //
+  // All provisioning should abort beyond this deadline.
+  google.protobuf.Timestamp deadline = 4;
+}
+
diff --git a/src/uprev/build_parallels_image/save.proto b/src/uprev/build_parallels_image/save.proto
new file mode 100644
index 0000000..6c50ac0
--- /dev/null
+++ b/src/uprev/build_parallels_image/save.proto
@@ -0,0 +1,22 @@
+// Copyright 2020 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto3";
+
+package uprev.build_parallels_image;
+
+option go_package = "go.chromium.org/chromiumos/infra/proto/go/uprev/build_parallels_image";
+
+import "uprev/build_parallels_image/common.proto";
+
+// SaveRequest defines the input of `phosphorus build-parallels-image-save`.
+message SaveRequest {
+  Config config = 1;
+
+  // DUT hostname.
+  string dut_name = 2;
+
+  // E.g. "needs_repair", "ready" etc.
+  string dut_state = 3;
+}