Skip to content

Commit

Permalink
feat: bulk actions matching filters (ET-241) (#9895)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesse-amano-hpe authored Oct 14, 2024
1 parent ac82b3c commit 2ef2f12
Show file tree
Hide file tree
Showing 9 changed files with 5,745 additions and 615 deletions.
594 changes: 592 additions & 2 deletions harness/determined/common/api/bindings.py

Large diffs are not rendered by default.

673 changes: 673 additions & 0 deletions master/internal/api_searches.go

Large diffs are not rendered by default.

549 changes: 549 additions & 0 deletions master/internal/api_searches_intg_test.go

Large diffs are not rendered by default.

1,549 changes: 956 additions & 593 deletions proto/pkg/apiv1/api.pb.go

Large diffs are not rendered by default.

546 changes: 546 additions & 0 deletions proto/pkg/apiv1/api.pb.gw.go

Large diffs are not rendered by default.

1,302 changes: 1,302 additions & 0 deletions proto/pkg/apiv1/search.pb.go

Large diffs are not rendered by default.

84 changes: 82 additions & 2 deletions proto/src/determined/api/v1/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import "determined/api/v1/notebook.proto";
import "determined/api/v1/project.proto";
import "determined/api/v1/rbac.proto";
import "determined/api/v1/run.proto";
import "determined/api/v1/search.proto";
import "determined/api/v1/task.proto";
import "determined/api/v1/template.proto";
import "determined/api/v1/tensorboard.proto";
Expand Down Expand Up @@ -2719,7 +2720,7 @@ service Determined {
};
}

// Get a list of runs.
// Kill runs.
rpc KillRuns(KillRunsRequest) returns (KillRunsResponse) {
option (google.api.http) = {
post: "/api/v1/runs/kill"
Expand All @@ -2730,7 +2731,7 @@ service Determined {
};
}

// Delete a list of runs.
// Delete runs.
rpc DeleteRuns(DeleteRunsRequest) returns (DeleteRunsResponse) {
option (google.api.http) = {
post: "/api/v1/runs/delete"
Expand Down Expand Up @@ -2886,4 +2887,83 @@ service Determined {
tags: "Alpha"
};
}

// Move searches.
rpc MoveSearches(MoveSearchesRequest) returns (MoveSearchesResponse) {
option (google.api.http) = {
post: "/api/v1/searches/move"
body: "*"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
tags: "Internal"
};
}

// Kill searches.
rpc KillSearches(KillSearchesRequest) returns (KillSearchesResponse) {
option (google.api.http) = {
post: "/api/v1/searches/kill"
body: "*"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
tags: "Internal"
};
}

// Delete searches.
rpc DeleteSearches(DeleteSearchesRequest) returns (DeleteSearchesResponse) {
option (google.api.http) = {
post: "/api/v1/searches/delete"
body: "*"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
tags: "Internal"
};
}

// Archive searches.
rpc ArchiveSearches(ArchiveSearchesRequest)
returns (ArchiveSearchesResponse) {
option (google.api.http) = {
post: "/api/v1/searches/archive"
body: "*"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
tags: "Internal"
};
}

// Unarchive searches.
rpc UnarchiveSearches(UnarchiveSearchesRequest)
returns (UnarchiveSearchesResponse) {
option (google.api.http) = {
post: "/api/v1/searches/unarchive"
body: "*"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
tags: "Internal"
};
}

// Pause experiment associated with provided searches.
rpc PauseSearches(PauseSearchesRequest) returns (PauseSearchesResponse) {
option (google.api.http) = {
post: "/api/v1/searches/pause"
body: "*"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
tags: "Internal"
};
}

// Unpause experiment associated with provided searches.
rpc ResumeSearches(ResumeSearchesRequest) returns (ResumeSearchesResponse) {
option (google.api.http) = {
post: "/api/v1/searches/resume"
body: "*"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
tags: "Internal"
};
}
}
183 changes: 183 additions & 0 deletions proto/src/determined/api/v1/search.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
syntax = "proto3";

package determined.api.v1;
option go_package = "github.com/determined-ai/determined/proto/pkg/apiv1";

import "protoc-gen-swagger/options/annotations.proto";

// Message for results of individual searches in a multi-search action.
message SearchActionResult {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "error", "id" ] }
};
// Optional error message.
string error = 1;
// search ID.
int32 id = 2;
}

