new proto that has MeasurementArgs

This commit is contained in:
ghe0 2025-01-03 18:08:23 +02:00
parent 716b7edd33
commit b1d272f8fb
Signed by: ghe0
GPG Key ID: 451028EE56A0FBB4

@ -24,6 +24,17 @@ message NodeResourceReq {
uint32 max_ports_per_vm = 8; uint32 max_ports_per_vm = 8;
} }
message MeasurementArgs {
// this will be IP:Port of the dtrfs API
// actually not a measurement arg, but needed for the injector
string dtrfs_api_endpoint = 1;
repeated uint32 exposed_ports = 2;
string ovmf_hash = 5;
// This is needed to allow the CLI to build the kernel params from known data.
// The CLI will use the kernel params to get the measurement.
repeated NewVmRespIP ips = 6;
}
message NewVMReq { message NewVMReq {
string uuid = 1; // UUID is empty when CLI sends request; brain sets UUID string uuid = 1; // UUID is empty when CLI sends request; brain sets UUID
string hostname = 2; string hostname = 2;
@ -41,6 +52,12 @@ message NewVMReq {
string dtrfs_sha = 14; string dtrfs_sha = 14;
} }
message NewVMResp {
string uuid = 1;
string error = 2;
MeasurementArgs args = 3;
}
message UpdateVMReq { message UpdateVMReq {
string uuid = 1; string uuid = 1;
uint32 disk_size_gb = 2; uint32 disk_size_gb = 2;
@ -55,7 +72,7 @@ message UpdateVMReq {
message UpdateVMResp { message UpdateVMResp {
string uuid = 1; string uuid = 1;
string error = 2; string error = 2;
string ovmf_hash = 3; MeasurementArgs args = 3;
} }
message VMContract { message VMContract {
@ -88,16 +105,6 @@ message NewVmRespIP {
string gateway = 4; string gateway = 4;
} }
message NewVMResp {
string uuid = 1;
repeated uint32 exposed_ports = 2;
string ovmf_hash = 5;
// This is needed to allow the CLI to build the kernel params from known data.
// The CLI will use the kernel params to get the measurement.
repeated NewVmRespIP ips = 6;
string error = 7;
}
message DeleteVMReq { message DeleteVMReq {
string uuid = 1; string uuid = 1;
} }
@ -111,6 +118,7 @@ service BrainDaemonService {
rpc ListVMContracts (ListVMContractsReq) returns (stream VMContract); rpc ListVMContracts (ListVMContractsReq) returns (stream VMContract);
rpc GetUpdateVMReq (NodePubkey) returns (stream UpdateVMReq); rpc GetUpdateVMReq (NodePubkey) returns (stream UpdateVMReq);
rpc SendUpdateVMResp (stream UpdateVMResp) returns (Empty); rpc SendUpdateVMResp (stream UpdateVMResp) returns (Empty);
// rpc SendMeasurementArgs (NodePubkey) returns (MeasurementArgs);
} }
message NodeFilters { message NodeFilters {
@ -143,4 +151,5 @@ service BrainCliService {
rpc GetOneNode (NodeFilters) returns (NodeListResp); rpc GetOneNode (NodeFilters) returns (NodeListResp);
rpc DeleteVM (DeleteVMReq) returns (Empty); rpc DeleteVM (DeleteVMReq) returns (Empty);
rpc UpdateVM (UpdateVMReq) returns (UpdateVMResp); rpc UpdateVM (UpdateVMReq) returns (UpdateVMResp);
// rpc GetMeasurementArgs (ListVMContractsReq) returns (MeasurementArgs);
} }