Skip to content

Commit

Permalink
feat: update porter & porter context
Browse files Browse the repository at this point in the history
  • Loading branch information
MuZhou233 committed Aug 6, 2024
1 parent 748f06e commit bbb9889
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 20 deletions.
26 changes: 18 additions & 8 deletions proto/librarian/porter/v1/porter.proto
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,20 @@ message EnablePorterRequest {
optional string refresh_token = 2;
}
message EnablePorterResponse {
// Used to request sephirah to sync data.
// To handle request, sephirah should send all `Enable*` requests to porter.
// Useful when porter is restarted.
bool need_full_sync = 1;
// Human-readable status message.
string status_message = 1;
// If true, enabler should resend request with `refresh_token`.
bool need_refresh_token = 2;
PorterEnablesSummary enables_summary = 3;
}

message PorterEnablesSummary {
// `EnableContextRequest.context_id`
repeated librarian.v1.InternalID context_ids = 1;
// `EnableFeedSetterRequest.setter_id`
repeated librarian.v1.InternalID feed_setter_ids = 2;
// `EnableFeedGetterRequest.getter_id`
repeated librarian.v1.InternalID feed_getter_ids = 3;
}

message EnableContextRequest {
Expand Down Expand Up @@ -173,7 +183,7 @@ message ExecFeedItemActionResponse {
}

message EnableFeedSetterRequest {
librarian.v1.InternalID id = 1;
librarian.v1.InternalID setter_id = 1;
// `PorterFeatureSummary.feed_setters`
librarian.v1.FeatureRequest setter = 2;
librarian.v1.InternalID feed_id = 3;
Expand All @@ -182,13 +192,13 @@ message EnableFeedSetterRequest {
message EnableFeedSetterResponse {}

message DisableFeedSetterRequest {
librarian.v1.InternalID id = 1;
librarian.v1.InternalID setter_id = 1;
}

message DisableFeedSetterResponse {}

message EnableFeedGetterRequest {
librarian.v1.InternalID id = 1;
librarian.v1.InternalID getter_id = 1;
// `PorterFeatureSummary.feed_getters`
librarian.v1.FeatureRequest getter = 2;
librarian.v1.InternalID feed_id = 3;
Expand All @@ -197,7 +207,7 @@ message EnableFeedGetterRequest {
message EnableFeedGetterResponse {}

message DisableFeedGetterRequest {
librarian.v1.InternalID id = 1;
librarian.v1.InternalID getter_id = 1;
}

message DisableFeedGetterResponse {}
50 changes: 38 additions & 12 deletions proto/librarian/sephirah/v1/tiphereth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ message UpdatePorterStatusRequest {
message UpdatePorterStatusResponse {}

message CreatePorterContextRequest {
librarian.v1.InternalID porter_id = 1;
PorterContext context = 2;
PorterContext context = 1;
}

message CreatePorterContextResponse {
Expand All @@ -172,19 +171,10 @@ message ListPorterContextsResponse {
}

message UpdatePorterContextRequest {
librarian.v1.InternalID porter_id = 1;
PorterContext context = 2;
PorterContext context = 1;
}
message UpdatePorterContextResponse {}

message PorterContext {
librarian.v1.InternalID id = 1;
librarian.v1.InternalID porter_id = 2;
optional string context_json = 3;
string name = 4;
string description = 5;
}

message User {
librarian.v1.InternalID id = 1;
string username = 2;
Expand Down Expand Up @@ -247,6 +237,8 @@ message Porter {
PorterConnectionStatus connection_status = 7;
// Only used in response
optional string context_json_schema = 8;
// Only used in response
string connection_status_message = 9;
}

enum PorterConnectionStatus {
Expand All @@ -259,4 +251,38 @@ enum PorterConnectionStatus {
PORTER_CONNECTION_STATUS_ACTIVE = 3;
// Available but failed to activate
PORTER_CONNECTION_STATUS_ACTIVATION_FAILED = 4;
// Active but downgraded
PORTER_CONNECTION_STATUS_DOWNGRADED = 5;
}

message PorterContext {
librarian.v1.InternalID id = 1;
string global_name = 2;
string region = 3;
string context_json = 4;
string name = 5;
string description = 6;
PorterContextStatus status = 7;
// Only used in response
PorterContextHandleStatus handle_status = 8;
// Only used in response
string handle_status_message = 9;
}

enum PorterContextStatus {
PORTER_CONTEXT_STATUS_UNSPECIFIED = 0;
PORTER_CONTEXT_STATUS_ACTIVE = 1;
PORTER_CONTEXT_STATUS_DISABLED = 2;
}

enum PorterContextHandleStatus {
PORTER_CONTEXT_HANDLE_STATUS_UNSPECIFIED = 0;
// Active and can be used
PORTER_CONTEXT_HANDLE_STATUS_ACTIVE = 1;
// Active but downgraded
PORTER_CONTEXT_HANDLE_STATUS_DOWNGRADED = 2;
// In queueing
PORTER_CONTEXT_HANDLE_STATUS_QUEUEING = 3;
// Blocked by some reason (e.g. no available resources)
PORTER_CONTEXT_HANDLE_STATUS_BLOCKED = 4;
}

0 comments on commit bbb9889

Please sign in to comment.