diff --git a/master/internal/api_searches.go b/master/internal/api_searches.go deleted file mode 100644 index 732de70eb8f..00000000000 --- a/master/internal/api_searches.go +++ /dev/null @@ -1,673 +0,0 @@ -package internal - -import ( - "context" - "database/sql" - "encoding/json" - "fmt" - - "github.com/pkg/errors" - log "github.com/sirupsen/logrus" - "github.com/uptrace/bun" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/determined-ai/determined/master/internal/db" - "github.com/determined-ai/determined/master/internal/experiment" - "github.com/determined-ai/determined/master/internal/grpcutil" - "github.com/determined-ai/determined/master/pkg/model" - "github.com/determined-ai/determined/master/pkg/set" - "github.com/determined-ai/determined/proto/pkg/apiv1" - "github.com/determined-ai/determined/proto/pkg/rbacv1" -) - -type searchCandidateResult struct { - Archived bool - ID int32 - IsTerminal bool -} - -func filterSearchQuery(getQ *bun.SelectQuery, filter *string) (*bun.SelectQuery, error) { - var efr experimentFilterRoot - err := json.Unmarshal([]byte(*filter), &efr) - if err != nil { - return nil, err - } - getQ = getQ.WhereGroup(" AND ", func(q *bun.SelectQuery) *bun.SelectQuery { - _, err = efr.toSQL(q) - return q - }).WhereGroup(" AND ", func(q *bun.SelectQuery) *bun.SelectQuery { - if !efr.ShowArchived { - return q.Where(`NOT e.archived`) - } - return q - }) - if err != nil { - return nil, err - } - return getQ, nil -} - -func getSelectSearchesQueryTables() *bun.SelectQuery { - return db.Bun().NewSelect(). - ModelTableExpr("experiments AS e"). - Join("JOIN projects p ON e.project_id = p.id"). - Join("JOIN workspaces w ON p.workspace_id = w.id") -} - -func (a *apiServer) MoveSearches( - ctx context.Context, req *apiv1.MoveSearchesRequest, -) (*apiv1.MoveSearchesResponse, error) { - curUser, _, err := grpcutil.GetUser(ctx) - if err != nil { - return nil, err - } - // check that user can view source project - srcProject, err := a.GetProjectByID(ctx, req.SourceProjectId, *curUser) - if err != nil { - return nil, err - } - if srcProject.Archived { - return nil, errors.Errorf("project (%v) is archived and cannot have searches moved from it", - srcProject.Id) - } - - // check suitable destination project - destProject, err := a.GetProjectByID(ctx, req.DestinationProjectId, *curUser) - if err != nil { - return nil, err - } - if destProject.Archived { - return nil, errors.Errorf("project (%v) is archived and cannot add new searches", - req.DestinationProjectId) - } - if err = experiment.AuthZProvider.Get().CanCreateExperiment(ctx, *curUser, destProject); err != nil { - return nil, status.Error(codes.PermissionDenied, err.Error()) - } - - if req.SourceProjectId == req.DestinationProjectId { - return &apiv1.MoveSearchesResponse{Results: []*apiv1.SearchActionResult{}}, nil - } - - var searchChecks []searchCandidateResult - getQ := db.Bun().NewSelect(). - ModelTableExpr("experiments AS e"). - Model(&searchChecks). - Column("e.id"). - ColumnExpr("COALESCE((e.archived OR p.archived OR w.archived), FALSE) AS archived"). - Join("JOIN projects p ON e.project_id = p.id"). - Join("JOIN workspaces w ON p.workspace_id = w.id"). - Where("e.project_id = ?", req.SourceProjectId) - - if req.Filter == nil { - getQ = getQ.Where("e.id IN (?)", bun.In(req.SearchIds)) - } else { - getQ, err = filterSearchQuery(getQ, req.Filter) - if err != nil { - return nil, err - } - } - - if getQ, err = experiment.AuthZProvider.Get().FilterExperimentsQuery(ctx, *curUser, nil, getQ, - []rbacv1.PermissionType{ - rbacv1.PermissionType_PERMISSION_TYPE_VIEW_EXPERIMENT_METADATA, - rbacv1.PermissionType_PERMISSION_TYPE_DELETE_EXPERIMENT, - }); err != nil { - return nil, err - } - - err = getQ.Scan(ctx) - if err != nil { - return nil, err - } - - var results []*apiv1.SearchActionResult - visibleIDs := set.New[int32]() - var validIDs []int32 - for _, check := range searchChecks { - visibleIDs.Insert(check.ID) - if check.Archived { - results = append(results, &apiv1.SearchActionResult{ - Error: "Search is archived.", - Id: check.ID, - }) - continue - } - validIDs = append(validIDs, check.ID) - } - if req.Filter == nil { - for _, originalID := range req.SearchIds { - if !visibleIDs.Contains(originalID) { - results = append(results, &apiv1.SearchActionResult{ - Error: fmt.Sprintf("Search with id '%d' not found in project with id '%d'", originalID, req.SourceProjectId), - Id: originalID, - }) - } - } - } - if len(validIDs) > 0 { - expMoveResults, err := experiment.MoveExperiments(ctx, srcProject.Id, validIDs, nil, req.DestinationProjectId) - if err != nil { - return nil, err - } - failedExpMoveIds := []int32{-1} - successExpMoveIds := []int32{-1} - for _, res := range expMoveResults { - if res.Error != nil { - failedExpMoveIds = append(failedExpMoveIds, res.ID) - } else { - successExpMoveIds = append(successExpMoveIds, res.ID) - } - } - - tx, err := db.Bun().BeginTx(ctx, nil) - if err != nil { - return nil, err - } - defer func() { - txErr := tx.Rollback() - if txErr != nil && txErr != sql.ErrTxDone { - log.WithError(txErr).Error("error rolling back transaction in MoveSearches") - } - }() - - if err = db.RemoveOutdatedProjectHparams(ctx, tx, int(req.SourceProjectId)); err != nil { - return nil, err - } - - var failedSearchIDs []int32 - if err = tx.NewSelect().Table("experiments"). - Column("id"). - Where("experiments.id IN (?)", bun.In(validIDs)). - Where("experiments.id IN (?)", bun.In(failedExpMoveIds)). - Scan(ctx, &failedSearchIDs); err != nil { - return nil, fmt.Errorf("getting failed experiment move IDs: %w", err) - } - for _, failedSearchID := range failedSearchIDs { - results = append(results, &apiv1.SearchActionResult{ - Error: "Failed to move experiment", - Id: failedSearchID, - }) - } - - var successSearchIDs []int32 - if err = tx.NewSelect().Table("experiments"). - Column("id"). - Where("experiments.id IN (?)", bun.In(successExpMoveIds)). - Scan(ctx, &successSearchIDs); err != nil { - return nil, fmt.Errorf("getting failed experiment move search IDs: %w", err) - } - for _, successSearchID := range successSearchIDs { - results = append(results, &apiv1.SearchActionResult{ - Error: "", - Id: successSearchID, - }) - } - if err = tx.Commit(); err != nil { - return nil, err - } - } - return &apiv1.MoveSearchesResponse{Results: results}, nil -} - -func (a *apiServer) KillSearches(ctx context.Context, req *apiv1.KillSearchesRequest, -) (*apiv1.KillSearchesResponse, error) { - curUser, _, err := grpcutil.GetUser(ctx) - if err != nil { - return nil, err - } - - type killSearchOKResult struct { - ID int32 - RequestID *string - IsTerminal bool - } - - var killCandidatees []killSearchOKResult - getQ := getSelectSearchesQueryTables(). - Model(&killCandidatees). - Column("e.id"). - ColumnExpr("t.request_id"). - ColumnExpr("e.state IN (?) AS is_terminal", bun.In(model.StatesToStrings(model.TerminalStates))). - Where("e.project_id = ?", req.ProjectId) - - if req.Filter == nil { - getQ = getQ.Where("e.id IN (?)", bun.In(req.SearchIds)) - } else { - getQ, err = filterSearchQuery(getQ, req.Filter) - if err != nil { - return nil, err - } - } - - if getQ, err = experiment.AuthZProvider.Get(). - FilterExperimentsQuery(ctx, *curUser, nil, getQ, - []rbacv1.PermissionType{rbacv1.PermissionType_PERMISSION_TYPE_UPDATE_EXPERIMENT}); err != nil { - return nil, err - } - - err = getQ.Scan(ctx) - if err != nil { - return nil, err - } - - var results []*apiv1.SearchActionResult - visibleIDs := set.New[int32]() - var validIDs []int32 - for _, cand := range killCandidatees { - visibleIDs.Insert(cand.ID) - switch { - case cand.IsTerminal: - results = append(results, &apiv1.SearchActionResult{ - Error: "", - Id: cand.ID, - }) - // This should be impossible in the current system but we will leave this check here - // to cover a possible error in integration tests - case cand.RequestID == nil: - results = append(results, &apiv1.SearchActionResult{ - Error: "Search has no associated request id.", - Id: cand.ID, - }) - default: - validIDs = append(validIDs, cand.ID) - } - } - if req.Filter == nil { - for _, originalID := range req.SearchIds { - if !visibleIDs.Contains(originalID) { - results = append(results, &apiv1.SearchActionResult{ - Error: fmt.Sprintf("Search with id '%d' not found", originalID), - Id: originalID, - }) - } - } - } - - for _, searchID := range validIDs { - _, err = a.KillExperiment(ctx, &apiv1.KillExperimentRequest{ - Id: searchID, - }) - if err != nil { - results = append(results, &apiv1.SearchActionResult{ - Error: fmt.Sprintf("Failed to kill search: %s", err), - Id: searchID, - }) - } else { - results = append(results, &apiv1.SearchActionResult{ - Error: "", - Id: searchID, - }) - } - } - return &apiv1.KillSearchesResponse{Results: results}, nil -} - -func (a *apiServer) DeleteSearches(ctx context.Context, req *apiv1.DeleteSearchesRequest, -) (*apiv1.DeleteSearchesResponse, error) { - if len(req.SearchIds) > 0 && req.Filter != nil { - return nil, fmt.Errorf("if filter is provided search id list must be empty") - } - curUser, _, err := grpcutil.GetUser(ctx) - if err != nil { - return nil, err - } - // get searches to delete - var deleteCandidates []searchCandidateResult - getQ := getSelectSearchesQueryTables(). - Model(&deleteCandidates). - Column("e.id"). - ColumnExpr("COALESCE((e.archived OR p.archived OR w.archived), FALSE) AS archived"). - ColumnExpr("e.state IN (?) AS is_terminal", bun.In(model.StatesToStrings(model.TerminalStates))). - Where("e.project_id = ?", req.ProjectId) - - if req.Filter == nil { - getQ = getQ.Where("e.id IN (?)", bun.In(req.SearchIds)) - } else { - getQ, err = filterSearchQuery(getQ, req.Filter) - if err != nil { - return nil, err - } - } - - if getQ, err = experiment.AuthZProvider.Get().FilterExperimentsQuery(ctx, *curUser, nil, getQ, - []rbacv1.PermissionType{ - rbacv1.PermissionType_PERMISSION_TYPE_DELETE_EXPERIMENT, - }); err != nil { - return nil, err - } - - err = getQ.Scan(ctx) - if err != nil { - return nil, err - } - - var results []*apiv1.SearchActionResult - visibleIDs := set.New[int32]() - var validIDs []int32 - for _, cand := range deleteCandidates { - visibleIDs.Insert(cand.ID) - if !cand.IsTerminal { - results = append(results, &apiv1.SearchActionResult{ - Error: "Search is not in a terminal state.", - Id: cand.ID, - }) - } else { - validIDs = append(validIDs, cand.ID) - } - } - if req.Filter == nil { - for _, originalID := range req.SearchIds { - if !visibleIDs.Contains(originalID) { - results = append(results, &apiv1.SearchActionResult{ - Error: fmt.Sprintf("Search with id '%d' not found in project with id '%d'", originalID, req.ProjectId), - Id: originalID, - }) - } - } - } - if len(validIDs) == 0 { - return &apiv1.DeleteSearchesResponse{Results: results}, nil - } - tx, err := db.Bun().BeginTx(ctx, nil) - if err != nil { - return nil, err - } - defer func() { - txErr := tx.Rollback() - if txErr != nil && txErr != sql.ErrTxDone { - log.WithError(txErr).Error("error rolling back transaction in DeleteSearches") - } - }() - - var deleteRunIDs []int32 - getQ = db.Bun().NewSelect(). - TableExpr("runs AS r"). - Model(&deleteRunIDs). - Column("r.id"). - Where("r.experiment_id IN (?)", bun.In(validIDs)) - - err = getQ.Scan(ctx) - if err != nil { - return nil, err - } - - // delete run logs - if _, err = tx.NewDelete().Table("trial_logs"). - Where("trial_logs.trial_id IN (?)", bun.In(deleteRunIDs)). - Exec(ctx); err != nil { - return nil, fmt.Errorf("delete run logs: %w", err) - } - - // delete task logs - trialTaskQuery := tx.NewSelect().Table("run_id_task_id"). - ColumnExpr("task_id"). - Where("run_id IN (?)", bun.In(deleteRunIDs)) - if _, err = tx.NewDelete().Table("task_logs"). - Where("task_logs.task_id IN (?)", trialTaskQuery). - Exec(ctx); err != nil { - return nil, fmt.Errorf("delete task logs: %w", err) - } - - // delete runs - if _, err = tx.NewDelete().Table("runs"). - Where("runs.id IN (?)", bun.In(deleteRunIDs)). - Exec(ctx); err != nil { - return nil, fmt.Errorf("delete runs: %w", err) - } - - var acceptedIDs []int - if _, err = tx.NewDelete().Table("experiments"). - Where("id IN (?)", bun.In(validIDs)). - Returning("id"). - Model(&acceptedIDs). - Exec(ctx); err != nil { - return nil, fmt.Errorf("delete runs: %w", err) - } - - for _, acceptID := range acceptedIDs { - results = append(results, &apiv1.SearchActionResult{ - Error: "", - Id: int32(acceptID), - }) - } - - // delete run hparams - if _, err = tx.NewDelete().Table("run_hparams"). - Where("run_id IN (?)", bun.In(deleteRunIDs)). - Exec(ctx); err != nil { - return nil, fmt.Errorf("deleting run hparams: %w", err) - } - // remove project hparams - if err = db.RemoveOutdatedProjectHparams(ctx, tx, int(req.ProjectId)); err != nil { - return nil, err - } - - if err = tx.Commit(); err != nil { - return nil, err - } - - return &apiv1.DeleteSearchesResponse{Results: results}, nil -} - -func (a *apiServer) ArchiveSearches( - ctx context.Context, req *apiv1.ArchiveSearchesRequest, -) (*apiv1.ArchiveSearchesResponse, error) { - results, err := archiveUnarchiveSearchAction(ctx, true, req.SearchIds, req.ProjectId, req.Filter) - if err != nil { - return nil, err - } - return &apiv1.ArchiveSearchesResponse{Results: results}, nil -} - -func (a *apiServer) UnarchiveSearches( - ctx context.Context, req *apiv1.UnarchiveSearchesRequest, -) (*apiv1.UnarchiveSearchesResponse, error) { - results, err := archiveUnarchiveSearchAction(ctx, false, req.SearchIds, req.ProjectId, req.Filter) - if err != nil { - return nil, err - } - return &apiv1.UnarchiveSearchesResponse{Results: results}, nil -} - -func archiveUnarchiveSearchAction(ctx context.Context, archive bool, runIDs []int32, - projectID int32, filter *string, -) ([]*apiv1.SearchActionResult, error) { - if len(runIDs) > 0 && filter != nil { - return nil, fmt.Errorf("if filter is provided run id list must be empty") - } - curUser, _, err := grpcutil.GetUser(ctx) - if err != nil { - return nil, err - } - - var searchCandidates []searchCandidateResult - query := db.Bun().NewSelect(). - ModelTableExpr("experiments AS e"). - Model(&searchCandidates). - Column("e.id"). - ColumnExpr("COALESCE((e.archived OR p.archived OR w.archived), FALSE) AS archived"). - ColumnExpr("e.state IN (?) AS is_terminal", bun.In(model.StatesToStrings(model.TerminalStates))). - Join("JOIN projects p ON e.project_id = p.id"). - Join("JOIN workspaces w ON p.workspace_id = w.id"). - Where("e.project_id = ?", projectID) - - if filter == nil { - query = query.Where("e.id IN (?)", bun.In(runIDs)) - } else { - query, err = filterSearchQuery(query, filter) - if err != nil { - return nil, err - } - } - - query, err = experiment.AuthZProvider.Get(). - FilterExperimentsQuery(ctx, *curUser, nil, query, - []rbacv1.PermissionType{rbacv1.PermissionType_PERMISSION_TYPE_UPDATE_EXPERIMENT_METADATA}) - if err != nil { - return nil, err - } - - err = query.Scan(ctx) - if err != nil { - return nil, err - } - - var results []*apiv1.SearchActionResult - visibleIDs := set.New[int32]() - var validIDs []int32 - for _, cand := range searchCandidates { - visibleIDs.Insert(cand.ID) - switch { - case !cand.IsTerminal: - results = append(results, &apiv1.SearchActionResult{ - Error: "Search is not in terminal state.", - Id: cand.ID, - }) - case cand.Archived == archive: - results = append(results, &apiv1.SearchActionResult{ - Id: cand.ID, - }) - default: - validIDs = append(validIDs, cand.ID) - } - } - - if filter == nil { - for _, originalID := range runIDs { - if !visibleIDs.Contains(originalID) { - results = append(results, &apiv1.SearchActionResult{ - Error: fmt.Sprintf("Search with id '%d' not found in project with id '%d'", originalID, projectID), - Id: originalID, - }) - } - } - } - - if len(validIDs) > 0 { - var acceptedIDs []int32 - _, err = db.Bun().NewUpdate(). - ModelTableExpr("experiments as e"). - Set("archived = ?", archive). - Where("id IN (?)", bun.In(validIDs)). - Returning("id"). - Model(&acceptedIDs). - Exec(ctx) - if err != nil { - return nil, fmt.Errorf("failed to archive/unarchive searches: %w", err) - } - for _, acceptID := range acceptedIDs { - results = append(results, &apiv1.SearchActionResult{ - Error: "", - Id: acceptID, - }) - } - } - - return results, nil -} - -func (a *apiServer) PauseSearches(ctx context.Context, req *apiv1.PauseSearchesRequest, -) (*apiv1.PauseSearchesResponse, error) { - results, err := pauseResumeSearchAction(ctx, true, req.ProjectId, req.SearchIds, req.Filter) - if err != nil { - return nil, err - } - return &apiv1.PauseSearchesResponse{Results: results}, nil -} - -func (a *apiServer) ResumeSearches(ctx context.Context, req *apiv1.ResumeSearchesRequest, -) (*apiv1.ResumeSearchesResponse, error) { - results, err := pauseResumeSearchAction(ctx, false, req.ProjectId, req.SearchIds, req.Filter) - if err != nil { - return nil, err - } - return &apiv1.ResumeSearchesResponse{Results: results}, nil -} - -func pauseResumeSearchAction(ctx context.Context, isPause bool, projectID int32, - searchIds []int32, filter *string) ( - []*apiv1.SearchActionResult, error, -) { - if len(searchIds) > 0 && filter != nil { - return nil, fmt.Errorf("if filter is provided search id list must be empty") - } - // Get experiment ids - var err error - var searchCandidates []searchCandidateResult - isSearchIDAction := (len(searchIds) > 0) - getQ := db.Bun().NewSelect(). - ModelTableExpr("experiments AS e"). - Model(&searchCandidates). - Column("e.id"). - ColumnExpr("COALESCE((e.archived OR p.archived OR w.archived), FALSE) AS archived"). - Join("JOIN projects p ON e.project_id = p.id"). - Join("JOIN workspaces w ON p.workspace_id = w.id"). - Where("e.project_id = ?", projectID) - - if isSearchIDAction { - getQ = getQ.Where("e.id IN (?)", bun.In(searchIds)) - } else { - getQ, err = filterSearchQuery(getQ, filter) - if err != nil { - return nil, err - } - } - - err = getQ.Scan(ctx) - if err != nil { - return nil, err - } - - var results []*apiv1.SearchActionResult - visibleIDs := set.New[int32]() - expIDs := set.New[int32]() - for _, cand := range searchCandidates { - visibleIDs.Insert(cand.ID) - if cand.Archived { - results = append(results, &apiv1.SearchActionResult{ - Error: "Search is archived.", - Id: cand.ID, - }) - continue - } - expIDs.Insert(cand.ID) - } - if isSearchIDAction { - for _, originalID := range searchIds { - if !visibleIDs.Contains(originalID) { - results = append(results, &apiv1.SearchActionResult{ - Error: fmt.Sprintf("Search with id '%d' not found in project with id '%d'", originalID, projectID), - Id: originalID, - }) - } - } - } - // Pause/Resume experiments - var expResults []experiment.ExperimentActionResult - var errMsg string - if isPause { - expResults, err = experiment.PauseExperiments(ctx, projectID, expIDs.ToSlice(), nil) - errMsg = "Failed to pause experiment: %s" - } else { - expResults, err = experiment.ActivateExperiments(ctx, projectID, expIDs.ToSlice(), nil) - errMsg = "Failed to resume experiment: %s" - } - if err != nil { - return nil, err - } - for _, expRes := range expResults { - if expRes.Error != nil { - results = append(results, &apiv1.SearchActionResult{ - Error: fmt.Sprintf(errMsg, expRes.Error), - Id: expRes.ID, - }) - } else { - results = append(results, &apiv1.SearchActionResult{ - Error: "", - Id: expRes.ID, - }) - } - } - return results, nil -} diff --git a/master/internal/api_searches_intg_test.go b/master/internal/api_searches_intg_test.go deleted file mode 100644 index 183cdcf6586..00000000000 --- a/master/internal/api_searches_intg_test.go +++ /dev/null @@ -1,549 +0,0 @@ -//go:build integration -// +build integration - -package internal - -import ( - "encoding/json" - "fmt" - "slices" - "strings" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/determined-ai/determined/master/internal/db" - "github.com/determined-ai/determined/master/pkg/model" - "github.com/determined-ai/determined/master/pkg/ptrs" - "github.com/determined-ai/determined/master/pkg/schemas" - "github.com/determined-ai/determined/master/pkg/schemas/expconf" - "github.com/determined-ai/determined/proto/pkg/apiv1" -) - -// nolint: exhaustruct -func createTestSearchWithHParams( - t *testing.T, api *apiServer, curUser model.User, projectID int, hparams map[string]any, -) *model.Experiment { - experimentConfig := expconf.ExperimentConfig{ - RawDescription: ptrs.Ptr("desc"), - RawName: expconf.Name{RawString: ptrs.Ptr("name")}, - } - - b, err := json.Marshal(hparams) - require.NoError(t, err) - err = json.Unmarshal(b, &experimentConfig.RawHyperparameters) - require.NoError(t, err) - - activeConfig := schemas.WithDefaults(schemas.Merge(minExpConfig, experimentConfig)) - return createTestExpWithActiveConfig(t, api, curUser, projectID, activeConfig) -} - -func TestMoveSearchesIds(t *testing.T) { - api, curUser, ctx := setupAPITest(t, nil) - _, projectIDInt := createProjectAndWorkspace(ctx, t, api) - sourceprojectID := int32(1) - destprojectID := int32(projectIDInt) - - search1 := createTestExp(t, api, curUser) - search2 := createTestExp(t, api, curUser) - - moveIds := []int32{int32(search1.ID)} - - moveReq := &apiv1.MoveSearchesRequest{ - SearchIds: moveIds, - SourceProjectId: sourceprojectID, - DestinationProjectId: destprojectID, - } - - moveResp, err := api.MoveSearches(ctx, moveReq) - require.NoError(t, err) - require.Len(t, moveResp.Results, 1) - require.Equal(t, "", moveResp.Results[0].Error) - - // run no longer in old project - filter := fmt.Sprintf(`{"filterGroup":{"children":[{"columnName":"id","kind":"field",`+ - `"location":"LOCATION_TYPE_EXPERIMENT","operator":"=","type":"COLUMN_TYPE_NUMBER","value":%d}],`+ - `"conjunction":"and","kind":"group"},"showArchived":false}`, int32(search2.ID)) - req := &apiv1.SearchExperimentsRequest{ - ProjectId: &sourceprojectID, - Filter: &filter, - } - resp, err := api.SearchExperiments(ctx, req) - require.NoError(t, err) - require.Len(t, resp.Experiments, 1) - require.Equal(t, int32(search2.ID), resp.Experiments[0].Experiment.Id) - - // runs in new project - req = &apiv1.SearchExperimentsRequest{ - ProjectId: &destprojectID, - Sort: ptrs.Ptr("id=desc"), - } - - resp, err = api.SearchExperiments(ctx, req) - require.NoError(t, err) - require.Len(t, resp.Experiments, 1) - require.Equal(t, moveIds[0], resp.Experiments[0].Experiment.Id) -} - -func TestMoveSearchesSameIds(t *testing.T) { - api, curUser, ctx := setupAPITest(t, nil) - sourceprojectID := int32(1) - - search1 := createTestExp(t, api, curUser) - moveIds := []int32{int32(search1.ID)} - - moveReq := &apiv1.MoveSearchesRequest{ - SearchIds: moveIds, - SourceProjectId: sourceprojectID, - DestinationProjectId: sourceprojectID, - } - - moveResp, err := api.MoveSearches(ctx, moveReq) - require.NoError(t, err) - require.Empty(t, moveResp.Results) -} - -func TestMoveSearchesFilter(t *testing.T) { - api, curUser, ctx := setupAPITest(t, nil) - _, projectIDInt := createProjectAndWorkspace(ctx, t, api) - _, projectID2Int := createProjectAndWorkspace(ctx, t, api) - sourceprojectID := int32(projectIDInt) - destprojectID := int32(projectID2Int) - - hyperparameters1 := map[string]any{"global_batch_size": 1, "test1": map[string]any{"test2": 1}} - hyperparameters2 := map[string]any{"test1": map[string]any{"test2": 5}} - exp1 := createTestSearchWithHParams(t, api, curUser, projectIDInt, hyperparameters1) - exp2 := createTestSearchWithHParams(t, api, curUser, projectIDInt, hyperparameters2) - - task1 := &model.Task{TaskType: model.TaskTypeTrial, TaskID: model.NewTaskID()} - require.NoError(t, db.AddTask(ctx, task1)) - require.NoError(t, db.AddTrial(ctx, &model.Trial{ - State: model.PausedState, - ExperimentID: exp1.ID, - StartTime: time.Now(), - HParams: hyperparameters1, - }, task1.TaskID)) - - task2 := &model.Task{TaskType: model.TaskTypeTrial, TaskID: model.NewTaskID()} - require.NoError(t, db.AddTask(ctx, task2)) - require.NoError(t, db.AddTrial(ctx, &model.Trial{ - State: model.PausedState, - ExperimentID: exp2.ID, - StartTime: time.Now(), - HParams: hyperparameters2, - }, task2.TaskID)) - - projHparam := getTestProjectHyperparmeters(ctx, t, projectIDInt) - require.Len(t, projHparam, 2) - require.True(t, slices.Contains(projHparam, "test1.test2")) - require.True(t, slices.Contains(projHparam, "global_batch_size")) - - req := &apiv1.SearchRunsRequest{ - ProjectId: &sourceprojectID, - Sort: ptrs.Ptr("id=asc"), - } - _, err := api.SearchRuns(ctx, req) - require.NoError(t, err) - - // If provided with filter MoveSearches should ignore these move ids - moveIds := []int32{int32(exp1.ID), int32(exp2.ID)} - - moveReq := &apiv1.MoveSearchesRequest{ - SearchIds: moveIds, - SourceProjectId: sourceprojectID, - DestinationProjectId: destprojectID, - Filter: ptrs.Ptr(`{"filterGroup":{"children":[{"columnName":"hp.test1.test2","kind":"field",` + - `"location":"LOCATION_TYPE_HYPERPARAMETERS","operator":"<=","type":"COLUMN_TYPE_NUMBER","value":1}],` + - `"conjunction":"and","kind":"group"},"showArchived":false}`), - } - - moveResp, err := api.MoveSearches(ctx, moveReq) - require.NoError(t, err) - require.Len(t, moveResp.Results, 1) - require.Equal(t, "", moveResp.Results[0].Error) - - // check 1 run moved in old project - resp, err := api.SearchRuns(ctx, req) - require.NoError(t, err) - require.Len(t, resp.Runs, 1) - - // run in new project - req = &apiv1.SearchRunsRequest{ - ProjectId: &destprojectID, - Sort: ptrs.Ptr("id=asc"), - } - - resp, err = api.SearchRuns(ctx, req) - require.NoError(t, err) - require.Len(t, resp.Runs, 1) - - // Hyperparam moved out of project A - projHparam = getTestProjectHyperparmeters(ctx, t, projectIDInt) - require.Len(t, projHparam, 1) - require.Equal(t, "test1.test2", projHparam[0]) - - // Hyperparams moved into project B - projHparam = getTestProjectHyperparmeters(ctx, t, projectID2Int) - require.Len(t, projHparam, 2) - require.True(t, slices.Contains(projHparam, "test1.test2")) - require.True(t, slices.Contains(projHparam, "global_batch_size")) - - i := strings.Index(resp.Runs[0].LocalId, "-") - localID := resp.Runs[0].LocalId[i+1:] - require.Equal(t, "1", localID) -} - -func TestDeleteSearchesNonTerminal(t *testing.T) { - api, curUser, ctx := setupAPITest(t, nil) - _, projectIDInt := createProjectAndWorkspace(ctx, t, api) - projectID := int32(projectIDInt) - - exp := createTestExpWithProjectID(t, api, curUser, projectIDInt) - - task1 := &model.Task{TaskType: model.TaskTypeTrial, TaskID: model.NewTaskID()} - require.NoError(t, db.AddTask(ctx, task1)) - require.NoError(t, db.AddTrial(ctx, &model.Trial{ - State: model.ActiveState, - ExperimentID: exp.ID, - StartTime: time.Now(), - }, task1.TaskID)) - - task2 := &model.Task{TaskType: model.TaskTypeTrial, TaskID: model.NewTaskID()} - require.NoError(t, db.AddTask(ctx, task2)) - require.NoError(t, db.AddTrial(ctx, &model.Trial{ - State: model.ActiveState, - ExperimentID: exp.ID, - StartTime: time.Now(), - }, task2.TaskID)) - - searchReq := &apiv1.SearchRunsRequest{ - ProjectId: &projectID, - Sort: ptrs.Ptr("id=asc"), - } - searchResp, err := api.SearchRuns(ctx, searchReq) - require.NoError(t, err) - require.Len(t, searchResp.Runs, 2) - - searchIDs := []int32{int32(exp.ID)} - req := &apiv1.DeleteSearchesRequest{ - SearchIds: searchIDs, - ProjectId: projectID, - } - res, err := api.DeleteSearches(ctx, req) - require.NoError(t, err) - require.Len(t, res.Results, 1) - require.Equal(t, "Search is not in a terminal state.", res.Results[0].Error) - - searchReq = &apiv1.SearchRunsRequest{ - ProjectId: &projectID, - Filter: ptrs.Ptr(`{"showArchived":true}`), - Sort: ptrs.Ptr("id=asc"), - } - - searchResp, err = api.SearchRuns(ctx, searchReq) - require.NoError(t, err) - require.Len(t, searchResp.Runs, 2) -} - -func TestDeleteSearchesIds(t *testing.T) { - api, curUser, ctx := setupAPITest(t, nil) - projectID, _, _, _, expID := setUpMultiTrialExperiments(ctx, t, api, curUser) //nolint:dogsled - require.NoError(t, completeExp(ctx, expID)) - - expIDs := []int32{expID} - req := &apiv1.DeleteSearchesRequest{ - SearchIds: expIDs, - ProjectId: projectID, - } - res, err := api.DeleteSearches(ctx, req) - require.NoError(t, err) - require.Len(t, res.Results, 1) - require.Equal(t, "", res.Results[0].Error) - - searchReq := &apiv1.SearchRunsRequest{ - ProjectId: &projectID, - Filter: ptrs.Ptr(`{"showArchived":true}`), - Sort: ptrs.Ptr("id=asc"), - } - - searchResp, err := api.SearchRuns(ctx, searchReq) - require.NoError(t, err) - require.Empty(t, searchResp.Runs) -} - -func TestDeleteSearchesIdsNonExistent(t *testing.T) { - api, _, ctx := setupAPITest(t, nil) - _, projectIDInt := createProjectAndWorkspace(ctx, t, api) - projectID := int32(projectIDInt) - - // delete runs - searchIDs := []int32{-1} - req := &apiv1.DeleteSearchesRequest{ - SearchIds: searchIDs, - ProjectId: projectID, - } - res, err := api.DeleteSearches(ctx, req) - require.NoError(t, err) - require.Len(t, res.Results, 1) - require.Equal(t, fmt.Sprintf("Search with id '%d' not found in project with id '%d'", -1, projectID), - res.Results[0].Error) -} - -func TestDeleteSearchesFilter(t *testing.T) { - api, curUser, ctx := setupAPITest(t, nil) - _, projectIDInt := createProjectAndWorkspace(ctx, t, api) - projectID := int32(projectIDInt) - - hyperparameters1 := map[string]any{"global_batch_size": 1, "test1": map[string]any{"test2": 1}} - exp1 := createTestSearchWithHParams(t, api, curUser, projectIDInt, hyperparameters1) - hyperparameters2 := map[string]any{"test1": map[string]any{"test2": 5}} - exp2 := createTestSearchWithHParams(t, api, curUser, projectIDInt, hyperparameters2) - - task1 := &model.Task{TaskType: model.TaskTypeTrial, TaskID: model.NewTaskID()} - require.NoError(t, db.AddTask(ctx, task1)) - require.NoError(t, db.AddTrial(ctx, &model.Trial{ - State: model.CompletedState, - ExperimentID: exp1.ID, - StartTime: time.Now(), - HParams: hyperparameters1, - }, task1.TaskID)) - - task2 := &model.Task{TaskType: model.TaskTypeTrial, TaskID: model.NewTaskID()} - require.NoError(t, db.AddTask(ctx, task2)) - require.NoError(t, db.AddTrial(ctx, &model.Trial{ - State: model.CompletedState, - ExperimentID: exp2.ID, - StartTime: time.Now(), - HParams: hyperparameters2, - }, task2.TaskID)) - - projHparam := getTestProjectHyperparmeters(ctx, t, projectIDInt) - require.Len(t, projHparam, 2) - require.True(t, slices.Contains(projHparam, "test1.test2")) - require.True(t, slices.Contains(projHparam, "global_batch_size")) - - require.NoError(t, completeExp(ctx, int32(exp1.ID))) - require.NoError(t, completeExp(ctx, int32(exp2.ID))) - - filter := `{ - "filterGroup": { - "children": [ - { - "columnName": "hp.test1.test2", - "kind": "field", - "location": "LOCATION_TYPE_HYPERPARAMETERS", - "operator": "<=", - "type": "COLUMN_TYPE_NUMBER", - "value": 1 - } - ], - "conjunction": "and", - "kind": "group" - }, - "showArchived": true - }` - req := &apiv1.DeleteSearchesRequest{ - Filter: &filter, - ProjectId: projectID, - } - res, err := api.DeleteSearches(ctx, req) - require.NoError(t, err) - require.Len(t, res.Results, 1) - require.Equal(t, "", res.Results[0].Error) - - searchReq := &apiv1.SearchRunsRequest{ - ProjectId: &projectID, - Filter: ptrs.Ptr(`{"showArchived":true}`), - Sort: ptrs.Ptr("id=asc"), - } - - projHparam = getTestProjectHyperparmeters(ctx, t, projectIDInt) - require.Len(t, projHparam, 1) - require.Equal(t, "test1.test2", projHparam[0]) - - searchResp, err := api.SearchRuns(ctx, searchReq) - require.NoError(t, err) - require.Len(t, searchResp.Runs, 1) -} - -func TestArchiveUnarchiveSearchIds(t *testing.T) { - api, curUser, ctx := setupAPITest(t, nil) - projectID, _, _, _, expID := setUpMultiTrialExperiments(ctx, t, api, curUser) //nolint:dogsled - require.NoError(t, completeExp(ctx, expID)) - - searchIDs := []int32{expID} - archReq := &apiv1.ArchiveSearchesRequest{ - SearchIds: searchIDs, - ProjectId: projectID, - } - archRes, err := api.ArchiveSearches(ctx, archReq) - require.NoError(t, err) - require.Len(t, archRes.Results, 1) - require.Equal(t, "", archRes.Results[0].Error) - - searchReq := &apiv1.SearchRunsRequest{ - ProjectId: &projectID, - Filter: ptrs.Ptr(`{"showArchived":false}`), - Sort: ptrs.Ptr("id=asc"), - } - - searchResp, err := api.SearchRuns(ctx, searchReq) - require.NoError(t, err) - require.Empty(t, searchResp.Runs) - - // Unarchive runs - unarchReq := &apiv1.UnarchiveSearchesRequest{ - SearchIds: searchIDs, - ProjectId: projectID, - } - unarchRes, err := api.UnarchiveSearches(ctx, unarchReq) - require.NoError(t, err) - require.Len(t, unarchRes.Results, 1) - require.Equal(t, "", unarchRes.Results[0].Error) - - searchResp, err = api.SearchRuns(ctx, searchReq) - require.NoError(t, err) - require.Len(t, searchResp.Runs, 2) -} - -func TestArchiveUnarchiveSearchFilter(t *testing.T) { - api, curUser, ctx := setupAPITest(t, nil) - _, projectIDInt := createProjectAndWorkspace(ctx, t, api) - projectID := int32(projectIDInt) - - hyperparameters1 := map[string]any{"global_batch_size": 1, "test1": map[string]any{"test2": 1}} - exp1 := createTestSearchWithHParams(t, api, curUser, projectIDInt, hyperparameters1) - hyperparameters2 := map[string]any{"global_batch_size": 1, "test1": map[string]any{"test2": 5}} - exp2 := createTestSearchWithHParams(t, api, curUser, projectIDInt, hyperparameters2) - - task1 := &model.Task{TaskType: model.TaskTypeTrial, TaskID: model.NewTaskID()} - require.NoError(t, db.AddTask(ctx, task1)) - require.NoError(t, db.AddTrial(ctx, &model.Trial{ - State: model.CompletedState, - ExperimentID: exp1.ID, - StartTime: time.Now(), - HParams: hyperparameters1, - }, task1.TaskID)) - - task2 := &model.Task{TaskType: model.TaskTypeTrial, TaskID: model.NewTaskID()} - require.NoError(t, db.AddTask(ctx, task2)) - require.NoError(t, db.AddTrial(ctx, &model.Trial{ - State: model.CompletedState, - ExperimentID: exp2.ID, - StartTime: time.Now(), - HParams: hyperparameters2, - }, task2.TaskID)) - - require.NoError(t, completeExp(ctx, int32(exp1.ID))) - require.NoError(t, completeExp(ctx, int32(exp2.ID))) - - filter := `{"filterGroup":{"children":[{"columnName":"hp.test1.test2","kind":"field",` + - `"location":"LOCATION_TYPE_HYPERPARAMETERS","operator":"<=","type":"COLUMN_TYPE_NUMBER","value":1}],` + - `"conjunction":"and","kind":"group"},"showArchived":true}` - archReq := &apiv1.ArchiveSearchesRequest{ - Filter: &filter, - ProjectId: projectID, - } - archRes, err := api.ArchiveSearches(ctx, archReq) - require.NoError(t, err) - require.Len(t, archRes.Results, 1) - require.Equal(t, "", archRes.Results[0].Error) - - searchReq := &apiv1.SearchRunsRequest{ - ProjectId: &projectID, - Filter: ptrs.Ptr(`{"showArchived":false}`), - Sort: ptrs.Ptr("id=asc"), - } - - searchResp, err := api.SearchRuns(ctx, searchReq) - require.NoError(t, err) - require.Len(t, searchResp.Runs, 1) - - // Unarchive runs - unarchReq := &apiv1.UnarchiveSearchesRequest{ - Filter: &filter, - ProjectId: projectID, - } - unarchRes, err := api.UnarchiveSearches(ctx, unarchReq) - require.NoError(t, err) - require.Len(t, unarchRes.Results, 1) - require.Equal(t, "", unarchRes.Results[0].Error) - - searchResp, err = api.SearchRuns(ctx, searchReq) - require.NoError(t, err) - require.Len(t, searchResp.Runs, 2) -} - -func TestArchiveAlreadyArchivedSearch(t *testing.T) { - api, curUser, ctx := setupAPITest(t, nil) - projectID, _, _, _, expID := setUpMultiTrialExperiments(ctx, t, api, curUser) //nolint:dogsled - require.NoError(t, completeExp(ctx, expID)) - - // Archive runs - searchIDs := []int32{expID} - archReq := &apiv1.ArchiveSearchesRequest{ - SearchIds: searchIDs, - ProjectId: projectID, - } - archRes, err := api.ArchiveSearches(ctx, archReq) - require.NoError(t, err) - require.Len(t, archRes.Results, 1) - require.Equal(t, "", archRes.Results[0].Error) - - searchReq := &apiv1.SearchRunsRequest{ - ProjectId: &projectID, - Filter: ptrs.Ptr(`{"showArchived":false}`), - Sort: ptrs.Ptr("id=asc"), - } - - searchResp, err := api.SearchRuns(ctx, searchReq) - require.NoError(t, err) - require.Empty(t, searchResp.Runs) - - // Try to archive again - archRes, err = api.ArchiveSearches(ctx, archReq) - require.NoError(t, err) - require.Len(t, archRes.Results, 1) - require.Equal(t, "", archRes.Results[0].Error) -} - -func TestArchiveSearchNonTerminalState(t *testing.T) { - api, curUser, ctx := setupAPITest(t, nil) - _, projectIDInt := createProjectAndWorkspace(ctx, t, api) - projectID := int32(projectIDInt) - - exp := createTestExpWithProjectID(t, api, curUser, projectIDInt) - - task1 := &model.Task{TaskType: model.TaskTypeTrial, TaskID: model.NewTaskID()} - require.NoError(t, db.AddTask(ctx, task1)) - require.NoError(t, db.AddTrial(ctx, &model.Trial{ - State: model.ActiveState, - ExperimentID: exp.ID, - StartTime: time.Now(), - }, task1.TaskID)) - - archReq := &apiv1.ArchiveSearchesRequest{ - SearchIds: []int32{int32(exp.ID)}, - ProjectId: projectID, - } - archRes, err := api.ArchiveSearches(ctx, archReq) - require.NoError(t, err) - require.Len(t, archRes.Results, 1) - require.Equal(t, "Search is not in terminal state.", archRes.Results[0].Error) -} - -func TestUnarchiveSearchAlreadyUnarchived(t *testing.T) { - api, curUser, ctx := setupAPITest(t, nil) - projectID, _, _, _, exp := setUpMultiTrialExperiments(ctx, t, api, curUser) //nolint:dogsled - require.NoError(t, completeExp(ctx, exp)) - - unarchReq := &apiv1.UnarchiveSearchesRequest{ - SearchIds: []int32{exp}, - ProjectId: projectID, - } - unarchRes, err := api.UnarchiveSearches(ctx, unarchReq) - require.NoError(t, err) - require.Len(t, unarchRes.Results, 1) - require.Equal(t, "", unarchRes.Results[0].Error) -} diff --git a/proto/pkg/apiv1/search.pb.go b/proto/pkg/apiv1/search.pb.go deleted file mode 100644 index 5968f5824bc..00000000000 --- a/proto/pkg/apiv1/search.pb.go +++ /dev/null @@ -1,1302 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// source: determined/api/v1/search.proto - -package apiv1 - -import ( - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Message for results of individual searches in a multi-search action. -type SearchActionResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Optional error message. - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - // search ID. - Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *SearchActionResult) Reset() { - *x = SearchActionResult{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchActionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchActionResult) ProtoMessage() {} - -func (x *SearchActionResult) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchActionResult.ProtoReflect.Descriptor instead. -func (*SearchActionResult) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{0} -} - -func (x *SearchActionResult) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -func (x *SearchActionResult) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -// Request to move the search to a different project. -type MoveSearchesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ids of the searches being moved. - SearchIds []int32 `protobuf:"varint,1,rep,packed,name=search_ids,json=searchIds,proto3" json:"search_ids,omitempty"` - // The id of the current parent project. - SourceProjectId int32 `protobuf:"varint,2,opt,name=source_project_id,json=sourceProjectId,proto3" json:"source_project_id,omitempty"` - // The id of the new parent project. - DestinationProjectId int32 `protobuf:"varint,3,opt,name=destination_project_id,json=destinationProjectId,proto3" json:"destination_project_id,omitempty"` - // Filter expression - Filter *string `protobuf:"bytes,4,opt,name=filter,proto3,oneof" json:"filter,omitempty"` -} - -func (x *MoveSearchesRequest) Reset() { - *x = MoveSearchesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MoveSearchesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MoveSearchesRequest) ProtoMessage() {} - -func (x *MoveSearchesRequest) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MoveSearchesRequest.ProtoReflect.Descriptor instead. -func (*MoveSearchesRequest) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{1} -} - -func (x *MoveSearchesRequest) GetSearchIds() []int32 { - if x != nil { - return x.SearchIds - } - return nil -} - -func (x *MoveSearchesRequest) GetSourceProjectId() int32 { - if x != nil { - return x.SourceProjectId - } - return 0 -} - -func (x *MoveSearchesRequest) GetDestinationProjectId() int32 { - if x != nil { - return x.DestinationProjectId - } - return 0 -} - -func (x *MoveSearchesRequest) GetFilter() string { - if x != nil && x.Filter != nil { - return *x.Filter - } - return "" -} - -// Response to MoveSearchesRequest. -type MoveSearchesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Details on success or error for each search. - Results []*SearchActionResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` -} - -func (x *MoveSearchesResponse) Reset() { - *x = MoveSearchesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MoveSearchesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MoveSearchesResponse) ProtoMessage() {} - -func (x *MoveSearchesResponse) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MoveSearchesResponse.ProtoReflect.Descriptor instead. -func (*MoveSearchesResponse) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{2} -} - -func (x *MoveSearchesResponse) GetResults() []*SearchActionResult { - if x != nil { - return x.Results - } - return nil -} - -// Kill searches. -type KillSearchesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ids of the searches being killed. - SearchIds []int32 `protobuf:"varint,1,rep,packed,name=search_ids,json=searchIds,proto3" json:"search_ids,omitempty"` - // Project id of the searches being killed. - ProjectId int32 `protobuf:"varint,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` - // Filter expression - Filter *string `protobuf:"bytes,3,opt,name=filter,proto3,oneof" json:"filter,omitempty"` -} - -func (x *KillSearchesRequest) Reset() { - *x = KillSearchesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KillSearchesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KillSearchesRequest) ProtoMessage() {} - -func (x *KillSearchesRequest) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KillSearchesRequest.ProtoReflect.Descriptor instead. -func (*KillSearchesRequest) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{3} -} - -func (x *KillSearchesRequest) GetSearchIds() []int32 { - if x != nil { - return x.SearchIds - } - return nil -} - -func (x *KillSearchesRequest) GetProjectId() int32 { - if x != nil { - return x.ProjectId - } - return 0 -} - -func (x *KillSearchesRequest) GetFilter() string { - if x != nil && x.Filter != nil { - return *x.Filter - } - return "" -} - -// Response to KillSearchesResponse. -type KillSearchesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Details on success or error for each search. - Results []*SearchActionResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` -} - -func (x *KillSearchesResponse) Reset() { - *x = KillSearchesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KillSearchesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KillSearchesResponse) ProtoMessage() {} - -func (x *KillSearchesResponse) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KillSearchesResponse.ProtoReflect.Descriptor instead. -func (*KillSearchesResponse) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{4} -} - -func (x *KillSearchesResponse) GetResults() []*SearchActionResult { - if x != nil { - return x.Results - } - return nil -} - -// Delete searches. -type DeleteSearchesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ids of the searches being deleted. - SearchIds []int32 `protobuf:"varint,1,rep,packed,name=search_ids,json=searchIds,proto3" json:"search_ids,omitempty"` - // Project id of the searches being deleted. - ProjectId int32 `protobuf:"varint,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` - // Filter expression - Filter *string `protobuf:"bytes,3,opt,name=filter,proto3,oneof" json:"filter,omitempty"` -} - -func (x *DeleteSearchesRequest) Reset() { - *x = DeleteSearchesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteSearchesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteSearchesRequest) ProtoMessage() {} - -func (x *DeleteSearchesRequest) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteSearchesRequest.ProtoReflect.Descriptor instead. -func (*DeleteSearchesRequest) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{5} -} - -func (x *DeleteSearchesRequest) GetSearchIds() []int32 { - if x != nil { - return x.SearchIds - } - return nil -} - -func (x *DeleteSearchesRequest) GetProjectId() int32 { - if x != nil { - return x.ProjectId - } - return 0 -} - -func (x *DeleteSearchesRequest) GetFilter() string { - if x != nil && x.Filter != nil { - return *x.Filter - } - return "" -} - -// Response to DeleteSearchesResponse. -type DeleteSearchesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Details on success or error for each search. - Results []*SearchActionResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` -} - -func (x *DeleteSearchesResponse) Reset() { - *x = DeleteSearchesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteSearchesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteSearchesResponse) ProtoMessage() {} - -func (x *DeleteSearchesResponse) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteSearchesResponse.ProtoReflect.Descriptor instead. -func (*DeleteSearchesResponse) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{6} -} - -func (x *DeleteSearchesResponse) GetResults() []*SearchActionResult { - if x != nil { - return x.Results - } - return nil -} - -// Request to archive the search -type ArchiveSearchesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ids of the searches being archived. - SearchIds []int32 `protobuf:"varint,1,rep,packed,name=search_ids,json=searchIds,proto3" json:"search_ids,omitempty"` - // The id of the current parent project. - ProjectId int32 `protobuf:"varint,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` - // Filter expression - Filter *string `protobuf:"bytes,3,opt,name=filter,proto3,oneof" json:"filter,omitempty"` -} - -func (x *ArchiveSearchesRequest) Reset() { - *x = ArchiveSearchesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ArchiveSearchesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ArchiveSearchesRequest) ProtoMessage() {} - -func (x *ArchiveSearchesRequest) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ArchiveSearchesRequest.ProtoReflect.Descriptor instead. -func (*ArchiveSearchesRequest) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{7} -} - -func (x *ArchiveSearchesRequest) GetSearchIds() []int32 { - if x != nil { - return x.SearchIds - } - return nil -} - -func (x *ArchiveSearchesRequest) GetProjectId() int32 { - if x != nil { - return x.ProjectId - } - return 0 -} - -func (x *ArchiveSearchesRequest) GetFilter() string { - if x != nil && x.Filter != nil { - return *x.Filter - } - return "" -} - -// Response to ArchiveSearchesRequest. -type ArchiveSearchesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Details on success or error for each search. - Results []*SearchActionResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` -} - -func (x *ArchiveSearchesResponse) Reset() { - *x = ArchiveSearchesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ArchiveSearchesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ArchiveSearchesResponse) ProtoMessage() {} - -func (x *ArchiveSearchesResponse) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ArchiveSearchesResponse.ProtoReflect.Descriptor instead. -func (*ArchiveSearchesResponse) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{8} -} - -func (x *ArchiveSearchesResponse) GetResults() []*SearchActionResult { - if x != nil { - return x.Results - } - return nil -} - -// Request to unarchive the search -type UnarchiveSearchesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ids of the searches being unarchived. - SearchIds []int32 `protobuf:"varint,1,rep,packed,name=search_ids,json=searchIds,proto3" json:"search_ids,omitempty"` - // The id of the current parent project. - ProjectId int32 `protobuf:"varint,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` - // Filter expression - Filter *string `protobuf:"bytes,3,opt,name=filter,proto3,oneof" json:"filter,omitempty"` -} - -func (x *UnarchiveSearchesRequest) Reset() { - *x = UnarchiveSearchesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UnarchiveSearchesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnarchiveSearchesRequest) ProtoMessage() {} - -func (x *UnarchiveSearchesRequest) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UnarchiveSearchesRequest.ProtoReflect.Descriptor instead. -func (*UnarchiveSearchesRequest) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{9} -} - -func (x *UnarchiveSearchesRequest) GetSearchIds() []int32 { - if x != nil { - return x.SearchIds - } - return nil -} - -func (x *UnarchiveSearchesRequest) GetProjectId() int32 { - if x != nil { - return x.ProjectId - } - return 0 -} - -func (x *UnarchiveSearchesRequest) GetFilter() string { - if x != nil && x.Filter != nil { - return *x.Filter - } - return "" -} - -// Response to UnarchiveSearchesRequest. -type UnarchiveSearchesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Details on success or error for each search. - Results []*SearchActionResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` -} - -func (x *UnarchiveSearchesResponse) Reset() { - *x = UnarchiveSearchesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UnarchiveSearchesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnarchiveSearchesResponse) ProtoMessage() {} - -func (x *UnarchiveSearchesResponse) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UnarchiveSearchesResponse.ProtoReflect.Descriptor instead. -func (*UnarchiveSearchesResponse) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{10} -} - -func (x *UnarchiveSearchesResponse) GetResults() []*SearchActionResult { - if x != nil { - return x.Results - } - return nil -} - -// Request to pause the experiment associated witha search. -type PauseSearchesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ids of the searches being moved. - SearchIds []int32 `protobuf:"varint,1,rep,packed,name=search_ids,json=searchIds,proto3" json:"search_ids,omitempty"` - // The id of the project of the searches being paused. - ProjectId int32 `protobuf:"varint,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` - // Filter expression - Filter *string `protobuf:"bytes,3,opt,name=filter,proto3,oneof" json:"filter,omitempty"` -} - -func (x *PauseSearchesRequest) Reset() { - *x = PauseSearchesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PauseSearchesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PauseSearchesRequest) ProtoMessage() {} - -func (x *PauseSearchesRequest) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PauseSearchesRequest.ProtoReflect.Descriptor instead. -func (*PauseSearchesRequest) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{11} -} - -func (x *PauseSearchesRequest) GetSearchIds() []int32 { - if x != nil { - return x.SearchIds - } - return nil -} - -func (x *PauseSearchesRequest) GetProjectId() int32 { - if x != nil { - return x.ProjectId - } - return 0 -} - -func (x *PauseSearchesRequest) GetFilter() string { - if x != nil && x.Filter != nil { - return *x.Filter - } - return "" -} - -// Response to PauseSearchesRequest. -type PauseSearchesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Details on success or error for each search. - Results []*SearchActionResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` -} - -func (x *PauseSearchesResponse) Reset() { - *x = PauseSearchesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PauseSearchesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PauseSearchesResponse) ProtoMessage() {} - -func (x *PauseSearchesResponse) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PauseSearchesResponse.ProtoReflect.Descriptor instead. -func (*PauseSearchesResponse) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{12} -} - -func (x *PauseSearchesResponse) GetResults() []*SearchActionResult { - if x != nil { - return x.Results - } - return nil -} - -// Request to unpause the experiment associated witha search. -type ResumeSearchesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ids of the searches being moved. - SearchIds []int32 `protobuf:"varint,1,rep,packed,name=search_ids,json=searchIds,proto3" json:"search_ids,omitempty"` - // The id of the project of the searches being unpaused. - ProjectId int32 `protobuf:"varint,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` - // Filter expression - Filter *string `protobuf:"bytes,3,opt,name=filter,proto3,oneof" json:"filter,omitempty"` -} - -func (x *ResumeSearchesRequest) Reset() { - *x = ResumeSearchesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResumeSearchesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResumeSearchesRequest) ProtoMessage() {} - -func (x *ResumeSearchesRequest) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResumeSearchesRequest.ProtoReflect.Descriptor instead. -func (*ResumeSearchesRequest) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{13} -} - -func (x *ResumeSearchesRequest) GetSearchIds() []int32 { - if x != nil { - return x.SearchIds - } - return nil -} - -func (x *ResumeSearchesRequest) GetProjectId() int32 { - if x != nil { - return x.ProjectId - } - return 0 -} - -func (x *ResumeSearchesRequest) GetFilter() string { - if x != nil && x.Filter != nil { - return *x.Filter - } - return "" -} - -// Response to ResumeSearchesRequest. -type ResumeSearchesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Details on success or error for each search. - Results []*SearchActionResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` -} - -func (x *ResumeSearchesResponse) Reset() { - *x = ResumeSearchesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_determined_api_v1_search_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResumeSearchesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResumeSearchesResponse) ProtoMessage() {} - -func (x *ResumeSearchesResponse) ProtoReflect() protoreflect.Message { - mi := &file_determined_api_v1_search_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResumeSearchesResponse.ProtoReflect.Descriptor instead. -func (*ResumeSearchesResponse) Descriptor() ([]byte, []int) { - return file_determined_api_v1_search_proto_rawDescGZIP(), []int{14} -} - -func (x *ResumeSearchesResponse) GetResults() []*SearchActionResult { - if x != nil { - return x.Results - } - return nil -} - -var File_determined_api_v1_search_proto protoreflect.FileDescriptor - -var file_determined_api_v1_search_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x11, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x1a, 0x2c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, - 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x4e, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x12, 0x92, - 0x41, 0x0f, 0x0a, 0x0d, 0xd2, 0x01, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0xd2, 0x01, 0x02, 0x69, - 0x64, 0x22, 0xff, 0x01, 0x0a, 0x13, 0x4d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x73, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x64, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x16, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x3a, 0x3f, 0x92, 0x41, 0x3c, 0x0a, 0x3a, 0xd2, 0x01, - 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x69, 0x64, 0xd2, 0x01, 0x16, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0xd2, 0x01, 0x0a, 0x73, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x5f, 0x69, 0x64, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x22, 0x68, 0x0a, 0x14, 0x4d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, - 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x0f, 0x92, 0x41, - 0x0c, 0x0a, 0x0a, 0xd2, 0x01, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xa3, 0x01, - 0x0a, 0x13, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, - 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x49, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, - 0x3a, 0x26, 0x92, 0x41, 0x23, 0x0a, 0x21, 0xd2, 0x01, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x5f, 0x69, 0x64, 0x73, 0xd2, 0x01, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x22, 0x68, 0x0a, 0x14, 0x4b, 0x69, 0x6c, 0x6c, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, - 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x0f, 0x92, 0x41, - 0x0c, 0x0a, 0x0a, 0xd2, 0x01, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x91, 0x01, - 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x73, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x49, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, - 0x01, 0x01, 0x3a, 0x12, 0x92, 0x41, 0x0f, 0x0a, 0x0d, 0xd2, 0x01, 0x0a, 0x73, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x5f, 0x69, 0x64, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x22, 0x6a, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, - 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x0f, 0x92, 0x41, - 0x0c, 0x0a, 0x0a, 0xd2, 0x01, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x9f, 0x01, - 0x0a, 0x16, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x73, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x49, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x88, 0x01, 0x01, 0x3a, 0x1f, 0x92, 0x41, 0x1c, 0x0a, 0x1a, 0xd2, 0x01, 0x0a, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0xd2, 0x01, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x5f, 0x69, 0x64, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, - 0x6b, 0x0a, 0x17, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, - 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x0f, 0x92, 0x41, 0x0c, - 0x0a, 0x0a, 0xd2, 0x01, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xa1, 0x01, 0x0a, - 0x18, 0x55, 0x6e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x73, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x88, 0x01, 0x01, 0x3a, 0x1f, 0x92, 0x41, 0x1c, 0x0a, 0x1a, 0xd2, 0x01, 0x0a, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0xd2, 0x01, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x5f, 0x69, 0x64, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x22, 0x6d, 0x0a, 0x19, 0x55, 0x6e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, - 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, - 0x2e, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x0f, - 0x92, 0x41, 0x0c, 0x0a, 0x0a, 0xd2, 0x01, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, - 0x9d, 0x01, 0x0a, 0x14, 0x50, 0x61, 0x75, 0x73, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x73, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x49, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x88, 0x01, 0x01, 0x3a, 0x1f, 0x92, 0x41, 0x1c, 0x0a, 0x1a, 0xd2, 0x01, 0x0a, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0xd2, 0x01, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x5f, 0x69, 0x64, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, - 0x69, 0x0a, 0x15, 0x50, 0x61, 0x75, 0x73, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x74, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x0f, 0x92, 0x41, 0x0c, 0x0a, 0x0a, - 0xd2, 0x01, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x9e, 0x01, 0x0a, 0x15, 0x52, - 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x69, - 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x49, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x3a, - 0x1f, 0x92, 0x41, 0x1c, 0x0a, 0x1a, 0xd2, 0x01, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x5f, 0x69, 0x64, 0xd2, 0x01, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x69, 0x64, 0x73, - 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x6a, 0x0a, 0x16, 0x52, - 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x0f, 0x92, 0x41, 0x0c, 0x0a, 0x0a, 0xd2, 0x01, 0x07, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x64, - 0x2d, 0x61, 0x69, 0x2f, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_determined_api_v1_search_proto_rawDescOnce sync.Once - file_determined_api_v1_search_proto_rawDescData = file_determined_api_v1_search_proto_rawDesc -) - -func file_determined_api_v1_search_proto_rawDescGZIP() []byte { - file_determined_api_v1_search_proto_rawDescOnce.Do(func() { - file_determined_api_v1_search_proto_rawDescData = protoimpl.X.CompressGZIP(file_determined_api_v1_search_proto_rawDescData) - }) - return file_determined_api_v1_search_proto_rawDescData -} - -var file_determined_api_v1_search_proto_msgTypes = make([]protoimpl.MessageInfo, 15) -var file_determined_api_v1_search_proto_goTypes = []interface{}{ - (*SearchActionResult)(nil), // 0: determined.api.v1.SearchActionResult - (*MoveSearchesRequest)(nil), // 1: determined.api.v1.MoveSearchesRequest - (*MoveSearchesResponse)(nil), // 2: determined.api.v1.MoveSearchesResponse - (*KillSearchesRequest)(nil), // 3: determined.api.v1.KillSearchesRequest - (*KillSearchesResponse)(nil), // 4: determined.api.v1.KillSearchesResponse - (*DeleteSearchesRequest)(nil), // 5: determined.api.v1.DeleteSearchesRequest - (*DeleteSearchesResponse)(nil), // 6: determined.api.v1.DeleteSearchesResponse - (*ArchiveSearchesRequest)(nil), // 7: determined.api.v1.ArchiveSearchesRequest - (*ArchiveSearchesResponse)(nil), // 8: determined.api.v1.ArchiveSearchesResponse - (*UnarchiveSearchesRequest)(nil), // 9: determined.api.v1.UnarchiveSearchesRequest - (*UnarchiveSearchesResponse)(nil), // 10: determined.api.v1.UnarchiveSearchesResponse - (*PauseSearchesRequest)(nil), // 11: determined.api.v1.PauseSearchesRequest - (*PauseSearchesResponse)(nil), // 12: determined.api.v1.PauseSearchesResponse - (*ResumeSearchesRequest)(nil), // 13: determined.api.v1.ResumeSearchesRequest - (*ResumeSearchesResponse)(nil), // 14: determined.api.v1.ResumeSearchesResponse -} -var file_determined_api_v1_search_proto_depIdxs = []int32{ - 0, // 0: determined.api.v1.MoveSearchesResponse.results:type_name -> determined.api.v1.SearchActionResult - 0, // 1: determined.api.v1.KillSearchesResponse.results:type_name -> determined.api.v1.SearchActionResult - 0, // 2: determined.api.v1.DeleteSearchesResponse.results:type_name -> determined.api.v1.SearchActionResult - 0, // 3: determined.api.v1.ArchiveSearchesResponse.results:type_name -> determined.api.v1.SearchActionResult - 0, // 4: determined.api.v1.UnarchiveSearchesResponse.results:type_name -> determined.api.v1.SearchActionResult - 0, // 5: determined.api.v1.PauseSearchesResponse.results:type_name -> determined.api.v1.SearchActionResult - 0, // 6: determined.api.v1.ResumeSearchesResponse.results:type_name -> determined.api.v1.SearchActionResult - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_determined_api_v1_search_proto_init() } -func file_determined_api_v1_search_proto_init() { - if File_determined_api_v1_search_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_determined_api_v1_search_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchActionResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MoveSearchesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MoveSearchesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KillSearchesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KillSearchesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteSearchesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteSearchesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ArchiveSearchesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ArchiveSearchesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnarchiveSearchesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnarchiveSearchesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PauseSearchesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PauseSearchesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResumeSearchesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_determined_api_v1_search_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResumeSearchesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_determined_api_v1_search_proto_msgTypes[1].OneofWrappers = []interface{}{} - file_determined_api_v1_search_proto_msgTypes[3].OneofWrappers = []interface{}{} - file_determined_api_v1_search_proto_msgTypes[5].OneofWrappers = []interface{}{} - file_determined_api_v1_search_proto_msgTypes[7].OneofWrappers = []interface{}{} - file_determined_api_v1_search_proto_msgTypes[9].OneofWrappers = []interface{}{} - file_determined_api_v1_search_proto_msgTypes[11].OneofWrappers = []interface{}{} - file_determined_api_v1_search_proto_msgTypes[13].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_determined_api_v1_search_proto_rawDesc, - NumEnums: 0, - NumMessages: 15, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_determined_api_v1_search_proto_goTypes, - DependencyIndexes: file_determined_api_v1_search_proto_depIdxs, - MessageInfos: file_determined_api_v1_search_proto_msgTypes, - }.Build() - File_determined_api_v1_search_proto = out.File - file_determined_api_v1_search_proto_rawDesc = nil - file_determined_api_v1_search_proto_goTypes = nil - file_determined_api_v1_search_proto_depIdxs = nil -} diff --git a/proto/src/determined/api/v1/api.proto b/proto/src/determined/api/v1/api.proto index f28505e2a56..e6d8993426e 100644 --- a/proto/src/determined/api/v1/api.proto +++ b/proto/src/determined/api/v1/api.proto @@ -20,7 +20,6 @@ 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"; @@ -2676,7 +2675,7 @@ service Determined { }; } - // Kill runs. + // Get a list of runs. rpc KillRuns(KillRunsRequest) returns (KillRunsResponse) { option (google.api.http) = { post: "/api/v1/runs/kill" @@ -2687,7 +2686,7 @@ service Determined { }; } - // Delete runs. + // Delete a list of runs. rpc DeleteRuns(DeleteRunsRequest) returns (DeleteRunsResponse) { option (google.api.http) = { post: "/api/v1/runs/delete" @@ -2843,118 +2842,4 @@ 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" - }; - } - - // Create and get a user's access token - rpc PostAccessToken(PostAccessTokenRequest) - returns (PostAccessTokenResponse) { - option (google.api.http) = { - post: "/api/v1/tokens", - body: "*" - }; - option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = { - tags: "Tokens" - }; - } - - // Get a list of all access token records. - rpc GetAccessTokens(GetAccessTokensRequest) - returns (GetAccessTokensResponse) { - option (google.api.http) = { - get: "/api/v1/tokens" - }; - option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = { - tags: "Tokens" - }; - } - - // Patch an access token's mutable fields. - rpc PatchAccessToken(PatchAccessTokenRequest) - returns (PatchAccessTokenResponse) { - option (google.api.http) = { - patch: "/api/v1/tokens/{token_id}" - body: "*" - }; - option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = { - tags: "Tokens" - }; - } } diff --git a/proto/src/determined/api/v1/search.proto b/proto/src/determined/api/v1/search.proto deleted file mode 100644 index 1154ac98934..00000000000 --- a/proto/src/determined/api/v1/search.proto +++ /dev/null @@ -1,183 +0,0 @@ -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; -}