Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

core: allow deleting of evaluations #13492

Merged
merged 11 commits into from
Jul 6, 2022
Merged

core: allow deleting of evaluations #13492

merged 11 commits into from
Jul 6, 2022

Conversation

jrasell
Copy link
Member

@jrasell jrasell commented Jun 27, 2022

This PR adds the ability to delete evals and adds to the work performed to allow the pausing of the eval and blocked eval brokers.

There is a change made to the signature of the eval reap RPC which we will want to backport in order to make future backport releases easier. Once this PR has been reviewed and approved, I will open this change as a PR separately.

related #11638

@jrasell jrasell added this to the 1.3.2 milestone Jun 27, 2022
@jrasell jrasell requested review from schmichael and lgfa29 June 27, 2022 10:11
@jrasell jrasell self-assigned this Jun 27, 2022
Copy link
Member

@shoenig shoenig left a comment

Choose a reason for hiding this comment

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

LGTM, this is great @jrasell! Just the usual nits/suggestions

api/evaluations_test.go Outdated Show resolved Hide resolved
command/agent/eval_endpoint.go Outdated Show resolved Hide resolved
require.Nil(t, obj)
})
},
name: "too few eval IDs",
Copy link
Member

Choose a reason for hiding this comment

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

i find it's easier to grok test cases when the name is the first field

Copy link
Member Author

Choose a reason for hiding this comment

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

Noted. I think I do it this way because of the process in which I build the tests which starts with what the inputs are. I have no doubt this is done in many places where I have written tests, so something I can look into changing moving forward.

command/eval_delete.go Outdated Show resolved Hide resolved
command/eval_delete.go Outdated Show resolved Hide resolved
command/eval_delete.go Outdated Show resolved Hide resolved
website/content/api-docs/evaluations.mdx Outdated Show resolved Hide resolved
website/content/api-docs/evaluations.mdx Outdated Show resolved Hide resolved
website/content/docs/commands/eval/delete.mdx Outdated Show resolved Hide resolved
return nil
}

// evalDeleteSafe ensures an evaluation is safe to delete based on its related
Copy link
Member

Choose a reason for hiding this comment

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

Would be helpful to have this behavior described in the docs

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes but I want to do that for both eval reap (GC) and eval delete (operator) so will tackle this separately.

api/api_test.go Outdated Show resolved Hide resolved
nomad/core_sched_test.go Show resolved Hide resolved
command/eval_delete.go Outdated Show resolved Hide resolved
command/eval_delete.go Outdated Show resolved Hide resolved
nomad/eval_endpoint.go Outdated Show resolved Hide resolved
nomad/structs/eval.go Show resolved Hide resolved
Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

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

Some early comments, but looking good so far! I will give it a try more thoroughly tomorrow to see how unhappy the scheduler gets with vanishing evals 😄

api/evaluations.go Outdated Show resolved Hide resolved
api/evaluations_test.go Show resolved Hide resolved
command/agent/eval_endpoint.go Outdated Show resolved Hide resolved
command/eval_delete.go Outdated Show resolved Hide resolved
command/eval_delete.go Outdated Show resolved Hide resolved
nomad/eval_endpoint.go Show resolved Hide resolved
website/content/docs/commands/eval/delete.mdx Outdated Show resolved Hide resolved
website/content/docs/commands/eval/delete.mdx Outdated Show resolved Hide resolved
website/content/docs/commands/eval/delete.mdx Outdated Show resolved Hide resolved
website/content/api-docs/evaluations.mdx Outdated Show resolved Hide resolved
command/eval_delete.go Outdated Show resolved Hide resolved
Copy link
Member

@schmichael schmichael left a comment

Choose a reason for hiding this comment

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

Amazing work. Sorry for the last second changes and late reviews from me.

@jrasell jrasell added the backport/1.3.x backport to 1.3.x release line label Jul 6, 2022
Base automatically changed from f-pause-eval to main July 6, 2022 14:13
@jrasell jrasell merged commit 11cb4c6 into main Jul 6, 2022
@jrasell jrasell deleted the f-eval-delete branch July 6, 2022 14:30
@github-actions
Copy link

github-actions bot commented Nov 4, 2022

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/1.3.x backport to 1.3.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants