Skip to content

DATA-4335: Add scope + fragmentIDs to CreateDataPIpeline #721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
26 changes: 24 additions & 2 deletions proto/viam/app/datapipelines/v1/data_pipelines.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ message DataPipeline {
optional viam.app.data.v1.TabularDataSourceType data_source_type = 9;
}

enum PipelineScopeType {
PIPELINE_SCOPE_TYPE_UNSPECIFIED = 0;

// PIPELINE_SCOPE_TYPE_ALL_MACHINES specifies that the pipeline should run for each machine in the organization.
PIPELINE_SCOPE_TYPE_ALL_MACHINES = 1;

// PIPELINE_SCOPE_TYPE_ALL_MACHINES_WITH_FRAGMENTS specifies that the pipeline should run for each machine with at least one of the specified fragments.
PIPELINE_SCOPE_TYPE_ALL_MACHINES_WITH_FRAGMENTS = 2;
}

message PipelineScope {
PipelineScopeType scope = 1;

// Required when using PIPELINE_SCOPE_TYPE_ALL_MACHINES_WITH_FRAGMENTS. When defined, the pipeline will only be run on machines with at least one of the specified fragments. If scope is PIPELINE_SCOPE_TYPE_ALL_MACHINES, this field will have no effect.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See related comment in the app PR

repeated string fragment_ids = 2;
}

message GetDataPipelineRequest {
// The ID of the data pipeline to retrieve.
string id = 1;
Expand All @@ -83,14 +100,16 @@ message ListDataPipelinesResponse {
}

message CreateDataPipelineRequest {
// The associated Viam organization ID.
// The associated Viam organization ID. This organization will also be billed for
// data usage.
string organization_id = 1;

// A unique identifier at the org level.
string name = 2;

// A MongoDB aggregation pipeline as a list of BSON documents, where
// each document is one stage in the pipeline.
// each document is one stage in the pipeline. The pipeline will be run
// for the defined scope.
repeated bytes mql_binary = 3;

// A cron expression representing the expected execution schedule in UTC (note this also
Expand All @@ -102,6 +121,9 @@ message CreateDataPipelineRequest {

// The type of data source for the pipeline. If not specified, default is standard data storage.
optional viam.app.data.v1.TabularDataSourceType data_source_type = 6;

// Defines the set of resources that the pipeline should execute against.
PipelineScope scope = 7;
}

message CreateDataPipelineResponse {
Expand Down
Loading