Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions proto/jumpstarter/client/v1/client.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "jumpstarter/v1/kubernetes.proto";
import "jumpstarter/v1/common.proto";

service ClientService {
rpc GetExporter(GetExporterRequest) returns (Exporter) {
Expand Down Expand Up @@ -68,16 +69,7 @@ message Exporter {
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
map<string, string> labels = 2;
bool online = 3 [(google.api.field_behavior) = OUTPUT_ONLY, deprecated = true];
ExporterStatus status = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}

enum ExporterStatus {
EXPORTER_STATUS_UNSPECIFIED = 0; // Unspecified exporter status
EXPORTER_STATUS_OFFLINE = 1; // Exporter is offline
EXPORTER_STATUS_AVAILABLE = 2; // Exporter is available to be leased
EXPORTER_STATUS_BEFORE_LEASE_HOOK = 3; // Exporter is executing before lease hook(s)
EXPORTER_STATUS_LEASE_READY = 4; // Exporter is leased and ready to accept commands
EXPORTER_STATUS_AFTER_LEASE_HOOK = 5; // Exporter is executing after lease hook(s)
jumpstarter.v1.ExporterStatus status = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}

message Lease {
Expand Down
28 changes: 28 additions & 0 deletions proto/jumpstarter/v1/common.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2024 The Jumpstarter Authors

syntax = "proto3";

package jumpstarter.v1;

// Shared types used across multiple Jumpstarter services

// Exporter status information
enum ExporterStatus {
EXPORTER_STATUS_UNSPECIFIED = 0; // Unspecified exporter status
EXPORTER_STATUS_OFFLINE = 1; // Exporter is offline
EXPORTER_STATUS_AVAILABLE = 2; // Exporter is available to be leased
EXPORTER_STATUS_BEFORE_LEASE_HOOK = 3; // Exporter is executing before lease hook(s)
EXPORTER_STATUS_LEASE_READY = 4; // Exporter is leased and ready to accept commands
EXPORTER_STATUS_AFTER_LEASE_HOOK = 5; // Exporter is executing after lease hook(s)
EXPORTER_STATUS_BEFORE_LEASE_HOOK_FAILED = 6; // Exporter before lease hook failed
EXPORTER_STATUS_AFTER_LEASE_HOOK_FAILED = 7; // Exporter after lease hook failed
}

// Source of log stream messages
enum LogSource {
LOG_SOURCE_UNSPECIFIED = 0; // Unspecified log source
LOG_SOURCE_DRIVER = 1; // Driver/device logs
LOG_SOURCE_BEFORE_LEASE_HOOK = 2; // beforeLease hook execution logs
LOG_SOURCE_AFTER_LEASE_HOOK = 3; // afterLease hook execution logs
LOG_SOURCE_SYSTEM = 4; // System/exporter logs
}
23 changes: 22 additions & 1 deletion proto/jumpstarter/v1/jumpstarter.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "jumpstarter/v1/kubernetes.proto";
import "jumpstarter/v1/common.proto";

// A service where a exporter can connect to make itself available
service ControllerService {
Expand All @@ -21,6 +22,10 @@ service ControllerService {
// has been invalidated
rpc Unregister(UnregisterRequest) returns (UnregisterResponse);

// Exporter status report
// Allows exporters to report their own status to the controller
rpc ReportStatus(ReportStatusRequest) returns (ReportStatusResponse);

// Exporter listening
// Returns stream tokens for accepting incoming client connections
rpc Listen(ListenRequest) returns (stream ListenResponse);
Expand Down Expand Up @@ -59,7 +64,7 @@ message RegisterRequest {
}

message DriverInstanceReport {
string uuid = 1; // a unique id within the expoter
string uuid = 1; // a unique id within the exporter
optional string parent_uuid = 2; // optional, if device has a parent device
map<string, string> labels = 3;
}
Expand Down Expand Up @@ -109,6 +114,13 @@ message AuditStreamRequest {
string message = 4;
}

message ReportStatusRequest {
ExporterStatus status = 1;
optional string message = 2; // Optional human-readable status message
}

message ReportStatusResponse {}

// A service a exporter can share locally to be used without a server
// Channel/Call credentials are used to authenticate the client, and routing to the right exporter
service ExporterService {
Expand All @@ -118,6 +130,7 @@ service ExporterService {
rpc StreamingDriverCall(StreamingDriverCallRequest) returns (stream StreamingDriverCallResponse);
rpc LogStream(google.protobuf.Empty) returns (stream LogStreamResponse);
rpc Reset(ResetRequest) returns (ResetResponse);
rpc GetStatus(GetStatusRequest) returns (GetStatusResponse);
}

message GetReportResponse {
Expand Down Expand Up @@ -163,6 +176,7 @@ message LogStreamResponse {
string uuid = 1;
string severity = 2;
string message = 3;
optional LogSource source = 4; // New optional field
}

message ResetRequest {}
Expand Down Expand Up @@ -201,3 +215,10 @@ message ListLeasesRequest {}
message ListLeasesResponse {
repeated string names = 1;
}

message GetStatusRequest {}

message GetStatusResponse {
ExporterStatus status = 1;
optional string message = 2;
}