Skip to content
Closed
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
19 changes: 15 additions & 4 deletions flyteidl2/actions/actions_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "buf/validate/validate.proto";
import "flyteidl2/common/address.proto";
import "flyteidl2/common/identifier.proto";
import "flyteidl2/common/identity.proto";
import "flyteidl2/common/rpc_options.proto";
import "flyteidl2/core/literals.proto";
import "flyteidl2/task/run.proto";
import "flyteidl2/workflow/run_definition.proto";
Expand All @@ -18,7 +19,11 @@ option go_package = "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/actions";
// the state and execution of actions.
service ActionsService {
// Enqueue queues a new action for execution.
rpc Enqueue(EnqueueRequest) returns (EnqueueResponse) {}
// For a restricted org only a child action is served: a root action starts a new run,
// and a deployment that restricts orgs refuses it.
rpc Enqueue(EnqueueRequest) returns (EnqueueResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}

// WatchForUpdates watches for updates to the state of actions.
// This API guarantees at-least-once delivery semantics.
Expand All @@ -28,19 +33,25 @@ service ActionsService {

// Update updates the status of an action and saves serialized NodeStatus.
// This deprecates Put in the current StateService.
rpc Update(UpdateRequest) returns (UpdateResponse) {}
rpc Update(UpdateRequest) returns (UpdateResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}

// Abort aborts a single action that was previously queued or is currently being processed by a worker.
// Note that this will cascade aborts to all descendant actions of the specified action.
rpc Abort(AbortRequest) returns (AbortResponse) {}
rpc Abort(AbortRequest) returns (AbortResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}

// Signal resolves a ConditionAction by providing its signal value.
// On success, transitions the condition to SUCCEEDED with the provided
// value as its output.
// Returns FAILED_PRECONDITION if the action is not a condition or is
// already terminal. Returns NOT_FOUND if the action does not exist.
// Returns ABORTED if the action has a write in-flight (retry).
rpc Signal(SignalRequest) returns (SignalResponse) {}
rpc Signal(SignalRequest) returns (SignalResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}
}

// Action represents a unit of work to be executed. Theses can be task executions, traces, or conditions.
Expand Down
13 changes: 10 additions & 3 deletions flyteidl2/app/app_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";
package flyteidl2.app;

import "flyteidl2/app/app_payload.proto";
import "flyteidl2/common/rpc_options.proto";

option go_package = "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/app";

Expand All @@ -20,10 +21,14 @@ service AppService {
rpc Update(UpdateRequest) returns (UpdateResponse) {}

// UpdateStatus updates the status of an existing app.
rpc UpdateStatus(UpdateStatusRequest) returns (UpdateStatusResponse) {}
rpc UpdateStatus(UpdateStatusRequest) returns (UpdateStatusResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}

// Delete deletes an app by its identifier.
rpc Delete(DeleteRequest) returns (DeleteResponse) {}
rpc Delete(DeleteRequest) returns (DeleteResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}

// List lists all apps with optional filtering.
rpc List(ListRequest) returns (ListResponse) {
Expand All @@ -36,5 +41,7 @@ service AppService {
}

// Lease leases apps.
rpc Lease(LeaseRequest) returns (stream LeaseResponse) {}
rpc Lease(LeaseRequest) returns (stream LeaseResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}
}
4 changes: 3 additions & 1 deletion flyteidl2/auth/identity.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ message UserInfoResponse {
// IdentityService defines an RPC Service that interacts with user/app identities.
service IdentityService {
// Retrieves user information about the currently logged in user.
rpc UserInfo(UserInfoRequest) returns (UserInfoResponse) {}
rpc UserInfo(UserInfoRequest) returns (UserInfoResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}
}
16 changes: 16 additions & 0 deletions flyteidl2/common/rpc_options.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto3";

package flyteidl2.common;

import "google/protobuf/descriptor.proto";

option go_package = "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/common";

extend google.protobuf.MethodOptions {
// allowed_when_restricted marks an RPC that has side effects but is still served while
// the caller's organization is restricted to read-only: stopping work, work already
// running reporting its progress, and keeping the account in good standing. A
// deployment that restricts organizations refuses every other RPC with side effects
// (anything not declared idempotency_level = NO_SIDE_EFFECTS) for a restricted org.
bool allowed_when_restricted = 50101;
}
4 changes: 3 additions & 1 deletion flyteidl2/dataproxy/dataproxy_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ service DataProxyService {
rpc UploadInputs(UploadInputsRequest) returns (UploadInputsResponse) {}

// CreateDownloadLink generates signed URL(s) for downloading a given artifact.
rpc CreateDownloadLink(CreateDownloadLinkRequest) returns (CreateDownloadLinkResponse) {}
rpc CreateDownloadLink(CreateDownloadLinkRequest) returns (CreateDownloadLinkResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
Comment thread
afbrock marked this conversation as resolved.
Resolved
}

// Get input and output data for an action.
rpc GetActionData(GetActionDataRequest) returns (GetActionDataResponse) {
Expand Down
5 changes: 4 additions & 1 deletion flyteidl2/trigger/trigger_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package flyteidl2.trigger;
import "buf/validate/validate.proto";
import "flyteidl2/common/identifier.proto";
import "flyteidl2/common/list.proto";
import "flyteidl2/common/rpc_options.proto";
import "flyteidl2/task/common.proto";
import "flyteidl2/task/task_definition.proto";
import "flyteidl2/trigger/trigger_definition.proto";
Expand Down Expand Up @@ -47,7 +48,9 @@ service TriggerService {
rpc UpdateTriggers(UpdateTriggersRequest) returns (UpdateTriggersResponse) {}

// Soft-delete multiple triggers at once.
rpc DeleteTriggers(DeleteTriggersRequest) returns (DeleteTriggersResponse) {}
rpc DeleteTriggers(DeleteTriggersRequest) returns (DeleteTriggersResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}
}

// Request message for saving a trigger.
Expand Down
8 changes: 6 additions & 2 deletions flyteidl2/workflow/events_proxy_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ syntax = "proto3";
package flyteidl2.workflow;

import "buf/validate/validate.proto";
import "flyteidl2/common/rpc_options.proto";
import "flyteidl2/workflow/run_definition.proto";

option go_package = "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow";

// EventsProxyService provides an interface for forwarding the events to Run Service or Redis stream.
service EventsProxyService {
// record the events for an action.
rpc Record(RecordRequest) returns (RecordResponse) {}
// record the events for an action. Work already running reports its progress through
// it, so it is allowed while the org is restricted to read-only.
rpc Record(RecordRequest) returns (RecordResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}
}

// ============================================================================
Expand Down
13 changes: 10 additions & 3 deletions flyteidl2/workflow/run_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "buf/validate/validate.proto";
import "flyteidl2/common/identifier.proto";
import "flyteidl2/common/list.proto";
import "flyteidl2/common/phase.proto";
import "flyteidl2/common/rpc_options.proto";
import "flyteidl2/common/run.proto";
import "flyteidl2/core/execution.proto";
import "flyteidl2/task/common.proto";
Expand All @@ -23,7 +24,9 @@ service RunService {
rpc CreateRun(CreateRunRequest) returns (CreateRunResponse) {}

// Abort a run.
rpc AbortRun(AbortRunRequest) returns (AbortRunResponse) {}
rpc AbortRun(AbortRunRequest) returns (AbortRunResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}

// Get detailed information about a run.
rpc GetRunDetails(GetRunDetailsRequest) returns (GetRunDetailsResponse) {
Expand Down Expand Up @@ -80,13 +83,17 @@ service RunService {
}

// AbortAction aborts a single action that was previously created or is currently being processed by a worker.
rpc AbortAction(AbortActionRequest) returns (AbortActionResponse) {}
rpc AbortAction(AbortActionRequest) returns (AbortActionResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}

// SignalEvent resolves a paused condition action by supplying its value.
// It converts the user-facing EventPayload to a core.Literal and delegates
// to ActionsService.Signal, resolving the condition's parent action for
// routing.
rpc SignalEvent(SignalEventRequest) returns (SignalEventResponse) {}
rpc SignalEvent(SignalEventRequest) returns (SignalEventResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}

// Stream updates for task groups based on the provided filter criteria.
rpc WatchGroups(WatchGroupsRequest) returns (stream WatchGroupsResponse) {
Expand Down
9 changes: 7 additions & 2 deletions flyteidl2/workflow/tracked_run_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package flyteidl2.workflow;

import "buf/validate/validate.proto";
import "flyteidl2/common/identifier.proto";
import "flyteidl2/common/rpc_options.proto";
import "flyteidl2/common/run.proto";
import "flyteidl2/task/common.proto";
import "flyteidl2/task/run.proto";
Expand Down Expand Up @@ -33,7 +34,9 @@ service TrackedRunService {
// Report state for one or more actions of a tracked run. Creates actions on first report and
// updates them on subsequent reports. Reports are idempotent: an event with an
// (attempt, version, phase) tuple that was already recorded is acknowledged as success.
rpc ReportActions(ReportTrackedActionsRequest) returns (ReportTrackedActionsResponse) {}
rpc ReportActions(ReportTrackedActionsRequest) returns (ReportTrackedActionsResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}

// Get detailed information about a tracked run.
rpc GetRunDetails(GetRunDetailsRequest) returns (GetRunDetailsResponse) {
Expand Down Expand Up @@ -80,7 +83,9 @@ service TrackedRunService {
// Abort a tracked run: mark the run and all of its non-terminal actions ABORTED on the server.
// The platform cannot stop the client that owns the run; subsequent reports against aborted actions
// are rejected. Aborting an already-terminal run is a no-op acknowledged as success.
rpc AbortRun(AbortRunRequest) returns (AbortRunResponse) {}
rpc AbortRun(AbortRunRequest) returns (AbortRunResponse) {
option (flyteidl2.common.allowed_when_restricted) = true;
}
}

// Request message for creating a tracked run.
Expand Down
Loading
Loading