// Request to move the search to a different project.
message MoveSearchesRequest {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: {
required: [ "source_project_id", "destination_project_id", "search_ids" ]
}
};

// The ids of the searches being moved.
repeated int32 search_ids = 1;
// The id of the current parent project.
int32 source_project_id = 2;
// The id of the new parent project.
int32 destination_project_id = 3;
// Filter expression
optional string filter = 4;
}

// Response to MoveSearchesRequest.
message MoveSearchesResponse {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "results" ] }
};

// Details on success or error for each search.
repeated SearchActionResult results = 1;
}

// Kill searches.
message KillSearchesRequest {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "search_ids", "source_project_id" ] }
};
// The ids of the searches being killed.
repeated int32 search_ids = 1;
// Project id of the searches being killed.
int32 project_id = 2;
// Filter expression
optional string filter = 3;
}
// Response to KillSearchesResponse.
message KillSearchesResponse {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "results" ] }
};
// Details on success or error for each search.
repeated SearchActionResult results = 1;
}

// Delete searches.
message DeleteSearchesRequest {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "search_ids" ] }
};
// The ids of the searches being deleted.
repeated int32 search_ids = 1;
// Project id of the searches being deleted.
int32 project_id = 2;
// Filter expression
optional string filter = 3;
}
// Response to DeleteSearchesResponse.
message DeleteSearchesResponse {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "results" ] }
};
// Details on success or error for each search.
repeated SearchActionResult results = 1;
}

// Request to archive the search
message ArchiveSearchesRequest {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "project_id", "search_ids" ] }
};

// The ids of the searches being archived.
repeated int32 search_ids = 1;
// The id of the current parent project.
int32 project_id = 2;
// Filter expression
optional string filter = 3;
}

// Response to ArchiveSearchesRequest.
message ArchiveSearchesResponse {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "results" ] }
};

// Details on success or error for each search.
repeated SearchActionResult results = 1;
}

// Request to unarchive the search
message UnarchiveSearchesRequest {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "project_id", "search_ids" ] }
};

// The ids of the searches being unarchived.
repeated int32 search_ids = 1;
// The id of the current parent project.
int32 project_id = 2;
// Filter expression
optional string filter = 3;
}

// Response to UnarchiveSearchesRequest.
message UnarchiveSearchesResponse {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "results" ] }
};

// Details on success or error for each search.
repeated SearchActionResult results = 1;
}

// Request to pause the experiment associated witha search.
message PauseSearchesRequest {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "project_id", "search_ids" ] }
};

// The ids of the searches being moved.
repeated int32 search_ids = 1;
// The id of the project of the searches being paused.
int32 project_id = 2;
// Filter expression
optional string filter = 3;
}

// Response to PauseSearchesRequest.
message PauseSearchesResponse {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "results" ] }
};

// Details on success or error for each search.
repeated SearchActionResult results = 1;
}

// Request to unpause the experiment associated witha search.
message ResumeSearchesRequest {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "project_id", "search_ids" ] }
};

// The ids of the searches being moved.
repeated int32 search_ids = 1;
// The id of the project of the searches being unpaused.
int32 project_id = 2;
// Filter expression
optional string filter = 3;
}

// Response to ResumeSearchesRequest.
message ResumeSearchesResponse {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
json_schema: { required: [ "results" ] }
};

// Details on success or error for each search.
repeated SearchActionResult results = 1;
}
Loading

0 comments on commit 2ef2f12

Please sign in to comment.